# Travis OS X and gcc

**URL:** <https://discourse.julialang.org/t/travis-os-x-and-gcc/9525>\
**Category:** General Usage\
**Tags:** travis\
**Created:** [March 5, 2018, 11:22pm UTC](https://discourse.julialang.org/t/travis-os-x-and-gcc/9525 "2018-03-05T23:22:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cortner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cortner/32/204_2.png) [@cortner](https://discourse.julialang.org/u/cortner)\
**Post date:** [March 5, 2018, 11:22pm UTC](https://discourse.julialang.org/t/travis-os-x-and-gcc/9525/1 "2018-03-05T23:22:36Z")

</div>

For the past little while all my OS X tests fail on travis, specifically the installation of gcc fails. I use this:

```nohighlight
before_install:
  - if [[$TRAVIS_OS_NAME == 'osx']]; then brew update; fi
  - if [[$TRAVIS_OS_NAME == 'osx']]; then brew install gcc; fi

```

and get the following error:

```julia
$ if [[$TRAVIS_OS_NAME == 'osx']]; then brew install gcc; fi
==> Installing dependencies for gcc: gmp, mpfr, libmpc, isl
==> Installing gcc dependency: gmp
==> Downloading https://homebrew.bintray.com/bottles/gmp-6.1.2_1.sierra.bottle.tar.gz
==> Pouring gmp-6.1.2_1.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/gmp/6.1.2_1: 18 files, 3.1MB
==> Installing gcc dependency: mpfr
==> Downloading https://homebrew.bintray.com/bottles/mpfr-4.0.1.sierra.bottle.tar.gz
==> Pouring mpfr-4.0.1.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/mpfr/4.0.1: 28 files, 4.6MB
==> Installing gcc dependency: libmpc
==> Downloading https://homebrew.bintray.com/bottles/libmpc-1.1.0.sierra.bottle.tar.gz
==> Pouring libmpc-1.1.0.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libmpc/1.1.0: 12 files, 353.9KB
==> Installing gcc dependency: isl
==> Downloading https://homebrew.bintray.com/bottles/isl-0.18.sierra.bottle.tar.gz
==> Pouring isl-0.18.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/isl/0.18: 80 files, 3.8MB
==> Installing gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-7.3.0.sierra.bottle.1.tar.gz
==> Pouring gcc-7.3.0.sierra.bottle.1.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/c++
Target /usr/local/include/c++
already exists. You may want to remove it:
  rm '/usr/local/include/c++'
To force the link and overwrite all conflicting files:
  brew link --overwrite gcc
To list all files that would be deleted:
  brew link --overwrite --dry-run gcc
Possible conflicting files are:
/usr/local/include/c++ -> /usr/local/Caskroom/oclint/0.11,15.6.0/oclint-0.11/include/c++
==> Summary
🍺 /usr/local/Cellar/gcc/7.3.0: 1,486 files, 284MB
The command "if [[$TRAVIS_OS_NAME == 'osx']]; then brew install gcc; fi" failed and exited with 1 during .

```

I was very surprised I didn’t find a relevant issue or discussion since I assume others must have the same problem, but apologies if this is discussed somewhere.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [March 5, 2018, 11:38pm UTC](https://discourse.julialang.org/t/travis-os-x-and-gcc/9525/2 "2018-03-05T23:38:03Z")

</div>

It looks like there’s some discussion of the issue here: [https://github.com/travis-ci/travis-ci/issues/8826](https://github.com/travis-ci/travis-ci/issues/8826) (although I don’t know the right solution for your case).

---

<div class="post-metadata">

**Author:** ![cortner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cortner/32/204_2.png) [@cortner](https://discourse.julialang.org/u/cortner)\
**Post date:** [March 6, 2018, 12:02am UTC](https://discourse.julialang.org/t/travis-os-x-and-gcc/9525/3 "2018-03-06T00:02:27Z")

</div>

Thank you, looks like adding

brew cask uninstall oclint

Before installing GCC solves the problem.
