LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Multiple versions of GCC and CUDA 5.0 (http://www.linuxquestions.org/questions/slackware-14/multiple-versions-of-gcc-and-cuda-5-0-a-4175434312/)

t35t 10-27-2012 02:27 AM

Multiple versions of GCC and CUDA 5.0
 
Hi all,

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 ;

/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:

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 ?

mats_b_tegner 10-27-2012 10:38 AM

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.

t35t 10-28-2012 04:55 AM

Quote:

Originally Posted by mats_b_tegner (Post 4816213)
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 installed by --prefix=/new/dir/bin/to/gcc.

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.

hiptobecubic 01-02-2013 08:08 AM

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:15 AM.