There are several discussions about gcc 4.4.x for CUDA SDK building issues, e.g. on FC 11 I am using.
General solutions are to step back 4.3 or use compat-34. Here is another workaround way:
Please edit common/common.mk
ADD one more flag to NVCCFLAGS
–compiler-options -fno-inline
As in gcc 4.4.x, check against inline function be declared as weak. If you still meet the problem about always-inline functions like memcpy and memset, I suggest to recover common.mk, and override nvccflags -O2 with -O0 or null. This is the cheapest way to go through 4.4.x issue, cheers!
Another suggested again, maybe to Nvidia:
in Makefile, please add two lines for clean @make -C common -f Makefile_paramgl clean @make -C common -f Makefile_rendercheckgl clean
I did exactly to your advice, but it still reports the error about weak declaration in simpleTemplates project. The error shows to string.h and string3.h files in /usr/include, and to common_functions.h in cuda subdirs.
Same as for smokyboy, changing to gcc-4.3 in common.mk or adding the no-inline flag did not work. The only way was to uninstall gcc/g+±4.4, and make manually the link of /usr/bin/gcc to /usr/bin/gcc-4.3, and same for g++.
Actually, when you uninstall gcc-4.4 and do the make before creating the link of gcc/g++, the compilation fails at some point because it can’t find “gcc” (which makes sense since when you uninstall gcc-4.4, Ubuntu deletes the link /usr/bin/gcc.
But, that would not make any sense since I specified to use CC:=gcc-4.3, then I suspected somewhere else CC and CXX were being re-assigned to gcc/g++.
And the culprit seemed to be
src/simpleAtomicIntrinsics/Makefile2
At end of Makefile2 you can see
NVCC := $(CUDA_INSTALL_PATH)/bin/nvcc
CXX := g++
CC := gcc
LINK := g++ -fPIC
and then all subsequent compilations fail because this
Then, I deleted the CXX, CC and LINK assignments in src/simpleAtomicIntrinsics/Makefile2 and did again make, but the error of “gcc: no such file or directory persisted”
"…
make -C src/simpleTextureDrv/
make[1]: Entering directory `/home/pichards/NVIDIA_GPU_Computing_SDK/C/src/simpleTextureDrv’
gcc: No such file or director
"
Then I simply decided to create manually the link /usr/bin/gcc to gcc-4.3 and theproblem was solved, I could not find exactly the rule in the Makefiles that was trying to use gcc instead of expanding $(CC)…
Then solution for Ubuntu 9.10:
Install gcc and g++ 4.3, then change manually the links gcc and g++ to the 4.3 counterparts.
Not very clean until we figure out where exactly the Makefiles are getting messy
To be simple, you do not bother to step back gcc 4.3.* for SDK building.
Right, as indicated above, --no-inline cannot solve all the issues on some platforms as Ubuntu 9.10, then you haveto change some system-level declarations. This is not a good method at all.
Alternatively, you can simply change common.mk as below.
This does not influence device performance and it also applies to SDK 3.0beta, however, in 3.0beta, some other problems arise because of the software definition elegance issues…
The changes in post #7 (highman) worked for me on Ubuntu 9.10 with a HP311 (NVIDIA ION LE) with CUDA 2.3 and driver version 190.42 (NVIDIA-Linux-x86-190.42-pkg1.run).
I was able to compile and run all the examples in the SDK.
gcc 4.3 and 4.4 did not work but 4.1 did. The gcc, g++ and gcov are but symlinks to the gcc-4.x etc, so I just deleted those and made new symlinks to the 4.1’s, and then all compiled w/o a squeak.
No doubt a config file should be used to find out what compiler version is/are available, and adjust the makefile accordingly. I use Debian-Sid 2.6.32-2.slh.3-sidux-amd64 x86_64 and NVIDIA 190.53.
All demos seem to run fine.
A config file should also be able to detect existing and missing dependencies. I guess I’m spoiled using Debian, apt-get finds all needed deps. I remember way back, External Image using rpm based stuff i always ended up with missing stuff, but here Nvidia could easily use a distribution agnostic config file. My debian repos even had some libcuda1 files.
OK, I’m a newbie and I tried the instructions in the previous post about installing gcc-4.1, etc. and re-making the symlinks. I am running Kubuntu 9.10. I perform a “make clean” and then “make”. Here’s my output:
Please be nice to me :rolleyes: - I am not a programmer and my intent is to get the SDK to compile the samples, run the samples, then learn/work with PyCuda to develop some stock analysis programs.
Sorry if I’m reviving a dead thread, but I would like to say that this method worked for me on Ubuntu 9.10 using CUDA 2.3 and the 190.53 drivers.
I’m curious why these compile errors are coming up. Is it because of certain compiler optimizations were defaulted in gcc 4.4 which were not present in 4.3?