-
Notifications
You must be signed in to change notification settings - Fork 30
/
azure-pipelines.yml
285 lines (258 loc) · 8.43 KB
/
azure-pipelines.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
jobs:
- job: 'linux_build'
displayName: 'Linux Builds'
pool:
vmImage: 'ubuntu-latest'
timeoutInMinutes: 90
cancelTimeoutInMinutes: 10
strategy:
maxParallel: 4
matrix:
gcc_py39_orb128:
F_COMPILER: 'gfortran'
C_COMPILER: 'gcc'
CXX_COMPILER: 'g++'
PYTHON_VER: '3.9'
BUILD_TYPE: 'RelWithDebInfo'
PSI_BUILD_TYPE: 'Debug'
MAX_DET_ORB: 128
APT_INSTALL: 'gfortran'
ENABLE_CHEMPS2: 'OFF'
ENABLE_BLOCK2: 'OFF'
gcc_py310_orb64_dmrg:
F_COMPILER: 'gfortran'
C_COMPILER: 'gcc'
CXX_COMPILER: 'g++'
PYTHON_VER: '3.10'
BUILD_TYPE: 'RelWithDebInfo'
PSI_BUILD_TYPE: 'Debug'
MAX_DET_ORB: 64
APT_INSTALL: 'gfortran'
ENABLE_CHEMPS2: 'ON'
ENABLE_BLOCK2: 'OFF'
gcc_py310_orb64_block2:
F_COMPILER: 'gfortran'
C_COMPILER: 'gcc'
CXX_COMPILER: 'g++'
PYTHON_VER: '3.10'
BUILD_TYPE: 'RelWithDebInfo'
PSI_BUILD_TYPE: 'Debug'
MAX_DET_ORB: 64
APT_INSTALL: 'gfortran'
ENABLE_CHEMPS2: 'OFF'
ENABLE_BLOCK2: 'ON'
steps:
- bash: |
[[ "${APT_REPOSITORY}" ]] && echo "Add Repo ${APT_REPOSITORY}" && sudo add-apt-repository "${APT_REPOSITORY}"
sudo apt-get update
sudo apt-get install ${APT_INSTALL}
displayName: "Apt-Get Packages"
- bash: |
echo "" && echo "Ubuntu"
lsb_release -a
echo "" && echo "Uname:"
uname -a
echo "" && echo "Free:"
free -m
echo "" && echo "df:"
df -h
echo "" && echo "Ulimit:"
ulimit -a
echo "" && echo "Nprocs:"
getconf _NPROCESSORS_ONLN
echo "C Ver:"
${C_COMPILER} --version
echo "CXX Ver:"
${CXX_COMPILER} --version
echo "F Ver:"
${F_COMPILER} --version
displayName: 'Setup Information'
- bash: |
echo "Current directory: $PWD"
echo "Agent.BuildDirectory:" $(Agent.BuildDirectory)
echo "Build.SourcesDirectory:" $(Build.SourcesDirectory)
mkdir -p build/forte
cp -R * build/forte/
ls build/forte/
displayName: 'Copy Forte Source'
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
conda config --set always_yes yes
displayName: 'Add Conda to PATH'
- bash: |
conda config --add channels conda-forge/label/libint_dev
conda create -q \
-n p4env \
python=$PYTHON_VER \
psi4/label/dev::gau2grid=2 \
libint=2.7.3dev1 \
psi4/label/dev::libxc \
psi4/label/dev::chemps2 \
psi4/label/dev::dkh \
blas=*=mkl \
mkl-include \
networkx \
eigen \
pytest \
pytest-xdist \
libgcc=5.2.0 \
conda-forge::qcelemental \
conda-forge::qcengine
source activate p4env
conda install -c conda-forge \
hdf5 \
mkl-devel \
pybind11 \
pytest \
pytest-cov \
pytest-xdist \
pytest-shutil \
py-cpuinfo \
scipy \
codecov \
lcov \
libstdcxx-ng
which python
conda list
displayName: 'Configure Environment'
- bash: |
which cmake
cmake --version
cd build
echo "Now at directory: $PWD"
git clone https://github.com/psi4/psi4.git psi4
displayName: 'Clone Psi4 Source'
- bash: |
source activate p4env
cd build
mkdir psi4bin
PSI4BIN_DIR=$(Build.SourcesDirectory)/build/psi4bin
echo "##vso[task.setvariable variable=PSI4BIN_DIR]${PSI4BIN_DIR}"
echo "Psi4 bin directory: $PSI4BIN_DIR"
mkdir psi4obj
cd psi4obj
cmake -H. -B$(Build.SourcesDirectory)/build/psi4obj \
-DCMAKE_INSTALL_PREFIX=${PSI4BIN_DIR} \
-DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \
-DCMAKE_CXX_COMPILER=${CXX_COMPILER} \
-DCMAKE_C_COMPILER=${C_COMPILER} \
-DCMAKE_Fortran_COMPILER=${F_COMPILER} \
-DPython_EXECUTABLE=${CONDA_PREFIX}/bin/python \
-DOpenMP_LIBRARY_DIRS=${CONDA_PREFIX}/lib \
-DCMAKE_BUILD_TYPE=${PSI_BUILD_TYPE} \
-Dpsi4_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=17 \
-DENABLE_CheMPS2=$ENABLE_CHEMPS2 \
-DENABLE_ecpint=ON \
$(Build.SourcesDirectory)/build/psi4
displayName: 'Configure Psi4 Build'
- bash: |
source activate p4env
cd build/psi4obj
echo "Now at directory (Psi4 objdir): $PWD"
make -j2 VERBOSE=1
echo "Now install Psi4 at: $(PSI4BIN_DIR)"
make install
cd $(PSI4BIN_DIR)
file lib/psi4/core*.so
ldd lib/psi4/core*.so
readelf -d lib/psi4/core*.so
displayName: 'Build Psi4'
- bash: |
STAGED_INSTALL_PREFIX=$(Build.SourcesDirectory)/build/psi4obj/stage
echo "##vso[task.setvariable variable=STAGED_INSTALL_PREFIX]$STAGED_INSTALL_PREFIX"
echo "##vso[task.setvariable variable=PYTHONPATH]${STAGED_INSTALL_PREFIX}/lib:$(Build.SourcesDirectory)/build/forte:$(Build.SourcesDirectory)/build/ambit-bin/lib:${PYTHONPATH}"
echo "##vso[task.setvariable variable=PATH]${PSI4BIN_DIR}/bin:${PATH}"
displayName: 'Add Psi4 to PATH and PYTHONPATH'
- bash: |
cd build
git clone https://github.com/jturney/ambit.git
displayName: 'Clone Ambit Source'
- bash: |
source activate p4env
cd build
mkdir ambit-bin
AMBIT_BIN_DIR=$(Build.SourcesDirectory)/build/ambit-bin
echo "##vso[task.setvariable variable=AMBIT_BIN_DIR]${AMBIT_BIN_DIR}"
cmake -Sambit -Bambitobj \
-DCMAKE_INSTALL_PREFIX=${AMBIT_BIN_DIR} \
-DCMAKE_CXX_COMPILER=${CXX_COMPILER} \
-DCMAKE_C_COMPILER=${C_COMPILER} \
-DPython_EXECUTABLE=${CONDA_PREFIX}/bin/python \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DOpenMP_LIBRARY_DIRS=${CONDA_PREFIX}/lib \
-DCMAKE_CXX_STANDARD=17
displayName: 'Configure Ambit Build'
- bash: |
source activate p4env
cd build/ambitobj
make -j2 VERBOSE=1
make install
displayName: 'Build Ambit'
- bash: |
BLOCK2_BIN_DIR=$(Build.SourcesDirectory)/build/block2-bin
if [[ "${ENABLE_BLOCK2}" != "OFF" ]]; then
source activate p4env
cd build
git clone -b p0.5.3rc14 https://github.com/block-hczhai/block2-preview.git
mkdir -p block2-preview/build
cd block2-preview/build
cmake .. -DUSE_MKL=OFF -DBUILD_CLIB=ON \
-DLARGE_BOND=ON \
-DMPI=OFF \
-DCMAKE_INSTALL_PREFIX=${BLOCK2_BIN_DIR}
make -j2 install
fi
displayName: 'Build Block2'
- bash: |
source activate p4env
echo "Conda path: ${CONDA_PREFIX}"
echo "$(python -V): $(which python)"
echo "Psi4 staging directory: $(STAGED_INSTALL_PREFIX)"
echo "Psi4 version: $(psi4 --version)"
echo "Psi4 plugin compile command: $(psi4 --plugin-compile)"
cd build/forte
cmake -S. -B. \
-C$(PSI4BIN_DIR)/share/cmake/psi4/psi4PluginCache.cmake \
-DCMAKE_PREFIX_PATH=$(PSI4BIN_DIR) \
-Dambit_DIR=$(AMBIT_BIN_DIR)/share/cmake/ambit \
-Dblock2_DIR=${BLOCK2_BIN_DIR}/share/cmake/block2 \
-DCMAKE_CXX_COMPILER=${CXX_COMPILER} \
-DCMAKE_C_COMPILER=${C_COMPILER} \
-DPython_EXECUTABLE="${CONDA_PREFIX}/bin/python" \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_CXX_FLAGS=-DPYBIND11_CPP17 \
-DENABLE_CheMPS2=$ENABLE_CHEMPS2 \
-DENABLE_block2=$ENABLE_BLOCK2 \
-DENABLE_CODECOV=ON \
-DOpenMP_LIBRARY_DIRS=${CONDA_PREFIX}/lib \
-DEIGEN3_INCLUDE_DIR=$CONDA_PREFIX/include/eigen3 \
-DMAX_DET_ORB=${MAX_DET_ORB}
displayName: 'Configure Forte Build'
- bash: |
source activate p4env
cd build/forte
make -j2 VERBOSE=1
file forte/_forte*.so
ldd forte/_forte*.so
readelf -d forte/_forte*.so
displayName: 'Build Forte'
- bash: |
source activate p4env
echo "PATH: $PATH"
echo "PYTHONPATH: $PYTHONPATH"
cd build
echo "Psi4 Python path:"
python -c "import psi4; print(psi4.__path__)"
echo "Forte Python path:"
python -c "import forte; print(forte.__path__)"
echo "Forte banner test:"
python -c "import forte; forte.banner()"
cd forte
bash tools/forte_codecov $MAX_DET_ORB $ENABLE_CHEMPS2
displayName: 'Run Forte tests'