New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gcc #1379

Closed
sarahhodne opened this Issue Aug 28, 2013 · 23 comments

Comments

@sarahhodne
Contributor

sarahhodne commented Aug 28, 2013

See travis-ci/travis-core#195.

In summary: Upgrade the gcc version to something that supports -std=c++11, for example 4.7.2.

From the original issue, it looks like this would do it:

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get -qq update
sudo apt-get -qq install g++-4.7

However, that would install the binary as gcc-4.7.

@artob

This comment has been minimized.

artob commented Aug 28, 2013

C++11 support isn't very good until GCC 4.8. Here's an example of installing and using GCC 4.8 in .travis.yml:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -qq
if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; fi
if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
@gildegoma

This comment has been minimized.

Member

gildegoma commented Aug 28, 2013

@bendiken I strongly invite you to participate to #979 discussion...

@sarahhodne

This comment has been minimized.

Contributor

sarahhodne commented Aug 28, 2013

To clarify a little bit: The idea with this issue is not to add more versions of gcc, but just to upgrade the version of gcc we have installed.

@artob

This comment has been minimized.

artob commented Aug 28, 2013

@gildegoma thanks, I posted in that issue as well and will watch developments there.

@henrikhodne I would like to suggest to you that upgrading GCC to 4.8.x (the current production release) would be rather more useful to everyone than just upgrading it to 4.7.2, due to the central issue of C++11 support which was only broadly completed in 4.8. GCC 4.7.x is somewhat painful to work with if developing a C++11 project.

@mavam

This comment has been minimized.

mavam commented Aug 28, 2013

👍 for GCC 4.8. This would give us full C++11 support. With the recent Clang 3.2 update, we can cover some ground, but GCC 4.8 is C++11 feature complete.

gildegoma added a commit to gildegoma/travis-cookbooks that referenced this issue Aug 30, 2013

Add 'gcc' cookbook
This cookbook currently provides two recipes:
 - default.rb, to install ubuntu 'gcc' default package
 - ppa.rb, to install latest 'gcc' from ubuntu-toolchain-r/test PPA

Address travis-ci/travis-ci#1379
Related to travis-ci/travis-ci#979
@larroy

This comment has been minimized.

larroy commented Feb 6, 2014

+1 for this. GCC 4.6 is a no-no

@Cruel

This comment has been minimized.

Cruel commented Feb 8, 2014

Surprised this hasn't been done already. What's the reason? Is there a fear of breaking dependencies?

Btw, I used the above commands plus this:

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90

This way the g++ default would link to the g++-4.8 binary.

@BanzaiMan

This comment has been minimized.

Member

BanzaiMan commented Feb 10, 2014

@joshk we should look into this for the next VM upgrade.

@LB--

This comment has been minimized.

LB-- commented Feb 12, 2014

I get the feeling GCC 4.9 will be out in the next few months - if travis isn't going to upgrade to 4.8 within a timely manner it might be worth it to wait for 4.9. If travis will update within the next few weeks then of course go for 4.8.2.

@gildegoma

This comment has been minimized.

Member

gildegoma commented Feb 13, 2014

Pre-installation of GCC 4.8 is ready in travis-cookbooks, and it will be easy to adapt it for GCC 4.9 when final release is out (note that ubuntu-toolchain-r/test PPA already provides it). Note that this gcc::ppa recipe still needs to be added to VM image provisioning run_list.

A global override of Ubuntu-12.04LTS's default gcc (4.6!) can potentially "break things" that were tied to pass with gcc-4.6 (as an example: golang 1.0.x does not compile with gcc 4.8). As central part of Long-Term-Support version, it sounds safer to keep it as "System" default.
For this reason the update-alternatives step is for now intentionally skipped in the cookbook configuration, but it's easy to change it (at your own risks ;-)

In order to get a reasonable default for "C/C++ Projects", I think that an elegant solution would consist in dynamically executing the update-alternatives for gcc/g++ binaries via travis-build setup phase (something similar to what jdk builders do), but only for language: cpp and language: c builds.

It is a bit messy having these two kinds of "defaults", and I'm afraid that even with great documentation, people may get confused. But I don't see better approach... What do you think?

@joshk

This comment has been minimized.

Member

joshk commented Feb 14, 2014

Are you saying we should install many versions of GCC and then have a 'selector' in the .travis.yml?

eg. gcc: 4.8 ?

@gildegoma

This comment has been minimized.

Member

gildegoma commented Feb 14, 2014

Not exactly, as C/C++ builds wish a latest GCC (today 4.8) as default, without additional customization via .travis.yml.

For sure, GCC (and Clang) version selection could be the next step to keep in mind: #979 (see also travis-ci/travis-cookbooks#215 (comment) thread). But even in this case the "gcc/g++ system default" vs "C/C++ travis builder default" question remains...

But as @henrikhodne previously mentioned:

The idea with this issue is not to add more versions of gcc, but just to upgrade the version of gcc we have installed.

This is not that obvious, because we cannot easily get rid of gcc-4.6 as "system default"...

For this iteration an implicit "auto-selection" of gcc-4.8 could be enough, don't you think? Or do you prefer to directly go for #979?

@ddevault

This comment has been minimized.

ddevault commented Mar 3, 2014

