Skip to content

Commit

Permalink
尝试在 M1 上编译,spdlog 出现了链接问题
Browse files Browse the repository at this point in the history
Signed-off-by: Zhihong Niu <[email protected]>
  • Loading branch information
Zhihong Niu authored and Zhihong Niu committed Apr 22, 2024
1 parent 4a1adae commit dce74cb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,8 @@ done
TAB:切换模型

sudo apt install doxygen cppcheck clang-tidy clang-format lcov libsdl2-dev libspdlog-dev

```shell
brew install gcc g++ cmake doxygen graphviz cppcheck llvm lcov sdl2 spdlog libomp
CC=gcc-13 CXX=g++-13 cmake --preset build
```
6 changes: 3 additions & 3 deletions cmake/3rd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ if (NOT SDL2_FOUND)
endif ()

if (APPLE)
set(OpenMP_C_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include/")
set(OpenMP_C_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include/ -I/opt/homebrew/Cellar/libomp/18.1.4/include")
set(OpenMP_C_LIB_NAMES "omp")
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include/")
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include/ -I/opt/homebrew/Cellar/libomp/18.1.4/include")
set(OpenMP_CXX_LIB_NAMES "omp")
set(OpenMP_omp_LIBRARY /usr/local/opt/libomp/lib/libomp.dylib)
set(OpenMP_omp_LIBRARY /opt/homebrew/Cellar/libomp/18.1.4/lib/libomp.dylib)
endif ()
find_package(OpenMP REQUIRED)
if (NOT OpenMP_FOUND)
Expand Down
5 changes: 4 additions & 1 deletion src/include/buffer_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@

#include <cstddef>
#include <cstdint>
#include <immintrin.h>
#if defined(x86_64)
// #include <immintrin.h>
#endif

#include <memory>
#include <mutex>
#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion src/include/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct fmt::formatter<SimpleRenderer::matrix4f_t>
-> decltype(_format_context.out()) {
std::stringstream buf;
buf << _matrix;
return format_to(_format_context.out(), "\n{}", buf.str());
return fmt::format_to(_format_context.out(), "\n{}", buf.str());
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/include/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ struct fmt::formatter<SimpleRenderer::model_t::box_t>
auto format(SimpleRenderer::model_t::box_t _box,
format_context &_format_context) const
-> decltype(_format_context.out()) {
return format_to(_format_context.out(), "max: {},\nmin: {}", _box.max,
return fmt::format_to(_format_context.out(), "max: {},\nmin: {}", _box.max,
_box.min);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/include/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct fmt::formatter<SimpleRenderer::vector3f_t>
-> decltype(_format_context.out()) {
std::stringstream buf;
buf << _vector;
return format_to(_format_context.out(), "\n{}", buf.str());
return fmt::format_to(_format_context.out(), "\n{}", buf.str());
}
};

Expand Down

0 comments on commit dce74cb

Please sign in to comment.