From f24dd7629a41e253287bbb643589cd2afb776484 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Fri, 29 Apr 2022 11:53:08 -0700 Subject: [PATCH] New release: v3.4.1 (#232) * Fixed syntax errors in checking for max python version (#208) * Fixed syntax errors in checking for max python version * Switch OS specification to absolute versions and reduce places where those are specified * Update Windows config to Visual Studio 17 2022 * skip ci -- Updated releases.rst with update info * [skip ci] Added release note Co-authored-by: Noah Oblath * Change OS specification in build workflow (#210) * Switch OS specification to absolute versions and reduce places where those are specified * Update Windows config to Visual Studio 17 2022 * skip ci -- Updated releases.rst with update info Co-authored-by: Noah Oblath Co-authored-by: Darren Curtis * Nsoblath/issue 212 (#217) * Turn off debugging steps * Only install python in Windows for "Test Usage" job, as we'll be statically linking Python in Mac and Linux. * Search for static python libs in linux and mac when doing a static build * Turn on tmate to check library linking * Find threads explicitly * Tmate only on failure * Verbose build for debugging * Added two more missing libraries: libdl and libutil * Enable tmate for the mac use-test job * Test with Python 3.10 * Test with Python 3.10 revealed we needed libintl. So that's added now. Should be mac-specific * Can't include_directories() on an empty variable * Typo fix * Find Iconv * Add linking of APBS to CoreFoundation framework under macOS * Remove debugging * Removing some of the debugging tools used in testing the build. * Switch back to the standard build with Python 3.9 * Removed last tmate debugging * [skip ci] Document changes Co-authored-by: Noah Oblath * Nsoblath/issue 222 (#223) * First committed version of Dockerfile.centos * Add alt config workflow * Alt config build: test docker builds * In Dockerfile, specify APBS_STATIC_BUILD instead of BUILD_SHARED_LIBS * Missing backslash found * Fixing bugs in both Dockerfiles * Dockerfile bug fixing * Complete missing pieces of ensuring a position-independent-code build * Minor fixes * Switch to a shared-library build in the Ubuntu Docker build * Rename Dockerfile --> Dockerfile.ubuntu * Override APBS_STATIC_BUILD when needed Co-authored-by: Noah Oblath * Remove all mention of ENABLE_FETK (#225) Co-authored-by: Noah Oblath * Nsoblath/issue 226: FETK update (#227) * Address missing linkages * Cleanup FETK import * Multithreaded build in docker now controlled by a build argument * Install superlu as a dependency in the Ubuntu docker build * Update the FETK version in use by the automatic builds (still on a development branch) * Add in debugging tmate session for mac * Manually build arpack to get the static lib (which seems to have disappeared?) * Remove -j flags * Set fortran compiler for arpack build * Engaging brain, fixing mac-build commands * Comment out tmate session * Update the FETK commit to be the main branch, pre-release * Update the changelog * Updated default FETK build to commit v1.9.3 (57195e) Co-authored-by: Noah Oblath * Nsoblath/new issue 207: Addressing python version test (#229) * Fix python test max-version test in apbs/CMakeLists.txt * Turn on the alternate non-docker builds, with updates from the main build * Fixing the python max version test in apbs/tests/CMakeLists.txt * Fixing the python max version test in apbs/tools/python/CMakeLists.txt * Test commit: remove python-max-version definition * Simplify the Python search by looking for an exact version * Add a default PYTHON_VERSION * Adapt the various files involved in building APBS to the new Python version setup * Didn't setup the python version correctly in the GHA builds Co-authored-by: Noah Oblath * Updated installation documentation (#231) Co-authored-by: Noah Oblath * Updated license, version, and release info for pending release Co-authored-by: Noah Oblath Co-authored-by: Darren Curtis --- .build.sh | 10 +- .github/workflows/build-alt-config.yaml | 317 ++++++++++++++++++++++++ .github/workflows/build.yaml | 72 +++--- CMakeLists.txt | 58 +++-- Dockerfile.centos | 112 +++++++++ Dockerfile => Dockerfile.ubuntu | 38 +-- LICENSE.md | 2 +- VERSION | 2 +- cmake/ImportFETK.cmake | 43 +--- contrib/iapbs/src/CMakeLists.txt | 3 +- docs/getting/index.rst | 19 +- docs/getting/source.rst | 13 +- docs/releases.rst | 39 +++ src/.config/apbscfg.h.in | 3 - src/CMakeLists.txt | 12 +- src/apbs.h | 6 +- src/routines.c | 9 +- tests/CMakeLists.txt | 10 +- tools/manip/CMakeLists.txt | 14 +- tools/mesh/CMakeLists.txt | 14 +- tools/python/CMakeLists.txt | 10 +- 21 files changed, 617 insertions(+), 189 deletions(-) create mode 100644 .github/workflows/build-alt-config.yaml create mode 100644 Dockerfile.centos rename Dockerfile => Dockerfile.ubuntu (70%) diff --git a/.build.sh b/.build.sh index 98c6a238..a8c56549 100755 --- a/.build.sh +++ b/.build.sh @@ -51,8 +51,7 @@ echo "Install dir: ${INSTALL_DIR}" : ${ENABLE_PYGBE:=ON} : ${ENABLE_BEM:=ON} : ${ENABLE_GEOFLOW:=ON} -: ${ENABLE_FETK:=ON} -: ${FETK_VERSION:="857a0cf6ae40410471ea10f0e67e370cbd8ed6a3"} +: ${FETK_VERSION:="57195e55351e04ce6ee0ef56a143c996a9aee7e2"} : ${ENABLE_iAPBS:=ON} : ${ENABLE_OPENMP:=OFF} : ${ENABLE_PBAM:=OFF} @@ -60,8 +59,7 @@ echo "Install dir: ${INSTALL_DIR}" : ${ENABLE_PYTHON:=OFF} : ${ENABLE_TESTS:=ON} : ${GET_NanoShaper:=ON} -: ${PYTHON_MIN_VERSION:="3.9"} -: ${PYTHON_MAX_VERSION:="3.10"} +: ${PYTHON_VERSION:="3.9"} echo "==================================== WHERE AM I ==================================== " pwd @@ -134,7 +132,6 @@ cmake -S .. -B $BUILD_DIR \ -DENABLE_PYGBE=${ENABLE_PYGBE} \ -DENABLE_BEM=${ENABLE_BEM} \ -DENABLE_GEOFLOW=${ENABLE_GEOFLOW} \ - -DENABLE_FETK=${ENABLE_FETK} \ -DENABLE_iAPBS=${ENABLE_iAPBS} \ -DENABLE_OPENMP=${ENABLE_OPENMP} \ -DENABLE_PBAM=${ENABLE_PBAM} \ @@ -142,8 +139,7 @@ cmake -S .. -B $BUILD_DIR \ -DENABLE_PYTHON=${ENABLE_PYBIND} \ -DENABLE_TESTS=${ENABLE_TESTS} \ -DFETK_VERSION="${FETK_VERSION}" \ - -DPYTHON_MIN_VERSION="${PYTHON_MIN_VERSION}" \ - -DPYTHON_MAX_VERSION="${PYTHON_MAX_VERSION}" \ + -DPYTHON_VERSION="${PYTHON_VERSION}" \ .. || exit 1 echo "==================================== BUILD =============================================== " diff --git a/.github/workflows/build-alt-config.yaml b/.github/workflows/build-alt-config.yaml new file mode 100644 index 00000000..8404d971 --- /dev/null +++ b/.github/workflows/build-alt-config.yaml @@ -0,0 +1,317 @@ +--- +name: Build APBS with an Alternate Configuration + +on: + #push: + # branches: [main] + # tags: ['*'] + pull_request: + + workflow_dispatch: + + +env: + WIN_DEPENDENCIES_RELEASE: "v0.4.0" + WIN_TOOLCHAIN_FILE: '/c/vcpkg/scripts/buildsystems/vcpkg.cmake' + APBS_STATIC_BUILD: ON + BLA_VENDOR: OpenBLAS + BUILD_DOC: ON + BUILD_TOOLS: ON + RELEASE_TYPE: Release + ENABLE_PYGBE: ON + ENABLE_BEM: ON + ENABLE_GEOFLOW: ON +# FETK_VERSION: "1.9.2" + FETK_VERSION: 57195e55351e04ce6ee0ef56a143c996a9aee7e2 + ENABLE_iAPBS: ON + ENABLE_OPENMP: OFF + ENABLE_PBAM: OFF + ENABLE_PBSAM: OFF + ENABLE_PYTHON: OFF + ENABLE_TESTS: ON + GET_NanoShaper: ON + PYTHON_VERSION: "3.9" + +jobs: + + build-docker: + name: Build and Test Docker Images + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - dockerfile: Dockerfile.ubuntu + apbs-static-build: OFF + python-version: "3.9" + - dockerfile: Dockerfile.centos + apbs-static-build: ON + python-version: "3.6" + + env: + # Override default environment variables with matrix values + DOCKERFILE: ${{ matrix.dockerfile }} + APBS_STATIC_BUILD: ${{ matrix.apbs-static-build }} + PYTHON_VERSION: ${{ matrix.python-version }} + + steps: + + - name: Checkout the repo + uses: actions/checkout@master + with: + submodules: recursive + + - name: Build and run + run: | + docker build \ + -f ${DOCKERFILE} \ + --build-arg APBS_STATIC_BUILD=${APBS_STATIC_BUILD} \ + --build-arg BLA_VENDOR=${BLA_VENDOR} \ + --build-arg BUILD_DOC=${BUILD_DOC} \ + --build-arg BUILD_TOOLS=${BUILD_TOOLS} \ + --build-arg RELEASE_TYPE=${RELEASE_TYPE} \ + --build-arg ENABLE_PYGBE=${ENABLE_PYGBE} \ + --build-arg ENABLE_BEM=${ENABLE_BEM} \ + --build-arg ENABLE_GEOFLOW=${ENABLE_GEOFLOW} \ + --build-arg FETK_VERSION=${FETK_VERSION} \ + --build-arg ENABLE_iAPBS=${ENABLE_iAPBS} \ + --build-arg ENABLE_OPENMP=${ENABLE_OPENMP} \ + --build-arg ENABLE_PBAM=${ENABLE_PBAM} \ + --build-arg ENABLE_PBSAM=${ENABLE_PBSAM} \ + --build-arg ENABLE_PYTHON=${ENABLE_PYTHON} \ + --build-arg ENABLE_TESTS=${ENABLE_TESTS} \ + --build-arg GET_NanoShaper=${GET_NanoShaper} \ + --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ + . + ctest -C ${RELEASE_TYPE} -VV --output-on-failure + + build: + name: Compile Code + + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + platform: [ubuntu, macOS, windows] + openmp: [OFF] + static-build: [ON] + python-version: ["3.9"] + include: + - platform: ubuntu + os: ubuntu-20.04 + bla-vendor: OpenBLAS + architecture: x64 + - platform: macos + os: macos-11 + bla-vendor: Apple + architecture: x64 + - platform: windows + os: windows-2022 + bla-vendor: OpenBLAS + architecture: x86 + + env: + BLA_VENDOR: ${{ matrix.bla-vendor }} + ENABLE_OPENMP: ${{ matrix.openmp }} + APBS_STATIC_BUILD: ${{matrix.static-build }} + PYTHON_VERSION: "${{ matrix.python-version }}" + + outputs: + apbs-version: ${{ steps.extract-version.outputs.apbs-version }} + apbs-tag: ${{ steps.extract-version.outputs.apbs-tag }} + cpack-out-lin-zip: ${{ steps.cpack-ml.outputs.cpack-out-ubuntu-zip }} + cpack-out-mac-zip: ${{ steps.cpack-ml.outputs.cpack-out-macos-zip }} + cpack-out-win-zip: ${{ steps.cpack-w.outputs.cpack-out-windows-zip }} + + steps: + + - name: Add msbuild to PATH + if: startsWith(matrix.os, 'windows') # Windows only + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Checkout reposistory + uses: actions/checkout@master + with: + submodules: recursive + + - name: Extract version + run: | + version="$(grep -E '^[0-9]+_[0-9]+_[0-9]+' VERSION | sed 's/_/./g')" + echo $version + echo ::set-output name=apbs-version::${version} + echo ::set-output name=apbs-tag::v${version} + shell: bash + id: extract-version + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.architecture }} + + - name: Mac Prereqs + if: startsWith(matrix.os, 'macos') # Mac only + run: | + brew install \ + wget \ + bison \ + flex \ + swig \ + boost \ + eigen \ + lapack \ + suite-sparse + wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz + gunzip metis-5.1.0.tar.gz + tar -xf metis-5.1.0.tar + cd metis-5.1.0 + make config prefix=/usr/local + make install + cd .. + git clone https://github.com/opencollab/arpack-ng.git + cd arpack-ng + git fetch --all --tags + git checkout tags/3.8.0 -b latest + mkdir build && cd build + cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DCMAKE_Fortran_COMPILER=$(which gfortran-11) -DEXAMPLES=OFF -DMPI=OFF -DBUILD_SHARED_LIBS=OFF .. + make install +# brew upgrade gcc@9 + + - name: Linux Prereqs and Remove broken apt repos [Ubuntu] + if: startsWith(matrix.os, 'ubuntu') # Linux only + run: | + for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done + sudo apt-get install -yq \ + software-properties-common \ + build-essential \ + wget \ + bison \ + flex \ + swig \ + libreadline-dev \ + libeigen3-dev \ + libboost-dev \ + libopenblas-serial-dev \ + libarpack2-dev \ + liblapack-dev \ + libsuitesparse-dev + wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz + gunzip metis-5.1.0.tar.gz + tar -xf metis-5.1.0.tar + cd metis-5.1.0 + make config prefix=/usr/local + sudo make install + + - name: Install Window dependencies + if: startsWith(matrix.os, 'windows') # Windows only + run: | + choco install wget + wget https://github.com/Electrostatics/cache/releases/download/${WIN_DEPENDENCIES_RELEASE}/apbs_dependencies_vcpkg.zip + 7z x apbs_dependencies_vcpkg.zip -aoa -o/c/vcpkg + ls /c/vcpkg + vcpkg integrate install + vcpkg list --triplet x86-windows + shell: bash + + - name: Configure for Windows + if: startsWith(matrix.os, 'windows') # Windows only + env: + CMAKE_PREFIX_PATH: ${VCPKG_INSTALLATION_ROOT}/installed/x86-windows + run: | + mkdir -p build/${RELEASE_TYPE} + cd build + echo $CMAKE_PREFIX_PATH + 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 .. + cat CMakeCache.txt + shell: bash + + - name: Configure and Build for Mac + if: startsWith(matrix.os, 'macos') # Mac only + env: + INSTALL_DIR: "./" + run: | + ./.build.sh + + - name: Configure and Build for Linux + if: startsWith(matrix.os, 'ubuntu') # Linux only + env: + # https://codecov.io/gh/Electrostatics/apbs + CODECOV_TOKEN: "e3a1e24c-5598-4f47-9353-7fa0ac57f98e" + INSTALL_DIR: "./" + run: | + ./.build.sh + + - name: Build on Windows + if: startsWith(matrix.os, 'windows') # Windows only + run: | + cd build + cmake --build . --config ${RELEASE_TYPE} --parallel 2 --target install + shell: bash + + - name: Configure Pagefile on Windows + if: startsWith(matrix.os, 'windows') # Windows only + uses: al-cheb/configure-pagefile-action@v1.2 + with: + minimum-size: 8GB + maximum-size: 16GB + + - name: Run tests + # Path setting includes a windows-specific path, but this should just be ignored in linux/mac + run: | + cd build + export PATH=$(pwd)/bin:/c/vcpkg/installed/x86-windows/bin:$PATH + ctest -C ${RELEASE_TYPE} -VV --output-on-failure + shell: bash + +# - name: Create package for Mac and Linux +# if: matrix.create-package && startsWith(matrix.os, 'macos') || startswith(matrix.os, 'ubuntu') # Mac or Linux only +# id: cpack-ml +# run: | +# cd build +# cpack -C ${RELEASE_TYPE} -G ZIP +# ZIP_CPACK_FILE=`ls APBS*.zip` +# echo "ZIP_CPACK_FILE=${ZIP_CPACK_FILE}" >> $GITHUB_ENV +# echo "PATH_TO_PACKAGE=build/" >> $GITHUB_ENV +# echo ::set-output name=cpack-out-${{ matrix.platform }}-zip::${ZIP_CPACK_FILE} +# echo "ZIP CPack file: $ZIP_CPACK_FILE" +# unzip -l ${ZIP_CPACK_FILE} + +# - name: Create package for Windows +# if: matrix.create-package && startsWith(matrix.os, 'windows') # Windows only +# id: cpack-w +# run: | +# cd build +# /c/Program\ Files/CMake/bin/cpack.exe -C ${RELEASE_TYPE} -G ZIP -V +# ZIP_CPACK_FILE=`ls APBS*.zip` +# echo "Repackaging with extra dlls" +# mkdir unzip +# cp $ZIP_CPACK_FILE unzip +# cd unzip +# 7z x $ZIP_CPACK_FILE +# PACKAGE_DIR=${ZIP_CPACK_FILE%.*} +# 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 +# 7z a -r $ZIP_CPACK_FILE $PACKAGE_DIR/bin/*.dll +# echo "ZIP_CPACK_FILE=${ZIP_CPACK_FILE}" >> $GITHUB_ENV +# echo "PATH_TO_PACKAGE=build/unzip/" >> $GITHUB_ENV +# echo ::set-output name=cpack-out-${{ matrix.platform }}-zip::${ZIP_CPACK_FILE} +# echo "ZIP CPack file: $ZIP_CPACK_FILE" +# unzip -l ${ZIP_CPACK_FILE} +# shell: bash + +# - name: Upload ZIP package to the action +# if: matrix.create-package +# uses: actions/upload-artifact@v2 +# with: +# name: ${{ env.ZIP_CPACK_FILE }} +# path: ${{ env.PATH_TO_PACKAGE }}${{ env.ZIP_CPACK_FILE }} +# retention-days: 5 + +# For debugging +# - name: Setup tmate session +# if: startsWith(matrix.os, 'macos') || ! success() +# if: startsWith(matrix.os, 'windows') || ! success() +# if: ${{ ! success() }} +# uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8550c2e4..2e9e2081 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,9 +19,8 @@ env: ENABLE_PYGBE: ON ENABLE_BEM: ON ENABLE_GEOFLOW: ON - ENABLE_FETK: ON # FETK_VERSION: "1.9.2" - FETK_VERSION: 857a0cf6ae40410471ea10f0e67e370cbd8ed6a3 + FETK_VERSION: 57195e55351e04ce6ee0ef56a143c996a9aee7e2 ENABLE_iAPBS: ON ENABLE_PBAM: OFF ENABLE_PBSAM: OFF @@ -41,43 +40,39 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macOS-latest, windows-latest] + platform: [ubuntu, macOS, windows] openmp: [OFF] static-build: [ON] - python-min-version: ["3.9"] + python-version: ["3.9"] include: - - os: ubuntu-latest + - platform: ubuntu + os: ubuntu-20.04 bla-vendor: OpenBLAS create-package: true - python-min-version: "3.9" - python-max-version: "3.10" architecture: x64 - - os: macos-latest + - platform: macos + os: macos-11 bla-vendor: Apple create-package: true - python-min-version: "3.9" - python-max-version: "3.10" architecture: x64 - - os: windows-latest + - platform: windows + os: windows-2022 bla-vendor: OpenBLAS create-package: true - python-min-version: "3.9" - python-max-version: "3.10" architecture: x86 env: BLA_VENDOR: ${{ matrix.bla-vendor }} ENABLE_OPENMP: ${{ matrix.openmp }} APBS_STATIC_BUILD: ${{matrix.static-build }} - PYTHON_MIN_VERSION: "${{ matrix.python-min-version }}" - PYTHON_MAX_VERSION: "${{ matrix.python-max-version }}" + PYTHON_VERSION: "${{ matrix.python-version }}" outputs: apbs-version: ${{ steps.extract-version.outputs.apbs-version }} apbs-tag: ${{ steps.extract-version.outputs.apbs-tag }} - cpack-out-lin-zip: ${{ steps.cpack-ml.outputs.cpack-out-ubuntu-latest-zip }} - cpack-out-mac-zip: ${{ steps.cpack-ml.outputs.cpack-out-macos-latest-zip }} - cpack-out-win-zip: ${{ steps.cpack-w.outputs.cpack-out-windows-latest-zip }} + cpack-out-lin-zip: ${{ steps.cpack-ml.outputs.cpack-out-ubuntu-zip }} + cpack-out-mac-zip: ${{ steps.cpack-ml.outputs.cpack-out-macos-zip }} + cpack-out-win-zip: ${{ steps.cpack-w.outputs.cpack-out-windows-zip }} steps: @@ -102,7 +97,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python-min-version }} + python-version: ${{ matrix.python-version }} architecture: ${{ matrix.architecture }} - name: Mac Prereqs @@ -115,7 +110,6 @@ jobs: swig \ boost \ eigen \ - arpack \ lapack \ suite-sparse wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz @@ -124,6 +118,14 @@ jobs: cd metis-5.1.0 make config prefix=/usr/local make install + cd .. + git clone https://github.com/opencollab/arpack-ng.git + cd arpack-ng + git fetch --all --tags + git checkout tags/3.8.0 -b latest + mkdir build && cd build + cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DCMAKE_Fortran_COMPILER=$(which gfortran-11) -DEXAMPLES=OFF -DMPI=OFF -DBUILD_SHARED_LIBS=OFF .. + make install # brew upgrade gcc@9 - name: Linux Prereqs and Remove broken apt repos [Ubuntu] @@ -170,7 +172,7 @@ jobs: mkdir -p build/${RELEASE_TYPE} cd build echo $CMAKE_PREFIX_PATH - 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_FETK=${ENABLE_FETK} -DENABLE_BEM=${ENABLE_BEM} -DENABLE_GEOFLOW=${ENABLE_GEOFLOW} -DENABLE_iAPBS=${ENABLE_iAPBS} -DENABLE_PYGBE=${ENABLE_PYGBE} -DPYTHON_MIN_VERSION="${PYTHON_MIN_VERSION}" -DPYTHON_MAX_VERSION="${PYTHON_MAX_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 16 2019" -A Win32 .. + 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 .. cat CMakeCache.txt shell: bash @@ -221,7 +223,7 @@ jobs: ZIP_CPACK_FILE=`ls APBS*.zip` echo "ZIP_CPACK_FILE=${ZIP_CPACK_FILE}" >> $GITHUB_ENV echo "PATH_TO_PACKAGE=build/" >> $GITHUB_ENV - echo ::set-output name=cpack-out-${{ matrix.os }}-zip::${ZIP_CPACK_FILE} + echo ::set-output name=cpack-out-${{ matrix.platform }}-zip::${ZIP_CPACK_FILE} echo "ZIP CPack file: $ZIP_CPACK_FILE" unzip -l ${ZIP_CPACK_FILE} @@ -242,7 +244,7 @@ jobs: 7z a -r $ZIP_CPACK_FILE $PACKAGE_DIR/bin/*.dll echo "ZIP_CPACK_FILE=${ZIP_CPACK_FILE}" >> $GITHUB_ENV echo "PATH_TO_PACKAGE=build/unzip/" >> $GITHUB_ENV - echo ::set-output name=cpack-out-${{ matrix.os }}-zip::${ZIP_CPACK_FILE} + echo ::set-output name=cpack-out-${{ matrix.platform }}-zip::${ZIP_CPACK_FILE} echo "ZIP CPack file: $ZIP_CPACK_FILE" unzip -l ${ZIP_CPACK_FILE} shell: bash @@ -256,10 +258,11 @@ jobs: retention-days: 5 # For debugging - - name: Setup tmate session +# - name: Setup tmate session +# if: startsWith(matrix.os, 'macos') || ! success() # if: startsWith(matrix.os, 'windows') || ! success() - if: ${{ ! success() }} - uses: mxschmitt/action-tmate@v3 +# if: ${{ ! success() }} +# uses: mxschmitt/action-tmate@v3 test: @@ -273,24 +276,25 @@ jobs: fail-fast: false matrix: cpack: [lin-zip, mac-zip, win-zip] - python-version: [3.9] + python-version: ["3.9"] include: - cpack: lin-zip - os: ubuntu-latest + os: ubuntu-20.04 package_file: ${{ needs.build.outputs.cpack-out-lin-zip }} architecture: x64 - cpack: mac-zip - os: macOS-latest + os: macOS-11 package_file: ${{ needs.build.outputs.cpack-out-mac-zip }} architecture: x64 - cpack: win-zip - os: windows-latest + os: windows-2022 package_file: ${{ needs.build.outputs.cpack-out-win-zip }} architecture: x86 steps: - name: Set up Python + if: startsWith(matrix.os, 'windows') # Windows only (no static python libs in windows) uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} @@ -349,10 +353,10 @@ jobs: shell: bash # For debugging - - name: Setup tmate session - if: ${{ ! success() }} -# if: startsWith(matrix.os, 'windows') - uses: mxschmitt/action-tmate@v3 +# - name: Setup tmate session +# if: ${{ ! success() }} +# if: startsWith(matrix.os, 'macOS') +# uses: mxschmitt/action-tmate@v3 release: diff --git a/CMakeLists.txt b/CMakeLists.txt index fea850b4..46a0a500 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ cmake_policy(SET CMP0042 NEW) # MacOS RPATH on by default cmake_policy(SET CMP0048 NEW) # project() command manages the VERSION variables cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted cmake_policy(SET CMP0077 NEW) # option() honors normal variables (i.e. does nothing if a normal variable with the same name exists) +cmake_policy(SET CMP0083 NEW) # Pass flags needed for position-independent executables cmake_policy(SET CMP0091 NEW) # MSVC runtime library flags are selected by an abstraction (i.e. CMAKE_MSVC_RUNTIME_LIBRARY) set(CMAKE_MACOSX_RPATH 1) @@ -91,6 +92,8 @@ set(TOOLS_PATH ${APBS_BUILD}/tools) set(APBS_LIBS) set(APBS_LIB_DIRS) +set(PYTHON_VERSION 3.6 CACHE STRING "Python version to be used (or compatible)") # Python 3.6 is the lowest version tested so far + find_file(CONTRIB_PATH "contrib" PATHS "${APBS_ROOT}" DOC "The path to contributed modules for apbs") @@ -123,6 +126,7 @@ if(APBS_STATIC_BUILD) else() list(PREPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) endif() + set(Python3_USE_STATIC_LIBS TRUE) else() set(FETK_STATIC_BUILD OFF) set(BLA_STATIC OFF) @@ -139,6 +143,7 @@ else() else() list(PREPEND CMAKE_FIND_LIBRARY_SUFFIXES .so) endif() + set(Python3_USE_STATIC_LIBS FALSE) endif() message(STATUS "") @@ -161,7 +166,7 @@ message(STATUS "") # FETK is currently required, and therefore this option is disabled #option(ENABLE_FETK "Enable the finite element solver" ON) -set(FETK_VERSION "857a0cf6ae40410471ea10f0e67e370cbd8ed6a3" CACHE STRING "Version of FETK to use") +set(FETK_VERSION "57195e55351e04ce6ee0ef56a143c996a9aee7e2" CACHE STRING "Version of FETK to use") include(ImportFETK) import_fetk(${FETK_VERSION}) @@ -335,9 +340,28 @@ endif() ################################################################################ if(NOT WIN32) find_library(MATH_LIBRARY "m") - list(APPEND APBS_LIBS m stdc++) + find_package(Intl REQUIRED) + find_package(Iconv REQUIRED) + list(APPEND APBS_LIBS + util + dl + m + stdc++ + ${Intl_LIBRARIES} + ${Iconv_LIBRARIES} + ) + set(MORE_INCLUDE_DIRS + ${Intl_INCLUDE_DIRS} + ${Iconv_INCLUDE_DIRS} + ) + if(MORE_INCLUDE_DIRS) + include_directories(${MORE_INCLUDE_DIRS}) + endif() endif() +find_package( Threads REQUIRED ) +list(APPEND APBS_LIBS ${CMAKE_THREAD_LIBS_INIT}) + find_package( UMFPACK REQUIRED ) find_package( SuiteSparse REQUIRED ) message(STATUS "UMFPack libraries: ${UMFPACK_LIBRARIES}") @@ -362,27 +386,9 @@ option(ENABLE_PYGBE "Boundary element method using PYGBE" OFF) if(ENABLE_PYGBE) message(STATUS "Building PYGBE") add_definitions(-DENABLE_PYGBE) - if(PYTHON_MAX_VERSION) - message(STATUS "**evaluates TRUE**") - else() - message(STATUS "**evaluates FALSE") - endif() - message(STATUS "cmake version: ${CMAKE_VERSION}") - if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19") - message(STATUS " version >= 3.19") - else() - message(STATUS " version < 3.19") - endif() #set (Python3_FIND_ABI "OFF" "ANY" "ANY") - if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19" AND PYTHON_MAX_VERSION) - find_package(Python3 ${PYTHON_MIN_VERSION}...<${PYTHON_MAX_VERSION} REQUIRED COMPONENTS Interpreter Development) - else() - find_package(Python3 ${PYTHON_MIN_VERSION} REQUIRED COMPONENTS Interpreter Development) - if(PYTHON_MAX_VERSION AND ${Python3_VERSION} VERSION_GREATER_EQUAL ${PYTHON_MAX_VERSION}) - set(Python3_FOUND FALSE) - message(FATAL_ERROR "Python version ${Python3_VERSION} is too high; maximum is ${PYTHON_MAX_VERSION}") - endif() - endif() + find_package(Python3 ${PYTHON_VERSION} EXACT REQUIRED COMPONENTS Interpreter Development) + message(STATUS "******** PYTHON3_VERSION ${Python3_VERSION}") message(STATUS "******** PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS}") message(STATUS "******** PYTHON_LIBRARIES ${Python3_LIBRARIES}") include_directories(${Python3_INCLUDE_DIRS}) @@ -421,8 +427,6 @@ if(ENABLE_BEM) ) FetchContent_MakeAvailable( tabi ) - list(APPEND APBS_LIB_DIRS "${tabi_BINARY_DIR}/lib") - list(APPEND APBS_LIBS TABIPBlib) include_directories(${tabi_SOURCE_DIR}/src) include_directories(${tabi_SOURCE_DIR}/src/tabipb_wrap) add_definitions(-DTABIPB_APBS) @@ -461,6 +465,7 @@ if(ENABLE_BEM) set(TABIPB_LIBNAME TABIPBlib) add_library(${TABIPB_LIBNAME} ${TABIPB_LIBFILES}) + target_link_libraries(${TABIPB_LIBNAME} ${APBS_LIBS}) target_compile_features(${TABIPB_LIBNAME} PRIVATE cxx_std_11) target_compile_options(${TABIPB_LIBNAME} PRIVATE $<$:-O3> @@ -468,7 +473,10 @@ if(ENABLE_BEM) $<$:-O0 -Wall>) install(FILES ${TABIPB_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tabi COMPONENT headers) install(TARGETS ${TABIPB_LIBNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) - + + list(APPEND APBS_LIB_DIRS "${tabi_BINARY_DIR}/lib") + list(APPEND APBS_LIBS TABIPBlib) + endif() # ENABLE_BEM diff --git a/Dockerfile.centos b/Dockerfile.centos new file mode 100644 index 00000000..fccf0f7b --- /dev/null +++ b/Dockerfile.centos @@ -0,0 +1,112 @@ +# CentOS-based Docker build +########################### + +## Notes ## + +# SCL is needed for devtoolset, so we can have a more advanced GCC than v4.8.5. +# GCC 4.8.5 was unable to compile: +# - GoogleTest +# - Some C99 for-loop convention used in routines.c + +# Note that because SCL's devtoolset is used: +# - LD_LIBRARY_PATH is set to only include devtoolset paths; if you install APBS in e.g. /usr/local, +# then you'll need to add /usr/local/lib64 and /usr/local/lib to LD_LIBRARY_PATH *after* the current contents: +# > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64:/usr/local/lib + +# Note that this build is rather sensitive to the Python3 version +# In particular, the include directory and library are explicitly specified and version dependent. + +FROM centos:7 AS apbs_base_centos + +RUN yum -y install \ + epel-release \ + centos-release-scl && \ + yum-config-manager --enable rhel-server-rhscl-7-rpms && \ + yum -y install devtoolset-11 && \ + source scl_source enable devtoolset-11 && \ + yum -y install \ + unzip \ + cmake3 \ + git \ + wget \ + arpack-devel \ + arpack-static \ + f2c \ + eigen3-devel \ + boost-devel \ + python3-pip \ + python3-devel \ + openblas-serial64 \ + openblas-static \ + openblas-devel \ + lapack64-devel \ + lapack64-static \ + suitesparse-devel \ + suitesparse-static \ + && \ + ln -s /usr/bin/cmake3 /usr/local/bin/cmake && \ + wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz && \ + gunzip metis-5.1.0.tar.gz && \ + tar -xf metis-5.1.0.tar && \ + cd metis-5.1.0 && \ + make config prefix=/usr/local && \ + make install && \ + /bin/true + + +######################################### + +FROM apbs_base_centos + +ADD . /tmp_source + +ARG BLA_VENDOR="OpenBLAS" +ARG BUILD_DOC=ON +ARG APBS_STATIC_BUILD=ON +ARG BUILD_TOOLS=ON +ARG INSTALL_DIR=/usr/local +ARG RELEASE_TYPE=Debug +ARG ENABLE_PYGBE=ON +ARG ENABLE_BEM=ON +ARG ENABLE_GEOFLOW=ON +#ARG FETK_VERSION="1.9.1" +ARG FETK_VERSION=57195e55351e04ce6ee0ef56a143c996a9aee7e2 +ARG ENABLE_iAPBS=ON +ARG ENABLE_OPENMP=OFF +ARG ENABLE_PBAM=OFF +ARG ENABLE_PBSAM=OFF +ARG ENABLE_PYTHON=OFF +ARG ENABLE_TESTS=ON +ARG GET_NanoShaper=ON +ARG PYTHON_VERSION="3.6" +ARG PYTHON3_INCLUDE_DIR="/usr/include/python3.6m" +ARG PYTHON3_LIBRARY="/usr/lib64/libpython3.6m.so" +ARG MAKEJOBS="-j" + +RUN source scl_source enable devtoolset-11 && \ + cd /tmp_source && \ + mkdir build && cd build && \ + cmake \ + -DCMAKE_INSTALL_INCLUDEDIR="include" \ + -DBUILD_DOC=${BUILD_DOC} \ + -DAPBS_STATIC_BUILD=${APBS_STATIC_BUILD} \ + -DBUILD_TOOLS=O${BUILD_TOOLS} \ + -DCMAKE_BUILD_TYPE=$RELEASE_TYPE \ + -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \ + -DENABLE_PYGBE=${ENABLE_PYGBE} \ + -DENABLE_BEM=${ENABLE_BEM} \ + -DENABLE_iAPBS=${ENABLE_iAPBS} \ + -DENABLE_GEOFLOW=${ENABLE_GEOFLOW} \ + -DENABLE_OPENMP=${ENABLE_OPENMP} \ + -DENABLE_PBAM=${ENABLE_PBAM} \ + -DENABLE_PBSAM=${ENABLE_PBSAM} \ + -DENABLE_PYTHON=${ENABLE_PYTHON} \ + -DENABLE_TESTS=${ENABLE_TESTS} \ + -DFETK_VERSION=${FETK_VERSION} \ + -DGET_NanoShaper=${GET_NanoShaper} \ + -DPYTHON_VERSION="${PYTHON_VERSION}" \ + -DPython3_INCLUDE_DIR=${PYTHON3_INCLUDE_DIR} \ + -DPython3_LIBRARY=${PYTHON3_LIBRARY} \ + .. && \ + make ${MAKEJOBS} install && \ + /bin/true diff --git a/Dockerfile b/Dockerfile.ubuntu similarity index 70% rename from Dockerfile rename to Dockerfile.ubuntu index ddd74782..7d93a2f1 100644 --- a/Dockerfile +++ b/Dockerfile.ubuntu @@ -1,4 +1,14 @@ -FROM ubuntu:20.04 AS apbs_base +# Ubuntu-based Docker build +########################### + +## Notes ## + +# Attempting to do a static build of APBS has previously failed in this Docker image. +# Errors were seen while linking `apbs` having to do with position-independent code. +# This is possibly due to the flags used to build the static Python library. +# Therefore this file defaults to using a shared build (i.e. `APBS_STATIC_BUILD=OFF`). + +FROM ubuntu:20.04 AS apbs_base_ubuntu RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ @@ -13,11 +23,12 @@ RUN apt-get update && \ libf2c2-dev \ libeigen3-dev \ libboost-dev \ - python3-dev \ + python3.9-dev \ python3-pip \ libopenblas-serial-dev \ liblapack-dev \ libsuitesparse-dev \ + libsuperlu-dev \ && \ wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz && \ gunzip metis-5.1.0.tar.gz && \ @@ -30,22 +41,21 @@ RUN apt-get update && \ ######################################### -FROM apbs_base +FROM apbs_base_ubuntu ADD . /tmp_source +ARG APBS_STATIC_BUILD=OFF ARG BLA_VENDOR="OpenBLAS" ARG BUILD_DOC=ON -ARG BUILD_SHARED_LIBS=OFF ARG BUILD_TOOLS=ON ARG INSTALL_DIR=/usr/local ARG RELEASE_TYPE=Debug ARG ENABLE_PYGBE=ON ARG ENABLE_BEM=ON ARG ENABLE_GEOFLOW=ON -ARG ENABLE_FETK=ON #ARG FETK_VERSION="1.9.1" -ARG FETK_VERSION=857a0cf6ae40410471ea10f0e67e370cbd8ed6a3 +ARG FETK_VERSION=57195e55351e04ce6ee0ef56a143c996a9aee7e2 ARG ENABLE_iAPBS=ON ARG ENABLE_OPENMP=OFF ARG ENABLE_PBAM=OFF @@ -53,15 +63,15 @@ ARG ENABLE_PBSAM=OFF ARG ENABLE_PYTHON=OFF ARG ENABLE_TESTS=ON ARG GET_NanoShaper=ON -ARG PYTHON_MIN_VERSION="3.9" -ARG PYTHON_MAX_VERSION="3.10" +ARG PYTHON_VERSION="3.9" +ARG MAKEJOBS="-j" RUN cd /tmp_source && \ mkdir build && cd build && \ cmake \ -DCMAKE_INSTALL_INCLUDEDIR="include" \ -DBUILD_DOC=${BUILD_DOC} \ - -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} \ + -DAPBS_STATIC_BUILD=${APBS_STATIC_BUILD} \ -DBUILD_TOOLS=O${BUILD_TOOLS} \ -DCMAKE_BUILD_TYPE=$RELEASE_TYPE \ -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \ @@ -69,7 +79,6 @@ RUN cd /tmp_source && \ -DENABLE_BEM=${ENABLE_BEM} \ -DENABLE_iAPBS=${ENABLE_iAPBS} \ -DENABLE_GEOFLOW=${ENABLE_GEOFLOW} \ - -DENABLE_FETK=${ENABLE_FETK} \ -DENABLE_OPENMP=${ENABLE_OPENMP} \ -DENABLE_PBAM=${ENABLE_PBAM} \ -DENABLE_PBSAM=${ENABLE_PBSAM} \ @@ -77,12 +86,7 @@ RUN cd /tmp_source && \ -DENABLE_TESTS=${ENABLE_TESTS} \ -DFETK_VERSION=${FETK_VERSION} \ -DGET_NanoShaper=${GET_NanoShaper} \ - -DPYTHON_MIN_VERSION="${PYTHON_MIN_VERSION}" \ - -DPYTHON_MAX_VERSION="${PYTHON_MAX_VERSION}" \ + -DPYTHON_VERSION="${PYTHON_VERSION}" \ .. && \ - make -j install && \ + make ${MAKEJOBS} install && \ /bin/true - -#RUN cd /tmp_source && \ -# ./.build.sh && \ -# /bin/true diff --git a/LICENSE.md b/LICENSE.md index de18fbb4..ca48a7b8 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -5,7 +5,7 @@ APBS -- Adaptive Poisson-Boltzmann Solver Additional contributing authors listed in the code documentation. -Copyright (c) 2010-2020 Battelle Memorial Institute. +Copyright (c) 2010-2022 Battelle Memorial Institute. Developed at the Pacific Northwest National Laboratory, operated by Battelle Memorial Institute, Pacific Northwest Division for the U.S. Department of Energy. Portions Copyright (c) 2002-2010, Washington University in St. Louis. diff --git a/VERSION b/VERSION index 40cdafd8..5e281ccd 100644 --- a/VERSION +++ b/VERSION @@ -10,4 +10,4 @@ # The third number is the Micro number of the release # - Only increment the Micro number when: # - Fixing bugs, adding tests, changing packaging -3_4_0 +3_4_1 diff --git a/cmake/ImportFETK.cmake b/cmake/ImportFETK.cmake index 904bff36..0d2caba5 100644 --- a/cmake/ImportFETK.cmake +++ b/cmake/ImportFETK.cmake @@ -37,6 +37,9 @@ macro(import_fetk FETK_IMPORT_VERSION) else() + # PMG is turned off because of some missing symbols: dc_vec__, dc_scal__, rand_, c_vec__, tsecnd_, and c_scal__ + set(BUILD_PMG OFF) + message(STATUS "Building FETK from commit ${FETK_IMPORT_VERSION}") FetchContent_Declare( fetk GIT_REPOSITORY https://github.com/Electrostatics/FETK.git @@ -45,52 +48,14 @@ macro(import_fetk FETK_IMPORT_VERSION) FetchContent_MakeAvailable( fetk ) list(APPEND CMAKE_MODULE_PATH ${fetk_SOURCE_DIR}/cmake) - include_directories( - ${fetk_SOURCE_DIR}/maloc/src/base - ${fetk_SOURCE_DIR}/maloc/src/psh - ${fetk_SOURCE_DIR}/maloc/src/vsh - ${fetk_SOURCE_DIR}/maloc/src/vsys - ${fetk_SOURCE_DIR}/mc/src/aprx - ${fetk_SOURCE_DIR}/mc/src/bam - ${fetk_SOURCE_DIR}/mc/src/base - ${fetk_SOURCE_DIR}/mc/src/dyn - ${fetk_SOURCE_DIR}/mc/src/gem - ${fetk_SOURCE_DIR}/mc/src/mcsh - ${fetk_SOURCE_DIR}/mc/src/nam - ${fetk_SOURCE_DIR}/mc/src/pde - ${fetk_SOURCE_DIR}/mc/src/whb - ${fetk_SOURCE_DIR}/punc/src/base - ) endif() + # Only need to link to mc because mc depends on the others list(APPEND APBS_LIBS - maloc - punc mc - gamer - superlu - vf2c ) - # find_package( BLAS REQUIRED ) - # find_package( UMFPACK REQUIRED ) - # list(APPEND APBS_LIBS - # ${UMFPACK_LIBRARIES} - # ${BLAS_LIBRARIES} - # ) - - # find_package( SuperLU ) - # if(SuperLU_FOUND) - # # include from find_package variables - # list(APPEND APBS_LIBS - # ${SUPERLU_LIBRARIES} - # ) - # else() - # # library built with FETK - # list(APPEND APBS_LIBS superlu) - # endif() - SET(HAVE_MC 1) SET(HAVE_PUNC 1) SET(HAVE_GAMER 1) diff --git a/contrib/iapbs/src/CMakeLists.txt b/contrib/iapbs/src/CMakeLists.txt index 9446a6ac..94ae0713 100644 --- a/contrib/iapbs/src/CMakeLists.txt +++ b/contrib/iapbs/src/CMakeLists.txt @@ -7,7 +7,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${APBS_ROOT}/src) LINK_DIRECTORIES(${APBS_ROOT_PATH}/lib) #ADD_LIBRARY(iapbs SHARED apbs_driver.c apbs_driver.h) -ADD_LIBRARY(iapbs STATIC apbs_driver.c apbs_driver.h) +ADD_LIBRARY(iapbs apbs_driver.c apbs_driver.h) +target_link_libraries(iapbs ${APBS_LIBS} ${APBS_INTERNAL_LIBS}) option(BUILD_iAPBS_FORTRAN_WRAPPER "Optionally build iAPBS Fortran wrapper" OFF) if(BUILD_iAPBS_FORTRAN_WRAPPER) diff --git a/docs/getting/index.rst b/docs/getting/index.rst index 9b284aa8..f80825a2 100644 --- a/docs/getting/index.rst +++ b/docs/getting/index.rst @@ -30,10 +30,17 @@ The best way to install APBS is via download of a pre-compiled binary from `GitH Requirements ^^^^^^^^^^^^ -The pre-compiled binaries include nearly all dependencies, so the only requirement is Python: +The pre-compiled binaries include nearly all dependencies. There are a few items to be aware of: -* All platforms - * Python 3 (tested with 3.9) +* Windows + * Python 3.9 + +* Linux + * Ubuntu or compatible flavor of Linux + * Compatible glibc + * Binaries were built with Ubuntu 20.04 with glibc version 2.31 + * Binaries have been tested *successfully* under Ubuntu 20.04, 21.10, and 22.04 + * Binaries have been tested *unsuccessfully* under Ubuntu 18.04 .. caution:: @@ -85,9 +92,9 @@ Current platform support | OS | PYTHON | GEOFLOW | BEM, | FETK | PBSAM | PBAM | PYTHON | SHARED_LIBS | | | VERSION | | NanoShaper | | | | SUPPORT | | +============+=========+=========+============+======+=======+======+=========+=============+ -| Ubuntu | 3.9 | Yes | Yes | Yes | Yes | Yes | Yes | No | +| Ubuntu | 3.9 | Yes | Yes | Yes | No | No | Yes | No | +------------+---------+---------+------------+------+-------+------+---------+-------------+ -| MacOSX | 3.9 | Yes | Yes | Yes | Yes | Yes | Yes | No | +| MacOSX | 3.9 | Yes | Yes | Yes | No | No | Yes | No | +------------+---------+---------+------------+------+-------+------+---------+-------------+ -| Windows 10 | 3.9 | Yes | Yes | Yes | Yes | Yes | No | No | +| Windows 10 | 3.9 | Yes | Yes | Yes | No | No | Yes | No | +------------+---------+---------+------------+------+-------+------+---------+-------------+ diff --git a/docs/getting/source.rst b/docs/getting/source.rst index bd6ce45a..ba4e1534 100644 --- a/docs/getting/source.rst +++ b/docs/getting/source.rst @@ -7,7 +7,7 @@ How to build APBS from source These instructions assume that you have downloaded the source code from `GitHub releases`_. -.. caution:: We do not recommend cloning directly from the head of the master branch because it is typically under development and could be unstable. Unless you really know what you are doing, we advise you to skip the next step. +.. caution:: We do not recommend cloning directly from the head of the `main` branch because it is typically under development and could be unstable. Unless you really know what you are doing, we advise you to skip the next step. ------------------------------- Get source directly from Github @@ -81,7 +81,7 @@ If you want to use the Poisson-Boltzmann Analytical Method developed by the Tere .. warning:: - PB-AM currently runs on OS X or Linux only. + PB-AM is not currently fully integrated with APBS and its use is not recommended. .. code:: bash @@ -130,7 +130,7 @@ That variable will be set to a working default if not manually set. .. code:: bash cd $APBS_BUILD_DIR - cmake -DENABLE_FETK_=ON -DFETK_VERSION=v1.9.2 + cmake -DFETK_VERSION=v1.9.2 For advanced users, you can use a version of FETK other than a released version by setting ``FETK_VERSION`` to the desired git commit hash instead of a version number: @@ -138,7 +138,7 @@ to the desired git commit hash instead of a version number: .. code:: bash cd $APBS_BUILD_DIR - cmake -DENABLE_FETK=ON -DFETK_VERSION=[git hash] + cmake -DFETK_VERSION=[git hash] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -194,11 +194,10 @@ Building the code - advanced -DCMAKE_BUILD_TYPE=$RELEASE_TYPE \ -DENABLE_GEOFLOW=ON \ -DENABLE_BEM=ON \ - -DENABLE_FETK=ON \ -DFETK_VERSION=[version] \ -DENABLE_OPENMP=ON \ - -DENABLE_PBAM=ON \ - -DENABLE_PBSAM=ON \ + -DENABLE_PBAM=OFF \ + -DENABLE_PBSAM=OFF \ -DENABLE_PYTHON=ON \ -DENABLE_TESTS=ON \ -DBUILD_SHARED_LIBS=ON \ diff --git a/docs/releases.rst b/docs/releases.rst index e7f29c5e..a076a59a 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -3,6 +3,45 @@ Release history =============== +--------------------- +APBS 3.4.1 (Apr 2022) +--------------------- + +* Binary releases may be found in `GitHub releases `_. + +^^^^^^^^^^^^^^^^^^^^^^^^^^ +Known Bugs and Limitations +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* Automated build is only single threaded +* pb_solvers has been disabled; requires further development for full integration +* Support for the PYGBE solver is minimal so far; user needs to install PYGBE (e.g. via `pip install pygbe`) + +^^^^^^^^^^^^^ +Minor Updates +^^^^^^^^^^^^^ + +* Updated Windows build to Windows 2022; Visual Studio updated to v17, 2022 +* Specified Ubuntu build (20.04) and Mac build (11) +* Fixed CMake syntax error around Python detection +* Statically link Python in the Mac and Ubuntu builds +* Build arpack manually in the Mac build to get the static library +* Updated FETK to v1.9.3 +* Updated installation documentation +* Added a CentOS Dockerfile; updated the Ubuntu Dockerfile + +^^^^^ +Notes +^^^^^ + +* The following are included in APBS: + + * `Geometric Flow `_ + * `FETk `_ + * `PBAM/PBSAM `_ + * `TABI-PB `_ + + --------------------- APBS 3.4.0 (Jan 2022) --------------------- diff --git a/src/.config/apbscfg.h.in b/src/.config/apbscfg.h.in index af3f4fe9..d4ebe396 100644 --- a/src/.config/apbscfg.h.in +++ b/src/.config/apbscfg.h.in @@ -40,9 +40,6 @@ -// FEtk components is enabled -#cmakedefine ENABLE_FETK - // have FEtk component PUNC #cmakedefine HAVE_PUNC diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 16e1222f..e471022f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,9 +47,7 @@ add_subdirectory(generic) add_subdirectory(pmgc) add_subdirectory(mg) -if(ENABLE_FETK) - add_subdirectory(fem) -endif(ENABLE_FETK) +add_subdirectory(fem) if(ENABLE_GEOFLOW) # add_items(SOURCES geoflow_wrap_apbs.c) @@ -57,7 +55,7 @@ if(ENABLE_GEOFLOW) endif(ENABLE_GEOFLOW) add_items(SOURCES routines.c) -add_sublibrary(routines ${APBS_INTERNAL_LIBS}) +add_sublibrary(routines ${APBS_LIBS} ${APBS_INTERNAL_LIBS}) message(STATUS "External Headers: ${EXTERNAL_HEADERS}") @@ -68,9 +66,15 @@ message(STATUS "APBS Libraries: ${APBS_LIBS}") message(STATUS "Internal Libraries: ${APBS_INTERNAL_LIBS}") message(STATUS " ") +# Use position-independent code for apbs +set_property(TARGET apbs PROPERTY POSITION_INDEPENDENT_CODE TRUE) + #add_dependencies(apbs ${BEM_LIB}) #target_include_directories(apbs PRIVATE apbs.h routines.h) target_link_libraries(apbs ${APBS_LIBS} ${APBS_INTERNAL_LIBS}) +if(APPLE) + target_link_libraries(apbs "-framework CoreFoundation") +endif() #add_dependencies(apbs ${APBS_LIBS} ${APBS_INTERNAL_LIBS} ${APBS_LIBS}) diff --git a/src/apbs.h b/src/apbs.h index 9a08912a..9ed08360 100644 --- a/src/apbs.h +++ b/src/apbs.h @@ -94,9 +94,7 @@ #include "mg/vpmgp.h" /* FEM headers */ -#if defined(ENABLE_FETK) - #include "fem/vfetk.h" - #include "fem/vpee.h" -#endif +#include "fem/vfetk.h" +#include "fem/vpee.h" #endif /* _APBSHEADERS_H_ */ diff --git a/src/routines.c b/src/routines.c index 7ec93b77..4a1f0d57 100644 --- a/src/routines.c +++ b/src/routines.c @@ -6129,14 +6129,7 @@ VPUBLIC void dump_options() puts("0"); #endif - printf("ENABLE_FETK:"); -#ifdef ENABLE_FETK - printf("1"); -#else - puts("0"); -#endif - - printf("HAVE_PUNC:"); + printf("HAVE_PUNC:"); #ifdef HAVE_PUNC puts("1"); #else diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b084b9ab..9a03b97f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,15 +3,7 @@ enable_testing() message(STATUS "******* TESTING ADDED *****************") #set (Python3_FIND_ABI "OFF" "ANY" "ANY") -if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19" AND DEFINED ${PYTHON_MAX_VERSION}) - find_package(Python3 ${PYTHON_MIN_VERSION}...<${PYTHON_MAX_VERSION} REQUIRED COMPONENTS Interpreter) -else() - find_package(Python3 ${PYTHON_MIN_VERSION} REQUIRED COMPONENTS Interpreter) - if(DEFINED ${PYTHON_MAX_VERSION} AND ${Python3_VERSION} VERSION_GREATER_EQUAL ${PYTHON_MAX_VERSION}) - set(Python3_FOUND FALSE) - message(FATAL_ERROR "Python version ${Python3_VERSION} is too high; maximum is ${PYTHON_MAX_VERSION}") - endif() -endif() +find_package(Python3 ${PYTHON_VERSION} EXACT REQUIRED COMPONENTS Interpreter) set(APBS_BINARY "apbs") if(CMAKE_HOST_WIN32) diff --git a/tools/manip/CMakeLists.txt b/tools/manip/CMakeLists.txt index 4825d91b..c70f31a6 100644 --- a/tools/manip/CMakeLists.txt +++ b/tools/manip/CMakeLists.txt @@ -1,12 +1,12 @@ message(STATUS "Building manip") -set(LIBS "") -list(APPEND LIBS "apbs_generic") -list(APPEND LIBS "apbs_mg") -list(APPEND LIBS "apbs_pmgc") -if(ENABLE_FETK) - list(APPEND LIBS "apbs_fem") -endif(ENABLE_FETK) +set( LIBS + apbs_generic + apbs_mg + apbs_pmgc + apbs_fem + apbs_routines +) message(STATUS "libraries: ${LIBS}") diff --git a/tools/mesh/CMakeLists.txt b/tools/mesh/CMakeLists.txt index 056c9981..241428c1 100644 --- a/tools/mesh/CMakeLists.txt +++ b/tools/mesh/CMakeLists.txt @@ -1,12 +1,12 @@ message(STATUS "Building mesh") -set(LIBS "") -list(APPEND LIBS "apbs_generic") -list(APPEND LIBS "apbs_mg") -list(APPEND LIBS "apbs_pmgc") -if(ENABLE_FETK) - list(APPEND LIBS "apbs_fem") -endif(ENABLE_FETK) +set( LIBS + apbs_generic + apbs_mg + apbs_pmgc + apbs_fem + apbs_routines +) message(STATUS "libraries: ${LIBS}") diff --git a/tools/python/CMakeLists.txt b/tools/python/CMakeLists.txt index be3f6743..85dddea5 100644 --- a/tools/python/CMakeLists.txt +++ b/tools/python/CMakeLists.txt @@ -9,15 +9,7 @@ INCLUDE(${SWIG_USE_FILE}) set(CMAKE_FIND_FRAMEWORK NEVER) #set (Python3_FIND_ABI "OFF" "ANY" "ANY") -if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19" AND DEFINED ${PYTHON_MAX_VERSION}) - find_package(Python3 ${PYTHON_MIN_VERSION}...<${PYTHON_MAX_VERSION} REQUIRED COMPONENTS Interpreter Development) -else() - find_package(Python3 ${PYTHON_MIN_VERSION} REQUIRED COMPONENTS Interpreter Development) - if(DEFINED ${PYTHON_MAX_VERSION} AND ${Python3_VERSION} VERSION_GREATER_EQUAL ${PYTHON_MAX_VERSION}) - set(Python3_FOUND FALSE) - message(FATAL_ERROR "Python version ${Python3_VERSION} is too high; maximum is ${PYTHON_MAX_VERSION}") - endif() -endif() +find_package(Python3 ${PYTHON_VERSION} EXACT REQUIRED COMPONENTS Interpreter Development) INCLUDE_DIRECTORIES(${Python3_INCLUDE_DIRS}) message(STATUS "***** Python3 include path is: ${Python3_INCLUDE_DIRS}")