Dropping in to express support for gcc 4.8 and bring this thread back to the top of your inboxes 😉

@fungos

This comment has been minimized.

fungos commented Apr 1, 2014

Any update on this? would be awesome to have up-to-date compilers out-of-the-box ;)

@mavam

This comment has been minimized.

mavam commented Apr 1, 2014

👍

My project requires GCC 4.9 and Clang 3.4 at this point. While GCC 4.9 is available via ppa:ubuntu-toolchain-r/test, getting Clang 3.4 up and running with libc++ and libcxxabi is still a major pain.

@artob

This comment has been minimized.

artob commented Apr 1, 2014

👍

I would wonder how much build VM time, in aggregate, is currently wasted by hundreds or thousands of projects installing the latest toolchain from the ppa:ubuntu-toolchain-r/test repository on every build as a precondition for building C++11 projects… I know all of my C++ projects do, which is a dozen or so right there.

@copumpkin

This comment has been minimized.

copumpkin commented Apr 6, 2014

👍

I'm encountering a known compiler bug compiling MPFR with 4.6 and would love to get 4.8 instead.

@krasin

This comment has been minimized.

krasin commented Apr 27, 2014

I would like to run tests under AddressSanitizer (-fsanitize=address), but this option is only available for the recent gcc versions (4.8 and newer). Please, invest time in Docker or something, to make it easier to offer more build environments options with less effort.

@roidrage

This comment has been minimized.

Member

roidrage commented Apr 27, 2014

While we're currently testing a Docker based setup, the above example works well with gcc 4.8 too:

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get -qq update
sudo apt-get -qq install g++-4.8
@matthiaskrgr

This comment has been minimized.

matthiaskrgr commented Jun 6, 2014

Gcc 4.9 has new undefined behaviour sanitized (-fsanitize=undefined).
However it seems gcc4.9 is not available in precise (yet?).

https://launchpad.net/~ubuntu-toolchain-r/+archive/test?field.series_filter=precise

@mavam

This comment has been minimized.

mavam commented Jun 6, 2014

While there exists a PPA for GCC 4.9, it does not work with Ubuntu 12.04, which runs on the VMs. It looks like 14.04 is necessary: http://askubuntu.com/a/456849.

Svalorzen added a commit to Svalorzen/AI-Toolbox that referenced this issue Jun 10, 2014

Removed g++ build since travis does not provide g++-4.9 yet
See travis-ci/travis-ci#1379, which in turn would require an Ubuntu update.

@roidrage roidrage added the bugsquash label Jun 16, 2014

@BanzaiMan

This comment has been minimized.

Member

BanzaiMan commented Jul 17, 2014

Trusty Tahr ticket is #2046.

@travis-ci travis-ci locked and limited conversation to collaborators Jul 17, 2014

@BanzaiMan BanzaiMan self-assigned this Jul 17, 2014

@BanzaiMan BanzaiMan added the trusty label Jul 17, 2014

jansegre added a commit to roboime/pfc-jan-bramigk that referenced this issue Oct 6, 2014

doy pushed a commit to crawl/crawl that referenced this issue Nov 6, 2014

Try to use GCC 4.8 for Travis.
Inspired by this: travis-ci/travis-ci#1379

This should let it do C++11 properly.

sgrunt added a commit to crawl/crawl that referenced this issue Nov 7, 2014

Try to use GCC 4.8 for Travis.
Inspired by this: travis-ci/travis-ci#1379

This should let it do C++11 properly.

ForbesLindesay pushed a commit to ForbesLindesay/thread-sleep that referenced this issue Jan 16, 2015

Forbes Lindesay

leeter added a commit to leeter/hexchat that referenced this issue Jan 18, 2015

splinterofchaos added a commit to splinterofchaos/fu that referenced this issue Feb 22, 2015

@sarahhodne sarahhodne removed the bugsquash label Feb 27, 2015

johnyf added a commit to johnyf/openpromela that referenced this issue Mar 10, 2015

johnyf added a commit to johnyf/openpromela that referenced this issue Mar 11, 2015

add `travis.yml`, build and coverage status images
- install latest `pip` in travis
- add script to install `slugs`, so that travis can install it. The script installs required dependencies in both Linux and Darwin. It installs CUDD, and patches it using the patches included in the slugs repository.
- use `/usr/local/bin` as installation location, because it is already
  on the `$PATH`.
- use coveralls for coverage statistics
- put all commands in install section of travis, so that the log become visible when the installation starts.
- install gcc-4.8 for better C++ support, and link g++ to g++-4.8 [1,2]
- update `gdb`, because on Linux qmake tests the compilation result using
  `gdb`
- use markdown "reference links", so that the readme's top remain readable when viewed raw.

[1] travis-ci/travis-ci#1379
[2] travis-ci/travis-ci#979

cqcallaw added a commit to cqcallaw/newt that referenced this issue May 19, 2015

cqcallaw added a commit to cqcallaw/newt that referenced this issue May 19, 2015

liamstask added a commit to liamstask/c-capnproto that referenced this issue Aug 3, 2015

@BanzaiMan

This comment has been minimized.

Member

BanzaiMan commented Apr 28, 2016

I'm going to close this now, as we've shipped Trusty support.

@BanzaiMan BanzaiMan closed this Apr 28, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.