Travis CI + os: windows + mingw : how to get gnu c/fortran compilers?

Hi all,

In .travis.yml, os windows, I need to get FC/CC (gfortran/gcc compilers) : any clue ?


Travis’s Windows image comes with the “mingw” Chocolatey package, which may have the gfortran compiler.

Alternatively, you can uninstall the “mingw” Chocolatey package and install MSYS2 as shown here, then install the mingw-w64-x86_64-toolchain package group inside it with pacman -S. (You’ll have to use the mentioned trick to enter a MSYS2 shell from the Git Bash shell that your build starts in.)

@tanzislam : tried many things… Not sure to get what I am missing. Could you have a quick look at the lasts commit CI and tell me if you get what’s wrong ? gcc is installed and found by cmake, but, not gfortran ?!..

The apt plugin won’t work on Windows. You’ll need to run choco yourself.

Already tried without success : and commit here Is that what you meant ?

What you’re now showing is a build on Linux, with the stage name set to “windows”. You need a os: windows setting to enable the Windows environment.

Also, your choco commands need to be put inside a check for $TRAVIS_OS_NAME == "windows" to avoid it from being run on other platforms.

@tanzislam : thanks. Replacing dist: windows with os: windows was the solution. I belived dist was equivalent to os.