Skip to content
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

Add gcc-8 #103

Closed
1 of 5 tasks
pefoo opened this issue Nov 19, 2019 · 22 comments
Closed
1 of 5 tasks

Add gcc-8 #103

pefoo opened this issue Nov 19, 2019 · 22 comments
Assignees
Labels

Comments

@pefoo
Copy link

pefoo commented Nov 19, 2019

Tool information

  • Tool name: gcc-8
  • Add or update? Add
  • Desired version: 8.3 (as provided by default ubuntu 18.04 package repository)
  • Approximate size:
  • If this is an add request:

Virtual environments affected

  • macOS 10.15
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Windows Server 2016 R2
  • Windows Server 2019

Can this tool be installed during the build?
Yes

apt-get install -y gcc-8

However, this fails at the moment because of broken packages. (which is not the reason for this request)

Are you willing to submit a PR?
Sure. Just need a bit help to get started.

@kaylangan kaylangan added Area: C/C++ enhancement New feature or request labels Jan 10, 2020
@zbeekman
Copy link

FWIW, gcc-8 (and g++-8 and gfortran-8) are my preferred toolchains as well. On 16.04 (and possibly 18.04) you may need to add the toolchain-r/test PPA.

@alepauly alepauly mentioned this issue Jan 29, 2020
5 tasks
@alepauly
Copy link
Contributor

@pefoo @zbeekman #104 mentions gcc 9 as preferred and looks like that's available in all package managers. Would that be good enough or you definitely need gcc 8? Due to maintenance and space concerns we sometimes can't get it all installed (though we wish we could), but your input can help us figure it out.

@pefoo
Copy link
Author

pefoo commented Jan 29, 2020

@alepauly Since gcc-9 should support everything gcc-8 does, I am fine with gcc-9.

@zbeekman
Copy link

@alepauly my only concern (which I voiced in #202) is that the GCC devs have a much lower bar for accepting patches etc in GFortran than they do for gcc and g++, so often the latest release of GCC can have serious regressions or new bugs in the gfortran compiler. I also wonder about windows. Are you going to move to MSYS2? (#30) Can you get GCC 9 with mingw?

My recommendation is to install GCC 8 (with at least gcc, g++ and gfortran) everywhere. Since homebrew is a rolling release package manager you should probably also install the latest stable gcc on macOS, otherwise some packages (especially those with fortran dependencies, direct or indirect) will need to also install gcc in addition to the package requested by the user itself. You can always brew unlink gcc before deploying the image, but homebrew adds the GCC major version as a suffix to all binaries so unlinking gcc is likely to cause more confusion than help.

@MSP-Greg
Copy link
Contributor

Can you get GCC 9 with mingw?

MSYS2 is using gcc 9.2.0.

@alepauly
Copy link
Contributor

thanks @zbeekman - We'll work on untangling this since we also want to include WSL in Windows and that goes along with the work of switching to MSYS2 (from MinGW) which I think makes sense. With that in hand we'll get Linux and Mac figured out so there's consistent cross-platform support. I'll write something up once we figure it out in the next few days and I'll post it for feedback.

@zbeekman
Copy link

zbeekman commented Feb 4, 2020

Great!

Here is my suggested approach:

macOS

brew install gcc@8
# or
brew install gcc@9

This gets you gcc-<ver>, g++-<ver>, gfortran-<ver> as well as ar, nm, dump, ranlib with the gcc- prefix and major version suffix, as well as gcov and gcov utilities with the major version suffix

One complication with Homebrew is that other formulas may depend on gcc, especially Fortran related stuff (even MPICH, OpenMPI, etc.) so that can trip people up a little bit if gcc is not installed (gcc@9 is effectively an alias for gcc). I would probably install both 8 and 9 on macOS, or only install 9.

Ubuntu

Can you please make sure you install packages that match the compilers provided by Homebrew (for consistency) and also gcov?

Something like:

sudo apt-get install -y --no-install-recommends ccache gcc-${GCC_V} g++-${GCC_V} gfortran-${GCC_V}

Windows

I have no idea, but please don't forget about g++, gfortran and gcov. Last time I looked mingw pinned GCC to a specific version. You probably should use MSYS2 or WSL.

Thanks!

@zbeekman
Copy link

zbeekman commented Feb 4, 2020

P.S. If you want to steer folks towards only GCC8, I would recommend brew install gcc@8 and brew install gcc && brew unlink gcc. That way anything that depends on GCC can be installed quickly and users wanting GCC9 can just brew link gcc.

@pefoo
Copy link
Author

pefoo commented Feb 4, 2020

@zbeekman Should we think about lcov as well? Currently, the official ubuntu repos do not provide a lcov version that is compatible with the gcc-8 toolchain (as far as I know).

I am using the following snippet to get a working lcov installation that is compatible to gcc-8 toolchain (contains lcov 1.14 download + installation as well as fixing used gcov version):

- name: Install lcov 1.14
      run: |
          wget http://downloads.sourceforge.net/ltp/lcov-1.14.tar.gz
          tar xzf lcov-1.14.tar.gz
          cd lcov-1.14/
          sudo make install 
    - name: Setup gcov version
      run: sudo ln -sf $(which gcov-8) $(which gcov) 

@zbeekman
Copy link

zbeekman commented Feb 4, 2020

@pefoo I rarely use lcov since I most often use codecov.io for coverage analysis.

But if you want it I would submit a new issue if I were you.

FYI, I think you want to use sudo update-alternatives or similar on ubuntu for getting the right version of your tooling setup. Something like:

      run: |
        sudo apt-get install -y --no-install-recommends gcc-${GCC_V} g++-${GCC_V} gfortran-${GCC_V}
        sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
        --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \
        --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
        --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}

