Help making gfortran dependency in a package work on Travis-CI (Mac)

I’ve been trying to figure out why https://github.com/JuliaDiffEq/DASKR.jl doesn’t work on Travis-CI (for Mac).
It seems that the problem is that gfortran isn’t available.
The .travis.yml file has the following:

addons:
  apt_packages:
    - gfortran

that seems to make sure that gfortran is available for Linux builds, however that doesn’t work for Mac builds.

Any help would be appreciated!

brew install gcc used to work.

gcc 7 may have broken a number of things when it comes to fortran dependencies

It’s just not installed by default. Or did you mean something else? If gcc 7 is a problem, you can brew install gcc@6.

Thanks @tkelman & @dpo!
How would one do that in the Travis-CI .travis.yml file? (and do it only for OS X?)

Here’s an example: https://github.com/JuliaSmoothOptimizers/PROPACK.jl/blob/master/.travis.yml#L25

2 Likes

Here’s another example: https://github.com/traktofon/FortranFiles.jl/blob/master/.travis.yml#L26-L28

The difference to @dpo’s version is an additional call to brew update before the install, which is recommended by the Travis CI documentation.

BTW, for my package, the brew calls take more time than the actual testing. If you encounter something similar, don’t try to speed those up by using Travis’ caching – I tried that, but retrieving the cache takes as long as the brew calls.

There’s no need for brew update any more because brew install now automatically triggers an update: Travis CI - Test and Deploy Your Code with Confidence

1 Like

That did the trick! If anybody needs to use https://github.com/JuliaDiffEq/DASKR.jl on the Mac, it’s now working :wink:
Thanks everybody for the help!

1 Like