I had changed the default flag for a cuda build from -g3 to -g. Perhaps you don't have the latest petsc-dev/BuildSystem?
http://petsc.cs.iit.edu/petsc/BuildSystem/rev/05b504243938 BTW: The defualt opt flags can be changed with --COPTFLAGS configure option. Satish On Thu, 12 Apr 2012, Ben Jamroz wrote: > 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 > >