-
Notifications
You must be signed in to change notification settings - Fork 2
129 lines (126 loc) · 4.61 KB
/
ci.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
name: CI
on:
push:
pull_request:
env:
# on CI, better dump stack trace in case there is an error
PLUMED_STACK_TRACE: yes
# use two threads for openMP tests
PLUMED_NUM_THREADS: 2
# these are used to build required packages
CC: gcc
CXX: g++
jobs:
linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
variant:
- -mpi-
- -
# - -intel- #qe ./configure seem to dislike this intel compiler
qeVersion: ["5.0.2", "6.2.0", "7.0", "7.2"]
include:
- qeVersion: "5.0.2"
qePlumedVersion: "5.0.2"
- qeVersion: "6.2.0"
qePlumedVersion: "6.2"
- qeVersion: "7.0"
qePlumedVersion: "7.0"
- qeVersion: "7.2"
qePlumedVersion: 7.2"
qeExtra: --enable-legacy_plugins
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-reset1-linux${{ matrix.variant }}hash-${{ github.sha }}
restore-keys: ccache-reset1-linux${{ matrix.variant }}hash-
- name: Set paths
run: |
echo "$HOME/opt/bin" >> $GITHUB_PATH
echo "CPATH=$HOME/opt/include:$CPATH" >> $GITHUB_ENV
echo "INCLUDE=$HOME/opt/include:$INCLUDE" >> $GITHUB_ENV
echo "LIBRARY_PATH=$HOME/opt/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install generic packages
run: |
sudo apt-get update -qq
sudo apt-get install -y libatlas-base-dev
sudo apt-get install -y libfftw3-dev
sudo apt-get install -y gsl-bin
sudo apt-get install -y libgsl0-dev
sudo apt-get install -y gfortran
sudo apt-get install -y ccache
# install INTEL at last since it modifies CC and CXX
- name: Install INTEL compiler
if: contains( matrix.variant, '-intel-' )
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mkl intel-oneapi-mkl-devel intel-oneapi-compiler-fortran
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
echo "CXX=icpc" >> $GITHUB_ENV
echo "CC=icc" >> $GITHUB_ENV
echo "FC=ifort" >> $GITHUB_ENV
- name: Install MPI
# install MPI at last since it modifies CC and CXX
if: contains( matrix.variant, '-mpi-' )
run: |
sudo apt-get install -y libopenmpi-dev openmpi-bin
echo "CC=mpicc" >> $GITHUB_ENV
echo "CXX=mpic++" >> $GITHUB_ENV
echo "OMPI_MCA_btl_base_warn_component_unused=0" >> $GITHUB_ENV
echo "OMPI_MCA_btl_base_verbose=0" >> $GITHUB_ENV
echo "MPIEXEC=mpirun --oversubscribe" >> $GITHUB_ENV
- name: Build PLUMED
run: |
ccache -s -M 100M
git clone https://github.com/Iximiel/plumed2.git
cd plumed2
git checkout v2.8_qePatches
./configure CXX="ccache $CXX" --disable-dependency-tracking LDFLAGS=-Wl,-rpath,$LD_LIBRARY_PATH --prefix="$HOME/opt"
make -j 4
make install
ccache -s -M 100M
#this ensures that the cache for at least plumed is stored
- uses: actions/cache/save@v3
with:
path: ~/.ccache
key: ccache-reset1-linux${{ matrix.variant }}hash-${{ github.sha }}
- name: Build QE
run: |
git clone https://gitlab.com/QEF/q-e.git
cd q-e
git checkout qe-${{ matrix.qeVersion }}
./configure --prefix="$HOME/opt" ${{ matrix.qeExtra }}
plumed patch --engine qespresso-${{ matrix.qePlumedVersion }} -p
make pw
make install
- name: Install qe 5.0.2
# qe 5.* does not make install
if: contains( matrix.qeVersion, '5.0.2' )
run: |
prefix=$HOME/opt
cd $prefix
ln -s $HOME/q-e/PW/src/pw.x pw.x
ln -s $HOME/q-e/PW/src/generate_vdW_kernel_table.x generate_vdW_kernel_table.x
ln -s $HOME/q-e/S3DE/iotk/tools/iotk iotk
ln -s $HOME/q-e/S3DE/iotk/src/iotk_print_kinds.x iotk_print_kinds.x
ln -s $HOME/q-e/S3DE/iotk/src/iotk.x iotk.x
- name: Check files
run: |
prefix=$HOME/opt
ls -ltr $prefix/bin
ls -ltr $prefix/lib
nm -C $prefix/bin/pw.x | grep plumed
ldd $prefix/bin/pw.x
- name: Run tests
run: |
./run_tests.sh