Multiple versions of GCC and CUDA 5.0
I have a fresh install of Slackware64-current with gcc 4.7.1 as default. The problem is that when I try to install CUDA 5.0 production release, installer returns an error saying it's not compatible with my version. Checking out the errata I realized that latest installer supports up to gcc 4.6.2 thus I download/configure/make/install this version to another location.
my $PATH ;
Currently gcc 4.7.1 is on my path via /usr/bin.
I have two options to make this work ;
1-Point CUDA installer to new built (old version) version of gcc at the install
2-Modify my system in a way that when I call "gcc" the old version will be called
First option is what I would prefer to achieve because second option might/probably will/will effect while building other source codes.
Any suggestions ?
I would strongly suggest building/installing GCC 4.6.3 using configure --program-suffix=-4.6.3. If you downgrade your main GCC-packages you will break a lot of things.
I finally got it working ;
1-Install gcc-4.4.7 to a different location
2-Install CUDA 5.0 to it's default location
3-Install Samples and SDK to your home directory
4-Add gcc-4.4.7 to your path (overwrite gcc-4.7.1)
5-Add LD_LIBRARY_PATH to your path
6-Add nvcc (/usr/local/cuda-5.0/bin) to your path
7-Compile (make) samples
Editing common.mk is not necessary, be sure to try gcc-4.4.7 not other versions.
This is old now but I'd like to point out that you *don't* want to do this.
Install gcc to a new dir and don't touch the gcc you already have. You don't want to compile all software using old gcc forever.
Instead, when you want to compile cuda apps, export CC=gcc-4.4.7. Check the nvcc documentation on how to specify a compiler. It will be some extra flag or environment variable.
|All times are GMT -5. The time now is 08:55 PM.|