Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 10-22-2011, 11:13 PM   #1
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, 11:30 PM   #2
Registered: Feb 2010
Location: Chicago, IL
Distribution: Slackware64 14.1
Posts: 777

Rep: Reputation: 102Reputation: 102
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, 03:51 PM   #3
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2015, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 15,910

Rep: Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021Reputation: 3021
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, 04:36 AM   #4
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.

sudo update-alternatives --config 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 03:15 PM
gcc versions installed on my system and which one is default..?? salmanmanekia Linux - Newbie 4 07-24-2009 01:26 PM
[SOLVED] Using old gcc. How to do? Is it safe? kaz2100 Debian 2 12-28-2008 10:14 AM
Are previous versions safe ? mat087 Linux - Newbie 4 05-08-2006 07:02 PM
gcc versions compatibility with kernel versions.. mahesh_manthapuri SUSE / openSUSE 1 03-22-2006 01:28 AM

All times are GMT -5. The time now is 03:25 AM.

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