<div dir="ltr">Hi guys,<div><br></div><div>I tried to compile petsc-dev with cuda5, but failed. I think the problem is the PETsc-dev with cuda, mpicc can not recognize c++ key word in thrust and cusp. Please help me out. here is my option file</div>
<div><br></div><div><div>configure_options = [ </div><div> '--with-shared-libraries=0', </div>
<div> '--with-mpi-dir=/media/public/MPICH3/mpich-install/', </div><div> '--with-cuda=1', </div>
<div> '--with-cuda-dir=/usr/local/cuda', </div><div> '--with-cudac=/usr/local/cuda/bin/nvcc', </div>
<div> '--with-cuda-arch=sm_20', </div><div> '--with-cusp-dir=/usr/local/cuda/include/cusp', </div>
<div> '--with-thrust=1', </div><div> '--with-cusp=1', </div>
<div> '--with-debugging=0', </div><div> '--with-precision=double', </div>
<div> 'COPTFLAGS=-O3', </div><div> 'CXXOPTFLAGS=-O3', </div>
<div> 'FOPTFLAGS=-O3', </div><div> ] </div>
</div><div><br></div><div>and the error i got</div><div>-------------------------------------------------------------------------------------------</div><div><div>=============================================================================== </div>
<div> Configuring PETSc to compile on your system </div><div>=============================================================================== </div>
<div>TESTING: alternateConfigureLibrary from PETSc.packages.petsc4py(config/PETSc/packages/petsc4py.py:65) \</div><div> Compilers: </div>
<div> C Compiler: /media/public/MPICH3/mpich-install/bin/mpicc -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3 </div><div> CUDA Compiler: /usr/local/cuda/bin/nvcc -O -arch=sm_20 </div>
<div> C++ Compiler: /media/public/MPICH3/mpich-install/bin/mpicxx -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3 </div><div>Linkers: </div>
<div> Static linker: /usr/bin/ar cr </div><div> Dynamic linker: /usr/bin/ar </div>
<div>make: </div><div>MPI: </div>
<div> Includes: -I/media/public/MPICH3/mpich-install/include </div><div>BLAS/LAPACK: -llapack -lblas </div>
<div>X: </div><div> Library: -lX11 </div>
<div>pthread: </div><div> Library: -lpthread </div>
<div>valgrind: </div><div>cuda: </div>
<div> Includes: -I/usr/local/cuda/include </div><div> Library: -Wl,-rpath,/usr/local/cuda/lib64 -L/usr/local/cuda/lib64 -lcufft -lcublas -lcudart -lcusparse </div>
<div> Arch: -arch=sm_20 </div><div>cusp: </div>
<div> Includes: -I/usr/local/cuda/include/cusp/ -I/usr/local/cuda/include/cusp/include </div><div>thrust: </div>
<div>sowing: </div><div>c2html: </div>
<div>PETSc: </div><div> PETSC_ARCH: arch-cuda5-cg-opt </div>
<div> PETSC_DIR: /home/leishi/work/development/3rd_party/petsc/petsc </div><div> Clanguage: C </div>
<div> Memory alignment: 16 </div><div> Scalar type: real </div>
<div> Precision: double </div><div> shared libraries: disabled </div>
<div>xxx=========================================================================xxx </div><div> Configure stage complete. Now build PETSc libraries with (gnumake build): </div>
<div> make PETSC_DIR=/home/leishi/work/development/3rd_party/petsc/petsc PETSC_ARCH=arch-cuda5-cg-opt all </div><div>xxx=========================================================================xxx </div>
</div><div><br></div><div><div>Using C/C++ compile: /media/public/MPICH3/mpich-install/bin/mpicc -c -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3 -I/home/leishi/work/development/3rd_party/pet\</div>
<div>sc/petsc/include -I/home/leishi/work/development/3rd_party/petsc/petsc/arch-cuda5-cg-opt/include -I/usr/local/cuda/include -I/usr/local/cuda/include/cusp/ -I/usr/local/cuda/include/cus\</div><div>p/include -I/media/public/MPICH3/mpich-install/include </div>
<div>mpicc -show: gcc -I/media/public/MPICH3/mpich-install/include -L/media/public/MPICH3/mpich-install/lib -lmpich -lopa -lmpl -lrt -lpthread </div><div>Using CUDA compile: /usr/local/cuda/bin/nvcc -O -arch=sm_20 -c --compiler-options=-Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3 -I/home/leishi/work/development/3\</div>
<div>rd_party/petsc/petsc/include -I/home/leishi/work/development/3rd_party/petsc/petsc/arch-cuda5-cg-opt/include -I/usr/local/cuda/include -I/usr/local/cuda/include/cusp/ -I/usr/local/cuda\</div><div>/include/cusp/include -I/media/public/MPICH3/mpich-install/include </div>
<div>----------------------------------------- </div><div>Using C/C++ linker: /media/public/MPICH3/mpich-install/bin/mpicc </div>
<div>Using C/C++ flags: -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3 </div><div>----------------------------------------- </div>
<div>Using libraries: -L/home/leishi/work/development/3rd_party/petsc/petsc/arch-cuda5-cg-opt/lib -lpetsc -llapack -lblas -lX11 -lpthread -Wl,-rpath,/usr/local/cuda/lib64 -L/usr/local/cuda\</div><div>/lib64 -lcufft -lcublas -lcudart -lcusparse -lm -L/media/public/MPICH3/mpich-install/lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6 -L/usr/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/usr/\</div>
<div>lib/gcc/x86_64-linux-gnu/4.8 -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl -lrt -lpthread -lgcc_s -ldl </div><div>------------------------------------------ </div>
<div>Using mpiexec: /media/public/MPICH3/mpich-install/bin/mpiexec </div><div>========================================== </div>
<div>Building PETSc using GNU Make with 18 build threads </div><div>========================================== </div>
<div>make[2]: Entering directory `/home/leishi/work/development/3rd_party/petsc/petsc' </div><div>Use "/usr/bin/make V=1" to see the verbose compile lines. </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/utils/arch.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/utils/fhost.o </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/utils/fuser.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/utils/memc.o </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/utils/mpiu.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/utils/psleep.o </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/utils/sortd.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/utils/sorti.o </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/utils/str.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/utils/sortip.o </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/utils/pbarrier.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/utils/pdisplay.o </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/utils/ctable.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/utils/psplit.o </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/utils/select.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/utils/mpimesg.o </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/utils/sseenabled.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/utils/mpitr.o </div>
</div><div><br></div><div><br></div><div><div>In file included from /usr/local/cuda/include/cusp/detail/config.h:24:0, </div>
<div> from /usr/local/cuda/include/cusp/complex.h:63, </div><div> from /home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145, </div>
<div> from /home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366, </div><div> from /home/leishi/work/development/3rd_party/petsc/petsc/include/petsc-private/petscimpl.h:8, </div>
<div> from /home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/options.c:14: </div><div>/usr/local/cuda/include/thrust/version.h:69:1: <span style="background-color:rgb(255,0,0)">error: unknown type name ‘namespace’ </span> </div>
<div>/usr/local/cuda/include/thrust/version.h:70:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token </div><div>In file included from /home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145:0, </div>
<div> from /home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366, </div><div> from /home/leishi/work/development/3rd_party/petsc/petsc/include/petsc-private/petscimpl.h:8, </div>
<div> from /home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/options.c:14: </div><div>/usr/local/cuda/include/cusp/complex.h:70:19: fatal error: complex: No such file or directory </div>
<div>compilation terminated. </div><div> CC arch-cuda5-cg-opt/obj/src/sys/objects/state.o </div>
<div> CC arch-cuda5-cg-opt/obj/src/sys/objects/aoptions.o </div><div> CC arch-cuda5-cg-opt/obj/src/sys/objects/subcomm.o </div>
<div>In file included from /usr/local/cuda/include/cusp/detail/config.h:24:0, </div><div> from /usr/local/cuda/include/cusp/complex.h:63, </div>
<div> from /home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145, </div><div> from /home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366, </div>
<div> from /home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/init.c:10: </div><div>/usr/local/cuda/include/thrust/version.h:69:1: error:<b> <span style="background-color:rgb(255,0,0)">unknown type name ‘namespace’ </span></b> </div>
<div>/usr/local/cuda/include/thrust/version.h:70:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token </div><div>In file included from /home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145:0, </div>
<div> from /home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366, </div><div> from /home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/init.c:10: </div>
<div>/usr/local/cuda/include/cusp/complex.h:70:19: fatal error: complex: No such file or directory </div></div><div><br></div><div><br></div><div><div> <br>
</div><div>make: *** [all] Error 1 </div></div><div><br clear="all"><div>Sincerely Yours,<br><br>Lei Shi <br>---------</div>
<img src="https://t.yesware.com/t/d1fcbaa1b12e0f6b1beef0b50d5ebbd873d1b8f9/c5360d8d93b6639c8c84a1db6a1d60fb/spacer.gif" style="border: 0px; width: 0px; height: 0px;" width="0" height="0"><img src="http://t.yesware.com/t/d1fcbaa1b12e0f6b1beef0b50d5ebbd873d1b8f9/c5360d8d93b6639c8c84a1db6a1d60fb/spacer.gif" style="border: 0px; width: 0px; height: 0px;" width="0" height="0"><font face="yw-d1fcbaa1b12e0f6b1beef0b50d5ebbd873d1b8f9-c5360d8d93b6639c8c84a1db6a1d60fb--to" style></font></div>
</div>