Skip to content

Commit

Permalink
Merge branch 'bundled-fmt' into 'master'
Browse files Browse the repository at this point in the history
Use bundled fmt from spdlog

See merge request ogs/ogs!4750
  • Loading branch information
bilke committed Sep 29, 2023
2 parents 3f62408 + bc053d4 commit 1585744
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 50 deletions.
1 change: 0 additions & 1 deletion .guix/modules/ogs-package.scm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#:cmake ,cmake)) ;for newer CMake version
(inputs (list boost
eigen
fmt
googletest
hdf5
json-modern-cxx
Expand Down
2 changes: 1 addition & 1 deletion Applications/Utils/MeshEdit/checkMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <mpi.h>
#endif

#include <fmt/ranges.h>
#include <spdlog/fmt/bundled/ranges.h>

#include <array>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion BaseLib/FileTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "FileTools.h"

#include <fmt/core.h>
#include <spdlog/fmt/bundled/core.h>

#include <boost/algorithm/string/predicate.hpp>
#include <filesystem>
Expand Down
2 changes: 1 addition & 1 deletion BaseLib/PrjProcessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

#include "PrjProcessing.h"

#include <fmt/core.h>
#include <libxml/globals.h>
#include <libxml/parser.h>
#include <libxml/xmlstring.h>
#include <spdlog/fmt/bundled/core.h>
#include <xml_patch.h>

#include <filesystem>
Expand Down
2 changes: 1 addition & 1 deletion GeoLib/AABB.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#pragma once

#include <fmt/ostream.h>
#include <spdlog/fmt/bundled/ostream.h>

#include <Eigen/Core>
#include <bitset>
Expand Down
2 changes: 1 addition & 1 deletion GeoLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target_link_libraries(
PUBLIC BaseLib Eigen3::Eigen MathLib $<$<BOOL:${OGS_BUILD_GUI}>:rapidxml>
$<$<BOOL:${OGS_BUILD_GUI}>:Qt5::Xml>
$<$<BOOL:${OGS_BUILD_GUI}>:Qt5::XmlPatterns>
fmt::fmt-header-only
spdlog::spdlog
PRIVATE range-v3 tet
)

Expand Down
2 changes: 1 addition & 1 deletion MaterialLib/SolidModels/SelectSolidConstitutiveRelation.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#pragma once

#include <fmt/ranges.h>
#include <spdlog/fmt/bundled/ranges.h>

#include <map>
#include <range/v3/view/map.hpp>
Expand Down
2 changes: 1 addition & 1 deletion MathLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ target_link_libraries(
$<$<BOOL:${OGS_USE_PETSC}>:petsc>
Eigen3::Eigen
$<$<TARGET_EXISTS:OpenMP::OpenMP_CXX>:OpenMP::OpenMP_CXX>
fmt::fmt-header-only
spdlog::spdlog
)

if(OGS_USE_LIS)
Expand Down
2 changes: 1 addition & 1 deletion MathLib/FormattingUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#pragma once

#include <fmt/ostream.h>
#include <spdlog/fmt/bundled/ostream.h>

#include <Eigen/Core>
#include <concepts>
Expand Down
3 changes: 2 additions & 1 deletion MeshToolsLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ append_source_files(SOURCES MeshQuality)
ogs_add_library(MeshToolsLib ${SOURCES})

target_link_libraries(
MeshToolsLib PUBLIC MeshLib
MeshToolsLib PUBLIC GeoLib
MeshLib
range-v3
VTK::IOXML
VTK::IOLegacy
Expand Down
2 changes: 1 addition & 1 deletion NumLib/ODESolver/PETScNonlinearSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

#include "PETScNonlinearSolver.h"

#include <fmt/core.h>
#include <petscmat.h>
#include <petscvec.h>
#include <spdlog/fmt/bundled/core.h>

#include "BaseLib/RunTime.h"

Expand Down
2 changes: 1 addition & 1 deletion ProcessLib/Assembly/MatrixOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "MatrixOutput.h"

#include <fmt/ostream.h>
#include <spdlog/fmt/bundled/ostream.h>

#include <optional>
#include <unordered_set>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#pragma once

#include <fmt/format.h>
#include <spdlog/fmt/bundled/format.h>

#include <Eigen/LU>
#include <cassert>
Expand Down
2 changes: 1 addition & 1 deletion Tests/MaterialLib/CheckStiffnessMatrixMFront.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#ifdef OGS_USE_MFRONT

#include <fmt/format.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include <spdlog/fmt/bundled/format.h>

#include "BaseLib/ConfigTree.h"
#include "MaterialLib/SolidModels/MFront/CreateMFrontGeneric.h"
Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/collection
Submodule collection updated from d57a65 to c0f039
3 changes: 1 addition & 2 deletions scripts/cmake/CheckHeaderCompilation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ function(_check_header_compilation target)
foreach(
lib
${LINK_LIBS}
spdlog
spdlog::spdlog
Boost::boost
Eigen3::Eigen
nlohmann_json::nlohmann_json
range-v3
# petsc; is given via ${PETSC_INCLUDES} below.
fmt::fmt-header-only
)
# Ignore non-existing targets or interface libs
if(NOT TARGET ${lib})
Expand Down
12 changes: 3 additions & 9 deletions scripts/cmake/CompilerSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL)
endif()
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fext-numeric-literals>)
include(GCCSanitizer)
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 13.1.1)
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 13.1.1
OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 13.2.1
)
# See https://gitlab.opengeosys.org/ogs/ogs/-/merge_requests/4597
add_compile_options(
$<$<COMPILE_LANGUAGE:CXX>:-Wno-dangling-reference>
Expand All @@ -76,14 +78,6 @@ if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL)
$<$<COMPILE_LANGUAGE:CXX>:-Wno-stringop-overread>
)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 13.2.1)
# A smaller set than that for 13.1.1
add_compile_options(
$<$<COMPILE_LANGUAGE:CXX>:-Wno-dangling-reference>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-array-bounds>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-stringop-overread>
)
endif()
endif()

