<div dir="ltr">make all-legacy worked. I don't understand the differences, but at least the CUDA files compile without having to manually copy and paste each compile line.<div><br></div><div>Thanks Satish!<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 5, 2014 at 1:52 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
>From <a href="http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#axzz3CTMr1nP1" target="_blank">http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#axzz3CTMr1nP1</a><br>
<br>
nvcc uses the following compilers for host code compilation:<br>
On Linux platforms<br>
The GNU compiler, gcc, and arm-linux-gnueabihf-g++ for cross compilation to the ARMv7 architecture<br>
On Windows platforms<br>
The Microsoft Visual Studio compiler, cl<br>
On both platforms, the compiler found on the current execution search path will be used, unless nvcc option -compiler-bindir is specified (see File and Path Specifications).<br>
<br>
<br>
<br>
Read more at: <a href="http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#ixzz3CTN6O86z" target="_blank">http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#ixzz3CTN6O86z</a><br>
Follow us: @GPUComputing on Twitter | NVIDIA on Facebook<br>
<div class="HOEnZb"><div class="h5"><br>
On Sep 5, 2014, at 2:47 PM, Nystrom, William David <<a href="mailto:wdn@lanl.gov">wdn@lanl.gov</a>> wrote:<br>
<br>
> I have had to comment out those lines so I could build with petsc with the Intel compilers<br>
> in a Linux environment.  That has seemed to work fine for me although my testing has not<br>
> been exhaustive.  But I have no petsc Windows experience.<br>
><br>
> Dave<br>
><br>
> --<br>
> Dave Nystrom<br>
> LANL HPC-5<br>
> Phone: <a href="tel:505-667-7913" value="+15056677913">505-667-7913</a><br>
> Email: <a href="mailto:wdn@lanl.gov">wdn@lanl.gov</a><br>
> Smail: Mail Stop B272<br>
>       Group HPC-5<br>
>       Los Alamos National Laboratory<br>
>       Los Alamos, NM 87545<br>
><br>
><br>
> ________________________________________<br>
> From: <a href="mailto:petsc-dev-bounces@mcs.anl.gov">petsc-dev-bounces@mcs.anl.gov</a> [<a href="mailto:petsc-dev-bounces@mcs.anl.gov">petsc-dev-bounces@mcs.anl.gov</a>] on behalf of Satish Balay [<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>]<br>
> Sent: Friday, September 05, 2014 1:41 PM<br>
> To: Paul Mullowney<br>
> Cc: For users of the development version of PETSc<br>
> Subject: Re: [petsc-dev] PETSc with CUDA on windows with VS2013 and CUDA 6.5<br>
><br>
> On Fri, 5 Sep 2014, Paul Mullowney wrote:<br>
><br>
>> Hi,<br>
>><br>
>> I've been trying to build PETSc in cygwin with Visual Studio 2013 and CUDA<br>
>> 6.5. I successfully built and ran the PETSc GPU code following the<br>
>> instructions for building on cygwin. However I ran in to a few problems<br>
>> along the way. If anyone has insight into the second problem, I would<br>
>> appreciate it.<br>
>><br>
>> 1) cuda.py (lines 112, 113):<br>
>> if not config.setCompilers.Configure.isGNU(<a href="http://self.setCompilers.CC" target="_blank">self.setCompilers.CC</a>):<br>
>>  raise RuntimeError('Must use GNU compilers with CUDA')<br>
>><br>
>> I had to comment these lines out to enable configuration success.<br>
><br>
> We might have had issues on linux with folks trying --with-cc=icc and<br>
> --with-cudac=nvcc [and nvcc internally using gcc causing conflit].<br>
><br>
> So I think this check was added at that time. Ideally it should query<br>
> nvcc to see what the internal compiler is - and then check if<br>
> '--with-cc' is compatible with it. But I don't know how to do that.<br>
><br>
> Perhaps the easier fix is either of:<br>
><br>
> if (isLinux() and not isGNU(cc)) then error<br>
><br>
> if (not isWindows() and not isGNU()) then error<br>
><br>
>><br>
>> 2) This may be related to why the GNU restriction in 1) was put in place.<br>
>> Whenever PETSc has to compile a .cu, it fails. For example for a single<br>
>> threaded build, the first .cu file to be compiled is <a href="http://veccusp.cu" target="_blank">veccusp.cu</a>. For a<br>
>> verbose build, I see:<br>
>><br>
>> /home/Paul/projects/petsc/bin/win32fe/win32fe nvcc -c -O -arch=sm_30<br>
>> --compiler-options="-MT -wd4996 -O2   -I/home/Paul/projects/petsc/include<br>
>> -I/home/Paul/projects/petsc/cuda_build/include<br>
>> -I/cygdrive/c/CUDA_6.5/include -I/home/Paul/projects/cusp/<br>
>> -I/home/Paul/projects/cusp/include -I/cygdrive/c/CUDA_6.5/include/thrust/<br>
>> -I/home/Paul/projects/petsc/include/mpiuni   "<br>
>> /home/Paul/projects/petsc/src/vec/vec/impls/seq/seqcusp/<a href="http://veccusp.cu" target="_blank">veccusp.cu</a> -o<br>
>> cuda_build/obj/src/vec/vec/impls/seq/seqcusp/veccusp.o # Compile first so<br>
>> that if there is an error, it comes from a normal compile<br>
>><br>
>> <a href="http://veccusp.cu" target="_blank">veccusp.cu</a><br>
>> *nvcc fatal   : redefinition of argument 'optimize'*<br>
>><br>
>><br>
>> However, if I copy and paste the the compile line above and run it in the<br>
>> terminal, it succeeds. If you do this for every file .cu file in PETSc<br>
>> (~10-15 files). PETSc will build and work properly on GPUs in cygwin.<br>
>><br>
>> I don't know what the problem is here. Insight from anyone with<br>
>> windows/cygwin/CUDA experience would be much appreciated. I've attached a<br>
>> configure.log and make.log.<br>
><br>
> For one - I haven't tried cuda on windows in a while. [It must be when<br>
> win32fe was modified to support nvcc - 3 years back]<br>
><br>
> And I don't unserstand the error. Is it complaining about '-O' vs '-O2'?<br>
><br>
> And the fact that copy/paste works is strange.<br>
><br>
> You can try: 'make all-legacy' and see if that works.<br>
><br>
> Or you can try Using --verbose option i.e 'win32fe nvcc --verbose' to<br>
> see exactly what win32fe is doing [from gmake and from direct<br>
> invocation] - and see if there are differences.<br>
><br>
> Perhaps there is a 'make' variable [thats read-in as env variable by<br>
> nvcc] thats causing nvcc to behave differently.<br>
><br>
> Satish<br>
<br>
</div></div></blockquote></div><br></div>