Skip to content

Commit

Permalink
Rewrite of the build system and working docker image creation (#4)
Browse files Browse the repository at this point in the history
* feat: updated dockerfile with custom config

* fix: docker build order

* debug: remove direction of autodiff build output

* fix: seems like a few of the arch codes are too new for CUDA

* fix: seems like a few of the arch codes are too new for CUDA

* fix: use lto for build of dealii, use CUDA_ARCHITECTURES CMake flag

* fix: default arguments for docker arguments

* fix: scripts for external builds should be now callable from everywhere!

* fix: missing semicolons in update_DiFfRG.sh

* fix: updated rmm

* fix: rewrite part of the build system,so that paths are not linked to build directories.

* fix: Forgot to symlink external data directory

* feat: Complete rebuild of the build system. CPM is now used for most dependencies, which is much more reliable and re-locateable than the previous setup.

* feat: third-party licenses are automatically exported.
fix: tests were missing the catch2 setup

* fix: formatting of cmake files

* fix: deal.ii platform introspection configurable

* fix: remove unnecessary OpenMP dependency
fix: actually remove the platform introspection for deal.ii
fix: disable by default lto for deal.ii

* feat: add autoformatting target

* fix: some problems with cuda architectures

* fix: formatting
fix: problem with __device__ code in interpolators. fixed by moving them to the .hh file.

* fix: installation instructions

* fix: some more docker fixes

* fix: the docker setup fully works.

Signed-off-by: Franz R. Sattler <[email protected]>
  • Loading branch information
satfra authored Dec 31, 2024
1 parent 3387fe7 commit 38309b3
Show file tree
Hide file tree
Showing 110 changed files with 8,014 additions and 1,115 deletions.
27 changes: 3 additions & 24 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
[submodule "external/autodiff"]
path = external/autodiff
url = https://github.com/autodiff/autodiff.git
[submodule "external/sundials"]
path = external/sundials
url = https://github.com/LLNL/sundials.git
[submodule "external/Catch2"]
path = external/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "external/rapidcsv"]
path = external/rapidcsv
url = https://github.com/d99kris/rapidcsv.git
[submodule "external/kokkos"]
path = external/kokkos
url = https://github.com/kokkos/kokkos.git
[submodule "external/rmm"]
path = external/rmm
url = https://github.com/rapidsai/rmm.git
[submodule "external/dealii"]
path = external/dealii
url = https://github.com/dealii/dealii.git
[submodule "external/boost"]
path = external/boost
url = https://github.com/boostorg/boost.git
[submodule "external/spdlog"]
path = external/spdlog
url = https://github.com/gabime/spdlog.git
[submodule "external/eigen"]
path = external/eigen
url = https://gitlab.com/libeigen/eigen
[submodule "external/qmc"]
path = external/qmc
url = https://github.com/mppmu/qmc.git
[submodule "external/thread-pool"]
path = external/thread-pool
url = https://github.com/bshoshany/thread-pool.git
[submodule "external/doxygen-awesome-css"]
path = external/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
[submodule "external/oneTBB"]
path = external/oneTBB
url = https://github.com/uxlfoundation/oneTBB.git
47 changes: 46 additions & 1 deletion DiFfRG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ if(DiFfRG_BUILD_DOCUMENTATION AND DOXYGEN_FOUND)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/documentation
DESTINATION ${CMAKE_INSTALL_PREFIX}) # target directory
install(CODE "file(CREATE_LINK ${CMAKE_INSTALL_PREFIX}/documentation/html/index.html ${CMAKE_INSTALL_PREFIX}/Documentation.html SYMBOLIC)")
install(
CODE "file(CREATE_LINK ${CMAKE_INSTALL_PREFIX}/documentation/html/index.html ${CMAKE_INSTALL_PREFIX}/Documentation.html SYMBOLIC)"
)

elseif(DiFfRG_BUILD_DOCUMENTATION AND DOXYGEN_FOUND)
message("Doxygen needs to be installed to generate the doxygen documentation")
Expand Down Expand Up @@ -102,3 +104,46 @@ install(
"${CMAKE_CURRENT_BINARY_DIR}/DiFfRGConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/DiFfRGTargets.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/DiFfRG")

# ##############################################################################
# licenses
# ##############################################################################

set(CPM_PACKAGE_deal.II_SOURCE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/../external/dealii)
set(CPM_PACKAGE_sundials_SOURCE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/../external/sundials)
set(CPM_PACKAGE_boost_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../external/boost)

# Add CPMLicenses for disclaimers
cpmaddpackage(NAME CPMLicenses.cmake GITHUB_REPOSITORY
cpm-cmake/CPMLicenses.cmake VERSION 0.0.5)

message("deal.II source directory: ${deal.II_SOURCE_DIR}")

message("packages: ${CPM_PACKAGES};deal.II;sundials;boost")

cpm_licenses_create_disclaimer_target(
write-licenses "${CMAKE_CURRENT_SOURCE_DIR}/../third_party.txt"
"${CPM_PACKAGES};deal.II;sundials;boost")

# ##############################################################################
# other scripts
# ##############################################################################

cpmaddpackage("gh:StableCoder/cmake-scripts#24.04")

include(${cmake-scripts_SOURCE_DIR}/formatting.cmake)

file(GLOB_RECURSE headers CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/include/*.hh")
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/source/*.cc")
file(GLOB_RECURSE cuda_sources CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/source/*.cu")

clang_format(TARGET_NAME ${headers} ${sources} ${cuda_sources})

file(GLOB_RECURSE CMAKE_FILES CMakeLists.txt)

cmake_format(TARGET_NAME ${CMAKE_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/setup_build_system.cmake)
2 changes: 1 addition & 1 deletion DiFfRG/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ set(DiFfRG_CMAKE_DIR @CMAKE_INSTALL_PREFIX@/cmake)

set(DiFfRG_USE_CUDA @USE_CUDA@)

include(${CMAKE_CURRENT_LIST_DIR}/DiFfRGTargets.cmake)
include(${DiFfRG_CMAKE_DIR}/setup_build_system.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/DiFfRGTargets.cmake)
7 changes: 4 additions & 3 deletions DiFfRG/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
configure_file(setup_build_system.cmake ${CMAKE_CURRENT_BINARY_DIR}/setup_build_system.cmake COPYONLY)
install(FILES setup_build_system.cmake
DESTINATION "${CMAKE_INSTALL_PREFIX}/cmake")
configure_file(setup_build_system.cmake
${CMAKE_CURRENT_BINARY_DIR}/setup_build_system.cmake COPYONLY)
install(FILES setup_build_system.cmake CPM.cmake
DESTINATION "${CMAKE_INSTALL_PREFIX}/cmake")
Loading

0 comments on commit 38309b3

Please sign in to comment.