<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hi,</div><div><br></div><div>Maybe I'm wrong but I think the following options are missing if you want to use C++:</div><div><br></div><div>--with-cxx=(g++ or icc....) --with-clanguage=cxx<br>
</div><div><br></div><div>Christophe</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Message: 2<br>
Date: Fri, 11 Apr 2014 03:26:09 -0500<br>
From: Lei Shi <<a href="mailto:stoneszone@gmail.com">stoneszone@gmail.com</a>><br>
To: <a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><br>
Subject: [petsc-users] Failed to compile the PETsc-dev with cuda,<br>
        mpicc can not recognize c++ key word in thrust and cusp<br>
Message-ID:<br>
        <CAEV8=<a href="mailto:V9JJr%2B8Np5JaOKqgrkS12KJ6TaO3V4wM9YPo-NG29EU-A@mail.gmail.com">V9JJr+8Np5JaOKqgrkS12KJ6TaO3V4wM9YPo-NG29EU-A@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi guys,<br>
<br>
I tried to compile petsc-dev with cuda5, but failed. I think the problem<br>
is the PETsc-dev with cuda, mpicc can not recognize c++ key word in thrust<br>
and cusp. Please help me out. here is my option file<br>
<br>
configure_options = [<br>
<br>
<br>
    '--with-shared-libraries=0',<br>
<br>
<br>
    '--with-mpi-dir=/media/public/MPICH3/mpich-install/',<br>
<br>
<br>
    '--with-cuda=1',<br>
<br>
<br>
    '--with-cuda-dir=/usr/local/cuda',<br>
<br>
<br>
    '--with-cudac=/usr/local/cuda/bin/nvcc',<br>
<br>
<br>
    '--with-cuda-arch=sm_20',<br>
<br>
<br>
    '--with-cusp-dir=/usr/local/cuda/include/cusp',<br>
<br>
<br>
    '--with-thrust=1',<br>
<br>
<br>
    '--with-cusp=1',<br>
<br>
<br>
    '--with-debugging=0',<br>
<br>
<br>
    '--with-precision=double',<br>
<br>
<br>
    'COPTFLAGS=-O3',<br>
<br>
<br>
    'CXXOPTFLAGS=-O3',<br>
<br>
<br>
    'FOPTFLAGS=-O3',<br>
<br>
<br>
  ]<br>
<br>
and the error i got<br>
-------------------------------------------------------------------------------------------<br>
===============================================================================<br>
<br>
<br>
             Configuring PETSc to compile on your system<br>
<br>
<br>
===============================================================================<br>
<br>
<br>
TESTING: alternateConfigureLibrary from<br>
PETSc.packages.petsc4py(config/PETSc/packages/petsc4py.py:65)<br>
                                                                    \<br>
 Compilers:<br>
<br>
<br>
  C Compiler:         /media/public/MPICH3/mpich-install/bin/mpicc  -Wall<br>
-Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3<br>
<br>
  CUDA Compiler:      /usr/local/cuda/bin/nvcc  -O -arch=sm_20<br>
<br>
<br>
  C++ Compiler:       /media/public/MPICH3/mpich-install/bin/mpicxx  -Wall<br>
-Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3<br>
<br>
Linkers:<br>
<br>
<br>
  Static linker:   /usr/bin/ar cr<br>
<br>
<br>
  Dynamic linker:   /usr/bin/ar<br>
<br>
<br>
make:<br>
<br>
<br>
MPI:<br>
<br>
<br>
  Includes: -I/media/public/MPICH3/mpich-install/include<br>
<br>
<br>
BLAS/LAPACK: -llapack -lblas<br>
<br>
<br>
X:<br>
<br>
<br>
  Library:  -lX11<br>
<br>
<br>
pthread:<br>
<br>
<br>
  Library:  -lpthread<br>
<br>
<br>
valgrind:<br>
<br>
<br>
cuda:<br>
<br>
<br>
  Includes: -I/usr/local/cuda/include<br>
<br>
<br>
  Library:  -Wl,-rpath,/usr/local/cuda/lib64 -L/usr/local/cuda/lib64<br>
-lcufft -lcublas -lcudart -lcusparse<br>
<br>
  Arch:     -arch=sm_20<br>
<br>
<br>
cusp:<br>
<br>
<br>
  Includes: -I/usr/local/cuda/include/cusp/<br>
-I/usr/local/cuda/include/cusp/include<br>
<br>
thrust:<br>
<br>
<br>
sowing:<br>
<br>
<br>
c2html:<br>
<br>
<br>
PETSc:<br>
<br>
<br>
  PETSC_ARCH: arch-cuda5-cg-opt<br>
<br>
<br>
  PETSC_DIR: /home/leishi/work/development/3rd_party/petsc/petsc<br>
<br>
<br>
  Clanguage: C<br>
<br>
<br>
  Memory alignment: 16<br>
<br>
<br>
  Scalar type: real<br>
<br>
<br>
  Precision: double<br>
<br>
<br>
  shared libraries: disabled<br>
<br>
<br>
xxx=========================================================================xxx<br>
<br>
<br>
 Configure stage complete. Now build PETSc libraries with (gnumake build):<br>
<br>
<br>
   make PETSC_DIR=/home/leishi/work/development/3rd_party/petsc/petsc<br>
PETSC_ARCH=arch-cuda5-cg-opt all<br>
<br>
xxx=========================================================================xxx<br>
<br>
<br>
Using C/C++ compile: /media/public/MPICH3/mpich-install/bin/mpicc -c -Wall<br>
-Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O3<br>
-I/home/leishi/work/development/3rd_party/pet\<br>
sc/petsc/include<br>
-I/home/leishi/work/development/3rd_party/petsc/petsc/arch-cuda5-cg-opt/include<br>
-I/usr/local/cuda/include -I/usr/local/cuda/include/cusp/<br>
-I/usr/local/cuda/include/cus\<br>
p/include -I/media/public/MPICH3/mpich-install/include<br>
<br>
<br>
mpicc -show: gcc -I/media/public/MPICH3/mpich-install/include<br>
-L/media/public/MPICH3/mpich-install/lib -lmpich -lopa -lmpl -lrt -lpthread<br>
<br>
Using CUDA compile: /usr/local/cuda/bin/nvcc -O -arch=sm_20  -c<br>
--compiler-options=-Wall -Wwrite-strings -Wno-strict-aliasing<br>
-Wno-unknown-pragmas -O3 -I/home/leishi/work/development/3\<br>
rd_party/petsc/petsc/include<br>
-I/home/leishi/work/development/3rd_party/petsc/petsc/arch-cuda5-cg-opt/include<br>
-I/usr/local/cuda/include -I/usr/local/cuda/include/cusp/ -I/usr/local/cuda\<br>
/include/cusp/include -I/media/public/MPICH3/mpich-install/include<br>
<br>
<br>
-----------------------------------------<br>
<br>
<br>
Using C/C++ linker: /media/public/MPICH3/mpich-install/bin/mpicc<br>
<br>
<br>
Using C/C++ flags: -Wall -Wwrite-strings -Wno-strict-aliasing<br>
-Wno-unknown-pragmas -O3<br>
<br>
-----------------------------------------<br>
<br>
<br>
Using libraries:<br>
-L/home/leishi/work/development/3rd_party/petsc/petsc/arch-cuda5-cg-opt/lib<br>
 -lpetsc -llapack -lblas -lX11 -lpthread -Wl,-rpath,/usr/local/cuda/lib64<br>
-L/usr/local/cuda\<br>
/lib64 -lcufft -lcublas -lcudart -lcusparse -lm<br>
-L/media/public/MPICH3/mpich-install/lib<br>
-L/usr/lib/gcc/x86_64-linux-gnu/4.6 -L/usr/lib/x86_64-linux-gnu<br>
-L/lib/x86_64-linux-gnu -L/usr/\<br>
lib/gcc/x86_64-linux-gnu/4.8 -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl<br>
-lrt -lpthread -lgcc_s -ldl<br>
<br>
------------------------------------------<br>
<br>
<br>
Using mpiexec: /media/public/MPICH3/mpich-install/bin/mpiexec<br>
<br>
<br>
==========================================<br>
<br>
<br>
Building PETSc using GNU Make with 18 build threads<br>
<br>
<br>
==========================================<br>
<br>
<br>
make[2]: Entering directory<br>
`/home/leishi/work/development/3rd_party/petsc/petsc'<br>
<br>
<br>
Use "/usr/bin/make V=1" to see the verbose compile lines.<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/arch.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/fhost.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/fuser.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/memc.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/mpiu.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/psleep.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/sortd.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/sorti.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/str.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/sortip.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/pbarrier.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/pdisplay.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/ctable.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/psplit.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/select.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/mpimesg.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/sseenabled.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/utils/mpitr.o<br>
<br>
<br>
<br>
In file included from /usr/local/cuda/include/cusp/detail/config.h:24:0,<br>
<br>
<br>
                 from /usr/local/cuda/include/cusp/complex.h:63,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petsc-private/petscimpl.h:8,<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/options.c:14:<br>
<br>
<br>
/usr/local/cuda/include/thrust/version.h:69:1: error: unknown type name<br>
?namespace?<br>
<br>
/usr/local/cuda/include/thrust/version.h:70:1: error: expected ?=?, ?,?,<br>
?;?, ?asm? or ?__attribute__? before ?{? token<br>
<br>
In file included from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145:0,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petsc-private/petscimpl.h:8,<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/options.c:14:<br>
<br>
<br>
/usr/local/cuda/include/cusp/complex.h:70:19: fatal error: complex: No such<br>
file or directory<br>
<br>
compilation terminated.<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/objects/state.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/objects/aoptions.o<br>
<br>
<br>
          CC arch-cuda5-cg-opt/obj/src/sys/objects/subcomm.o<br>
<br>
<br>
In file included from /usr/local/cuda/include/cusp/detail/config.h:24:0,<br>
<br>
<br>
                 from /usr/local/cuda/include/cusp/complex.h:63,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/init.c:10:<br>
<br>
<br>
/usr/local/cuda/include/thrust/version.h:69:1: error:* unknown type name<br>
?namespace? *<br>
<br>
/usr/local/cuda/include/thrust/version.h:70:1: error: expected ?=?, ?,?,<br>
?;?, ?asm? or ?__attribute__? before ?{? token<br>
<br>
In file included from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petscmath.h:145:0,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/include/petscsys.h:366,<br>
<br>
<br>
                 from<br>
/home/leishi/work/development/3rd_party/petsc/petsc/src/sys/objects/init.c:10:<br>
<br>
<br>
/usr/local/cuda/include/cusp/complex.h:70:19: fatal error: complex: No such<br>
file or directory<br>
<br>
<br>
<br>
make: *** [all] Error 1<br>
<br>
Sincerely Yours,<br>
<br>
Lei Shi<br>
---------<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140411/4831a810/attachment.html" target="_blank">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140411/4831a810/attachment.html</a>><br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
petsc-users mailing list<br>
<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/petsc-users" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/petsc-users</a><br>
<br>
<br>
End of petsc-users Digest, Vol 64, Issue 26<br>
*******************************************<br>
<br>
----------------------------<br>
Confidencialidad:<br>
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.<br>

<br>
Disclaimer:<br>
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.<br>

----------------------------<br>
<br>
</blockquote></div><br></div></div>