install.sh 1.55 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
# This script is executed via the line:
#   source devtools/ci/jenkins/install.sh
# in a bash shell with the -lex options turned on

echo "Using the following SWIG (`which swig`) version:"
swig -version

echo "Using cmake (`which cmake`) version":
cmake --version

echo "Using clang (`which clang`) version:"
Jason Swails's avatar
Typo  
Jason Swails committed
12
clang --version
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

module load cuda conda/jenkins

# Constants
CONDAENV=openmm-test-3.5
BUILD_DIRECTORY="${WORKSPACE}/openmm-build"
INSTALL_DIRECTORY="${WORKSPACE}/openmm-install"
SRC_DIRECTORY="${WORKSPACE}/openmm-src" # set in the Jenkins configuration

# Create a conda environment, but clean up after one first. If it doesn't exist, don't complain.
# But since we are invoking this shell with -e (exit on all errors), we need || true to prevent this
# command from crashing the whole shell
conda remove -yn ${CONDAENV} --all --quiet || true
conda create -yn ${CONDAENV} python=3.5 --no-default-packages --quiet
conda install -yn ${CONDAENV} numpy scipy pytest --quiet
source activate ${CONDAENV} # enter our new environment

# Build OpenMM
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=\"${INSTALL_DIRECTORY}\" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
Jason Swails's avatar
Jason Swails committed
32
33
34
35
test -d "${BUILD_DIRECTORY}" && rm -fr "${BUILD_DIRECTORY}"
mkdir "${BUILD_DIRECTORY}"
cd "$BUILD_DIRECTORY"
cmake $CMAKE_FLAGS "${SRC_DIRECTORY}"
36
37
38
39
40
41
make -j4 install
make PythonInstall

# Now run the tests
python -m simtk.testInstallation
cd python/tests && py.test -v
Jason Swails's avatar
Jason Swails committed
42
43
44
45
46
python devtools/run-ctest.py --start-time $START_TIME

# Now remove the conda environment
source deactivate
conda remove -yn ${CONDAENV} --all --quiet