LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-27-2012, 02:27 AM   #1
t35t
LQ Newbie
 
Registered: Mar 2012
Posts: 19

Rep: Reputation: Disabled
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 ?
 
Old 10-27-2012, 10:38 AM   #2
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 946

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
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.
 
1 members found this post helpful.
Old 10-28-2012, 04:55 AM   #3
t35t
LQ Newbie
 
Registered: Mar 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by mats_b_tegner View Post
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.
 
Old 01-02-2013, 08:08 AM   #4
hiptobecubic
LQ Newbie
 
Registered: Oct 2009
Distribution: Slackware
Posts: 23

Rep: Reputation: 2
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple gcc versions? Zeno McDohl Linux - Server 17 01-12-2009 06:40 AM
Having multiple versions of GCC Rostfrei Programming 4 11-21-2007 01:10 AM
Multiple versions of GCC Denisius Slackware 11 11-15-2007 07:39 AM
multiple versions of gcc Avatar33 Linux - General 3 02-22-2005 02:06 PM
multiple gcc versions and selectability tincat2 Linux - Software 1 06-08-2003 02:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration