From e755a4201a825e3cc5441ba43fa1251a58d7a96c Mon Sep 17 00:00:00 2001 From: akuesters <42005107+akuesters@users.noreply.github.com> Date: Mon, 1 Oct 2018 12:23:39 +0200 Subject: [PATCH] Integrating Mac OS X and clang compiler into Travis CI (#601) changes: - .travis.yml: - added matrix for different osx's, since enumeration style only works for `env` and `compiler` - scripts/travis/build.sh: - changed getting compiler version from ``${CXX} -dumpversion`` to ``${CXX} --version | grep -m1 ""`` - added `--oversubscribe` flag to `mpiexec` on Mac to allow more processes on a node than processing elements - added `--mca btl tcp,self` flag for Open MPI to use the "tcp" and "self" BTLs for transporting MPI messages on Mac --- .travis.yml | 139 +++++++++++++++++++++++++++++++++++----- doc/install.rst | 16 ++--- scripts/travis/build.sh | 12 +++- 3 files changed, 140 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index baa6baaa..e1500dea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,132 @@ +######## Testing minimal compiler requirements ######## +# GCC 6.4.0 +# Clang 4.0 +# Apple Clang 900.0.39.2 +####################################################### + language: cpp sudo: false -os: linux -dist: trusty -compiler: gcc -addons: - apt: +matrix: + include: +########################## OS X ######################### +## test gcc6 - single node/rank with threading backend ## + - name: "osx, gcc, serial" + os: osx + osx_image: xcode9.2 + env: + - MATRIX_EVAL="brew install gcc@6 && brew link --force --overwrite gcc@6 && CC=gcc-6 && CXX=g++-6" + - BUILD_NAME=cthread WITH_DISTRIBUTED=serial + compiler: gcc-6 + +## test gcc6 - mpi with threading backend ## + - name: "osx, gcc, mpi" + os: osx + osx_image: xcode9.2 + env: + - MATRIX_EVAL="brew install gcc@6 && brew link --force --overwrite gcc@6 && CC=gcc-6 && CXX=g++-6" + - BUILD_NAME=mpi WITH_DISTRIBUTED=mpi + compiler: gcc-6 + +## test clang9 - single node/rank with threading backend ## + - name: "osx, apple clang, serial" + os: osx + osx_image: xcode9.2 + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - BUILD_NAME=cthread WITH_DISTRIBUTED=serial + compiler: clang + +## test clang9 - mpi with threading backend ## + - name: "osx, apple clang, mpi" + os: osx + osx_image: xcode9.2 + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - BUILD_NAME=mpi WITH_DISTRIBUTED=mpi + compiler: clang + +######################### LINUX ######################### +## test gcc6 - single node/rank with threading backend ## + - name: "linux, gcc, serial" + os: linux + dist: trusty + addons: + apt: sources: - - ubuntu-toolchain-r-test + - ubuntu-toolchain-r-test packages: - - g++-6 - - openmpi-bin - - libopenmpi-dev + - g++-6 + - openmpi-bin + - libopenmpi-dev + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" + - BUILD_NAME=cthread WITH_DISTRIBUTED=serial + compiler: gcc-6 -env: - # test single node/rank with threading backend - - BUILD_NAME=cthread WITH_DISTRIBUTED=serial - # test mpi with threading backend - - BUILD_NAME=mpi WITH_DISTRIBUTED=mpi +## test gcc6 - mpi with threading backend ## + - name: "linux, gcc, mpi" + os: linux + dist: trusty + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + - openmpi-bin + - libopenmpi-dev + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" + - BUILD_NAME=mpi WITH_DISTRIBUTED=mpi + compiler: gcc-6 + +## test clang4 - single node/rank with threading backend ## + - name: "linux, clang, serial" + os: linux + dist: trusty + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-4.0 + packages: + - clang-4.0 + - g++-6 + - openmpi-bin + - libopenmpi-dev + env: + - MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0" + - BUILD_NAME=cthread WITH_DISTRIBUTED=serial + compiler: clang-4.0 + +## test clang4 - mpi with threading backend ## + - name: "linux, clang, mpi" + os: linux + dist: trusty + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-4.0 + packages: + - clang-4.0 + - g++-6 + - openmpi-bin + - libopenmpi-dev + env: + - MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0" + - BUILD_NAME=mpi WITH_DISTRIBUTED=mpi + compiler: clang-4.0 -before_install: - - CC=gcc-6 - - CXX=g++-6 +before_script: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export HOMEBREW_NO_AUTO_UPDATE=1; brew cask uninstall --force oclint; fi + - if [[ ( "$TRAVIS_OS_NAME" == "osx" ) && ( "$WITH_DISTRIBUTED" == "mpi" ) ]]; then brew install open-mpi; fi + - eval "${MATRIX_EVAL}" script: source ./scripts/travis/build.sh +notifications: + email: + on_success: never + on_failure: always diff --git a/doc/install.rst b/doc/install.rst index 9bf9915e..9b4206cc 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -44,8 +44,8 @@ We recommend using GCC or Clang, for which Arbor has been tested and optimised. Compiler Min version Notes =========== ============ ============================================ GCC 6.1.0 - Clang 4.0 Clang 3.8 and later probably work. - Apple Clang 9 + Clang 4.0 Needs GCC 6 or later for standard library. + Apple Clang 9 Apple LLVM version 9.0.0 (clang-900.0.39.2) Intel 17.0.1 Needs GCC 5 or later for standard library. =========== ============ ============================================ @@ -56,7 +56,7 @@ We recommend using GCC or Clang, for which Arbor has been tested and optimised. CMake should use. If these are not set, CMake will attempt to automatically choose a compiler, which may be too old to compile Arbor. For example, the default compiler chosen below by CMake was GCC 4.8.5 at ``/usr/bin/c++``, - so the ``CC`` and ``CXX`` variables were used to specify GCC 5.2.0 before calling ``cmake``. + so the ``CC`` and ``CXX`` variables were used to specify GCC 6.1.0 before calling ``cmake``. .. code-block:: bash @@ -66,7 +66,7 @@ We recommend using GCC or Clang, for which Arbor has been tested and optimised. # check which version of GCC is available $ g++ --version - g++ (GCC) 5.2.0 + g++ (GCC) 6.1.0 Copyright (C) 2015 Free Software Foundation, Inc. # set environment variables for compilers @@ -75,10 +75,10 @@ We recommend using GCC or Clang, for which Arbor has been tested and optimised. # launch CMake # the compiler version and path is given in the CMake output $ cmake .. - -- The C compiler identification is GNU 5.2.0 - -- The CXX compiler identification is GNU 5.2.0 - -- Check for working C compiler: /cm/local/apps/gcc/5.2.0/bin/gcc - -- Check for working C compiler: /cm/local/apps/gcc/5.2.0/bin/gcc -- works + -- The C compiler identification is GNU 6.1.0 + -- The CXX compiler identification is GNU 6.1.0 + -- Check for working C compiler: /cm/local/apps/gcc/6.1.0/bin/gcc + -- Check for working C compiler: /cm/local/apps/gcc/6.1.0/bin/gcc -- works ... .. Note:: diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index 583daec5..f36eda21 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -13,10 +13,10 @@ build_path=build-${BUILD_NAME} # progress "build environment" -compiler_version=`${CXX} -dumpversion` +compiler_version=`${CXX} --version | grep -m1 ""` cmake_version=`cmake --version | grep version | awk '{print $3}'` -echo "compiler : ${CXX} ${compiler_version}" +echo "compiler : ${compiler_version}" echo "cmake : ${cmake_version}" echo "build path : ${build_path}" echo "base path : ${base_path}" @@ -28,6 +28,14 @@ if [[ "${WITH_DISTRIBUTED}" = "mpi" ]]; then CC="mpicc" CXX="mpicxx" launch="mpiexec -n 4" + # on mac: + # --oversubscribe flag allows more processes on a node than processing elements + # --mca btl tcp,self for Open MPI to use the "tcp" and "self" Byte Transfer Layers for transporting MPI messages + # "self" to deliver messages to the same rank as the sender + # "tcp" sends messages across TCP-based networks (Transmission Control Protocol with Internet Protocol) + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + launch="${launch} --oversubscribe --mca btl tcp,self" + fi WITH_MPI="ON" else echo "mpi : off" -- GitLab