Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
newbie wanting to upgrade from gcc 4.6 to 4.7 or 4.8
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Fri Mar 22, 2013 5:35 pm    Post subject: newbie wanting to upgrade from gcc 4.6 to 4.7 or 4.8 Reply with quote

I'm learning about Gentoo by trying things out on my laptop, prior to installing Gentoo on my main computer. I would like to upgrade gcc from 4.6.3 to 4.7 or 4.8. The purpose is to try out graphite and lto. Background to why I want to try graphite and lto is here: https://forums.gentoo.org/viewtopic-t-954484.htmt, but I'm asking "how to" in this forum because upgrading gcc probably isn't a proper topic for the "Installing Gentoo" forum.

I'm not sure where gcc 4.8 might be located, but gcc 4.7.2-r1 is listed on this page: http://www.gentoo-portage.com/sys-devel/gcc. I've been reading through the Gentoo documentation and forums and it seems that more or less mysterious things like "ebuild", "overlay", "arch", "keywords", and maybe "layman", "mask", and "testing" are relevant to what I want to do. But I haven't been able to put it all together in terms of "how to upgrade to a higher (not yet officially supported?) version of gcc". Hints as to how to proceed and/or links to the proper documentation to read would be very much appreciated.

Elle
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Mar 22, 2013 6:04 pm    Post subject: Reply with quote

Elle,

Do you have equery installed? (That's part of sys-apps/gentoolkit.) If so, you don't need to go to an external web site to see the available versions of a package:
Code:
~ # equery list -p gcc
 * Searching for gcc ...
[-P-] [ ~] sys-devel/gcc-2.95.3-r10:2.95
[-P-] [  ] sys-devel/gcc-3.1.1-r2:3.1
[-P-] [ -] sys-devel/gcc-3.2.2:3.2
[-P-] [  ] sys-devel/gcc-3.2.3-r4:3.2
[-P-] [ ~] sys-devel/gcc-3.3.6-r1:3.3
[-P-] [  ] sys-devel/gcc-3.4.6-r2:3.4
[-P-] [ -] sys-devel/gcc-4.0.4:4.0
[-P-] [  ] sys-devel/gcc-4.1.2:4.1
[-P-] [ ~] sys-devel/gcc-4.2.4-r1:4.2
[-P-] [ ~] sys-devel/gcc-4.3.3-r2:4.3
[-P-] [  ] sys-devel/gcc-4.3.4:4.3
[-P-] [ ~] sys-devel/gcc-4.3.5:4.3
[-P-] [  ] sys-devel/gcc-4.3.6-r1:4.3
[-P-] [ ~] sys-devel/gcc-4.4.2:4.4
[-P-] [ ~] sys-devel/gcc-4.4.3-r3:4.4
[-P-] [  ] sys-devel/gcc-4.4.4-r2:4.4
[-P-] [  ] sys-devel/gcc-4.4.5:4.4
[-P-] [  ] sys-devel/gcc-4.4.6-r1:4.4
[-P-] [  ] sys-devel/gcc-4.4.7:4.4
[-P-] [ ~] sys-devel/gcc-4.5.1-r1:4.5
[-P-] [ ~] sys-devel/gcc-4.5.2:4.5
[-P-] [  ] sys-devel/gcc-4.5.3-r2:4.5
[IP-] [  ] sys-devel/gcc-4.5.4:4.5
[-P-] [ ~] sys-devel/gcc-4.6.0:4.6
[-P-] [  ] sys-devel/gcc-4.6.1-r1:4.6
[-P-] [ ~] sys-devel/gcc-4.6.2:4.6
[IP-] [  ] sys-devel/gcc-4.6.3:4.6
[-P-] [ ~] sys-devel/gcc-4.7.0:4.7
[-P-] [ ~] sys-devel/gcc-4.7.1:4.7
[-P-] [ ~] sys-devel/gcc-4.7.2-r1:4.7
The tilde symbol adjacent to gcc-4.7.2-r1 means that it's simply masked by missing keyword, also called being in the "testing branch" of the Portage tree. Since it's in the tree, it's supported. You can keyword the package (thus unmasking it) really easily. See the Mixing Software Branches topic in the Handbook.

Newer versions of gcc that haven't yet reached testing branch are in the toolchain overlay. Have you discovered Layman yet? See the Gentoo Overlays: Users' Guide for a good introduction to overlays in general and Layman in particular.

If something isn't clear, don't hesitate to ask. :)

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Mar 22, 2013 6:43 pm    Post subject: Re: newbie wanting to upgrade from gcc 4.6 to 4.7 or 4.8 Reply with quote

ElleStone wrote:
Hints as to how to proceed

Go with the gcc 4.7 series - forget 4.8, it's far too new and unknown right now (it's not even in Arch Linux's testing section yet ;) ).
Back to top
View user's profile Send private message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Fri Mar 22, 2013 9:29 pm    Post subject: Reply with quote

John, thank you *very* much. "equery list -p gcc" was exactly what I needed to start making sense of the documentation. I had read the documentation about mixing software branches, but couldn't find gcc 4.7 on my system as an option for updating.

Paul, starting with gcc 4.7 seems like good advice - one new thing to learn at a time, first mixing, then maybe overlays.

Give me a day or two to break things, I'm sure I'll be back with more questions!

Elle
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21431

