[petsc-users] Failed to compile the PETsc-dev with cuda, mpicc can not recognize c++ key word in thrust and cusp (Lei Shi)

Satish Balay balay at mcs.anl.gov
Tue Apr 15 11:44:41 CDT 2014


You shouldn't need --with-clanguage=cxx for cuda build.

The error is

> >> In file included from /usr/local/cuda/include/cusp/detail/config.h:24:0,
> >>                  from /usr/local/cuda/include/cusp/complex.h:63,
> >>                  from
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145,

Hm - complex.h should not be picked up from 'cusp/' dir. It happens because of:

> >>     '--with-cusp-dir=/usr/local/cuda/include/cusp',


You should use

--with-cusp-dir=/usr/local/cuda/include

Satish

On Tue, 15 Apr 2014, Lei Shi wrote:

> Hi Christophe,
> 
> Thanks a lot. I add --with-clanguage=cxx option. It works well now. This
> option is not on the manual for the compilation with gpu.
> 
> 
> Sincerely Yours,
> 
> Lei Shi
> ---------
> 
> 
> On Fri, Apr 11, 2014 at 3:42 AM, Christophe Ortiz <
> christophe.ortiz at ciemat.es> wrote:
> 
> > Hi,
> >
> > Maybe I'm wrong but I think the following options are missing if you want
> > to use C++:
> >
> > --with-cxx=(g++ or icc....) --with-clanguage=cxx
> >
> > Christophe
> >
> >
> >>
> >> Message: 2
> >> Date: Fri, 11 Apr 2014 03:26:09 -0500
> >> From: Lei Shi <stoneszone at gmail.com>
> >> To: petsc-users at mcs.anl.gov
> >> Subject: [petsc-users] Failed to compile the PETsc-dev with cuda,
> >>         mpicc can not recognize c++ key word in thrust and cusp
> >> Message-ID:
> >>         <CAEV8=
> >> V9JJr+8Np5JaOKqgrkS12KJ6TaO3V4wM9YPo-NG29EU-A at mail.gmail.com>
> >> Content-Type: text/plain; charset="utf-8"
> >>
> >> Hi guys,
> >>
> >> 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
> >>
> >> configure_options = [
> >>
> >>
> >>     '--with-shared-libraries=0',
> >>
> >>
> >>     '--with-mpi-dir=/media/public/MPICH3/mpich-install/',
> >>
> >>
> >>     '--with-cuda=1',
> >>
> >>
> >>     '--with-cuda-dir=/usr/local/cuda',
> >>
> >>
> >>     '--with-cudac=/usr/local/cuda/bin/nvcc',
> >>
> >>
> >>     '--with-cuda-arch=sm_20',
> >>
> >>
> >>     '--with-cusp-dir=/usr/local/cuda/include/cusp',
> >>
> >>
> >>     '--with-thrust=1',
> >>
> >>
> >>     '--with-cusp=1',
> >>
> >>
> >>     '--with-debugging=0',
> >>
> >>
> >>     '--with-precision=double',
> >>
> >>
> >>     'COPTFLAGS=-O3',
> >>
> >>
> >>     'CXXOPTFLAGS=-O3',
> >>
> >>
> >>     'FOPTFLAGS=-O3',
> >>
> >>
> >>   ]
> >>
> >> and the error i got
> >>
> >> -------------------------------------------------------------------------------------------
> >>
> >> ===============================================================================
> >>
> >>
> >>              Configuring PETSc to compile on your system
> >>
> >>
> >>
> >> ===============================================================================
> >>
> >>
> >> TESTING: alternateConfigureLibrary from
> >> PETSc.packages.petsc4py(config/PETSc/packages/petsc4py.py:65)
> >>                                                                     \
> >>  Compilers:
> >>
> >>
> >>   C Compiler:         /media/public/MPICH3/mpich-install/bin/mpicc  -Wall
> >> -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3
> >>
> >>   CUDA Compiler:      /usr/local/cuda/bin/nvcc  -O -arch=sm_20
> >>
> >>
> >>   C++ Compiler:       /media/public/MPICH3/mpich-install/bin/mpicxx  -Wall
> >> -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3
> >>
> >> Linkers:
> >>
> >>
> >>   Static linker:   /usr/bin/ar cr
> >>
> >>
> >>   Dynamic linker:   /usr/bin/ar
> >>
> >>
> >> make:
> >>
> >>
> >> MPI:
> >>
> >>
> >>   Includes: -I/media/public/MPICH3/mpich-install/include
> >>
> >>
> >> BLAS/LAPACK: -llapack -lblas
> >>
> >>
> >> X:
> >>
> >>
> >>   Library:  -lX11
> >>
> >>
> >> pthread:
> >>
> >>
> >>   Library:  -lpthread
> >>
> >>
> >> valgrind:
> >>
> >>
> >> cuda:
> >>
> >>
> >>   Includes: -I/usr/local/cuda/include
> >>
> >>
> >>   Library:  -Wl,-rpath,/usr/local/cuda/lib64 -L/usr/local/cuda/lib64
> >> -lcufft -lcublas -lcudart -lcusparse
> >>
> >>   Arch:     -arch=sm_20
> >>
> >>
> >> cusp:
> >>
> >>
> >>   Includes: -I/usr/local/cuda/include/cusp/
> >> -I/usr/local/cuda/include/cusp/include
> >>
> >> thrust:
> >>
> >>
> >> sowing:
> >>
> >>
> >> c2html:
> >>
> >>
> >> PETSc:
> >>
> >>
> >>   PETSC_ARCH: arch-cuda5-cg-opt
> >>
> >>
> >>   PETSC_DIR: /home/leishi/work/development/3rd_party/petsc/petsc
> >>
> >>
> >>   Clanguage: C
> >>
> >>
> >>   Memory alignment: 16
> >>
> >>
> >>   Scalar type: real
> >>
> >>
> >>   Precision: double
> >>
> >>
> >>   shared libraries: disabled
> >>
> >>
> >>
> >> xxx=========================================================================xxx
> >>
> >>
> >>  Configure stage complete. Now build PETSc libraries with (gnumake build):
> >>
> >>
> >>    make PETSC_DIR=/home/leishi/work/development/3rd_party/petsc/petsc
> >> PETSC_ARCH=arch-cuda5-cg-opt all
> >>
> >>
> >> xxx=========================================================================xxx
> >>
> >>
> >> 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\
> >> 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\
> >> p/include -I/media/public/MPICH3/mpich-install/include
> >>
> >>
> >> mpicc -show: gcc -I/media/public/MPICH3/mpich-install/include
> >> -L/media/public/MPICH3/mpich-install/lib -lmpich -lopa -lmpl -lrt
> >> -lpthread
> >>
> >> 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\
> >> 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\
> >> /include/cusp/include -I/media/public/MPICH3/mpich-install/include
> >>
> >>
> >> -----------------------------------------
> >>
> >>
> >> Using C/C++ linker: /media/public/MPICH3/mpich-install/bin/mpicc
> >>
> >>
> >> Using C/C++ flags: -Wall -Wwrite-strings -Wno-strict-aliasing
> >> -Wno-unknown-pragmas -O3
> >>
> >> -----------------------------------------
> >>
> >>
> >> 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\
> >> /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/\
> >> lib/gcc/x86_64-linux-gnu/4.8 -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl
> >> -lrt -lpthread -lgcc_s -ldl
> >>
> >> ------------------------------------------
> >>
> >>
> >> Using mpiexec: /media/public/MPICH3/mpich-install/bin/mpiexec
> >>
> >>
> >> ==========================================
> >>
> >>
> >> Building PETSc using GNU Make with 18 build threads
> >>
> >>
> >> ==========================================
> >>
> >>
> >> make[2]: Entering directory
> >> `/home/leishi/work/development/3rd_party/petsc/petsc'
> >>
> >>
> >> Use "/usr/bin/make V=1" to see the verbose compile lines.
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/arch.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/fhost.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/fuser.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/memc.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/mpiu.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/psleep.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/sortd.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/sorti.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/str.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/sortip.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/pbarrier.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/pdisplay.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/ctable.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/psplit.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/select.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/mpimesg.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/sseenabled.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/utils/mpitr.o
> >>
> >>
> >>
> >> In file included from /usr/local/cuda/include/cusp/detail/config.h:24:0,
> >>
> >>
> >>                  from /usr/local/cuda/include/cusp/complex.h:63,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petsc-private/petscimpl.h:8,
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/options.c:14:
> >>
> >>
> >> /usr/local/cuda/include/thrust/version.h:69:1: error: unknown type name
> >> ?namespace?
> >>
> >> /usr/local/cuda/include/thrust/version.h:70:1: error: expected ?=?, ?,?,
> >> ?;?, ?asm? or ?__attribute__? before ?{? token
> >>
> >> In file included from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145:0,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petsc-private/petscimpl.h:8,
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/options.c:14:
> >>
> >>
> >> /usr/local/cuda/include/cusp/complex.h:70:19: fatal error: complex: No
> >> such
> >> file or directory
> >>
> >> compilation terminated.
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/objects/state.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/objects/aoptions.o
> >>
> >>
> >>           CC arch-cuda5-cg-opt/obj/src/sys/objects/subcomm.o
> >>
> >>
> >> In file included from /usr/local/cuda/include/cusp/detail/config.h:24:0,
> >>
> >>
> >>                  from /usr/local/cuda/include/cusp/complex.h:63,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/init.c:10:
> >>
> >>
> >> /usr/local/cuda/include/thrust/version.h:69:1: error:* unknown type name
> >> ?namespace? *
> >>
> >> /usr/local/cuda/include/thrust/version.h:70:1: error: expected ?=?, ?,?,
> >> ?;?, ?asm? or ?__attribute__? before ?{? token
> >>
> >> In file included from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145:0,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366,
> >>
> >>
> >>                  from
> >>
> >> /home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/init.c:10:
> >>
> >>
> >> /usr/local/cuda/include/cusp/complex.h:70:19: fatal error: complex: No
> >> such
> >> file or directory
> >>
> >>
> >>
> >> make: *** [all] Error 1
> >>
> >> Sincerely Yours,
> >>
> >> Lei Shi
> >> ---------
> >> -------------- next part --------------
> >> An HTML attachment was scrubbed...
> >> URL: <
> >> http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140411/4831a810/attachment.html
> >> >
> >>
> >> ------------------------------
> >>
> >> _______________________________________________
> >> petsc-users mailing list
> >> petsc-users at mcs.anl.gov
> >> https://lists.mcs.anl.gov/mailman/listinfo/petsc-users
> >>
> >>
> >> End of petsc-users Digest, Vol 64, Issue 26
> >> *******************************************
> >>
> >> ----------------------------
> >> Confidencialidad:
> >> Este mensaje y sus ficheros adjuntos se dirige exclusivamente a su
> >> destinatario y puede contener información privilegiada o confidencial. Si
> >> no es vd. el destinatario indicado, queda notificado de que la utilización,
> >> divulgación y/o copia sin autorización está prohibida en virtud de la
> >> legislación vigente. Si ha recibido este mensaje por error, le rogamos que
> >> nos lo comunique inmediatamente respondiendo al mensaje y proceda a su
> >> destrucción.
> >>
> >> Disclaimer:
> >> This message and its attached files is intended exclusively for its
> >> recipients and may contain confidential information. If you received this
> >> e-mail in error you are hereby notified that any dissemination, copy or
> >> disclosure of this communication is strictly prohibited and may be
> >> unlawful. In this case, please notify us by a reply and delete this email
> >> and its contents immediately.
> >> ----------------------------
> >>
> >>
> >
> 


More information about the petsc-users mailing list