LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-22-2011, 10:13 PM   #1
swingliner
LQ Newbie
 
Registered: Oct 2010
Posts: 10

Rep: Reputation: 2
Is it safe to use non-default versions of gcc?


Hello. I've recently been playing around with CUDA on Ubuntu 11.10. Ubuntu 11.10's default gcc version is apparently 4.6, but CUDA only works with gcc up to version 4.4. It wasn't any problem installing the gcc-4.4 package and relinking /usr/bin/gcc to /usr/bin/gcc-4.4, and the CUDA example are working now. Though nothing has exploded yet, is this safe? Are dynamic libraries and object files compiled with one version of gcc compatible with those compiled with another?
 
Old 10-22-2011, 10:30 PM   #2
Cultist
Member
 
Registered: Feb 2010
Location: Chicago, IL
Distribution: Slackware64 14.1
Posts: 777

Rep: Reputation: 101Reputation: 101
in general you'll be okay, but its possible that you have something installed (or will install something) that requires gcc 4.6 to run. But your computer isn't likely to explode anytime soon.
 
Old 10-23-2011, 02:51 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,564

Rep: Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512
The 3 compilers for Ubuntu 11.10 are : 1) The default /usr/bin/gcc
And the 2 "compat compilers" 2) gcc-4.4, 3) gcc-4.5 .


It should be possible in most situations to use 2) /usr/bin/gcc-4.4
and 3) /usr/bin/gcc-4.5 without relinking.

Examples : a) export CC=gcc-4.4 CXX=g++-4.4 && <other command>
b) ./configure CC=gcc-4.4 CXX=g++-4.4
c) make CC=gcc-4.4 CXX=g++-4.4
 
Old 10-24-2011, 03:36 AM   #4
inclusivedisjunction
LQ Newbie
 
Registered: May 2008
Posts: 8

Rep: Reputation: 0
You can also use update-alternatives to switch between them without having to create a new link.

Quote:
sudo update-alternatives --config gcc
 
  


Reply

Tags
gcc


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
How to Instal GCC without prior gcc versions. shri_tech007 Linux - Software 4 12-09-2010 02:15 PM
gcc versions installed on my system and which one is default..?? salmanmanekia Linux - Newbie 4 07-24-2009 12:26 PM
[SOLVED] Using old gcc. How to do? Is it safe? kaz2100 Debian 2 12-28-2008 09:14 AM
Are previous versions safe ? mat087 Linux - Newbie 4 05-08-2006 06:02 PM
gcc versions compatibility with kernel versions.. mahesh_manthapuri Suse/Novell 1 03-22-2006 12:28 AM


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