LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 08-09-2018, 01:56 AM   #1
laqq3
LQ Newbie
 
Registered: Jul 2018
Posts: 5

Rep: Reputation: Disabled
Older GCC version on current


Hi all,

First time poster here, so please be gentle :-)

I recently installed Slackware (x64) current via alien bob’s ISO. I wanted to go with 14.2 but my hardware is too new to be supported by 14.2’s kernel.

I want to install nvidia CUDA9 for running computations on the GPU. The problem is that CUDA9 only supports gcc version 6 and lower (there must be a lower bound on the GCC version as well — but I know that 5 and 6 should work, based on reading CUDA docs). Current ships GCC 8.2.

I understand I could build GCC6 from source and instruct CUDA to use that. I’m not averse to doing that, but I am posting to see whether there is another less manual option available.

I see that alien bob has gcc5 packaged for -current; however its README says it is to be co-installed with gcc7.

Generally, I’m wondering if there is a way to use older versions of GCC with current — perhaps a package is available somewhere, given that current had GCC6 in the past? Or is building GCC6 manually the best way forward?

Thanks!

Best regards,
 
Old 08-09-2018, 06:11 AM   #2
kgha
Senior Member
 
Registered: May 2018
Location: Sweden
Distribution: Slackware 64 -current multilib from AlienBob's LiveSlak MATE
Posts: 1,061

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
I'm no gcc expert, but apparently it's possible to have multiple versions of gcc installed. See https://gcc.gnu.org/faq.html#multiple
So you should be able to install AlienBob's gcc-5 package. Then it's about finding a way of getting CUDA9 to use the correct version, with symlinks or whatever, but I guess that it's possible to find a solution via google, there must be other CUDA9 users facing the same issue.

Last edited by kgha; 08-09-2018 at 06:13 AM.
 
2 members found this post helpful.
Old 08-09-2018, 08:31 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by laqq3 View Post
I see that alien bob has gcc5 packaged for -current; however its README says it is to be co-installed with gcc7.
I wrote that because at the time, Slackware-current was indeed shipping GCC-7.
Now that it has GCC-8 you can still 'installpkg' my gcc5 package and then it is co-installed with GCC-8. No big deal, works just fine. Be sure to source the "/etc/profile.d/gcc5.sh" script if you actually want to use the gcc5 compiler.
Also note that this "gcc5" package only contains C, C++ and Java compilers. I left out the Fortran, Go etc compilers. I kept Java because that compiler is no longer offered since gcc-7 and it still has its uses for some.
 
3 members found this post helpful.
Old 08-09-2018, 09:53 AM   #4
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Rep: Reputation: 87
If there isn't a particular reason to use CUDA 9 specifically, you're better with latest CUDA 9.2, that supports GCC 7 (however, beware that CUDA doesn't work with NVIDIA drivers past 396.24, as discussed in this thread here on forum). Furthermore, I think indeed that installing GCC from source is the best approach. There are number of pages explaining how to do it, so that should be easy for you. And when you have it installed, it's just about pointing your build system to use these compilers, also don't forget to specifically set CUDA host compiler to the same GCC version.

Btw, it's indeed very annoying that there are so much issues when GCC 8 used with CUDA. It was similar with GCC 7 and previous CUDA version, but this time issues are even much more complicated. Previously, it was simply enough to comment out code line checking compiler version in corresponding CUDA header file, and everything would work fine.
 
2 members found this post helpful.
Old 08-09-2018, 10:37 PM   #5
laqq3
LQ Newbie
 
Registered: Jul 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the help everyone! I ended up compiling GCC 7.3 from source and using that for CUDA 9.2. (I originally chose CUDA 9 since that's the version used by Tensorflow in the provided binaries, but since I needed to install Tensorflow from source anyway I went with CUDA 9.2). Thanks @cgorac for the pointer regarding the Nvidia driver (also thanks to alien bob for providing the -current ISO in the first place!).
 
  


Reply



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
Is there a way to compile gcc with an older version or build gcc manually? anon002 Linux - Software 10 05-11-2015 01:05 AM
[Ubuntu] Older gcc Version Siebenkeim Linux - Server 10 08-16-2012 01:53 PM
need an older gcc version parent's_basement Debian 4 12-18-2008 07:04 AM
using an older version of gcc win32sux Slackware 1 05-12-2004 01:53 AM
Install older version of gcc s9902245 Linux - Newbie 1 09-16-2003 03:08 PM

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

All times are GMT -5. The time now is 03:15 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