[petsc-dev] nvcc -g3 error
Ben Jamroz
jamroz at txcorp.com
Thu Apr 12 12:37:28 CDT 2012
Hi,
I've had trouble building a debug version of petsc-dev with nvcc. At
compile time I was getting the following error.
===============================================================
libfast in: /scr_0/jamroz/petsc-dev-jamroz/src/vec/vec/impls/seq/seqcusp
nvcc -O3 -g -g -arch=sm_20 -c --compiler-options=-g -O3 -g3 -fno-inline
-O0 -I/scr_0/jamroz/petsc-dev-jamroz/include
-I/scr_0/jamroz/petsc-dev-jamroz/arch-linux2-c-debug/include
-I/usr/local/cuda/4.1/cuda/include
-I/scr_0/jamroz/gpuPETSc/txpetscgpu/include -I/scr_0/jamroz/
-I/usr/local/cuda/4.1/cuda/include/
-I/usr/mpi/gcc/openmpi-1.4.3/include
-D__INSDIR__=src/vec/vec/impls/seq/seqcusp/ veccusp.cu
<built-in>(1): error: "__STDC_HOSTED__" is predefined; attempted
redefinition ignored
<built-in>(1): error: "__WCHAR_TYPE__" is predefined; attempted
redefinition ignored
<built-in>(1): error: "__x86_64" is predefined; attempted redefinition
ignored
<built-in>(1): error: "__x86_64__" is predefined; attempted redefinition
ignored
<built-in>(1): error: "__linux__" is predefined; attempted redefinition
ignored
<built-in>(1): error: "__unix__" is predefined; attempted redefinition
ignored
<built-in>(1): error: "unix" is predefined; attempted redefinition ignored
7 errors detected in the compilation of
"/tmp/tmpxft_00006e29_00000000-7_veccusp.cpp3.i".
/usr/bin/ar: veccusp.o: No such file or directory
===============================================================
It turns out that -g3 (debug level) in the --compiler-options was
causing the trouble. Commenting out this line in
BuildSystem/config/compilerOptions.py (line 24) fixed this error.
According to http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
the default debug is level 2.
Just a heads up.
-Ben
ps. My config script was:
./configure --with-debugging=1 --with-mpi=1
--with-thrust-dir=/usr/local/cuda/4.1/cuda/include/
--with-cusp-dir=/scr_0/jamroz/ --CFLAGS="-g -O3" --with-cuda=1
--with-cuda-dir=/usr/local/cuda/4.1/cuda --CUDAFLAGS="-O3 -g"
--with-cudac=nvcc --with-cuda-arch=sm_20 --with-precision=double
--with-txpetscgpu=1 --download-txpetscgpu=no
--with-txpetscgpu-dir=/scr_0/jamroz/gpuPETSc/txpetscgpu
--
Ben Jamroz jamroz at txcorp.com
Tech-X Corporation
5621 Arapahoe Ave, Suite A
Boulder, CO 80303
Phone: (720) 974-1853, Fax: (303) 448-7756
More information about the petsc-dev
mailing list