install.sh 1.42 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
# 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

11
12
echo "Using g++ (`which g++`) version:"
g++ --version
13

14
module load cuda/9.0
15
16
17

# Constants
CONDAENV=openmm-test-3.5
18
INSTALL_DIRECTORY="`pwd`/install"
Jason Swails's avatar
Jason Swails committed
19
export OPENMM_CUDA_COMPILER=`which nvcc`
20
21
22
23

# 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
24
25
26
create_conda_env() {
  conda create -yn ${CONDAENV} python=3.5 --no-default-packages --quiet
}
27
conda remove -yn ${CONDAENV} --all --quiet || true
28
create_conda_env || create_conda_env # Crappy way to work around conda concurrency restrictions
29
30
31
32
conda install -yn ${CONDAENV} numpy scipy pytest --quiet
source activate ${CONDAENV} # enter our new environment

# Build OpenMM
33
34
cmake -DCMAKE_INSTALL_PREFIX="${INSTALL_DIRECTORY}" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc .
make -j6 install
35
36
37
38
make PythonInstall

# Now run the tests
python -m simtk.testInstallation
Jason Swails's avatar
Jason Swails committed
39
cd python/tests && py.test -v && cd ../..
40
python devtools/run-ctest.py --job-duration=120 --timeout 300
Jason Swails's avatar
Jason Swails committed
41
42
43

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