forked from igfuw/UWLCM
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
137 lines (114 loc) · 4.83 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
stages:
- precache
- test
language: cpp
os:
- linux
dist: xenial
compiler:
- gcc
env:
- TEST_SUITE=unit_iles MPI=none
- TEST_SUITE=unit_smg MPI=none
- TEST_SUITE=moist_thermal MPI=none
- TEST_SUITE=moist_thermal MPI=mvapich2
cache:
packages: true
pip: true
directories:
- ${TRAVIS_BUILD_DIR}/deps/mvapich2-2.3b
- ${TRAVIS_BUILD_DIR}/deps/boost
- ${TRAVIS_BUILD_DIR}/deps/hdf5
# define the precache stage
# empty phases mean that default phases (before_install, install, ...) from the test stage are used (?)
# TODO: precache stage has a lot of unnecessary before_install and install code common to the (default) test stage;
# add after_success, after_failure to precache, remove building of caches from the test stage, make the build error instead;
# YAML alias for the options common to precache jobs
aliases:
# YAML alias for the options common to precache jobs
- &precache_uwlcm_mpi
stage: precache
install:
- . ./.travis_scripts/deps_install/mvapich2.sh
- . ./.travis_scripts/deps_install/boost.sh
- . ./.travis_scripts/deps_install/mpi_hdf5.sh
script: echo "Preparing cache finished"
jobs:
include:
- <<: *precache_uwlcm_mpi
env: TEST_SUITE=moist_thermal MPI=mvapich2
addons:
apt:
packages:
# - g++-6
#libcloudphxx dependencies
- python3-dev
- python3-pip
- python3-six
- python3-setuptools
- python3-numpy
- libblitz0-dev
- libthrust-dev
sources: &sources
- sourceline: 'ppa:rakhimov/boost'
- ubuntu-toolchain-r-test
# - llvm-toolchain-xenial
notifications:
email: false
before_install:
# define a compiler variable for use in if statements
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]]; then export COMPILER=g++; fi
# 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://us.archive.ubuntu.com/ubuntu/ xenial main universe multiverse restricted"; fi
# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install -t xenial --no-install-recommends -y"; fi
# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi
# locally installed stuff comes first
- export PATH=/usr/local/bin:$PATH
install:
#compiler
# - if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]]; then export CC=gcc-6; fi
# - if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]]; then export CXX=g++-6; fi
- export apt_get_install="apt-get install -t xenial --no-install-recommends -y"
# cmake
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then wget https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.sh; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo sh cmake-3.13.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir; fi
# order matters!
- if [[ $MPI != 'none' ]]; then . ./.travis_scripts/deps_install/mvapich2.sh; fi
- if [[ $MPI != 'none' ]]; then . ./.travis_scripts/deps_install/boost.sh; fi
- . ./.travis_scripts/deps_install/libmpdata_dependencies.sh # installs mpi-hdf5 if needed
- sudo -H pip3 install --upgrade pip
- sudo -H pip3 install -U pytest --ignore-installed six
- sudo -H pip3 install -U numpy==1.18.5 --ignore-installed six # newer versions require python >= 3.6
- sudo -H pip3 install -U scipy==1.4.1 six # ditto
# boost from a package - only when no MPI
- if [[ $MPI == 'none' ]]; then sudo $apt_get_install boost1.61; fi
- if [[ $MPI == 'none' ]]; then sudo ln -s /usr/lib/x86_64-linux-gnu/libboost_python-py35.so /usr/lib/x86_64-linux-gnu/libboost_python3.so; fi # different naming conventions for boost python with python 3
- sudo $apt_get_install hdf5-tools
before_script:
- chmod -R +x ./.travis_scripts/*
script:
# install libcloudphxx in RelWithDebInfo mode
- cd ..
- git clone --depth=1 git://github.com/igfuw/libcloudphxx.git
- cd libcloudphxx
- mkdir build
- cd build
- cmake -DBoost_DEBUG=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
- make
- sudo make install
- cd ../..
# install libmpdataxx
- git clone --depth=1 git://github.com/igfuw/libmpdataxx.git
- cd libmpdataxx/libmpdata++
- mkdir build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr ..
- sudo make install
- cd ../../..
- cd UWLCM
# run the unit tests
- if [[ $TEST_SUITE == 'unit_iles' ]]; then . ./.travis_scripts/unit_iles.sh; fi
- if [[ $TEST_SUITE == 'unit_smg' ]]; then . ./.travis_scripts/unit_smg.sh; fi
# run the moist thermal test
- if [[ $TEST_SUITE == 'moist_thermal' ]]; then . ./.travis_scripts/moist_thermal.sh; fi