toppers / hakoniwa-core-cpp-client

5 stars 3 forks source link

Mac環境でビルドエラーになります #5

Closed mitsut closed 1 year ago

mitsut commented 2 years ago

spdlog関連でエラーになります。

[  3%] Building CXX object core/src/CMakeFiles/hako.dir/hako/hako_impl.cpp.o
In file included from /Users/mtakada/Workspace/hakoniwa/athrill-target-rh850f1x/hakoniwa-core-cpp-client/core/src/hako/hako_impl.cpp:1:
In file included from /Users/mtakada/Workspace/hakoniwa/athrill-target-rh850f1x/hakoniwa-core-cpp-client/core/src/include/hako.hpp:7:
In file included from /opt/homebrew/Cellar/spdlog/1.10.0_1/include/spdlog/spdlog.h:12:
In file included from /opt/homebrew/Cellar/spdlog/1.10.0_1/include/spdlog/common.h:45:
/opt/homebrew/Cellar/spdlog/1.10.0_1/include/spdlog/fmt/fmt.h:27:14: fatal error: 'fmt/core.h' file not found

install.bashbrew install spdlogをしてパッケージが入っていますが、

#    include <fmt/core.h>
#    include <fmt/format.h>

の該当ファイルがありません。

mitsut commented 2 years ago

ソースコードからビルドすることで解決できました。 以下はspdlogのREADME通り

$ git clone https://github.com/gabime/spdlog.git
$ cd spdlog && mkdir build && cd build
$ cmake .. && make -j

さらにローカルにインストール

