[petsc-dev] Intel compilers + CUDA
Satish Balay
balay at mcs.anl.gov
Fri Feb 24 10:57:41 CST 2012
On Fri, 24 Feb 2012, Jed Brown wrote:
> On Fri, Feb 24, 2012 at 10:51, John Fettig <john.fettig at gmail.com> wrote:
>
> > Unfortunately it doesn't work. I'll send the logs to petsc-maint, but
> > here's the error. If you remove these lines:
> >
> > #ifndef PETSC_HAVE___INT64
> > #define PETSC_HAVE___INT64 1
> > #endif
> >
>
> What system uses __int64? If we have stdint.h, we should use int64_t
> because that is the standard.
We added that for windows [ms compilers]. But then - intel compilers
also support it [and configure sets this flag for icc]. When nvcc is
used [with gcc] - this flag conflicts with it.
Satish
>
>
> >
> > from $PETSC_ARCH/include/petscconf.h, it builds ok (and make test
> > passes). Here's the error:
> >
> > nvcc -O -arch=sm_20 -c --compiler-options=-fPIC
> > -I/home/jfe/local/petsc-dev/include
> > -I/home/jfe/local/petsc-dev/intel-opt-cuda-precise/include
> > -I/usr/local/cuda/include
> > -I/home/jfe/local/petsc-dev/intel-opt-cuda-precise/include/txpetscgpu/include
> > -I/usr/local/encap/platform_mpi-8.01/include
> > -D__INSDIR__=src/vec/vec/impls/seq/seqcusp/ veccusp.cu
> > /home/jfe/local/petsc-dev/include/petscsys.h(219): error: identifier
> > "__int64" is undefined
> >
> > John
> >
> >
> > On Fri, Feb 24, 2012 at 10:53 AM, Satish Balay <balay at mcs.anl.gov> wrote:
> >
> >> >>>>>>>>>>
> >> --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