[petsc-dev] Intel compilers + CUDA

Satish Balay balay at mcs.anl.gov
Fri Feb 24 09:53:25 CST 2012


>>>>>>>>>>
--compiler-bindir <directory>               (-ccbin)                          
        Specify the directory in which the compiler executable (Microsoft 
        Visual Studion cl, or a gcc derivative) resides. By default, this 
        executable is expected in the current executable search path.
<<<<<<<<

It says it will look for the default compiler in the specified path -
and doesn't mention that it can switch the compiler. Ah - the manpage
is misleading.. Looks like '--ccbin icc' works..

balay at bb30:~/junk>nvcc -v -ccbin icc sizeof.c 
#$ _SPACE_= 
#$ _CUDART_=cudart
#$ _HERE_=/usr/local/cuda/bin
#$ _THERE_=/usr/local/cuda/bin
#$ _TARGET_SIZE_=64
#$ TOP=/usr/local/cuda/bin/..
#$ LD_LIBRARY_PATH=/usr/local/cuda/bin/../lib:/usr/local/cuda/bin/../extools/lib:/soft/intel/11.0.081/lib/intel64:/soft/intel/11.0.081/lib/intel64:/usr/local/cuda/lib64:/usr/local/cuda/lib64
#$ PATH=/usr/local/cuda/bin/../open64/bin:/usr/local/cuda/bin:/soft/intel/11.0.081/bin/intel64:/soft/intel/11.0.081/bin/intel64:/usr/mpi/gcc/mvapich2-1.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/cuda/bin:/usr/local/cuda/bin
#$ INCLUDES="-I/usr/local/cuda/bin/../include" "-I/usr/local/cuda/bin/../include/cudart"  
#$ LIBRARIES=  "-L/usr/local/cuda/bin/../lib64" -lcudart
#$ CUDAFE_FLAGS=
#$ OPENCC_FLAGS=
#$ PTXAS_FLAGS=
#$ icc -c -x c "-I/usr/local/cuda/bin/../include" "-I/usr/local/cuda/bin/../include/cudart"   -m64 -o "/tmp/tmpxft_00000199_00000000-1_sizeof.o" "sizeof.c" 
#$ icpc -m64 -o "a.out" -Wl,--start-group "/tmp/tmpxft_00000199_00000000-1_sizeof.o"   "-L/usr/local/cuda/bin/../lib64" -lcudart -Wl,--end-group 
balay at bb30:~/junk>


So '--with-cc=icc' --with-nvcc='nvcc --ccbin icc' should work.. Will check..

Satish

On Fri, 24 Feb 2012, John Fettig wrote:

> Some time ago I asked about using icc with nvcc.  You can use icc with nvcc
> by passing it as an argument:
> 
> nvcc -ccbin /path/to/icc
> 
> Has anybody tried building PETSc with CUDA this way?
> 
> John
> 




More information about the petsc-dev mailing list