From 37ddfd7d6e448185fc15b320b44785d06ab62577 Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Fri, 15 Feb 2019 07:23:05 -0800 Subject: [PATCH] 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 --- .travis.yml | 1 + tests/travis/run_test.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index b0a9b052f..877ebdcbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,6 +68,7 @@ addons: - g++-7 homebrew: packages: + - gcc@7 - graphviz update: true diff --git a/tests/travis/run_test.sh b/tests/travis/run_test.sh index 61dbe35a1..c2efa0e22 100755 --- a/tests/travis/run_test.sh +++ b/tests/travis/run_test.sh @@ -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