-
Notifications
You must be signed in to change notification settings - Fork 65
172 lines (162 loc) · 5.65 KB
/
merge-gate.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Cpptraj Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
linux_build:
runs-on: ubuntu-latest
name: Build ${{ matrix.compiler }} with CMake ${{ matrix.use_cmake }}
strategy:
fail-fast: false
matrix:
compiler: ["gnu", "clang"]
use_cmake: ["0", "1"]
use_openmp: ["no"]
use_mpi: ["no"]
include:
- use_openmp: "yes"
compiler: "gnu"
use_mpi: "no"
use_cmake: "0"
- use_openmp: "no"
compiler: "gnu"
use_mpi: "yes"
use_cmake: "0"
- use_openmp: "yes"
compiler: "gnu"
use_mpi: "yes"
use_cmake: "0"
- use_openmp: "no"
compiler: "gnu"
use_mpi: "yes"
use_cmake: "1"
env:
COMPILER: ${{ matrix.compiler }}
USE_CMAKE: ${{ matrix.use_cmake }}
BUILD_TYPE: "install"
TEST_TYPE: "test.showerrors"
USE_MPI: ${{ matrix.use_mpi }}
USE_OPENMP: ${{ matrix.use_openmp }}
steps:
- name: Install prerequisite packages
run: |
sudo apt-get install gfortran
sudo apt-get install libbz2-dev
sudo apt-get install libblas-dev liblapack-dev
sudo apt-get install libfftw3-dev
sudo apt-get install clang
sudo apt-get install cmake-data cmake
- name: Checkout source code
uses: actions/checkout@v4
- name: Compile and test cpptraj
shell: bash -lex {0}
run: |
curl -OL https://anaconda.org/AmberMD/amber_phenix/0.9.6/download/linux-64/amber_phenix-0.9.6-0.tar.bz2
tar jxf amber_phenix-0.9.6-0.tar.bz2 lib/libsander.so AmberTools/src/sander/sander.h
mkdir -p include && mv AmberTools/src/sander/sander.h include
mv lib include $HOME
if [ $USE_OPENMP = "yes" ]; then
export OPT="openmp"
export OMP_NUM_THREADS=4
if [ "$USE_CMAKE" = "1" ]; then
export BUILD_FLAGS="-DOPENMP=TRUE"
else
export BUILD_FLAGS="-openmp"
fi
fi
if [ $USE_MPI = "yes" ]; then
curl -OL http://www.mpich.org/static/downloads/3.4.2/mpich-3.4.2.tar.gz
tar -zxf mpich-3.4.2.tar.gz
cd mpich-3.4.2
export FFLAGS=-fallow-argument-mismatch
./configure --with-device=ch3 --prefix=$HOME
make -j2
make install
cd ..
export PATH=$HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
export DO_PARALLEL="mpirun -n 2"
if [ $USE_OPENMP = "yes" ]; then
export OMP_NUM_THREADS=1
fi
if [ "$USE_CMAKE" = "1" ]; then
export BUILD_FLAGS="-DMPI=TRUE ${BUILD_FLAGS}"
else
export BUILD_FLAGS="-mpi ${BUILD_FLAGS}"
fi
fi
if [ "$USE_CMAKE" = "1" ]; then
curl -OL https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.2.tar.gz
tar -zxf v4.9.2.tar.gz
cd netcdf-c-4.9.2
./configure --disable-byterange --disable-libxml2 --disable-netcdf-4 --disable-dap --disable-doxygen --prefix=$HOME
make -j2
make install
cd ..
export PATH=$HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib:${LD_LIBRARY_PATH}
mkdir build install
installdir=$(pwd)
cd build
cmake .. $BUILD_FLAGS -DCOMPILER=${COMPILER^^} -DINSTALL_HEADERS=FALSE \
-DCMAKE_INSTALL_PREFIX=$installdir -DCMAKE_LIBRARY_PATH=$HOME/lib \
-DPRINT_PACKAGING_REPORT=TRUE -DNetCDF_LIBRARIES_C=$HOME/lib/libnetcdf.so \
-DNetCDF_INCLUDES=$HOME/include
make -j2 install
cd ..
export PATH=$installdir/bin:$PATH
else
export LD_LIBRARY_PATH=$HOME/lib:${LD_LIBRARY_PATH}
./configure --buildlibs ${BUILD_FLAGS} ${COMPILER}
source cpptraj.sh
make -j2 install
fi
cd test && make $TEST_TYPE
build-pytraj:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
steps:
- name: Install prerequisite packages
run: |
sudo apt-get install gfortran
sudo apt-get install libbz2-dev
sudo apt-get install libblas-dev liblapack-dev
sudo apt-get install libfftw3-dev
sudo apt-get install clang
sudo apt-get install cmake-data cmake
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install conda packages
run: |
which conda
conda install conda=23.11.0 python=3.10
conda --version
conda env update --file devtools/ci/environment.yml --name base
- name: Install cpptraj
run: |
export PATH=$HOME/bin:${PATH}
export LD_LIBRARY_PATH=$HOME/lib:${LD_LIBRARY_PATH}
export MAKE_COMMAND="make -j2"
./configure --buildlibs -openmp -shared gnu
source cpptraj.sh
make -j2 libcpptraj
- name: Install pytraj
run: |
git clone https://github.com/Amber-MD/pytraj.git
source cpptraj.sh
cd pytraj
python setup.py install
cd ..
- name: Test with pytest
run: |
source cpptraj.sh && cd pytraj/tests && pytest -vs --ignore=test_parallel_pmap