compilation issues on OpenSuse 10.2

I am trying to compile the CUDA samples on suse 10.2
The problem is that I have GCC 4.2.2 installed as well as the standard gcc. Compiling with 4.2.2 gives errors, and I’d like to use 4.1.2.

But when I type
export CC=/usr/bin/gcc

the compilation still uses the wrong version of the compiler.
comperrors.txt (22.6 KB)

Are you sure that gcc is the 4.1.2 version? To have nvcc use the 4.1.2 take a look at some of the opensuse 10.3 threads in this forum.


OK, now I get a different error:

brodskie@linux-bw3k:~/NVIDIA_CUDA_SDK> make
make[1]: Entering directory /home/brodskie/NVIDIA_CUDA_SDK/common' a - obj/release/bank_checker.cpp_o a - obj/release/cmd_arg_reader.cpp_o a - obj/release/cutil.cpp_o a - obj/release/stopwatch.cpp_o a - obj/release/stopwatch_linux.cpp_o a - obj/release/multithreading.cpp_o make[1]: Leaving directory /home/brodskie/NVIDIA_CUDA_SDK/common’
make[1]: Entering directory /home/brodskie/NVIDIA_CUDA_SDK/common' a - obj/release/paramgl.cpp_o a - obj/release/param.cpp_o make[1]: Leaving directory /home/brodskie/NVIDIA_CUDA_SDK/common’
make -C projects/template/
make[1]: Entering directory /home/brodskie/NVIDIA_CUDA_SDK/projects/template' ../../lib/libcutil.a(cutil.cpp_o): In function CUTBoolean (anonymous namespace)::cutWriteFile(char const*, unsigned char const*, unsigned int, unsigned char, bool)’:
cutil.cpp:(.text+0x868): undefined reference to `std::basic_ostream<char, std::char_traits >& std::__ostream_insert<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*, int)’

and the errors continue like that ( I attached the full message)
I can compile other applications perfectly well, I don’t understand why make cannot find the STL (that is what I at least think is wrong).
errors.txt (30 KB)

I did solve the problem , but only by deleting all traces of the second installation of gcc 4.2.1 Since the developers of gcc didn’t bother to include an uninstaller, this involved a fair amount of hunting.
I still find it very interesting that the building process of the nvidia samples used the wrong versions of the libraries included with the 4.2.1 compiler; my build environment was sane enough to allow other programs to compile just fine.

CUDA is tested & qualified against specific Linux distributions. Using a compiler toolchain which didn’t ship with a qualified Linux distribution is effectively equivalent to using an unqualified Linux distribution.

Please note that if you wish to use an alternative gcc, you should be specifying the --compiler-bindir option:
–compiler-bindir (-ccbin)
Specify the directory in which the compiler executable (Microsoft Visual
Studion cl, or a gcc derivative) resides. By default, this executable is
expected in the current executable search path.