-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
111 lines (88 loc) · 3.05 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
# http://travis-ci.org/Crompulence/CPL_APP_OPENFOAM-3.0.1
os: linux
sudo: required
language: python
python:
- 2.7
# set up build matrix
matrix:
include:
#Build for 14.04
- dist: trusty
env:
- GCC_VERSION=7.2_conda
- MPI=mpich3_conda
branches:
only:
- master
cache:
apt: true
virtualenv:
system_site_packages: true
before_install:
#Needed steps to get out opf virtualenv and get Scipy working
- SITE_PKG_DIR=$VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/site-packages
- rm -f $VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/no-global-site-packages.txt
install:
#Get miniconda
- wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
#Create environment
- conda create -q -n cplrun python=$TRAVIS_PYTHON_VERSION numpy scipy
- source activate cplrun
- conda config --add channels edu159
#We need to explicitly get gcc/gfortran as miniconda is not available for 5+ yet
- conda install -y gxx_linux-64=7.2
- conda install -y gfortran_linux-64=7.2
#Here we install openfoam
- conda install -c edu159 -y mpich
- conda install -c edu159 -y openfoam
#pytest and mpi4py
- conda install -c edu159 -y mpi4py
- conda install -y pytest
#Setup aliases
- FOAM_VERSION=3.0.1
- FOAM_DIR_NAME=OpenFOAM-$FOAM_VERSION
- ENVPREFIX=$HOME/miniconda/envs/cplrun
#Go to virtual enviroment directory
- cd $ENVPREFIX
- git clone https://github.com/Crompulence/cpl-library.git ./cpl-library
#Build CPL library using conda version of code
- cd ./cpl-library
- make PLATFORM=gcc
- ldd lib/*
# - cp lib/* $ENVPREFIX/lib
- source SOURCEME.sh
- cd ../
#Get conda build so we can copy required stuff
- git clone https://github.com/Crompulence/cpl_conda_builds.git ./cpl_conda_builds
- RECIPE_DIR=$ENVPREFIX/cpl_conda_builds/cplapp-openfoam3.0.1/
- cp -Rf ${RECIPE_DIR}/linux64Gcc $ENVPREFIX/opt/$FOAM_DIR_NAME/wmake/rules
#Get all of CPL APP
- cd /home/travis/build/Crompulence/CPL_APP_OPENFOAM-3.0.1/
- echo "$ENVPREFIX/opt" > CODE_INST_DIR
- source SOURCEME.sh
#We need to make Pstream and patch the OpenFOAM version
- make pstream
- mv $FOAM_LIBBIN/$FOAM_MPI/libPstream.so $FOAM_LIBBIN/$FOAM_MPI/libPstream.so.orig
- cp lib/libPstream.so $FOAM_LIBBIN/$FOAM_MPI/
- make
- cp lib/* $ENVPREFIX/lib
- cp bin/* $ENVPREFIX/bin
# Add PyFoam for granular cases
- pip install PyFoam
script:
- make test-hydrostatic
# - make test-fcc_dummy
- make test-couette
- make test-granular
after_success:
- echo "Build Success"
after_failure:
- cat /home/travis/build/Crompulence/CPL_APP_OPENFOAM-3.0.1/openfoam_build.log