| 1 |
--- |
| 2 |
name: Build APBS with an Alternate Configuration |
| 3 |
|
| 4 |
on: |
| 5 |
#push: |
| 6 |
# branches: [main] |
| 7 |
# tags: ['*'] |
| 8 |
pull_request: |
| 9 |
|
| 10 |
workflow_dispatch: |
| 11 |
|
| 12 |
|
| 13 |
env: |
| 14 |
WIN_DEPENDENCIES_RELEASE: "v0.4.0" |
| 15 |
WIN_TOOLCHAIN_FILE: '/c/vcpkg/scripts/buildsystems/vcpkg.cmake' |
| 16 |
APBS_STATIC_BUILD: ON |
| 17 |
BLA_VENDOR: OpenBLAS |
| 18 |
BUILD_DOC: ON |
| 19 |
BUILD_TOOLS: ON |
| 20 |
RELEASE_TYPE: Release |
| 21 |
ENABLE_PYGBE: ON |
| 22 |
ENABLE_BEM: ON |
| 23 |
ENABLE_GEOFLOW: ON |
| 24 |
# FETK_VERSION: "1.9.2" |
| 25 |
FETK_VERSION: 57195e55351e04ce6ee0ef56a143c996a9aee7e2 |
| 26 |
ENABLE_iAPBS: ON |
| 27 |
ENABLE_OPENMP: OFF |
| 28 |
ENABLE_PBAM: OFF |
| 29 |
ENABLE_PBSAM: OFF |
| 30 |
ENABLE_PYTHON: OFF |
| 31 |
ENABLE_TESTS: ON |
| 32 |
GET_NanoShaper: ON |
| 33 |
PYTHON_VERSION: "3.9" |
| 34 |
|
| 35 |
jobs: |
| 36 |
|
| 37 |
build-docker: |
| 38 |
name: Build and Test Docker Images |
| 39 |
|
| 40 |
runs-on: ubuntu-latest |
| 41 |
|
| 42 |
strategy: |
| 43 |
fail-fast: false |
| 44 |
matrix: |
| 45 |
include: |
| 46 |
- dockerfile: Dockerfile.ubuntu |
| 47 |
apbs-static-build: OFF |
| 48 |
python-version: "3.9" |
| 49 |
- dockerfile: Dockerfile.centos |
| 50 |
apbs-static-build: ON |
| 51 |
python-version: "3.6" |
| 52 |
|
| 53 |
env: |
| 54 |
# Override default environment variables with matrix values |
| 55 |
DOCKERFILE: ${{ matrix.dockerfile }} |
| 56 |
APBS_STATIC_BUILD: ${{ matrix.apbs-static-build }} |
| 57 |
PYTHON_VERSION: ${{ matrix.python-version }} |
| 58 |
|
| 59 |
steps: |
| 60 |
|
| 61 |
- name: Checkout the repo |
| 62 |
uses: actions/checkout@master |
| 63 |
with: |
| 64 |
submodules: recursive |
| 65 |
|
| 66 |
- name: Build and run |
| 67 |
run: | |
| 68 |
docker build \ |
| 69 |
-f ${DOCKERFILE} \ |
| 70 |
--build-arg APBS_STATIC_BUILD=${APBS_STATIC_BUILD} \ |
| 71 |
--build-arg BLA_VENDOR=${BLA_VENDOR} \ |
| 72 |
--build-arg BUILD_DOC=${BUILD_DOC} \ |
| 73 |
--build-arg BUILD_TOOLS=${BUILD_TOOLS} \ |
| 74 |
--build-arg RELEASE_TYPE=${RELEASE_TYPE} \ |
| 75 |
--build-arg ENABLE_PYGBE=${ENABLE_PYGBE} \ |
| 76 |
--build-arg ENABLE_BEM=${ENABLE_BEM} \ |
| 77 |
--build-arg ENABLE_GEOFLOW=${ENABLE_GEOFLOW} \ |
| 78 |
--build-arg FETK_VERSION=${FETK_VERSION} \ |
| 79 |
--build-arg ENABLE_iAPBS=${ENABLE_iAPBS} \ |
| 80 |
--build-arg ENABLE_OPENMP=${ENABLE_OPENMP} \ |
| 81 |
--build-arg ENABLE_PBAM=${ENABLE_PBAM} \ |
| 82 |
--build-arg ENABLE_PBSAM=${ENABLE_PBSAM} \ |
| 83 |
--build-arg ENABLE_PYTHON=${ENABLE_PYTHON} \ |
| 84 |
--build-arg ENABLE_TESTS=${ENABLE_TESTS} \ |
| 85 |
--build-arg GET_NanoShaper=${GET_NanoShaper} \ |
| 86 |
--build-arg PYTHON_VERSION=${PYTHON_VERSION} \ |
| 87 |
. |
| 88 |
ctest -C ${RELEASE_TYPE} -VV --output-on-failure |
| 89 |
|
| 90 |
build: |
| 91 |
name: Compile Code |
| 92 |
|
| 93 |
runs-on: ${{ matrix.os }} |
| 94 |
|
| 95 |
strategy: |
| 96 |
fail-fast: false |
| 97 |
matrix: |
| 98 |
platform: [ubuntu, macOS, windows] |
| 99 |
openmp: [OFF] |
| 100 |
static-build: [ON] |
| 101 |
python-version: ["3.9"] |
| 102 |
include: |
| 103 |
- platform: ubuntu |
| 104 |
os: ubuntu-20.04 |
| 105 |
bla-vendor: OpenBLAS |
| 106 |
architecture: x64 |
| 107 |
- platform: macos |
| 108 |
os: macos-11 |
| 109 |
bla-vendor: Apple |
| 110 |
architecture: x64 |
| 111 |
- platform: windows |
| 112 |
os: windows-2022 |
| 113 |
bla-vendor: OpenBLAS |
| 114 |
architecture: x86 |
| 115 |
|
| 116 |
env: |
| 117 |
BLA_VENDOR: ${{ matrix.bla-vendor }} |
| 118 |
ENABLE_OPENMP: ${{ matrix.openmp }} |
| 119 |
APBS_STATIC_BUILD: ${{matrix.static-build }} |
| 120 |
PYTHON_VERSION: "${{ matrix.python-version }}" |
| 121 |
|
| 122 |
outputs: |
| 123 |
apbs-version: ${{ steps.extract-version.outputs.apbs-version }} |
| 124 |
apbs-tag: ${{ steps.extract-version.outputs.apbs-tag }} |
| 125 |
cpack-out-lin-zip: ${{ steps.cpack-ml.outputs.cpack-out-ubuntu-zip }} |
| 126 |
cpack-out-mac-zip: ${{ steps.cpack-ml.outputs.cpack-out-macos-zip }} |
| 127 |
cpack-out-win-zip: ${{ steps.cpack-w.outputs.cpack-out-windows-zip }} |
| 128 |
|
| 129 |
steps: |
| 130 |
|
| 131 |
- name: Add msbuild to PATH |
| 132 |
if: startsWith(matrix.os, 'windows') # Windows only |
| 133 |
uses: microsoft/[email protected] |
| 134 |
|
| 135 |
- name: Checkout reposistory |
| 136 |
uses: actions/checkout@master |
| 137 |
with: |
| 138 |
submodules: recursive |
| 139 |
|
| 140 |
- name: Extract version |
| 141 |
run: | |
| 142 |
version="$(grep -E '^[0-9]+_[0-9]+_[0-9]+' VERSION | sed 's/_/./g')" |
| 143 |
echo $version |
| 144 |
echo ::set-output name=apbs-version::${version} |
| 145 |
echo ::set-output name=apbs-tag::v${version} |
| 146 |
shell: bash |
| 147 |
id: extract-version |
| 148 |
|
| 149 |
- name: Set up Python |
| 150 |
uses: actions/setup-python@v2 |
| 151 |
with: |
| 152 |
python-version: ${{ matrix.python-version }} |
| 153 |
architecture: ${{ matrix.architecture }} |
| 154 |
|
| 155 |
- name: Mac Prereqs |
| 156 |
if: startsWith(matrix.os, 'macos') # Mac only |
| 157 |
run: | |
| 158 |
brew install \ |
| 159 |
wget \ |
| 160 |
bison \ |
| 161 |
flex \ |
| 162 |
swig \ |
| 163 |
boost \ |
| 164 |
eigen \ |
| 165 |
lapack \ |
| 166 |
suite-sparse |
| 167 |
wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz |
| 168 |
gunzip metis-5.1.0.tar.gz |
| 169 |
tar -xf metis-5.1.0.tar |
| 170 |
cd metis-5.1.0 |
| 171 |
make config prefix=/usr/local |
| 172 |
make install |
| 173 |
cd .. |
| 174 |
git clone https://github.com/opencollab/arpack-ng.git |
| 175 |
cd arpack-ng |
| 176 |
git fetch --all --tags |
| 177 |
git checkout tags/3.8.0 -b latest |
| 178 |
mkdir build && cd build |
| 179 |
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DCMAKE_Fortran_COMPILER=$(which gfortran-11) -DEXAMPLES=OFF -DMPI=OFF -DBUILD_SHARED_LIBS=OFF .. |
| 180 |
make install |
| 181 |
# brew upgrade gcc@9 |
| 182 |
|
| 183 |
- name: Linux Prereqs and Remove broken apt repos [Ubuntu] |
| 184 |
if: startsWith(matrix.os, 'ubuntu') # Linux only |
| 185 |
run: | |
| 186 |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done |
| 187 |
sudo apt-get install -yq \ |
| 188 |
software-properties-common \ |
| 189 |
build-essential \ |
| 190 |
wget \ |
| 191 |
bison \ |
| 192 |
flex \ |
| 193 |
swig \ |
| 194 |
libreadline-dev \ |
| 195 |
libeigen3-dev \ |
| 196 |
libboost-dev \ |
| 197 |
libopenblas-serial-dev \ |
| 198 |
libarpack2-dev \ |
| 199 |
liblapack-dev \ |
| 200 |
libsuitesparse-dev |
| 201 |
wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz |
| 202 |
gunzip metis-5.1.0.tar.gz |
| 203 |
tar -xf metis-5.1.0.tar |
| 204 |
cd metis-5.1.0 |
| 205 |
make config prefix=/usr/local |
| 206 |
sudo make install |
| 207 |
|
| 208 |
- name: Install Window dependencies |
| 209 |
if: startsWith(matrix.os, 'windows') # Windows only |
| 210 |
run: | |
| 211 |
choco install wget |
| 212 |
wget https://github.com/Electrostatics/cache/releases/download/${WIN_DEPENDENCIES_RELEASE}/apbs_dependencies_vcpkg.zip |
| 213 |
7z x apbs_dependencies_vcpkg.zip -aoa -o/c/vcpkg |
| 214 |
ls /c/vcpkg |
| 215 |
vcpkg integrate install |
| 216 |
vcpkg list --triplet x86-windows |
| 217 |
shell: bash |
| 218 |
|
| 219 |
- name: Configure for Windows |
| 220 |
if: startsWith(matrix.os, 'windows') # Windows only |
| 221 |
env: |
| 222 |
CMAKE_PREFIX_PATH: ${VCPKG_INSTALLATION_ROOT}/installed/x86-windows |
| 223 |
run: | |
| 224 |
mkdir -p build/${RELEASE_TYPE} |
| 225 |
cd build |
| 226 |
echo $CMAKE_PREFIX_PATH |
| 227 |
cmake -DCMAKE_TOOLCHAIN_FILE=${WIN_TOOLCHAIN_FILE} -DVCPKG_TARGET_TRIPLET=x86-windows -DCMAKE_INSTALL_INCLUDEDIR=include -DCMAKE_BUILD_TYPE=${RELEASE_TYPE} -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF -DBUILD_TESTING=${BUILD_TESTING} -DBUILD_TOOLS=${BUILD_TOOLS} -DCHECK_EPSILON=ON -DBLA_VENDOR=${BLA_VENDOR} -DENABLE_BEM=${ENABLE_BEM} -DENABLE_GEOFLOW=${ENABLE_GEOFLOW} -DENABLE_iAPBS=${ENABLE_iAPBS} -DENABLE_PYGBE=${ENABLE_PYGBE} -DPYTHON_VERSION="${PYTHON_VERSION}" -DENABLE_INLINE=ON -DENABLE_PBAM=${ENABLE_PBAM} -DENABLE_PBSAM=${ENABLE_PBSAM} -DENABLE_PYTHON=${ENABLE_PYTHON} -DENABLE_TESTS=${ENABLE_TESTS} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -DENABLE_VERBOSE_DEBUG=OFF -DGET_NanoShaper=${GET_NanoShaper} -DFETK_VERSION=${FETK_VERSION} -G "Visual Studio 17 2022" -A Win32 .. |
| 228 |
cat CMakeCache.txt |
| 229 |
shell: bash |
| 230 |
|
| 231 |
- name: Configure and Build for Mac |
| 232 |
if: startsWith(matrix.os, 'macos') # Mac only |
| 233 |
env: |
| 234 |
INSTALL_DIR: "./" |
| 235 |
run: | |
| 236 |
./.build.sh |
| 237 |
|
| 238 |
- name: Configure and Build for Linux |
| 239 |
if: startsWith(matrix.os, 'ubuntu') # Linux only |
| 240 |
env: |
| 241 |
# https://codecov.io/gh/Electrostatics/apbs |
| 242 |
CODECOV_TOKEN: "e3a1e24c-5598-4f47-9353-7fa0ac57f98e" |
| 243 |
INSTALL_DIR: "./" |
| 244 |
run: | |
| 245 |
./.build.sh |
| 246 |
|
| 247 |
- name: Build on Windows |
| 248 |
if: startsWith(matrix.os, 'windows') # Windows only |
| 249 |
run: | |
| 250 |
cd build |
| 251 |
cmake --build . --config ${RELEASE_TYPE} --parallel 2 --target install |
| 252 |
shell: bash |
| 253 |
|
| 254 |
- name: Configure Pagefile on Windows |
| 255 |
if: startsWith(matrix.os, 'windows') # Windows only |
| 256 |
uses: al-cheb/[email protected] |
| 257 |
with: |
| 258 |
minimum-size: 8GB |
| 259 |
maximum-size: 16GB |
| 260 |
|
| 261 |
- name: Run tests |
| 262 |
# Path setting includes a windows-specific path, but this should just be ignored in linux/mac |
| 263 |
run: | |
| 264 |
cd build |
| 265 |
export PATH=$(pwd)/bin:/c/vcpkg/installed/x86-windows/bin:$PATH |
| 266 |
ctest -C ${RELEASE_TYPE} -VV --output-on-failure |
| 267 |
shell: bash |
| 268 |
|
| 269 |
# - name: Create package for Mac and Linux |
| 270 |
# if: matrix.create-package && startsWith(matrix.os, 'macos') || startswith(matrix.os, 'ubuntu') # Mac or Linux only |
| 271 |
# id: cpack-ml |
| 272 |
# run: | |
| 273 |
# cd build |
| 274 |
# cpack -C ${RELEASE_TYPE} -G ZIP |
| 275 |
# ZIP_CPACK_FILE=`ls APBS*.zip` |
| 276 |
# echo "ZIP_CPACK_FILE=${ZIP_CPACK_FILE}" >> $GITHUB_ENV |
| 277 |
# echo "PATH_TO_PACKAGE=build/" >> $GITHUB_ENV |
| 278 |
# echo ::set-output name=cpack-out-${{ matrix.platform }}-zip::${ZIP_CPACK_FILE} |
| 279 |
# echo "ZIP CPack file: $ZIP_CPACK_FILE" |
| 280 |
# unzip -l ${ZIP_CPACK_FILE} |
| 281 |
|
| 282 |
# - name: Create package for Windows |
| 283 |
# if: matrix.create-package && startsWith(matrix.os, 'windows') # Windows only |
| 284 |
# id: cpack-w |
| 285 |
# run: | |
| 286 |
# cd build |
| 287 |
# /c/Program\ Files/CMake/bin/cpack.exe -C ${RELEASE_TYPE} -G ZIP -V |
| 288 |
# ZIP_CPACK_FILE=`ls APBS*.zip` |
| 289 |
# echo "Repackaging with extra dlls" |
| 290 |
# mkdir unzip |
| 291 |
# cp $ZIP_CPACK_FILE unzip |
| 292 |
# cd unzip |
| 293 |
# 7z x $ZIP_CPACK_FILE |
| 294 |
# PACKAGE_DIR=${ZIP_CPACK_FILE%.*} |
| 295 |
# cp /c/vcpkg/installed/x86-windows/bin/{libumfpack.dll,libcholmod.dll,libamd.dll,openblas.dll,libcamd.dll,libcolamd.dll,libccolamd.dll,liblapack.dll,libgfortran-5.dll,libgcc_s_dw2-1.dll,libwinpthread-1.dll,libquadmath-0.dll} ./${PACKAGE_DIR}/bin |
| 296 |
# 7z a -r $ZIP_CPACK_FILE $PACKAGE_DIR/bin/*.dll |
| 297 |
# echo "ZIP_CPACK_FILE=${ZIP_CPACK_FILE}" >> $GITHUB_ENV |
| 298 |
# echo "PATH_TO_PACKAGE=build/unzip/" >> $GITHUB_ENV |
| 299 |
# echo ::set-output name=cpack-out-${{ matrix.platform }}-zip::${ZIP_CPACK_FILE} |
| 300 |
# echo "ZIP CPack file: $ZIP_CPACK_FILE" |
| 301 |
# unzip -l ${ZIP_CPACK_FILE} |
| 302 |
# shell: bash |
| 303 |
|
| 304 |
# - name: Upload ZIP package to the action |
| 305 |
# if: matrix.create-package |
| 306 |
# uses: actions/upload-artifact@v2 |
| 307 |
# with: |
| 308 |
# name: ${{ env.ZIP_CPACK_FILE }} |
| 309 |
# path: ${{ env.PATH_TO_PACKAGE }}${{ env.ZIP_CPACK_FILE }} |
| 310 |
# retention-days: 5 |
| 311 |
|
| 312 |
# For debugging |
| 313 |
# - name: Setup tmate session |
| 314 |
# if: startsWith(matrix.os, 'macos') || ! success() |
| 315 |
# if: startsWith(matrix.os, 'windows') || ! success() |
| 316 |
# if: ${{ ! success() }} |
| 317 |
# uses: mxschmitt/action-tmate@v3 |