Skip to content

Commit

Permalink
Nsoblath/issue 226: FETK update (#227)
Browse files Browse the repository at this point in the history
* 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 <noah.oblath@pnnl.gov>
  • Loading branch information
nsoblath and Noah Oblath authored Apr 28, 2022
1 parent 4afec7c commit 2eb1b96
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ echo "Install dir: ${INSTALL_DIR}"
: ${ENABLE_PYGBE:=ON}
: ${ENABLE_BEM:=ON}
: ${ENABLE_GEOFLOW:=ON}
: ${FETK_VERSION:="857a0cf6ae40410471ea10f0e67e370cbd8ed6a3"}
: ${FETK_VERSION:="57195e55351e04ce6ee0ef56a143c996a9aee7e2"}
: ${ENABLE_iAPBS:=ON}
: ${ENABLE_OPENMP:=OFF}
: ${ENABLE_PBAM:=OFF}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-alt-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
ENABLE_BEM: ON
ENABLE_GEOFLOW: ON
# FETK_VERSION: "1.9.2"
FETK_VERSION: 857a0cf6ae40410471ea10f0e67e370cbd8ed6a3
FETK_VERSION: 57195e55351e04ce6ee0ef56a143c996a9aee7e2
ENABLE_iAPBS: ON
ENABLE_OPENMP: OFF
ENABLE_PBAM: OFF
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
ENABLE_BEM: ON
ENABLE_GEOFLOW: ON
# FETK_VERSION: "1.9.2"
FETK_VERSION: 857a0cf6ae40410471ea10f0e67e370cbd8ed6a3
FETK_VERSION: 57195e55351e04ce6ee0ef56a143c996a9aee7e2
ENABLE_iAPBS: ON
ENABLE_PBAM: OFF
ENABLE_PBSAM: OFF
Expand Down Expand Up @@ -117,7 +117,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
Expand All @@ -126,6 +125,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]
Expand Down Expand Up @@ -259,6 +266,7 @@ jobs:

# 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
Expand Down
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,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})

Expand Down Expand Up @@ -443,8 +443,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)
Expand Down Expand Up @@ -483,14 +481,18 @@ 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
$<$<CONFIG:RELEASE>:-O3>
$<$<CONFIG:RELWITHDEBINFO>:-O3>
$<$<CONFIG:DEBUG>:-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


Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.centos
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ARG ENABLE_PYGBE=ON
ARG ENABLE_BEM=ON
ARG ENABLE_GEOFLOW=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
Expand All @@ -82,6 +82,7 @@ ARG PYTHON_MIN_VERSION="3.6"
ARG PYTHON_MAX_VERSION="3.7"
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 && \
Expand Down Expand Up @@ -109,5 +110,5 @@ RUN source scl_source enable devtoolset-11 && \
-DPython3_INCLUDE_DIR=${PYTHON3_INCLUDE_DIR} \
-DPython3_LIBRARY=${PYTHON3_LIBRARY} \
.. && \
make -j install && \
make ${MAKEJOBS} install && \
/bin/true
6 changes: 4 additions & 2 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RUN apt-get update && \
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 && \
Expand All @@ -54,7 +55,7 @@ ARG ENABLE_PYGBE=ON
ARG ENABLE_BEM=ON
ARG ENABLE_GEOFLOW=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
Expand All @@ -64,6 +65,7 @@ ARG ENABLE_TESTS=ON
ARG GET_NanoShaper=ON
ARG PYTHON_MIN_VERSION="3.9"
ARG PYTHON_MAX_VERSION="3.10"
ARG MAKEJOBS="-j"

RUN cd /tmp_source && \
mkdir build && cd build && \
Expand All @@ -88,5 +90,5 @@ RUN cd /tmp_source && \
-DPYTHON_MIN_VERSION="${PYTHON_MIN_VERSION}" \
-DPYTHON_MAX_VERSION="${PYTHON_MAX_VERSION}" \
.. && \
make -j install && \
make ${MAKEJOBS} install && \
/bin/true
43 changes: 4 additions & 39 deletions cmake/ImportFETK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion contrib/iapbs/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Minor Updates
* 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

^^^^^
Notes
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,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}")

Expand Down
12 changes: 7 additions & 5 deletions tools/manip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
message(STATUS "Building manip")

set(LIBS "")
list(APPEND LIBS "apbs_generic")
list(APPEND LIBS "apbs_mg")
list(APPEND LIBS "apbs_pmgc")
list(APPEND LIBS "apbs_fem")
set( LIBS
apbs_generic
apbs_mg
apbs_pmgc
apbs_fem
apbs_routines
)

message(STATUS "libraries: ${LIBS}")

Expand Down
12 changes: 7 additions & 5 deletions tools/mesh/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
message(STATUS "Building mesh")

set(LIBS "")
list(APPEND LIBS "apbs_generic")
list(APPEND LIBS "apbs_mg")
list(APPEND LIBS "apbs_pmgc")
list(APPEND LIBS "apbs_fem")
set( LIBS
apbs_generic
apbs_mg
apbs_pmgc
apbs_fem
apbs_routines
)

message(STATUS "libraries: ${LIBS}")

Expand Down

0 comments on commit 2eb1b96

Please sign in to comment.