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


#1

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!


#2

brew install gcc used to work.


#3

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


#4

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.


#5

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


#6

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


#7

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.


#8

There’s no need for brew update any more because brew install now automatically triggers an update: https://travis-ci.org/JuliaSmoothOptimizers/PROPACK.jl/jobs/231360902#L86


#9

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!