More Errors than I know what to do with... Be gentle...

Hello all,

It has become necessary to make a Linux distribution of the CUDA code I have been working on. I only installed Ubuntu 7.10 a week ago, so please be gentle with me. Treat me as a complete amateur.

So far so good though, I have been able to use CMake and the FindCUDA.cmake script from MIT to create the project and the Makefile. When I start ‘make’, everything goes reasonably smoothly, and I have seen my way through a few problems.

However, I hit several pages of errors, but mainly the same error repeated on every line. I assume that something in the gcc parser gets flagged to read every line as strings for some reason, and thus the pages of errors…

mikesalt@mikesalt-laptop:~/Desktop/GPMAD/build$ make

[ 23%] Built target parser

[ 28%] Building C object CUDA/src/CMakeFiles/coreGPU.dir/__/__/src/cuda/coreGPU.cu_coreGPU_generated.c.o

/usr/include/c++/4.2/i486-linux-gnu/bits/c++config.h:149: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘std’

In file included from /usr/local/cuda/bin/../include/builtin_types.h:46,

                 from /usr/local/cuda/bin/../include/cuda_runtime_api.h:56,

                 from /usr/local/cuda/bin/../include/crt/host_runtime.h:70,

                 from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h:216:

/usr/local/cuda/bin/../include/vector_types.h:394: error: expected identifier or ‘(’ before ‘unsigned’

/usr/local/cuda/bin/../include/vector_types.h:395: error: expected ‘;’ before ‘dim3’

In file included from /usr/local/cuda/bin/../include/crt/host_runtime.h:70,

                 from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/stddef.h:216:

/usr/local/cuda/bin/../include/cuda_runtime_api.h:79: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:88: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:89: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:90: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:91: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:92: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:101: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:102: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:103: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:104: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:105: error: expected identifier or ‘(’ before string constant

/usr/local/cuda/bin/../include/cuda_runtime_api.h:106: error: expected identifier or ‘(’ before string constant

etc...

Any ideas what typically causes behavior like this?

Cheers,

Mike

Which version of CUDA are you using?
With gcc4.2 you should use CUDA 2.0.

Sorry, forgot to say that I am using gcc 4.2.3 with CUDA 2.0b2.

Thanks

did you solve this problem? i’m not getting a page of errors, but i’m getting one of the same error on the lines:

extern "C"

void usage();