PostPosted: Fri Mar 22, 2013 10:47 pm    Post subject: Reply with quote

If a package version is available, but Portage is not choosing to use it when you use the bare name, you can ask emerge for that specific version. If there is a reason emerge is ignoring that version, such as unsuitable keywords, you will receive an error message stating why your request cannot be satisfied. That message is often helpful in making the changes required to permit that version to be picked. Be aware that some changes like that can bypass important safety measures set by Gentoo developers, so careless changes can leave you with a mess. For your use case, I would do emerge --pretend --verbose sys-devel/gcc:4.7 to request the newest suitable gcc in the slot 4.7. If you are on stable, you will receive a message explaining that the 4.7 slot requires a testing keyword.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Mar 22, 2013 11:10 pm    Post subject: Re: newbie wanting to upgrade from gcc 4.6 to 4.7 or 4.8 Reply with quote

ElleStone wrote:
I'm not sure where gcc 4.8 might be located, but gcc 4.7.2-r1 is listed on this page:

ElleStone ... it, at least the tools to install it, is already on your system. You have 'portage' (the package manager) and /usr/portage (the tree of 'ebuilds', patches, etc, that are used by portage to fetch, patch, configure, build, and install, the packages).

First, I'd suggest you install a number of packages which are not installed by default, but are invaluable in managing, querying, etc, portage .... if you haven't already.

Code:
# emerge -a eix portage-utils gentoolkit layman pfl

John already suggested you install gentoolkit, so if that is already installed exclude it from the list.

With these tools installed you can begin to get some idea of what each does ... and get further aquainted with portage/gentoo. John already pointed you to 'Mixing Software Branches' but you should also check the following sections of the handbook and docs:

Section 3 of the Handbook: Working with Portage
Gentoo Doc: gentoolkit and portage-utils
Gentoo Doc: Gentoo Overlays: Users' Guide

Even if you just skim these they'll help to build up your vocabulary, and so when someone says "you need to keyword foo" you'll have some idea of what is meant, and how you might do that.

ElleStone wrote:
I've been reading through the Gentoo documentation and forums and it seems that more or less mysterious things like "ebuild", "overlay", "arch", "keywords", and maybe "layman", "mask", and "testing" are relevant to what I want to do. But I haven't been able to put it all together in terms of "how to upgrade to a higher (not yet officially supported?) version of gcc". Hints as to how to proceed and/or links to the proper documentation to read would be very much appreciated.

You have to learn to walk before you can run and you need some idea of how the system works before you can make it work for you. If you don't, you can break the install entirely, or not be able to fix any issues at arise. So, understanding the above terms, and how they are set, used, etc, is essencial (more so if you want to use the ~arch or masked packages).

That said, mostly its straightforward, once you gasp what does what, but that takes time and some experience. Anyhow, my platitudes are not so as to deter you ... but to prepare you to some degree.

Some terms and their meanings (in brief):

"ebuild": these are what might be best descibed as "scripts" that fetch, patch, configure, build and install software. As they are versioned they also provide a method for the package manager to track the status of packages (for the purpose of updating) and the dependencies between/with other packages. These are located under <category>/<package>/package-<version>-<revision>.ebuild in /usr/portage.

"keyword" and "arch": these describe in what branch of the tree a package is situated, and the support for the "architecture". "arch" descibes the "stable" branch of an architecture, so "x86", "amd64", "ppc", etc, and "~arch" the "testing" branch. So, if we look at the following output of 'eshowkw' (from gentoolkit) for the package i3status:
Code:
# eshowkw i3status
Keywords for x11-misc/i3status:
       |                           | u   | 
       | a a             p     s   | n   | 
       | l m   h i m m   p s   p   | u s | r
       | p d a p a 6 i p c 3   a x | s l | e
       | h 6 r p 6 8 p p 6 9 s r 8 | e o | p
       | a 4 m a 4 k s c 4 0 h c 6 | d t | o
-------+---------------------------+-----+-------
   2.6 | o + o o o o o o o o o o + | o 0 | gentoo
[I]2.7 | o ~ o o o o o o o o o o ~ | o   | gentoo

... we can see that for amd64 and x86 the version 2.6 is stable, and 2.7 is in testing, for other architecures the package is not keyworded and so for all intent and purpose, "masked". Packages can be "keyworded", using /etc/portage/package.accept_keywords, so the user can install a package thats in "~arch" (this is whats called "mixing software branches") or they can set ACCEPT_KEYWORDS="~x86" to accept all packages from ~arch. Masked packages are similar in nature to ~arch, they are either unkeywored or hardmasked via package.mask, and must be explicitly unmasked to be installed.

"layman": a tool for managing software branches that are outside of the gentoo tree, these trees are called "overlays".

Hopefully that covers most of the "mystery" ... I've nothing to add re gcc I pretty much use the stable branch with some software picked from ~arch and various overlays.

best ... khay
Back to top
View user's profile Send private message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 106

PostPosted: Sun Mar 24, 2013 11:58 am    Post subject: Reply with quote

Thanks very much to all of you for advice and suggested documentation to read. I do have gentoolkit installed (I followed the install documentation pretty closely) and I will install the other recommended packages. Learning Gentoo is like learning a new language - light dawns gradually over the whole - it will take a while before I've absorbed enough to take the next step and actually install gc 4.7.

Elle
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum