Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/Build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,25 @@ jobs:
strategy:
matrix:
fail-fast: [false]
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-20.04, macos-11, windows-2022, macos-12]
include:
- os: ubuntu-latest
- os: ubuntu-20.04
CMAKE_SYSTEM: Linux
PACKAGE_TYPE: tar.gz
BLA_VENDOR: OpenBLAS
- os: macos-latest
- os: macos-11
CMAKE_SYSTEM: Darwin
PACKAGE_TYPE: tar.gz
BLA_VENDOR: Apple
- os: windows-latest
- os: windows-2022
CMAKE_SYSTEM: win32
PACKAGE_TYPE: zip
BLA_VENDOR: OpenBLAS
WIN_DEPENDENCIES_RELEASE: v0.4.0
- os: macos-12
CMAKE_SYSTEM: Darwin
PACKAGE_TYPE: tar.gz
BLA_VENDOR: Apple

env:
# job-wide environment variables to use in `run` commands to avoid command-injection risks
Expand Down Expand Up @@ -96,7 +100,7 @@ jobs:
cd build
echo $CMAKE_PREFIX_PATH
echo "CREATE_PACKAGE: ${CREATE_PACKAGE}"
cmake -DCMAKE_BUILD_TYPE=Release -DBLA_VENDOR=${BLA_VENDOR} -DCREATE_PACKAGE=${CREATE_PACKAGE} -DVCPKG_TARGET_TRIPLET=x86-windows -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" -A Win32 ..
cmake -DCMAKE_BUILD_TYPE=Release -DBLA_VENDOR=${BLA_VENDOR} -DCREATE_PACKAGE=${CREATE_PACKAGE} -DVCPKG_TARGET_TRIPLET=x86-windows -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 17 2022" -A Win32 ..
shell: bash

- name: Build on Mac and Linux
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# FETK Changelog

## X.Y.Z

April 22, 2022

* CMake library targets keep track of the interface include directories
* PUNC looks for pre-installed SuperLU before building its own (non-static build only)
* Updated Visual Studio version used in the autmatic build to VS 17 (2022)

## 1.9.2

Jan 21, 2022
Expand Down
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apt-get update && \
libf2c2-dev \
libopenblas-serial-dev \
libsuitesparse-dev \
libsuperlu-dev \
&& \
mkdir /src

Expand All @@ -20,7 +21,8 @@ RUN apt-get update && \
FROM fetk_base

ARG CREATE_PACKAGE=FALSE
ENV CREATE_PACKAGE=${CREATE_PACKAGE}
ARG FETK_STATIC_BUILD=ON
ARG MAKEJOBS="-j"

COPY cmake /src/cmake
COPY gamer /src/gamer
Expand All @@ -34,6 +36,9 @@ RUN cd /src && \
export CC=gcc && \
mkdir build && \
cd build && \
cmake -DCREATE_PACKAGE=${CREATE_PACKAGE} .. && \
make install && \
cmake \
-DCREATE_PACKAGE:BOOL=${CREATE_PACKAGE} \
-DFETK_STATIC_BUILD:BOOL=${FETK_STATIC_BUILD} \
.. && \
make ${MAKEJOBS} install && \
if [ "${CREATE_PACKAGE,,}" = true ]; then cpack; fi
12 changes: 6 additions & 6 deletions gamer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ header_and_type_checks()
if(NOT TARGET maloc)
message(FATAL_ERROR "Maloc target not found")
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/base
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/psh
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/vsh
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/vsys
)
#include_directories(
# ${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/base
# ${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/psh
# ${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/vsh
# ${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/vsys
#)
list(APPEND GAMER_INT_LIBS maloc)


Expand Down
7 changes: 7 additions & 0 deletions gamer/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,12 @@ add_subdirectory(biom)
add_library(gamer ${SOURCES} ${EXTERNAL_HEADERS} ${INTERNAL_HEADERS})
target_link_libraries(gamer ${GAMER_EXT_LIBS} ${GAMER_INT_LIBS})

get_target_property( SOURCE_TREE_INCLUDE_DIRS gamer INCLUDE_DIRECTORIES )
target_include_directories( gamer
INTERFACE
"$<BUILD_INTERFACE:${SOURCE_TREE_INCLUDE_DIRS}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

install(FILES ${EXTERNAL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS gamer DESTINATION ${CMAKE_INSTALL_LIBDIR})
7 changes: 7 additions & 0 deletions maloc/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,12 @@ add_subdirectory(vsys)
add_library(maloc ${SOURCES} ${EXTERNAL_HEADERS} ${INTERNAL_HEADERS})
target_link_libraries(maloc ${MALOC_EXT_LIBS})

get_target_property( SOURCE_TREE_INCLUDE_DIRS maloc INCLUDE_DIRECTORIES )
target_include_directories( maloc
INTERFACE
"$<BUILD_INTERFACE:${SOURCE_TREE_INCLUDE_DIRS}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

install(FILES ${EXTERNAL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS maloc DESTINATION ${CMAKE_INSTALL_LIBDIR})
10 changes: 0 additions & 10 deletions mc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,12 @@ list(APPEND MC_EXT_LIBS
if(NOT TARGET maloc)
message(FATAL_ERROR "Maloc target not found")
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/base
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/psh
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/vsh
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/vsys
${CMAKE_CURRENT_SOURCE_DIR}/../punc/src/base
# ${CMAKE_CURRENT_SOURCE_DIR}/../punc/src/amd/punc # we need this because punc/umfpack.h has #include
)
list(APPEND MC_INT_LIBS maloc)

# punc library
if(NOT TARGET punc)
message(FATAL_ERROR "Punc target not found")
endif()
#include_directories(
#)
list(APPEND MC_INT_LIBS punc)


Expand Down
7 changes: 7 additions & 0 deletions mc/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,12 @@ add_subdirectory(mcsh)
add_library(mc ${SOURCES} ${EXTERNAL_HEADERS} ${INTERNAL_HEADERS})
target_link_libraries(mc ${MC_EXT_LIBS} ${MC_INT_LIBS})

get_target_property( SOURCE_TREE_INCLUDE_DIRS mc INCLUDE_DIRECTORIES )
target_include_directories( mc
INTERFACE
"$<BUILD_INTERFACE:${SOURCE_TREE_INCLUDE_DIRS}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

install(FILES ${EXTERNAL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS mc DESTINATION ${CMAKE_INSTALL_LIBDIR})
56 changes: 36 additions & 20 deletions punc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ header_and_type_checks()

# vf2c library
# We only build vf2c
set(BUILD_VF2C ON)
message(STATUS "Will build vf2c")
option(BUILD_VF2C "Flag to build VF2C" ON)
if(BUILD_VF2C)
message(STATUS "Will build vf2c")
endif()

# BLAS library
# We do not optionally build BLAS
Expand All @@ -63,36 +65,56 @@ else()
set( BLA_VENDOR OpenBLAS )
endif()
find_package( BLAS )
if(NOT BLAS_FOUND)
set(BUILD_BLAS ON)
message(STATUS "Will build BLAS")
else()
if(BLAS_FOUND)
set(BUILD_BLAS OFF)
message(STATUS "Will not build BLAS; using BLAS type ${BLA_VENDOR}")
### list(APPEND PUNC_EXT_LIBS ${AMD_LIBRARIES})
### list(APPEND PUNC_EXT_LIB_DIRS ${AMD_LIBDIR})
else()
option(BUILD_BLAS "Flag to build BLAS" ON)
endif()
if(BUILD_BLAS)
message(STATUS "Will build BLAS")
endif()

# SuperLU library
# We only build SuperLU from its git repo
set(BUILD_SUPERLU ON)
# At the moment, managed distributions of SuperLU include only the shared libraries.
# Note: checked on 4/20/22; including apt on Ubuntu and Home/Linuxbrew
# Therefore, we assume that we'll build SuperLU if we're not building shared libs.
if(NOT FETK_STATIC_BUILD)
find_package(SuperLU)
endif()
if(SuperLU_FOUND)
set(BUILD_SUPERLU OFF)
else()
option(BUILD_SUPERLU "Flag to build SuperLU" ON)
endif()
if(BUILD_SUPERLU)
message(STATUS "Will build SuperLU")
endif()

# ARPACK library
find_package( ARPACK )
if(NOT ARPACK_FOUND)
set(BUILD_ARPACK ON)
else()
set(BUILD_ARPACK OFF)
option(BUILD_ARPACK "Flag to build ARPACK" OFF)
### list(APPEND PUNC_EXT_LIBS ${ARPACK_LIBRARIES})
endif()
if(BUILD_ARPACK)
message(STATUS "Will build ARPACK")
endif()

# cgcode library
# Will always build cgcode
set(BUILD_CGCODE ON)
option(BUILD_CGCODE "Flag to build CGCODE" ON)
if(BUILD_CGCODE)
message(STATUS "Will build CGCODE")
endif()

# pmg library
# Will always build pmg
set(BUILD_PMG ON)
option(BUILD_PMG "Flag to build PMG" ON)
if(BUILD_PMG)
message(STATUS "Will build PMG")
endif()

################################################################################
# Ensure we have the MALOC library
Expand All @@ -102,12 +124,6 @@ set(BUILD_PMG ON)
if(NOT TARGET maloc)
message(FATAL_ERROR "Maloc target not found")
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/base
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/psh
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/vsh
${CMAKE_CURRENT_SOURCE_DIR}/../maloc/src/vsys
)
list(APPEND PUNC_INT_LIBS maloc)


Expand Down
25 changes: 20 additions & 5 deletions punc/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,39 @@ setup_for_build()
if(BUILD_VF2C)
include_directories(vf2c vf2c/punc)
add_subdirectory(vf2c)
list(APPEND PUNC_INT_LIBS vf2c)
endif()

# optional build of cgcode
if(BUILD_CGCODE)
include_directories(cgcode)
add_subdirectory(cgcode)
list(APPEND PUNC_INT_LIBS cgcode)
endif()

# optional build of pmg
if(BUILD_PMG)
include_directories(pmg)
add_subdirectory(pmg)
list(APPEND PUNC_INT_LIBS pmg)
endif()

# optional build of blas
if(BUILD_BLAS)
include_directories(blas)
add_subdirectory(blas)
list(APPEND PUNC_INT_LIBS blas)
else()
list(APPEND PUNC_EXT_LIBS ${BLAS_LIBRARIES})
endif()

# optional build of arpack
if(BUILD_ARPACK)
include_directories(arpack)
add_subdirectory(arpack)
list(APPEND PUNC_INT_LIBS arpack)
else()
list(APPEND PUNC_EXT_LIBS ${ARPACK_LIBRARIES})
endif()

# optional build of superlu (actual build takes place below)
Expand All @@ -50,6 +59,10 @@ if(BUILD_SUPERLU)
)
FetchContent_MakeAvailable( superlu )
include_directories(${superlu_SOURCE_DIR}/SRC)
list(APPEND PUNC_INT_LIBS superlu)
else()
include_directories(${SUPERLU_INCLUDES})
list(APPEND PUNC_EXT_LIBS ${SUPERLU_LIBRARIES})
endif()


Expand All @@ -59,6 +72,7 @@ endif()

include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/base)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config/punccf.h.in
Expand All @@ -79,13 +93,14 @@ if(${SOURCES})
message(FATAL_ERROR "The SOURCES variable should be empty because the PUNC build is currently setup to create an interface library. If there are actual PUNC sources, this library should be made into an actual library")
endif()

#add_library(punc INTERFACE)
add_library(punc ${SOURCES} ${EXTERNAL_HEADERS} ${INTERNAL_HEADERS})
target_link_libraries(punc ${PUNC_EXT_LIBS} ${PUNC_INT_LIBS})
target_include_directories(punc PUBLIC
$<BUILD_INTERFACE:${superlu_SOURCE_DIR}/SRC>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/punc

get_target_property( SOURCE_TREE_INCLUDE_DIRS punc INCLUDE_DIRECTORIES )
target_include_directories( punc
INTERFACE
"$<BUILD_INTERFACE:${SOURCE_TREE_INCLUDE_DIRS}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

install(FILES ${EXTERNAL_HEADERS} ${INTERNAL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
Expand Down