From c9c04af879a6b0e00dc9ff6cffe3a7f848c1b2dd Mon Sep 17 00:00:00 2001 From: Tobias Hienzsch Date: Sun, 14 Jul 2024 09:17:29 +0200 Subject: [PATCH] Fix macOS compilation --- CMakeLists.txt | 1 + conanfile.py | 5 ++++- src/cpp/CMakeLists.txt | 1 + src/cpp/main_2d/engine.cpp | 8 ++++---- src/cpp/main_3d/CMakeLists.txt | 2 -- src/cpp/pffdtd/hdf.hpp | 5 +++-- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bfeb51..b2f6cdc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ find_package(CLI11 REQUIRED) find_package(fmt REQUIRED) find_package(HDF5 REQUIRED) find_package(OpenCV REQUIRED COMPONENTS core videoio) +find_package(OpenMP REQUIRED) if(PFFDTD_ENABLE_ACPP_SYCL) find_package(AdaptiveCpp REQUIRED) diff --git a/conanfile.py b/conanfile.py index b53702e..3af34e8 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,12 +8,15 @@ class NeoFDTD(ConanFile): def requirements(self): self.requires("cli11/2.4.2") self.requires("fmt/11.0.1") + self.requires("hdf5/1.14.4.3") if self.settings.os != "Macos": - self.requires("hdf5/1.14.4.3") self.requires("opencv/4.10.0") def config_options(self): + if self.settings.os == "Macos": + self.options["hdf5"].with_zlib = False + self.options["opencv"].calib3d = False self.options["opencv"].dnn = False self.options["opencv"].features2d = False diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index 1650b0a..2f07443 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -10,6 +10,7 @@ target_link_libraries(pffdtd fmt::fmt HDF5::HDF5 opencv_videoio + OpenMP::OpenMP_CXX std::mdspan ) diff --git a/src/cpp/main_2d/engine.cpp b/src/cpp/main_2d/engine.cpp index e1cca35..f194449 100644 --- a/src/cpp/main_2d/engine.cpp +++ b/src/cpp/main_2d/engine.cpp @@ -103,10 +103,10 @@ auto run(Simulation2D const& sim) auto videoThread = std::unique_ptr(); if (shouldRenderVideo) { - auto opt = sim.videoOptions.value(); - auto func = [&videoWriter, &sim] { run(*videoWriter, sim); }; - videoWriter = std::make_unique(VideoWriter{opt}); - videoThread = std::make_unique(func); + // auto opt = sim.videoOptions.value(); + // auto func = [&videoWriter, &sim] { run(*videoWriter, sim); }; + // videoWriter = std::make_unique(VideoWriter{opt}); + // videoThread = std::make_unique(func); } auto prop = sycl::property_list{sycl::property::queue::in_order()}; diff --git a/src/cpp/main_3d/CMakeLists.txt b/src/cpp/main_3d/CMakeLists.txt index 2cebde2..946aa61 100644 --- a/src/cpp/main_3d/CMakeLists.txt +++ b/src/cpp/main_3d/CMakeLists.txt @@ -1,7 +1,5 @@ project(pffdtd_3d) -find_package(OpenMP REQUIRED) - add_executable(pffdtd_3d) target_compile_definitions(pffdtd_3d PRIVATE USING_CUDA=0) target_sources(pffdtd_3d diff --git a/src/cpp/pffdtd/hdf.hpp b/src/cpp/pffdtd/hdf.hpp index 5354e22..8aa1c3c 100644 --- a/src/cpp/pffdtd/hdf.hpp +++ b/src/cpp/pffdtd/hdf.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include namespace pffdtd { @@ -99,8 +100,8 @@ struct H5FReader { } private: - auto checkErrorAndCloseDataset(char const* name, hid_t set, herr_t err) - -> void { + auto + checkErrorAndCloseDataset(char const* name, hid_t set, herr_t err) -> void { if (err != 0) { throw std::runtime_error{"dataset read in: " + std::string{name}}; }