From 79706f97dbd5805eec04cea170bf4d5794f57aaa Mon Sep 17 00:00:00 2001 From: Jacob Merson Date: Mon, 16 Mar 2026 02:26:07 -0400 Subject: [PATCH] remove spdlog closes #257 --- .github/workflows/clang-tidy.yml | 1 - .github/workflows/cmake-test.yml | 1 - .github/workflows/self-hosted.yml | 1 - CMakeLists.txt | 5 ----- config.cmake.in | 4 ---- pyproject.toml | 1 - src/pcms/configuration.h.in | 1 - src/pcms/localization/CMakeLists.txt | 6 +----- src/pcms/utility/CMakeLists.txt | 4 ---- src/pcms/utility/print.h | 23 ++++++----------------- 10 files changed, 7 insertions(+), 40 deletions(-) diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 3204f6b1..dc6a4645 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -193,7 +193,6 @@ jobs: -DPETSC_DIR=${{ runner.temp }}/petsc-openmpi \ -DPETSC_ARCH=ubuntu-kokkos \ -DPCMS_TIMEOUT=10 \ - -DPCMS_ENABLE_SPDLOG=OFF \ -DCatch2_DIR=${{ runner.temp }}/build-Catch2-openmpi/install/lib/cmake/Catch2 \ -DOmega_h_DIR=${{ runner.temp }}/build-omega_h-openmpi/install/lib/cmake/Omega_h \ -Dmeshfields_DIR=${{ runner.temp }}/build-meshFields-openmpi/install/lib/cmake/meshfields \ diff --git a/.github/workflows/cmake-test.yml b/.github/workflows/cmake-test.yml index 591284a3..fccde2a0 100644 --- a/.github/workflows/cmake-test.yml +++ b/.github/workflows/cmake-test.yml @@ -212,7 +212,6 @@ jobs: -DPETSC_DIR=${{ runner.temp }}/petsc -DPETSC_ARCH=ubuntu-kokkos -DPCMS_TIMEOUT=10 - -DPCMS_ENABLE_SPDLOG=OFF -DPCMS_ENABLE_Python=${{ matrix.python_api }} -DCatch2_DIR=${{ runner.temp }}/build-Catch2/install/lib/cmake/Catch2 -DOmega_h_DIR=${{ runner.temp }}/build-omega_h/install/lib/cmake/Omega_h diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 4b2472b7..e632ee0d 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -188,7 +188,6 @@ jobs: -DCMAKE_C_COMPILER=mpicc \ -DCMAKE_CXX_COMPILER=mpicxx \ -DPCMS_TIMEOUT=20 \ - -DPCMS_ENABLE_SPDLOG=OFF \ -DPCMS_ENABLE_PETSC=ON \ -DPETSC_LINK_STATIC=ON \ -DPETSC_DIR=${workDir}/petsc \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 77364b2a..6ecb99b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,15 +48,10 @@ option(PCMS_ENABLE_C "Enable pcms C api" ON) option(PCMS_ENABLE_Python "Enable pcms Python api" OFF) option(PCMS_ENABLE_PRINT "PCMS print statements enabled" ON) -option(PCMS_ENABLE_SPDLOG "use spdlog for logging" ON) option(PETSC_LINK_STATIC "Use pkg-config --static results for PETSc" ${_pcms_link_petsc_static_default}) -if(PCMS_ENABLE_SPDLOG) - find_package(spdlog REQUIRED) -endif() - # find package before fortran enabled, so we don't require the adios2 fortran # interfaces this is important because adios2 build with clang/gfortran is # broken diff --git a/config.cmake.in b/config.cmake.in index ff5f128f..60ca9502 100644 --- a/config.cmake.in +++ b/config.cmake.in @@ -25,10 +25,6 @@ if(@PCMS_ENABLE_PETSC@) find_dependency(PETSc) endif() -if(@PCMS_ENABLE_SPDLOG@) - find_dependency(spdlog CONFIG HINTS @spdlog_DIR@) -endif() - if(@PCMS_ENABLE_OMEGA_H@) find_dependency(Omega_h CONFIG HINTS @Omega_h_DIR@) endif() diff --git a/pyproject.toml b/pyproject.toml index 3b85337f..7d177378 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,4 +8,3 @@ version = "0.3.0" [tool.scikit-build.cmake.define] PCMS_ENABLE_Python = true -PCMS_ENABLE_SPDLOG = false diff --git a/src/pcms/configuration.h.in b/src/pcms/configuration.h.in index f52825b6..9f1e260f 100644 --- a/src/pcms/configuration.h.in +++ b/src/pcms/configuration.h.in @@ -4,5 +4,4 @@ #cmakedefine PCMS_ENABLE_OMEGA_H #cmakedefine PCMS_ENABLE_C #cmakedefine PCMS_ENABLE_PRINT -#cmakedefine PCMS_ENABLE_SPDLOG #cmakedefine PCMS_ENABLE_Fortran diff --git a/src/pcms/localization/CMakeLists.txt b/src/pcms/localization/CMakeLists.txt index c46aaad4..02badf92 100644 --- a/src/pcms/localization/CMakeLists.txt +++ b/src/pcms/localization/CMakeLists.txt @@ -25,10 +25,6 @@ set_target_properties( localization ) -if (PCMS_ENABLE_SPDLOG) - target_link_libraries(pcms_localization PUBLIC spdlog::spdlog) -endif () - ## export the library set_target_properties(pcms_localization PROPERTIES PUBLIC_HEADER "${PCMS_LOCALIZATION_HEADERS}") @@ -47,4 +43,4 @@ install( EXPORT pcms_localization-targets NAMESPACE pcms:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pcms -) \ No newline at end of file +) diff --git a/src/pcms/utility/CMakeLists.txt b/src/pcms/utility/CMakeLists.txt index 8dd53372..fa04bdce 100644 --- a/src/pcms/utility/CMakeLists.txt +++ b/src/pcms/utility/CMakeLists.txt @@ -37,10 +37,6 @@ set_target_properties( utility ) -if (PCMS_ENABLE_SPDLOG) - target_link_libraries(pcms_utility PUBLIC spdlog::spdlog) -endif () - ## export the library target_sources(pcms_utility PUBLIC FILE_SET utilities diff --git a/src/pcms/utility/print.h b/src/pcms/utility/print.h index d8b8fd82..5ac8fd3b 100644 --- a/src/pcms/utility/print.h +++ b/src/pcms/utility/print.h @@ -3,11 +3,6 @@ #include "pcms/configuration.h" #include -#ifdef PCMS_ENABLE_SPDLOG -#include "spdlog/spdlog.h" -#include -#endif - #include namespace pcms @@ -27,9 +22,7 @@ void setStderr(FILE* err); template void printError(const char* fmt, const Args&... args) { -#if defined(PCMS_ENABLE_SPDLOG) && defined(PCMS_ENABLE_PRINT) - spdlog::error("{}", fmt::sprintf(fmt, args...)); -#elif defined(PCMS_ENABLE_PRINT) +#if defined(PCMS_ENABLE_PRINT) fprintf(getStdout(), fmt, args...); #endif } @@ -37,10 +30,7 @@ void printError(const char* fmt, const Args&... args) template KOKKOS_INLINE_FUNCTION void printInfo(const char* fmt, const Args&... args) { -#if defined(PCMS_ENABLE_SPDLOG) && defined(PCMS_ENABLE_PRINT) && \ - !defined(ACTIVE_GPU_EXECUTION) - spdlog::info("{}", fmt::sprintf(fmt, args...)); -#elif defined(PCMS_ENABLE_PRINT) && !defined(ACTIVE_GPU_EXECUTION) +#if defined(PCMS_ENABLE_PRINT) && !defined(ACTIVE_GPU_EXECUTION) fprintf(getStdout(), fmt, args...); #endif } @@ -48,16 +38,15 @@ KOKKOS_INLINE_FUNCTION void printInfo(const char* fmt, const Args&... args) template KOKKOS_INLINE_FUNCTION void printDebugInfo(const char* fmt, const Args&... args) { -#if !defined(NDEBUG) && defined(PCMS_PRINT_ENABLED) +#if !defined(NDEBUG) && defined(PCMS_ENABLE_PRINT) #if !defined(ACTIVE_GPU_EXECUTION) -#if defined(PCMS_SPDLOG_ENABLED) - spdlog::debug("{}", fmt::sprintf(fmt, args...)); -#else fprintf(getStdout(), fmt, args...); -#endif #else // For GPU execution printf(fmt, args...); #endif +#else + (void)fmt; + ((void)args, ...); #endif }