From 62323b9c07753862178e39f8bf3be3abea891610 Mon Sep 17 00:00:00 2001 From: Jonas Schuhmacher Date: Thu, 28 Nov 2024 19:01:30 +0100 Subject: [PATCH] Organize spdlog imports and fix fmt symbol issue. Reorganize spdlog headers in CSVWriter.h and remove unused imports in other files to clean up code dependencies. Add a compile definition in CMakeLists.txt to resolve missing fmt symbols. --- CMakeLists.txt | 4 ++++ src/polyhedralGravity/model/GravityModelDetail.h | 1 - src/polyhedralGravity/output/CSVWriter.h | 2 +- test/model/GravityModelVectorUtility.h | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aac9db3..362ec95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,10 @@ IF(_LIBCPP_DISABLE_AVAILABILITY) add_definitions(-D_LIBCPP_DISABLE_AVAILABILITY) endif () +# Resolves missing fmt symbols when working with spdlog (bundled via brew/ conda on Arm architecture) +# Refer to https://github.com/gabime/spdlog/issues/660 +add_compile_definitions(FMT_HEADER_ONLY) + ####################################################### # Including dependencies needed across multiple targets ####################################################### diff --git a/src/polyhedralGravity/model/GravityModelDetail.h b/src/polyhedralGravity/model/GravityModelDetail.h index ccb3f34..c86a295 100644 --- a/src/polyhedralGravity/model/GravityModelDetail.h +++ b/src/polyhedralGravity/model/GravityModelDetail.h @@ -6,7 +6,6 @@ #include #include -#include "spdlog/spdlog.h" #include "thrust/iterator/zip_iterator.h" #include "thrust/iterator/transform_iterator.h" #include "thrust/iterator/counting_iterator.h" diff --git a/src/polyhedralGravity/output/CSVWriter.h b/src/polyhedralGravity/output/CSVWriter.h index 0e3baab..3c44068 100644 --- a/src/polyhedralGravity/output/CSVWriter.h +++ b/src/polyhedralGravity/output/CSVWriter.h @@ -6,9 +6,9 @@ #include #include #include "polyhedralGravity/model/GravityModelData.h" +#include "spdlog/spdlog.h" #include "spdlog/sinks/basic_file_sink.h" #include "spdlog/fmt/ostr.h" -#include "spdlog/spdlog.h" namespace polyhedralGravity { diff --git a/test/model/GravityModelVectorUtility.h b/test/model/GravityModelVectorUtility.h index cd6a458..a6abde4 100644 --- a/test/model/GravityModelVectorUtility.h +++ b/test/model/GravityModelVectorUtility.h @@ -8,7 +8,6 @@ #include "polyhedralGravity/model/GravityModelData.h" #include "polyhedralGravity/util/UtilityConstants.h" #include "polyhedralGravity/util/UtilityContainer.h" -#include "spdlog/spdlog.h" #include "thrust/iterator/zip_iterator.h" #include "thrust/iterator/transform_iterator.h" #include "thrust/iterator/counting_iterator.h"