-
Notifications
You must be signed in to change notification settings - Fork 19
164 lines (132 loc) · 4.01 KB
/
build.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
name: CI
on: [push, pull_request]
env:
CI: "ON"
BUILD_DIR: _build
INSTALL_DIR: _install
jobs:
gcc-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
config: [Debug]
version: [13]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install GCC (Linux)
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.version}} gfortran-${{ matrix.version }}
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.version }} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.version }}
- name: Set Compiler
run: |
echo "FC=gfortran" >> $GITHUB_ENV
echo "CC=gcc" >> $GITHUB_ENV
- name: Compile and Install libXC
run: |
git clone https://gitlab.com/libxc/libxc.git
cd libxc/
git checkout 6.2.2
cmake -DCMAKE_INSTALL_PREFIX=${PWD}/${BUILD_DIR}/${INSTALL_DIR} -DENABLE_FORTRAN=True -B ${BUILD_DIR} .
cd ${BUILD_DIR}
make -j 2
make install
cd ../../
- name: Set libXC search path
run: |
echo "CMAKE_PREFIX_PATH=./libxc/${BUILD_DIR}/${INSTALL_DIR}/" >> $GITHUB_ENV
- name: Install requirements (pip)
run: |
pip3 install --upgrade pip
pip3 install wheel
pip3 install cmake fypp numpy scipy
- name: Configure build
run: |
cmake -B ${BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${PWD}/${BUILD_DIR}/${INSTALL_DIR} -DCMAKE_BUILD_TYPE=Debug .
- name: Build project
run: cmake --build ${BUILD_DIR}
- name: Run regression tests
run: |
pushd ${BUILD_DIR}
ctest -j 2 --output-on-failure
popd
- name: Install project
run: |
cmake --install ${BUILD_DIR}
intel-build:
strategy:
matrix:
os: [ubuntu-latest]
config: [RelWithDebInfo]
runs-on: ${{ matrix.os }}
env:
FC: ifx
CC: icx
CMAKE_OPTIONS: >-
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
-DFYPP_FLAGS='-DTRAVIS'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Setup Intel compiler
uses: rscohn2/setup-oneapi@v0
with:
components: |
icx@2024.0.0
ifx@2024.0.0
mkl@2024.0.0
- name: Setup Intel environment
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> ${GITHUB_ENV}
echo "FC=ifx" >> ${GITHUB_ENV}
echo "CC=icx" >> ${GITHUB_ENV}
- name: Compile and install libXC
run: |
git clone https://gitlab.com/libxc/libxc.git
cd libxc/
git checkout 6.2.2
cmake -DCMAKE_INSTALL_PREFIX=${PWD}/${BUILD_DIR}/${INSTALL_DIR} -DENABLE_FORTRAN=True -B ${BUILD_DIR} .
cd ${BUILD_DIR}
make -j 2
make install
cd ../../
- name: Set libXC search path
run: |
echo "CMAKE_PREFIX_PATH=./libxc/${BUILD_DIR}/${INSTALL_DIR}/" >> $GITHUB_ENV
- name: Install requirements (pip)
run: |
pip3 install --upgrade pip
pip3 install wheel
pip3 install cmake fypp numpy scipy
- name: Set extra CMake flags (Linux)
run: |
echo "CMAKE_OPTIONS=${CMAKE_OPTIONS}" >> $GITHUB_ENV
- name: Configure build
run: |
cmake -DCMAKE_INSTALL_PREFIX=${PWD}/${BUILD_DIR}/${INSTALL_DIR} -B ${BUILD_DIR} .
- name: Build project
run: cmake --build ${BUILD_DIR}
- name: Run regression tests
run: |
pushd ${BUILD_DIR}
ctest -j 2 --output-on-failure
popd
- name: Install project
run: |
cmake --install ${BUILD_DIR}