Skip to content

Commit

Permalink
Merge pull request #429 from mwarusz/osx_local_clang
Browse files Browse the repository at this point in the history
testing local clang with osx on Travis
  • Loading branch information
pdziekan authored Jan 8, 2019
2 parents ec5c801 + 721dc8f commit 5192dbe
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 8 deletions.
17 changes: 16 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
- TEST_SUITE=nair_jablonowski_2008
- TEST_SUITE=UWLCM
- TEST_SUITE=pbl
- TEST_SUITE=osx_local_clang

matrix:
exclude:
Expand All @@ -25,6 +26,12 @@ matrix:

- compiler: clang
env: TEST_SUITE=UWLCM # UWLCM is not tested on clang yet

# local clang tests on osx
- os: linux
env: TEST_SUITE=osx_local_clang
- compiler: gcc
env: TEST_SUITE=osx_local_clang
addons:
apt:
packages:
Expand All @@ -48,8 +55,11 @@ before_install:
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi

# Workaround for upgrading gcc, see https://github.com/travis-ci/travis-ci/issues/8826
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew cask uninstall oclint; fi
# Seems like this is now done by Travis, but leaving it (commented out) for now
#- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew cask uninstall oclint; fi

# needed to get rvm, see below
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -; fi
# https://github.com/travis-ci/travis-ci/issues/10165
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm get stable; fi

Expand Down Expand Up @@ -79,6 +89,8 @@ install:
# redefine CXX to the actual version used
- if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'clang++' ]]; then export CXX=clang++-4.0; fi
- if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then export CXX=g++-6; fi
# downloads and setups local clang on osx
- if [[ $TEST_SUITE == 'osx_local_clang' ]]; then . ./.travis_scripts/setup_local_clang.sh; fi

# boost
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost1.55-all-dev; fi
Expand Down Expand Up @@ -142,3 +154,6 @@ script:

# running pbl tests in Release mode
- if [[ $TEST_SUITE == 'pbl' ]]; then . ./.travis_scripts/pbl.sh; fi

# testing local clang on osx
- if [[ $TEST_SUITE == 'osx_local_clang' ]]; then . ./.travis_scripts/unit.sh; fi # with '.' to pass env vars
2 changes: 1 addition & 1 deletion .travis_scripts/UWLCM.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
set -ex
set -e

# install libmpata++
cd libmpdata++/build
Expand Down
2 changes: 1 addition & 1 deletion .travis_scripts/elliptic_drop.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
set -ex
set -e
# installing
cd libmpdata++/build
sudo make install
Expand Down
2 changes: 1 addition & 1 deletion .travis_scripts/nair_jablonowski_2008.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
set -ex
set -e
cd tests/nair_jablonowski_2008
mkdir build
cd build
Expand Down
2 changes: 1 addition & 1 deletion .travis_scripts/paper.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
set -ex
set -e
cd tests/paper_2015_GMD
mkdir build
cd build
Expand Down
2 changes: 1 addition & 1 deletion .travis_scripts/pbl.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
set -ex
set -e
cd tests/sandbox
mkdir build
cd build
Expand Down
2 changes: 1 addition & 1 deletion .travis_scripts/sandbox.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
set -ex
set -e
cd tests/sandbox
mkdir build
cd build
Expand Down
12 changes: 12 additions & 0 deletions .travis_scripts/setup_local_clang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -e
mkdir local_clang
cd local_clang
export CLANG_VER=clang+llvm-6.0.0-x86_64-apple-darwin
wget http://releases.llvm.org/6.0.0/$CLANG_VER.tar.xz
tar -xf $CLANG_VER.tar.xz
export LLVM_PATH=`pwd`/$CLANG_VER
export CXX=$LLVM_PATH/bin/clang++
export LDFLAGS=$LDFLAGS" -L "$LLVM_PATH/lib" -Wl,-rpath,"$LLVM_PATH/lib
export CPPFLAGS=$CPPFLAGS" -I"$LLVM_PATH/include" -I"$LLVM_PATH/include/c++/v1/
cd ..
2 changes: 1 addition & 1 deletion .travis_scripts/unit.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
set -ex
set -e
cd tests/unit
mkdir build
cd build
Expand Down

0 comments on commit 5192dbe

Please sign in to comment.