From c0c80fc7b9a01b2532c529b81c831b89c7ad0341 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Mon, 29 Jan 2018 16:23:09 +0100 Subject: [PATCH 01/21] adding a Dockerfile --- Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..3e8189dc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +FROM ubuntu:16.04 + +ARG DEBIAN_FRONTEND=noninteractive + +WORKDIR /usr/local/src/libmpdataxx + +RUN apt-get update -qq \ + && apt-get install -yq --no-install-recommends \ + apt-utils \ + build-essential \ + pkg-config \ + git \ + cmake \ + ca-certificates \ + clang-4.0 \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN apt-get update -qq \ + && apt-get install -yq --no-install-recommends \ + libblitz0-dev \ + libboost-all-dev \ + gnuplot-nox \ + wget \ + libhdf5-dev \ + hdf5-tools \ + python-h5py \ + python-scipy \ + python-matplotlib \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h + +COPY . . + +WORKDIR /usr/local/src/libmpdataxx/libmpdata++/build + +RUN cmake .. && make + +WORKDIR /usr/local/src/libmpdataxx/ From f7c314a4448ab843afc8fcb4563dc67f2888c8d7 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Mon, 29 Jan 2018 16:24:43 +0100 Subject: [PATCH 02/21] temporarily disable osx on travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5665f444..610e8479 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp os: - linux - - osx +# - osx dist: trusty compiler: - gcc From f658ab9f2b9b8250d929d72aacd4281b7c9d5c19 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Mon, 29 Jan 2018 16:41:36 +0100 Subject: [PATCH 03/21] try using docker on travis --- .travis.yml | 68 +++++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 610e8479..082be681 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ +sudo: required language: cpp +services: + - docker os: - linux # - osx @@ -43,10 +46,10 @@ before_install: - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export COMPILER=clang++; fi # only clang on osx # to avoid python lib/interpreter mismatch; https://github.com/travis-ci/travis-ci/issues/5326 - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t trusty -y"; fi +# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi +# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi +# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi +# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t trusty -y"; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew tap homebrew/science; fi @@ -63,9 +66,9 @@ before_install: - if [[ $COMPILER == 'g++' ]]; then export make_j="make"; fi # testing both Python 2 and 3 on Linux (unrelated to compiler choice!) - - export PY3DEB="" - - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then PY3DEB=3; fi - - if [[ $PY3DEB != '' ]]; then sudo apt-get install python3-dev; fi + # - export PY3DEB="" + # - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then PY3DEB=3; fi + # - if [[ $PY3DEB != '' ]]; then sudo apt-get install python3-dev; fi install: # silence the gazillion warnings coming from blitz headers when using the osx clang @@ -73,67 +76,70 @@ 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 + # - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then export CXX=g++-6; fi # boost - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost1.55-all-dev; fi + # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost1.55-all-dev; fi # cmake - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install cmake; fi + #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install cmake; fi # blitz - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install blitz; fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libblitz0-dev; fi + #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libblitz0-dev; fi # hdf5 - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" libpango-1.0-0 libpangocairo-1.0-0 libhdf5-dev; fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install hdf5-tools; fi + #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" libpango-1.0-0 libpangocairo-1.0-0 libhdf5-dev; fi + #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install hdf5-tools; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install hdf5 --with-cxx; fi # gnuplot-iostream - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install gnuplot-nox; fi + #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install gnuplot-nox; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gnuplot; fi - - sudo wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h + #- sudo wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h # h5py - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-h5py; fi + #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-h5py; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install h5py; fi # scipy - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-scipy; fi + #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-scipy; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install scipy; fi # matplotlib - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-matplotlib; fi + #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-matplotlib; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install matplotlib; fi # make Python 3 the default if requested - - if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi + #- if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi +before script: + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then docker build -t libmpdataxx .; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e make_j -e CXX -t libmpdataxx"; fi script: # libmpdata++ - - cd libmpdata++ - - mkdir build - - cd build - - cmake .. - - cd ../.. + #- cd libmpdata++ + #- mkdir build + #- cd build + #- cmake .. + #- cd ../.. # compiling and running all unit tests in Debug & Release modes - - if [[ $TEST_SUITE == 'unit' ]]; then . ./.travis_scripts/unit.sh; fi + - if [[ $TEST_SUITE == 'unit' ]]; then $docker_run bash ./.travis_scripts/unit.sh; fi # compiling and running selected paper tests in Debug mode - - if [[ $TEST_SUITE == 'paper' ]]; then . ./.travis_scripts/paper.sh; fi + - if [[ $TEST_SUITE == 'paper' ]]; then $docker_run bash ./.travis_scripts/paper.sh; fi # compiling all sandbox tests in Release mode - - if [[ $TEST_SUITE == 'sandbox' ]]; then . ./.travis_scripts/sandbox.sh; fi + - if [[ $TEST_SUITE == 'sandbox' ]]; then $docker_run bash ./.travis_scripts/sandbox.sh; fi - - if [[ $TEST_SUITE == 'elliptic_drop' ]]; then . ./.travis_scripts/elliptic_drop.sh; fi + - if [[ $TEST_SUITE == 'elliptic_drop' ]]; then $docker_run bash ./.travis_scripts/elliptic_drop.sh; fi # running tests from UWLCM in Release mode - - if [[ $TEST_SUITE == 'UWLCM' ]]; then . ./.travis_scripts/UWLCM.sh; fi # with '.' to pass env vars + - if [[ $TEST_SUITE == 'UWLCM' ]]; then $docker_run bash ./.travis_scripts/UWLCM.sh; fi # with '.' to pass env vars # compiling and running tests from Nair & Jablonowski 2008 MWR paper in Release mode - - if [[ $TEST_SUITE == 'nair_jablonowski_2008' ]]; then . ./.travis_scripts/nair_jablonowski_2008.sh; fi + - if [[ $TEST_SUITE == 'nair_jablonowski_2008' ]]; then $docker_run bash ./.travis_scripts/nair_jablonowski_2008.sh; fi # running pbl tests in Release mode - - if [[ $TEST_SUITE == 'pbl' ]]; then . ./.travis_scripts/pbl.sh; fi + - if [[ $TEST_SUITE == 'pbl' ]]; then $docker_run bash ./.travis_scripts/pbl.sh; fi From 33ac0b1ce65bd844fa6aafdb174838cc1777e246 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Mon, 29 Jan 2018 16:48:59 +0100 Subject: [PATCH 04/21] fix a typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 082be681..743990eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,7 +113,7 @@ install: # make Python 3 the default if requested #- if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi -before script: +before_script: - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then docker build -t libmpdataxx .; fi - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e make_j -e CXX -t libmpdataxx"; fi script: From e361a1455384cd97fccf45d93a068024de8753dc Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Mon, 29 Jan 2018 17:27:54 +0100 Subject: [PATCH 05/21] add sudo installation to Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 3e8189dc..b22a4607 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ WORKDIR /usr/local/src/libmpdataxx RUN apt-get update -qq \ && apt-get install -yq --no-install-recommends \ + sudo \ apt-utils \ build-essential \ pkg-config \ From e5ca79380997bbc75fae9504312a012a2a7e2d44 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Mon, 29 Jan 2018 17:30:07 +0100 Subject: [PATCH 06/21] propagate more env variables --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 743990eb..c51a177c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -115,7 +115,7 @@ install: before_script: - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then docker build -t libmpdataxx .; fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e make_j -e CXX -t libmpdataxx"; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e make_j -e CXX -e COMPILER -e TRAVIS_OS_NAME -t libmpdataxx"; fi script: # libmpdata++ #- cd libmpdata++ From 51aea977d7388c3d5b966db4ebe1a59df0a1fb40 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Mon, 29 Jan 2018 17:33:06 +0100 Subject: [PATCH 07/21] remove leftover compiler addons --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index c51a177c..0a457516 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,14 +28,6 @@ matrix: - compiler: clang env: TEST_SUITE=UWLCM # UWLCM is not tested on clang yet -addons: - apt: - packages: - - g++-6 - - clang-4.0 - sources: &sources - - ubuntu-toolchain-r-test - - llvm-toolchain-trusty-4.0 osx_image: xcode8 From 2bc949cfa7180bb535c1883ed8d61c55bc3d1e1f Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Tue, 30 Jan 2018 16:31:09 +0100 Subject: [PATCH 08/21] export apt_get_install to docker --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0a457516..e37c3682 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ before_install: # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi -# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t trusty -y"; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t trusty -y"; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew tap homebrew/science; fi @@ -107,7 +107,7 @@ install: before_script: - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then docker build -t libmpdataxx .; fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e make_j -e CXX -e COMPILER -e TRAVIS_OS_NAME -t libmpdataxx"; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e apt_get_install -e make_j -e CXX -e COMPILER -e TRAVIS_OS_NAME -t libmpdataxx"; fi script: # libmpdata++ #- cd libmpdata++ From 35701b601621b6690fc4298f14eeebce46c713e9 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Tue, 30 Jan 2018 16:46:37 +0100 Subject: [PATCH 09/21] change apt_get_install to not force trusty --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e37c3682..17dc7419 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ before_install: # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t trusty -y"; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -y"; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew tap homebrew/science; fi From d845cec83860aa64f809f830563b4292bb6e84a2 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Thu, 1 Feb 2018 17:36:32 +0100 Subject: [PATCH 10/21] gcc6 on travis with docker --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 17dc7419..090861ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,7 +68,7 @@ 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 + - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then export CXX=g++-6; fi # boost # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost1.55-all-dev; fi From 82017cfffb6ff344b03798fea3e6c263a0e851fe Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Fri, 2 Feb 2018 08:37:00 +0100 Subject: [PATCH 11/21] forgot to commit Dockerfile --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b22a4607..14d2d0df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,9 +14,11 @@ RUN apt-get update -qq \ cmake \ ca-certificates \ clang-4.0 \ + software-properties-common \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN apt-get update -qq \ +RUN add-apt-repository ppa:ubuntu-toolchain-r/test \ + && apt-get update -qq \ && apt-get install -yq --no-install-recommends \ libblitz0-dev \ libboost-all-dev \ @@ -27,6 +29,7 @@ RUN apt-get update -qq \ python-h5py \ python-scipy \ python-matplotlib \ + gcc-6 g++-6 \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h From 6f10afa6324cd5a4d22741e4757619c551818e9d Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Fri, 2 Feb 2018 10:38:02 +0100 Subject: [PATCH 12/21] travis.yml cleanup --- .travis.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 090861ea..9603c1a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,10 +37,6 @@ before_install: - if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]]; then export COMPILER=g++; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export COMPILER=clang++; fi # only clang on osx -# to avoid python lib/interpreter mismatch; https://github.com/travis-ci/travis-ci/issues/5326 -# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi -# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi -# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -y"; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew tap homebrew/science; fi @@ -53,9 +49,7 @@ before_install: # to avoid problems with plotting by paraview on Travis - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then unset DISPLAY; fi - # you may not believe it, but GCC (4.8.2) is giving ICEs otherwise! - export make_j="make -j 2" - - if [[ $COMPILER == 'g++' ]]; then export make_j="make"; fi # testing both Python 2 and 3 on Linux (unrelated to compiler choice!) # - export PY3DEB="" @@ -70,36 +64,23 @@ install: - 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 - # boost - # - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost1.55-all-dev; fi - - # cmake - #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install cmake; fi - # blitz - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install blitz; fi - #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libblitz0-dev; fi # hdf5 - #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" libpango-1.0-0 libpangocairo-1.0-0 libhdf5-dev; fi - #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install hdf5-tools; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install hdf5 --with-cxx; fi # gnuplot-iostream - #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install gnuplot-nox; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gnuplot; fi #- sudo wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h # h5py - #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-h5py; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install h5py; fi # scipy - #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-scipy; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install scipy; fi # matplotlib - #- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-matplotlib; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install matplotlib; fi # make Python 3 the default if requested From 820c9c90b00438068209845787525f4dae9d26fe Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Fri, 2 Feb 2018 15:37:50 +0100 Subject: [PATCH 13/21] try bringing back python3 choice --- .travis.yml | 10 +++------- .travis_scripts/UWLCM.sh | 6 ------ Dockerfile | 3 +++ 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9603c1a6..c2dddf21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,9 +52,8 @@ before_install: - export make_j="make -j 2" # testing both Python 2 and 3 on Linux (unrelated to compiler choice!) - # - export PY3DEB="" - # - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then PY3DEB=3; fi - # - if [[ $PY3DEB != '' ]]; then sudo apt-get install python3-dev; fi + - export PY3DEB="" + - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' && $TEST_SUITE != 'UWLCM']]; then PY3DEB=3; fi install: # silence the gazillion warnings coming from blitz headers when using the osx clang @@ -83,12 +82,9 @@ install: # matplotlib - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install matplotlib; fi - # make Python 3 the default if requested - #- if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi - before_script: - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then docker build -t libmpdataxx .; fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e apt_get_install -e make_j -e CXX -e COMPILER -e TRAVIS_OS_NAME -t libmpdataxx"; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e PY3DEB -e apt_get_install -e make_j -e CXX -e COMPILER -e TRAVIS_OS_NAME -t libmpdataxx"; fi script: # libmpdata++ #- cd libmpdata++ diff --git a/.travis_scripts/UWLCM.sh b/.travis_scripts/UWLCM.sh index 6f6373df..d4acc067 100755 --- a/.travis_scripts/UWLCM.sh +++ b/.travis_scripts/UWLCM.sh @@ -6,16 +6,10 @@ cd libmpdata++/build sudo make install cd ../.. -# making Python 2 back the default if needed - TODO: support Python3 in libcloudph++ -if [[ $PY3DEB != '' ]]; then sudo update-alternatives --remove python /usr/bin/python3; fi -if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 10; fi - # libcloudph++'s dependencies #if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost-python-dev python-numpy; fi if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python-numpy; fi if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install boost-python; fi -if [[ $TRAVIS_OS_NAME == 'osx' ]]; then git clone --depth=1 git://github.com/thrust/thrust.git; fi -if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo ln -s `pwd`/thrust/thrust /usr/local/include/thrust; fi # odeint if [[ $TRAVIS_OS_NAME == 'linux' ]]; then git clone --depth=1 https://github.com/boostorg/odeint.git; fi # get boost odeint > 1.58 diff --git a/Dockerfile b/Dockerfile index 14d2d0df..3583b005 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,8 +30,11 @@ RUN add-apt-repository ppa:ubuntu-toolchain-r/test \ python-scipy \ python-matplotlib \ gcc-6 g++-6 \ + python3-dev \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi + RUN wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h COPY . . From 6ac8ea386fc60db87d63600b8e519f18dd2752f9 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Fri, 2 Feb 2018 15:41:08 +0100 Subject: [PATCH 14/21] fix syntax error in travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c2dddf21..e017e756 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ before_install: # testing both Python 2 and 3 on Linux (unrelated to compiler choice!) - export PY3DEB="" - - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' && $TEST_SUITE != 'UWLCM']]; then PY3DEB=3; fi + - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' && $TEST_SUITE != 'UWLCM' ]]; then PY3DEB=3; fi install: # silence the gazillion warnings coming from blitz headers when using the osx clang From e40c5c5563e2d7b9f152643487855289f012da14 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Fri, 2 Feb 2018 16:37:07 +0100 Subject: [PATCH 15/21] trying to conditionally select python3 in docker --- .travis.yml | 8 ++++---- Dockerfile | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e017e756..c9c1ea19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,8 +52,8 @@ before_install: - export make_j="make -j 2" # testing both Python 2 and 3 on Linux (unrelated to compiler choice!) - - export PY3DEB="" - - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' && $TEST_SUITE != 'UWLCM' ]]; then PY3DEB=3; fi + - export PYVER="2" + - if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' && $TEST_SUITE != 'UWLCM' ]]; then PYVER=3; fi install: # silence the gazillion warnings coming from blitz headers when using the osx clang @@ -83,8 +83,8 @@ install: - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install matplotlib; fi before_script: - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then docker build -t libmpdataxx .; fi - - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e PY3DEB -e apt_get_install -e make_j -e CXX -e COMPILER -e TRAVIS_OS_NAME -t libmpdataxx"; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then docker build --build-arg PYVER=$PYVER -t libmpdataxx .; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e apt_get_install -e make_j -e CXX -e COMPILER -e TRAVIS_OS_NAME -t libmpdataxx"; fi script: # libmpdata++ #- cd libmpdata++ diff --git a/Dockerfile b/Dockerfile index 3583b005..0a4f96d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM ubuntu:16.04 ARG DEBIAN_FRONTEND=noninteractive + WORKDIR /usr/local/src/libmpdataxx RUN apt-get update -qq \ @@ -33,7 +34,9 @@ RUN add-apt-repository ppa:ubuntu-toolchain-r/test \ python3-dev \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi +ARG PYVER + +RUN if [ "$PYVER" = 3 ]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi RUN wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h From 73d863306fea2a5d4a06e237adeaf3026ae6e11c Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Fri, 2 Feb 2018 17:04:03 +0100 Subject: [PATCH 16/21] also install python3 libraries in docker --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0a4f96d5..af118a48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,9 @@ RUN add-apt-repository ppa:ubuntu-toolchain-r/test \ python-matplotlib \ gcc-6 g++-6 \ python3-dev \ + python3-h5py \ + python3-scipy \ + python3-matplotlib \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ARG PYVER From fd5203bd9b8c48d6a3123848b9a31951799c315d Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Wed, 7 Feb 2018 10:23:41 +0100 Subject: [PATCH 17/21] [travis] try running plain vm osx builds alongside docker on linux --- .travis.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c9c1ea19..8e6e4c87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,7 @@ -sudo: required language: cpp -services: - - docker os: - linux -# - osx + - osx dist: trusty compiler: - gcc @@ -19,6 +16,13 @@ env: - TEST_SUITE=pbl matrix: + include: + - os: osx + sudo: false + - os: linux + sudo: required + services: + - docker exclude: - os: osx compiler: gcc From 1cb5182f8ddb75e1461d587e1669221b186eb608 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Wed, 7 Feb 2018 11:15:49 +0100 Subject: [PATCH 18/21] [travis] homebrew/science was deprecated --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8e6e4c87..9e3b0c6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,6 @@ before_install: - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -y"; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi - - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew tap homebrew/science; fi # fixing broken OSX gzip tools - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export PATH=/usr/local/bin:$PATH; fi # so that brew-installed ones are first From 07c004d33971543beecaa2850b7328dfdd138c17 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Wed, 7 Feb 2018 11:18:51 +0100 Subject: [PATCH 19/21] [travis] wip on osx --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e3b0c6a..cf5bd7fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,13 +88,14 @@ install: before_script: - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then docker build --build-arg PYVER=$PYVER -t libmpdataxx .; fi - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export docker_run="docker run -e apt_get_install -e make_j -e CXX -e COMPILER -e TRAVIS_OS_NAME -t libmpdataxx"; fi + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export docker_run=""; fi script: # libmpdata++ - #- cd libmpdata++ - #- mkdir build - #- cd build - #- cmake .. - #- cd ../.. + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then cd libmpdata++; fi + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then mkdir build; fi + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then cd build; fi + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then cmake ..; fi + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then cd ../..; fi # compiling and running all unit tests in Debug & Release modes - if [[ $TEST_SUITE == 'unit' ]]; then $docker_run bash ./.travis_scripts/unit.sh; fi From c1ed8b2994bf076dc59b1238baf8046786595f93 Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Wed, 7 Feb 2018 12:00:52 +0100 Subject: [PATCH 20/21] [travis] homebrew/dupes was deprecated --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cf5bd7fd..e5309547 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,6 @@ before_install: # fixing broken OSX gzip tools - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export PATH=/usr/local/bin:$PATH; fi # so that brew-installed ones are first - - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew tap homebrew/dupes; fi - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gzip; fi # to avoid problems with plotting by paraview on Travis From 21e2c9fa267b0d3f20193155255e257b4155cfba Mon Sep 17 00:00:00 2001 From: Maciej Waruszewski Date: Wed, 7 Feb 2018 12:34:32 +0100 Subject: [PATCH 21/21] [travis] gnuplot-iostream on osx --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e5309547..9792cd6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,7 +73,7 @@ install: # gnuplot-iostream - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gnuplot; fi - #- sudo wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h; fi # h5py - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install h5py; fi