Skip to content

Commit

Permalink
fix: This should fix a handful of problems with installation.
Browse files Browse the repository at this point in the history
Signed-off-by: Franz R. Sattler <[email protected]>
  • Loading branch information
Franz R. Sattler committed Jan 8, 2025
1 parent b72a23a commit 26b5ced
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 29 deletions.
2 changes: 1 addition & 1 deletion DiFfRG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ clang_format(format ${headers} ${sources} ${cuda_sources})
file(GLOB_RECURSE CMAKE_FILES CMakeLists.txt)

cmake_format(cmake-format ${CMAKE_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/setup_build_system.cmake)
${CMAKE_CURRENT_SOURCE_DIR}/cmake/setup_build_system.cmake)
25 changes: 15 additions & 10 deletions DiFfRG/cmake/setup_build_system.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,21 @@ if(USE_CUDA)

endif()

cpmaddpackage(
NAME
spdlog
GITHUB_REPOSITORY
gabime/spdlog
VERSION
1.14.1
OPTIONS
"CMAKE_BUILD_TYPE Release"
"CMAKE_CXX_FLAGS \"-O3 -DNDEBUG\"")
if(NOT spdlog_ADDED)
cpmaddpackage(
NAME
spdlog
GITHUB_REPOSITORY
gabime/spdlog
VERSION
1.14.1
OPTIONS
"CMAKE_BUILD_TYPE Release")
if(spdlog_ADDED)
install(TARGETS spdlog
EXPORT DiFfRGTargets)
endif()
endif()

# ##############################################################################
# Helper functions
Expand Down
2 changes: 1 addition & 1 deletion DiFfRG/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ set_property(TARGET DiFfRG PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)

include(GNUInstallDirs)
install(
TARGETS DiFfRG spdlog
TARGETS DiFfRG
EXPORT DiFfRGTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ if [[ ${install_dir} != "n" ]] && [[ ${install_dir} != "N" ]]; then

# Make sure the install directory is absolute
idir=$(expandPath ${install_dir}/)
idir=$(readlink --canonicalize ${idir})
#idir=$(readlink --canonicalize ${idir})
echo "DiFfRG library will be installed in ${idir}"

# Check if the install directory is writable
Expand Down
4 changes: 2 additions & 2 deletions external/build_boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ fi
echo $COMPILER
cd $SOURCE_PATH

./bootstrap.sh --prefix=${INSTALL_PATH}
./b2 --build-dir=${BUILD_PATH} \
$SuperUser ./bootstrap.sh --prefix=${INSTALL_PATH}
$SuperUser ./b2 --build-dir=${BUILD_PATH} \
--prefix=${INSTALL_PATH} \
--with-headers \
--with-iostreams \
Expand Down
2 changes: 1 addition & 1 deletion external/build_dealii.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ cmake -DCMAKE_BUILD_TYPE=DebugRelease \
2>&1 | tee $CMAKE_LOG_FILE

make -j $THREADS 2>&1 | tee $MAKE_LOG_FILE
make -j $THREADS install
$SuperUser make -j $THREADS install
18 changes: 9 additions & 9 deletions external/build_kokkos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ source $SCRIPT_PATH/build_scripts/setup_folders.sh

cd $BUILD_PATH

#-DKokkos_ARCH_NATIVE=ON \
#-DKokkos_ARCH_NATIVE=ON \
cmake -DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=OFF \
-DKokkos_ENABLE_CUDA=OFF \
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${EXE_LINKER_FLAGS}" \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \
-S ${SOURCE_PATH} \
2>&1 | tee $CMAKE_LOG_FILE
-DKokkos_ENABLE_OPENMP=OFF \
-DKokkos_ENABLE_CUDA=OFF \
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${EXE_LINKER_FLAGS}" \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \
-S ${SOURCE_PATH} \
2>&1 | tee $CMAKE_LOG_FILE

make -j $THREADS 2>&1 | tee $MAKE_LOG_FILE
make -j $THREADS install
$SuperUser make -j $THREADS install
2 changes: 1 addition & 1 deletion external/build_oneTBB.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ cmake -DCMAKE_BUILD_TYPE=Release \
2>&1 | tee $CMAKE_LOG_FILE

make -j $THREADS 2>&1 | tee $MAKE_LOG_FILE
make -j $THREADS install
$SuperUser make -j $THREADS install
16 changes: 15 additions & 1 deletion external/build_scripts/setup_folders.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
mkdir -p $SCRIPT_PATH/logs
mkdir -p $BUILD_PATH
mkdir -p $INSTALL_PATH

failed_first=0
mkdir -p $INSTALL_PATH &>/dev/null && touch $INSTALL_PATH/_permission_test &>/dev/null || {
failed_first=1
}

SuperUser=""
if ((failed_first == 0)); then
echo "Elevated permissions required to write into $INSTALL_PATH."
SuperUser="sudo -E"

$SuperUser mkdir -p $INSTALL_PATH
else
rm $INSTALL_PATH/_permission_test
fi
2 changes: 1 addition & 1 deletion external/build_sundials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ cmake -DENABLE_OPENMP=ON \
2>&1 | tee $CMAKE_LOG_FILE

make -j $THREADS 2>&1 | tee $MAKE_LOG_FILE
make -j $THREADS install
$SuperUser make -j $THREADS install
2 changes: 1 addition & 1 deletion update_DiFfRG.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if [[ ${option_install_library} != "n" ]] && [[ ${option_install_library} != "N"

# Make sure the install directory is absolute
idir=$(expandPath ${option_install_library}/)
idir=$(readlink --canonicalize ${idir})
#idir=$(readlink --canonicalize ${idir})
echo "DiFfRG library will be installed in ${idir}"

# Check if the install directory is writable
Expand Down

0 comments on commit 26b5ced

Please sign in to comment.