if(COMPILER_IS_CLANG)
Expand Down
30 changes: 8 additions & 22 deletions scripts/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,14 @@ if(OGS_BUILD_TESTING)
endif()
endif()

# Check spdlog release for compatible fmt release. fmt may be provided by vtk
# _ext build.
if(NOT TARGET fmt::fmt-header-only)
CPMFindPackage(
NAME fmt
GIT_TAG 10.1.0
GITHUB_REPOSITORY fmtlib/fmt
EXCLUDE_FROM_ALL YES
)
endif()
CPMFindPackage(
NAME spdlog
GITHUB_REPOSITORY gabime/spdlog
VERSION 1.12.0
OPTIONS "BUILD_SHARED_LIBS OFF" "SPDLOG_BUILD_SHARED OFF"
"SPDLOG_FMT_EXTERNAL_HO 1"
)
if(spdlog_ADDED)
set_target_properties(
spdlog
PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:spdlog,INTERFACE_INCLUDE_DIRECTORIES>
if(GUIX_BUILD)
find_package(spdlog REQUIRED)
else()
CPMAddPackage(
NAME spdlog
GITHUB_REPOSITORY gabime/spdlog
VERSION 1.12.0
OPTIONS "BUILD_SHARED_LIBS OFF"
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions web/data/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
}
},
"cpm": {
"package_file_id": 749,
"package_file_sha256": "25862fd9b76d5c685cd60432396507822dd547e7ee2e87dffb1126603574efad"
"package_file_id": 865,
"package_file_sha256": "00db04d08660e131c41fcc20b9cc4046516223c668b0d422e3002775e4d4e967"
},
"ext": {
"cache_hash": "4ebd62e0ce484732dbf3cd9932f60b67762e156b"
Expand Down

0 comments on commit 1585744

Please sign in to comment.