Skip to content

Commit

Permalink
Fix macOS compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Jul 14, 2024
1 parent c77e4e7 commit c9c04af
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ target_link_libraries(pffdtd
fmt::fmt
HDF5::HDF5
opencv_videoio
OpenMP::OpenMP_CXX
std::mdspan
)

Expand Down
8 changes: 4 additions & 4 deletions src/cpp/main_2d/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ auto run(Simulation2D const& sim)
auto videoThread = std::unique_ptr<std::thread>();

if (shouldRenderVideo) {
auto opt = sim.videoOptions.value();
auto func = [&videoWriter, &sim] { run(*videoWriter, sim); };
videoWriter = std::make_unique<BackgroundVideoWriter>(VideoWriter{opt});
videoThread = std::make_unique<std::thread>(func);
// auto opt = sim.videoOptions.value();
// auto func = [&videoWriter, &sim] { run(*videoWriter, sim); };
// videoWriter = std::make_unique<BackgroundVideoWriter>(VideoWriter{opt});
// videoThread = std::make_unique<std::thread>(func);
}

auto prop = sycl::property_list{sycl::property::queue::in_order()};
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/main_3d/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/cpp/pffdtd/hdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cassert>
#include <span>
#include <stdexcept>
#include <string>
#include <vector>

namespace pffdtd {
Expand Down Expand Up @@ -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}};
}
Expand Down

0 comments on commit c9c04af

Please sign in to comment.