Fix broken R test: Install Homebrew GCC (#4142)

* Fix broken R test: Install Homebrew GCC

Missing GCC Fortran causes installation failure of a dependency package
(igraph)

* Register gfortran system-wide

* Use correct keg

* Set env vars to change compiler choice

* Do not break other Mac builds

* Nuclear option: symlink gfortran

* Use /usr/local/bin instead of /usr/bin

* Symlink library path too

* Update run_test.sh
This commit is contained in:
Philip Hyunsu Cho 2019-02-15 07:23:05 -08:00 committed by GitHub
parent d506a8bc63
commit 37ddfd7d6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -68,6 +68,7 @@ addons:
- g++-7
homebrew:
packages:
- gcc@7
- graphviz
update: true

View File

@ -87,6 +87,12 @@ if [ ${TASK} == "r_test" ]; then
export _R_CHECK_TIMINGS_=0
export R_BUILD_ARGS="--no-build-vignettes --no-manual"
export R_CHECK_ARGS="--no-vignettes --no-manual"
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
# Work-around to fix "gfortran command not found" error
sudo ln -s $(which gfortran-7) /usr/local/bin/gfortran
sudo mkdir -p /usr/local/gfortran/lib/gcc/x86_64-apple-darwin15
sudo ln -s /usr/local/lib/gcc/7 /usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0
fi
curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh
chmod 755 ./travis-tool.sh