@MSP-Greg
Copy link
Contributor

MSP-Greg commented Feb 5, 2020

@zbeekman

Re MSYS2, using pacman, the current gcc is 9.2.0. There is discussion about adding a MSYS2 install to the Windows image(s). One can pre-install just gcc, or it could be switched to toolchain.

toolchain has the following additional packages:

gcc-ada
gcc-fortran
gcc-libgfortran
gcc-objc

Would you prefer than toolchain is used?

@ivan-nosar
Copy link
Contributor

Good day!
We have added gcc, gfortran and clang tools on Windows and Ubuntu virtual environments in #369

@zbeekman
Copy link

zbeekman commented Feb 6, 2020

@MSP-Greg can you please elaborate on what toolchain is and how to use it? Or point me to the docs? I’m afraid I’m not familiar and don’t quite follow.

@zbeekman
Copy link

zbeekman commented Feb 6, 2020

@ivan-nosar Any word on macOS?

@MSP-Greg
Copy link
Contributor

MSP-Greg commented Feb 6, 2020

@zbeekman

Sorry. toolchain is a group available when using pacman on MSYS2. You mentioned 'gfortran' and I assume the MSYS2 packages gcc-fortran & gcc-libgfortran would be the equivalent? All I use is gcc...

@zbeekman
Copy link

zbeekman commented Feb 6, 2020

@MSP-Greg Thanks for clarifying. I'm not a big Aur or MSYS/Windows user so not super familiar with pacman. So to clarify, toolchain is a meta-package, I presume.

I assume the MSYS2 packages gcc-fortran & gcc-libgfortran would be the equivalent?

Yes, gfortran is the Fortran compiler in the GCC suite. Hopefully you get libgfortran when you install gcc-fortran otherwise it definitely won't work... that's the language's runtime library (GCC specific).

I don't know if you need GCC Objective C or Ada, (I don't use either personally... not yet at least) but I definitely need gcc g++ and gfortran including the GFortran runtime lib which is presumably a dependency no matter what.

Hopefully through msys there's a straight forwards way to get the GCC 8.x tooling too, (for consistency with Linux/macOS) but, so long as GCC 8 tooling is a relatively snappy install, I'll be fine with gcc/g++/gfortran 9.2 on Windows.

@MSP-Greg
Copy link
Contributor

MSP-Greg commented Feb 6, 2020

@zbeekman

JFYI:

MSYS is rather old and has really been replaced by MSYS2. One main difference is MSYS2 added pacman.

Because of pacman, 'there is only one', and downgrading to GCC 8 requires knowing where to download the older files from.

The main reason I've asked is that other Windows CI systems have MSYS2 installs with a lot more packages that 'standard shell and compile tools'. I'm trying to help determine what is reasonable...

@zbeekman
Copy link

zbeekman commented Feb 7, 2020

@MSP-Greg yeah, sorry I meant MSYS2 not MSYS. I guess that makes sense: if Pac-Man is what Aur uses then it’s a rolling release type manager like homebrew. If the only good/easy solution on Windows is GCC 9 I’m good with that. It will match Homebrew more closely and I’d rather be forced into a GFortran that’s newer than I want instead of older. That means fixes should come around faster even if there is higher exposure to regressions.

@al-cheb al-cheb added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Feb 10, 2020
@al-cheb
Copy link
Contributor

al-cheb commented Feb 10, 2020

Hello, All

We have added gcc8 for Ubuntu 18.04 in #369. It should start rolling out early next week, once the rollout start it shows up as a pre-release here: https://github.com/actions/virtual-environments/releases

After that it takes about 6-7 days to reach all accounts (assuming no delays)

@miketimofeev
Copy link
Contributor

@pefoo the image has been rolled out. Could you check gcc, please?

@al-cheb
Copy link
Contributor

al-cheb commented Feb 21, 2020

gcc-8:

jobs:
  build:
    runs-on: [ubuntu-latest]
    steps:
    - name: gcc
      run: |
        gcc-8 --version
      shell: bash

gcc - Copy

@al-cheb al-cheb closed this as completed Feb 21, 2020
pefoo added a commit to pefoo/MoSer2 that referenced this issue Feb 21, 2020
- removed installation of compiler (see actions/runner-images#103)
- switched to a less hacky way to set the gcov version
@pefoo
Copy link
Author

pefoo commented Feb 21, 2020

@miketimofeev Removed the compiler installation and checked the build. Looks great! Thank you.

@miketimofeev miketimofeev removed the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants