LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 11-25-2012, 09:57 PM   #1
animeresistance
Member
 
Registered: Feb 2004
Distribution: Slackware
Posts: 190

Rep: Reputation: 20
Help installing an old version of gcc


Hello...

I'm trying to install Cuda in Slackware 14, and it needs an old version of gcc, i found this thread http://www.linuxquestions.org/questi...-a-4175434312/.

I read the instructions on how to configure and make it, but i'm not that skilled

Does anybody knows a simpler way to get cuda up and running?

Thank you in advance.

Cheers.
 
Old 11-26-2012, 12:48 AM   #2
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 436

Rep: Reputation: Disabled
I don't use cuda, but from the advice handed down from IRC, it's recommended to install something like gcc into /opt into it's own package directory: /opt/gcc-<VERSION>.

You don't really need that <VERSION> part unless you want multiple versions of gcc in /opt. Anyways, what I would recommend is taking the SlackBuild (from Pat) and other files closest to the gcc version the program requires. Based on the thread you linked, it seems the person is using gcc-4.4.7.

Slackware 13.37 ships with gcc-4.5.2, but Slackware 13.1 ships with gcc-4.4.4. I can't guarantee gcc 4.4.7 will work with the 13.1 SlackBuild or even the 13.37 SlackBuild, but maybe you can give it a go. You never know until you try. Don't forget the other files that are also in the gcc.SlackBuild directory.

However, you should edit the SlackBuild to replace "usr" with something like "opt/gcc-$VERSION" or something. If all goes well, you have a different version of gcc installed into /opt/gcc-$VERSION/. So you'll see something like: "/opt/gcc-$VERSION/bin/gcc" or something.

Now you might be able to use:
Code:
export CC="/opt/bin/gcc-$VERSION/gcc"
Same export except with CXX instead of CC if cuda has C++ code in it.

If you don't want to do that export stuff (might forget after you're done running the script or something), you can symlink the /opt/gcc-$VERSION/bin/gcc to /usr/local/bin/gcc instead. In a default $PATH, /usr/local/bin is read before /usr/bin is so the symlinked gcc in /usr/local/bin would be used first before the newer gcc is. Although to be honest, you might forget to remove the symlink more than the export line since symlinks (in my opinion) are easier to forget. Either way, remember to remove the symlink or unset the environment variable you set with export, otherwise all of your programs will start compiling with this old gcc unless specifically told otherwise.

By the way, I said I don't use cuda and the advice I gave is what I could remember from IRC, so good luck (and I'm basically saying I gave you a fair warning ^.^ )!

Last edited by TommyC7; 11-26-2012 at 12:50 AM.
 
Old 11-26-2012, 02:54 AM   #3
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,014

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by animeresistance View Post
Hello...

I'm trying to install Cuda in Slackware 14, and it needs an old version of gcc, i found this thread http://www.linuxquestions.org/questi...-a-4175434312/.

I read the instructions on how to configure and make it, but i'm not that skilled

Does anybody knows a simpler way to get cuda up and running?

Thank you in advance.

Cheers.
  1. Download proper gcc from the slackware source directory. Cuda currently supports gcc up to 4.6.x.
  2. Run the slackbuild script to build the that gcc
  3. Install that gcc
  4. Reinstall the distributed gcc (currently 4.7.1) to repair symbolic links
  5. Make symbolic links in the cuda directory, e.g. "ln -s /usr/bin/gcc-4.4.7 /usr/local/cuda/bin/gcc; ln -s /usr/bin/g++-gcc-4.4.7 /usr/local/cuda/bin/g++"

Where do you have problems in these steps?
 
Old 11-26-2012, 05:14 AM   #4
animeresistance
Member
 
Registered: Feb 2004
Distribution: Slackware
Posts: 190

Original Poster
Rep: Reputation: 20
Hi guys.

Thanks for replying ...

The problem was, that i was trying to install gcc from source, i read the index.html that explains how to configure it and install it, but got lost in the configuration files. When i configured (i think it configured), the make throwed some errors.

I will try your suggestions guys, and again, thanks for replying
 
  


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
installing gcc conflicts with previous version A*J Linux - Newbie 3 08-22-2012 10:33 PM
installing a second (older) gcc/g++ version (how to configure) r.stiltskin Linux - Software 1 02-07-2011 12:02 AM
installing an old version of GCC on Etch knobby67 Debian 1 03-29-2007 10:35 AM
has anybody any experience on installing a second gcc version? perfect_circle Slackware 2 02-16-2006 02:42 AM
installing another version of gcc kulmis Linux - Newbie 3 06-21-2005 01:24 PM


All times are GMT -5. The time now is 08:45 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration