Installing GCC 4.7.x in /opt

Anything that pertains to Portage

Moderator: Moderators

Installing GCC 4.7.x in /opt

Postby PsyGhost » Sat Dec 15, 2012 0:44

I wish to start developing in C++11, and therefore need version 4.7.2 of GCC.
I don't want to install it as my main GCC compiler in order not to break my system, so I wish to install it in /opt.
Of course, I can download the official source tarball and compile it with --prefix=/opt/gcc-4.7.2, but I wounder if there's a "Gentoo way" to accomplish it with portage.
PsyGhost
Baby Hen
 
Posts: 7
Joined: Sat Dec 15, 2012 0:37

Re: Installing GCC 4.7.x in /opt

Postby micia » Sun Dec 16, 2012 0:19

Hi,
GCC 4.7.2 is in portage and you can compile it with emerge (since gcc ebuild is slotted, 4.7.2 belongs to the 4.7 slot), you can avoid setting it as your default compiler by using gcc-config, doing so shouldn't break your system, there are a few things that you should acknowledge though:
Sabayon has a different configuration for GCC than portage, the portage version of GCC includes both the runtime libraries (Sabayon's base-gcc) and the compiler itself (Sabayon's gcc). Mind this when performing updates with entropy, especially in the future, when GCC 4.7.x will be available.
User avatar
micia
Sagely Hen
 
Posts: 2710
Joined: Wed Nov 26, 2008 16:41

Re: Installing GCC 4.7.x in /opt

Postby PsyGhost » Sun Dec 16, 2012 20:59

Thank you for the assist. I successfully merged GCC 4.7.2 and now it appears in gcc-config -l
However, I wish to experiment it without setting it as the default compiler for the system, since I don't want to compile packages with it, but develop my own software.
When I try to launch:
/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.2/gcc
it tells me that:
gcc: error: hardenednossp.specs: No such file or directory

Is there any way to use the new version without switching to it in gcc-config?

EDIT:
I did:
gcc-config -E x86_64-pc-linux-gnu-4.7.2

and sourced the output.
PsyGhost
Baby Hen
 
Posts: 7
Joined: Sat Dec 15, 2012 0:37

Re: Installing GCC 4.7.x in /opt

Postby King_DuckZ » Wed Mar 13, 2013 13:10

I have a similar problem, I need to use gcc 4.7.2 and I don't really mind having it as the default compiler as well (unless there's a good reason for not doing that).

I've done:
# gcc-config x86_64-pc-linux-gnu-4.7.2-vanilla

but when I run gcc --version (or g++) I get:
gcc: error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/vanilla.specs: File o directory non esistente

In fact, if I locate that file I only get one result:
$ locate vanilla.specs
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.6.3/vanilla.specs

so can I just copy it into the 4.7.2 directory?
User avatar
King_DuckZ
Simple Hen
 
Posts: 65
Joined: Wed Sep 07, 2011 0:46

Re: Installing GCC 4.7.x in /opt

Postby sabayonino » Wed Mar 13, 2013 13:32

Example to set gcc :
Code: Select all
# gcc-config -l
 [1] x86_64-pc-linux-gnu-4.6.3
 [2] x86_64-pc-linux-gnu-4.7.2 *


Wxample to set [1] profile :
Code: Select all
# gcc-config 1

Code: Select all
# . /etc/profile


check your list
User avatar
sabayonino
Sagely Hen
 
Posts: 1564
Joined: Sun Sep 21, 2008 1:12
Location: Italy

Re: Installing GCC 4.7.x in /opt

Postby King_DuckZ » Wed Mar 13, 2013 14:15

I already have 4.6.3 set and working, but I need 4.7.2. Plus, I don't want the hardened version, I'd rather use the vanilla compiler, but I get the file missing error. Hardened 4.7.2 (I assume the one with no suffix is the hardened compiler) does indeed work.
User avatar
King_DuckZ
Simple Hen
 
Posts: 65
Joined: Wed Sep 07, 2011 0:46

Re: Installing GCC 4.7.x in /opt

Postby King_DuckZ » Thu Mar 14, 2013 11:38

Nobody knows how to fix this?
User avatar
King_DuckZ
Simple Hen
 
Posts: 65
Joined: Wed Sep 07, 2011 0:46

Re: Installing GCC 4.7.x in /opt

Postby lxnay » Thu Mar 14, 2013 14:35

I will roll out 4.7.2 very soon...
Image
Join us on IRC (chat.freenode.net #sabayon or WebChat)
Submit bugs to our Bug Tracker
Follow me on Twitter
Add me on Facebook
Add me on Google+
lxnay
Land Owner
 
Posts: 3405
Joined: Thu Oct 13, 2005 23:16
Location: Italy

Re: Installing GCC 4.7.x in /opt

Postby wintux » Fri Mar 29, 2013 17:34

lxnay wrote:I will roll out 4.7.2 very soon...

Yes, I just saw that it's already in limbo now! :)

But the go USE flag is disabled :cry:
although all other languages are enabled and
although I requested to enable it in my version bump request.

Please, be so kind and enable the go flag.
wintux
Baby Hen
 
Posts: 18
Joined: Mon Feb 18, 2013 22:16

Re: Installing GCC 4.7.x in /opt

Postby wintux » Sat Mar 30, 2013 12:34

Many thanks for enabling the go USE-flag in package sys-devel/gcc-4.7.2-r1!

lxnay wrote:I will roll out 4.7.2 very soon...

Sorry, it also affects sys-devel/base-gcc-4.7.2-r1.
:arrow: Could you please change it here, too?

General question:
In order to keep it simple for the maintainers I decided to make to make only one version bump request for both packages (including a hint that it affects both).
Would two separate requests have been better in such a case (packages that belong together)?
wintux
Baby Hen
 
Posts: 18
Joined: Mon Feb 18, 2013 22:16


Return to Portage|Emerge Package Managers

Who is online

Users browsing this forum: No registered users and 1 guest