sudo make install                                                                                                                                 ✘ 2 
Password:
[ 80%] Built target spdlog
[100%] Built target example
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/include
-- Installing: /usr/local/include/spdlog
-- Installing: /usr/local/include/spdlog/pattern_formatter-inl.h
-- Installing: /usr/local/include/spdlog/fwd.h
-- Installing: /usr/local/include/spdlog/version.h
-- Installing: /usr/local/include/spdlog/spdlog.h
-- Installing: /usr/local/include/spdlog/fmt
-- Installing: /usr/local/include/spdlog/fmt/ranges.h
-- Installing: /usr/local/include/spdlog/fmt/xchar.h
-- Installing: /usr/local/include/spdlog/fmt/chrono.h
-- Installing: /usr/local/include/spdlog/fmt/bin_to_hex.h
-- Installing: /usr/local/include/spdlog/fmt/fmt.h
-- Installing: /usr/local/include/spdlog/fmt/compile.h
-- Installing: /usr/local/include/spdlog/fmt/ostr.h
-- Installing: /usr/local/include/spdlog/logger-inl.h
-- Installing: /usr/local/include/spdlog/sinks
-- Installing: /usr/local/include/spdlog/sinks/qt_sinks.h
-- Installing: /usr/local/include/spdlog/sinks/ansicolor_sink-inl.h
-- Installing: /usr/local/include/spdlog/sinks/hourly_file_sink.h
-- Installing: /usr/local/include/spdlog/sinks/stdout_sinks.h
-- Installing: /usr/local/include/spdlog/sinks/basic_file_sink.h
-- Installing: /usr/local/include/spdlog/sinks/rotating_file_sink.h
-- Installing: /usr/local/include/spdlog/sinks/daily_file_sink.h
-- Installing: /usr/local/include/spdlog/sinks/ringbuffer_sink.h
-- Installing: /usr/local/include/spdlog/sinks/ansicolor_sink.h
-- Installing: /usr/local/include/spdlog/sinks/systemd_sink.h
-- Installing: /usr/local/include/spdlog/sinks/base_sink.h
-- Installing: /usr/local/include/spdlog/sinks/stdout_color_sinks.h
-- Installing: /usr/local/include/spdlog/sinks/dist_sink.h
-- Installing: /usr/local/include/spdlog/sinks/msvc_sink.h
-- Installing: /usr/local/include/spdlog/sinks/tcp_sink.h
-- Installing: /usr/local/include/spdlog/sinks/mongo_sink.h
-- Installing: /usr/local/include/spdlog/sinks/sink-inl.h
-- Installing: /usr/local/include/spdlog/sinks/wincolor_sink-inl.h
-- Installing: /usr/local/include/spdlog/sinks/android_sink.h
-- Installing: /usr/local/include/spdlog/sinks/stdout_sinks-inl.h
-- Installing: /usr/local/include/spdlog/sinks/sink.h
-- Installing: /usr/local/include/spdlog/sinks/syslog_sink.h
-- Installing: /usr/local/include/spdlog/sinks/dup_filter_sink.h
-- Installing: /usr/local/include/spdlog/sinks/win_eventlog_sink.h
-- Installing: /usr/local/include/spdlog/sinks/stdout_color_sinks-inl.h
-- Installing: /usr/local/include/spdlog/sinks/ostream_sink.h
-- Installing: /usr/local/include/spdlog/sinks/udp_sink.h
-- Installing: /usr/local/include/spdlog/sinks/rotating_file_sink-inl.h
-- Installing: /usr/local/include/spdlog/sinks/basic_file_sink-inl.h
-- Installing: /usr/local/include/spdlog/sinks/null_sink.h
-- Installing: /usr/local/include/spdlog/sinks/base_sink-inl.h
-- Installing: /usr/local/include/spdlog/sinks/wincolor_sink.h
-- Installing: /usr/local/include/spdlog/formatter.h
-- Installing: /usr/local/include/spdlog/common-inl.h
-- Installing: /usr/local/include/spdlog/details
-- Installing: /usr/local/include/spdlog/details/log_msg_buffer-inl.h
-- Installing: /usr/local/include/spdlog/details/log_msg-inl.h
-- Installing: /usr/local/include/spdlog/details/udp_client.h
-- Installing: /usr/local/include/spdlog/details/file_helper.h
-- Installing: /usr/local/include/spdlog/details/periodic_worker-inl.h
-- Installing: /usr/local/include/spdlog/details/udp_client-windows.h
-- Installing: /usr/local/include/spdlog/details/periodic_worker.h
-- Installing: /usr/local/include/spdlog/details/mpmc_blocking_q.h
-- Installing: /usr/local/include/spdlog/details/os.h
-- Installing: /usr/local/include/spdlog/details/thread_pool-inl.h
-- Installing: /usr/local/include/spdlog/details/fmt_helper.h
-- Installing: /usr/local/include/spdlog/details/null_mutex.h
-- Installing: /usr/local/include/spdlog/details/registry.h
-- Installing: /usr/local/include/spdlog/details/backtracer.h
-- Installing: /usr/local/include/spdlog/details/registry-inl.h
-- Installing: /usr/local/include/spdlog/details/thread_pool.h
-- Installing: /usr/local/include/spdlog/details/circular_q.h
-- Installing: /usr/local/include/spdlog/details/synchronous_factory.h
-- Installing: /usr/local/include/spdlog/details/os-inl.h
-- Installing: /usr/local/include/spdlog/details/log_msg.h
-- Installing: /usr/local/include/spdlog/details/backtracer-inl.h
-- Installing: /usr/local/include/spdlog/details/file_helper-inl.h
-- Installing: /usr/local/include/spdlog/details/log_msg_buffer.h
-- Installing: /usr/local/include/spdlog/details/tcp_client.h
-- Installing: /usr/local/include/spdlog/details/console_globals.h
-- Installing: /usr/local/include/spdlog/details/windows_include.h
-- Installing: /usr/local/include/spdlog/details/tcp_client-windows.h
-- Installing: /usr/local/include/spdlog/async_logger.h
-- Installing: /usr/local/include/spdlog/cfg
-- Installing: /usr/local/include/spdlog/cfg/env.h
-- Installing: /usr/local/include/spdlog/cfg/argv.h
-- Installing: /usr/local/include/spdlog/cfg/helpers-inl.h
-- Installing: /usr/local/include/spdlog/cfg/helpers.h
-- Installing: /usr/local/include/spdlog/tweakme.h
-- Installing: /usr/local/include/spdlog/async.h
-- Installing: /usr/local/include/spdlog/common.h
-- Installing: /usr/local/include/spdlog/async_logger-inl.h
-- Installing: /usr/local/include/spdlog/stopwatch.h
-- Installing: /usr/local/include/spdlog/pattern_formatter.h
-- Installing: /usr/local/include/spdlog/logger.h
-- Installing: /usr/local/include/spdlog/spdlog-inl.h
-- Installing: /usr/local/lib/libspdlog.a
-- Installing: /usr/local/include/spdlog/fmt/bundled/
-- Installing: /usr/local/include/spdlog/fmt/bundled//ostream.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//format-inl.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//ranges.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//xchar.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//core.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//locale.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//chrono.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//os.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//fmt.license.rst
-- Installing: /usr/local/include/spdlog/fmt/bundled//color.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//args.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//printf.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//compile.h
-- Installing: /usr/local/include/spdlog/fmt/bundled//format.h
-- Installing: /usr/local/lib/pkgconfig/spdlog.pc
-- Installing: /usr/local/lib/cmake/spdlog/spdlogConfigTargets.cmake
-- Installing: /usr/local/lib/cmake/spdlog/spdlogConfigTargets-release.cmake
-- Installing: /usr/local/lib/cmake/spdlog/spdlogConfig.cmake
-- Installing: /usr/local/lib/cmake/spdlog/spdlogConfigVersion.cmake

この後にhakoniwa-core-cpp-clientをリビルドし直すことで解決できました。 おそらく、homebrewでのパッケージのインストールではcmakeへのパッケージがインストールされないのかと思います。 ビルドスクリプトにどう反映させるか...

mitsut commented 1 year ago

spdlogを削除されたので、ビルドの解消されましたので、こちらも取り下げます