forked from evangelistalab/forte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
256 lines (231 loc) · 7.39 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
# 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_orb64:
F_COMPILER: 'gfortran'
C_COMPILER: 'gcc'
CXX_COMPILER: 'g++'
PYTHON_VER: '3.9'
BUILD_TYPE: 'RelWithDebInfo'
PSI_BUILD_TYPE: 'Debug'
MAX_DET_ORB: 64
APT_INSTALL: 'gfortran'
gcc_py37_orb128:
F_COMPILER: 'gfortran'
C_COMPILER: 'gcc'
CXX_COMPILER: 'g++'
PYTHON_VER: '3.7'
BUILD_TYPE: 'RelWithDebInfo'
PSI_BUILD_TYPE: 'Debug'
MAX_DET_ORB: 128
APT_INSTALL: 'gfortran'
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 create -q \
-n p4env \
python=$PYTHON_VER \
psi4/label/dev::gau2grid=2 \
psi4/label/dev::libint2 \
psi4/label/dev::libxc \
psi4/label/dev::chemps2 \
psi4/label/dev::dkh \
psi4/label/dev::gdma \
psi4/label/dev::pcmsolver \
psi4/label/dev::simint \
psi4/label/dev::dftd3 \
psi4/label/dev::gcp \
psi4/label/dev::resp \
psi4/label/dev::pycppe \
psi4/label/dev::pylibefp \
psi4/label/dev::snsmp2 \
psi4/label/dev::fockci \
psi4/label/dev::mp2d \
blas=*=mkl \
mkl-include \
networkx \
pytest \
eigen \
mpfr \
pytest-xdist \
conda-forge::qcelemental \
conda-forge::qcengine \
conda-forge::pymdi \
adcc::adcc
source activate p4env
conda install -c conda-forge \
cmake \
hdf5 \
boost \
mkl-devel \
pybind11 \
pytest \
pytest-cov \
pytest-xdist \
pytest-shutil \
codecov \
lcov
which python
pip install git+https://github.com/i-pi/i-pi.git@master-py3
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"
cmake -Spsi4 -Bpsi4obj \
-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_FLAGS=-DPYBIND11_CPP17 \
-DCMAKE_CXX_STANDARD=17
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:{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: |
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 \
-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_CODECOV=ON \
-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
displayName: 'Run Forte tests'