Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build Failed]: spdlog dependency is not resolved #608

Open
patrickphzhang opened this issue Nov 28, 2024 · 2 comments
Open

[Build Failed]: spdlog dependency is not resolved #608

patrickphzhang opened this issue Nov 28, 2024 · 2 comments

Comments

@patrickphzhang
Copy link

Environment:
CentOS Linux release 8.2.2.2004
Clang 17.0.6
fmt (GNU coreutils) 8.30

I first executed this:

$:~/build_bear>cmake -DCMAKE_CXX_FLAGS=-std=c++17 -DENABLE_UNIT_TESTS=OFF -DENABLE_FUNC_TESTS=OFF -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../Bear/
$:make -j 24
The output is:

[  0%] Built target nlohmann_json_dependency
[  0%] Built target fmt_dependency
[ 47%] Built target grpc_dependency
[ 47%] Built target googletest_dependency
[ 47%] Built target spdlog_dependency
[ 52%] Performing build step for 'BearSource'
[  1%] Built target shell_a
[  3%] Built target flags_a
[ 16%] Built target exec_a
[ 18%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Process.cc.o
[ 28%] Built target rpc_a
[ 32%] Building CXX object libmain/CMakeFiles/main_a.dir/source/SubcommandFromArgs.cc.o
[ 32%] Building CXX object libmain/CMakeFiles/main_a.dir/source/ApplicationLogConfig.cc.o
[ 33%] Building CXX object libmain/CMakeFiles/main_a.dir/source/ApplicationFromArgs.cc.o
[ 38%] Built target exec
[ 40%] Building CXX object intercept/CMakeFiles/domain_a.dir/source/Convert.cc.o
[ 42%] Building CXX object intercept/CMakeFiles/domain_a.dir/source/Domain.cc.o
In file included from /home/patphzhang/Bear/source/libmain/source/ApplicationLogConfig.cc:24:
In file included from /usr/include/spdlog/spdlog.h:12:
In file included from /usr/include/spdlog/common.h:38:
/usr/include/spdlog/fmt/fmt.h:22:10: fatal error: 'spdlog/fmt/bundled/core.h' file not found
   22 | #include <spdlog/fmt/bundled/core.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[5]: *** [libmain/CMakeFiles/main_a.dir/build.make:76: libmain/CMakeFiles/main_a.dir/source/ApplicationLogConfig.cc.o] Error 1
make[5]: *** Waiting for unfinished jobs....
In file included from /home/patphzhang/Bear/source/libmain/source/SubcommandFromArgs.cc:23:
In file included from /usr/include/spdlog/spdlog.h:12:
In file included from /usr/include/spdlog/common.h:38:
/usr/include/spdlog/fmt/fmt.h:22:10: fatal error: 'spdlog/fmt/bundled/core.h' file not found
   22 | #include <spdlog/fmt/bundled/core.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/patphzhang/Bear/source/libmain/source/ApplicationFromArgs.cc:23:
In file included from /usr/include/spdlog/spdlog.h:12:
In file included from /usr/include/spdlog/common.h:38:
/usr/include/spdlog/fmt/fmt.h:22:10: fatal error: 'spdlog/fmt/bundled/core.h' file not found
   22 | #include <spdlog/fmt/bundled/core.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
1 error generated.
make[5]: *** [libmain/CMakeFiles/main_a.dir/build.make:104: libmain/CMakeFiles/main_a.dir/source/SubcommandFromArgs.cc.o] Error 1
make[5]: *** [libmain/CMakeFiles/main_a.dir/build.make:90: libmain/CMakeFiles/main_a.dir/source/ApplicationFromArgs.cc.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:335: libmain/CMakeFiles/main_a.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
In file included from /home/patphzhang/Bear/source/libsys/source/Process.cc:55:
In file included from /usr/include/spdlog/spdlog.h:12:
In file included from /usr/include/spdlog/common.h:38:
/usr/include/spdlog/fmt/fmt.h:22:10: fatal error: 'spdlog/fmt/bundled/core.h' file not found
   22 | #include <spdlog/fmt/bundled/core.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[5]: *** [libsys/CMakeFiles/sys_a.dir/build.make:132: libsys/CMakeFiles/sys_a.dir/source/Process.cc.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:309: libsys/CMakeFiles/sys_a.dir/all] Error 2
[ 42%] Built target domain_a
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/BearSource.dir/build.make:87: subprojects/Stamp/BearSource/BearSource-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/BearSource.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

It seems that the include files of spdlog are not fully installed on the CentOS. Then I removed the spdlog and let bear resolve the dependency.

$:~/build_bear>cmake -DCMAKE_CXX_FLAGS=-std=c++17 -DENABLE_UNIT_TESTS=OFF -DENABLE_FUNC_TESTS=OFF -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../Bear/
-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Looking for nlohman_json dependency
-- Looking for nlohman_json dependency -- found
-- Looking for fmt dependency
-- Looking for fmt dependency -- found
-- Looking for spdlog dependency
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for spdlog dependency -- found
-- Looking for gRPC::grpc++ dependency
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2") 
-- Checking for modules 'protobuf>=3.11;grpc++>=1.26'
--   Package 'protobuf', required by 'virtual:world', not found
--   Package 'grpc++', required by 'virtual:world', not found
-- Looking for gRPC::grpc++ dependency -- not found
-- Configuring done (0.7s)
-- Generating done (0.0s)
-- Build files have been written to: /home/patphzhang/build_bear
patphzhang@VM-60-244-tencentos:~/build_bear>make -j 24
[  0%] Built target spdlog_dependency
[  0%] Built target fmt_dependency
[  5%] Creating directories for 'grpc_dependency'
[  5%] Built target nlohmann_json_dependency
[  5%] Built target googletest_dependency
[ 11%] Performing download step (git clone) for 'grpc_dependency'
Cloning into 'grpc_dependency'...
HEAD is now at 0e34ec339 fix PHP distribtest on monterey (#31567) (#31702)
Submodule 'third_party/abseil-cpp' (https://github.com/abseil/abseil-cpp.git) registered for path 'third_party/abseil-cpp'
Submodule 'third_party/benchmark' (https://github.com/google/benchmark) registered for path 'third_party/benchmark'
Submodule 'third_party/bloaty' (https://github.com/google/bloaty.git) registered for path 'third_party/bloaty'
Submodule 'third_party/boringssl-with-bazel' (https://github.com/google/boringssl.git) registered for path 'third_party/boringssl-with-bazel'
Submodule 'third_party/cares/cares' (https://github.com/c-ares/c-ares.git) registered for path 'third_party/cares/cares'
Submodule 'third_party/envoy-api' (https://github.com/envoyproxy/data-plane-api.git) registered for path 'third_party/envoy-api'
Submodule 'third_party/googleapis' (https://github.com/googleapis/googleapis.git) registered for path 'third_party/googleapis'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/googletest'
Submodule 'third_party/libuv' (https://github.com/libuv/libuv.git) registered for path 'third_party/libuv'
Submodule 'third_party/opencensus-proto' (https://github.com/census-instrumentation/opencensus-proto.git) registered for path 'third_party/opencensus-proto'
Submodule 'third_party/opentelemetry' (https://github.com/open-telemetry/opentelemetry-proto.git) registered for path 'third_party/opentelemetry'
Submodule 'third_party/protobuf' (https://github.com/protocolbuffers/protobuf.git) registered for path 'third_party/protobuf'
Submodule 'third_party/re2' (https://github.com/google/re2.git) registered for path 'third_party/re2'
Submodule 'third_party/xds' (https://github.com/cncf/xds.git) registered for path 'third_party/xds'
Submodule 'third_party/zlib' (https://github.com/madler/zlib) registered for path 'third_party/zlib'
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/abseil-cpp'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/benchmark'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/boringssl-with-bazel'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/cares/cares'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/envoy-api'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/googleapis'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/googletest'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/libuv'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/opencensus-proto'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/opentelemetry'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/protobuf'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/re2'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/xds'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/zlib'...
Submodule path 'third_party/abseil-cpp': checked out '273292d1cfc0a94a65082ee350509af1d113344d'
Submodule path 'third_party/benchmark': checked out '0baacde3618ca617da95375e0af13ce1baadea47'
Submodule path 'third_party/bloaty': checked out '60209eb1ccc34d5deefb002d1b7f37545204f7f2'
Submodule 'third_party/abseil-cpp' (https://github.com/abseil/abseil-cpp.git) registered for path 'third_party/bloaty/third_party/abseil-cpp'
Submodule 'third_party/capstone' (https://github.com/aquynh/capstone.git) registered for path 'third_party/bloaty/third_party/capstone'
Submodule 'third_party/demumble' (https://github.com/nico/demumble.git) registered for path 'third_party/bloaty/third_party/demumble'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/bloaty/third_party/googletest'
Submodule 'third_party/protobuf' (https://github.com/protocolbuffers/protobuf.git) registered for path 'third_party/bloaty/third_party/protobuf'
Submodule 'third_party/re2' (https://github.com/google/re2) registered for path 'third_party/bloaty/third_party/re2'
Submodule 'third_party/zlib' (https://github.com/madler/zlib) registered for path 'third_party/bloaty/third_party/zlib'
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty/third_party/abseil-cpp'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty/third_party/capstone'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty/third_party/demumble'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty/third_party/googletest'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty/third_party/protobuf'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty/third_party/re2'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty/third_party/zlib'...
Submodule path 'third_party/bloaty/third_party/abseil-cpp': checked out '5dd240724366295970c613ed23d0092bcf392f18'
Submodule path 'third_party/bloaty/third_party/capstone': checked out '852f46a467cb37559a1f3a18bd45d5ca8c6fc5e7'
Submodule path 'third_party/bloaty/third_party/demumble': checked out '01098eab821b33bd31b9778aea38565cd796aa85'
Submodule path 'third_party/bloaty/third_party/googletest': checked out '565f1b848215b77c3732bca345fe76a0431d8b34'
Submodule path 'third_party/bloaty/third_party/protobuf': checked out 'bc1773c42c9c3c522145a3119e989e0dff2a8d54'
Submodule 'third_party/benchmark' (https://github.com/google/benchmark.git) registered for path 'third_party/bloaty/third_party/protobuf/third_party/benchmark'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/bloaty/third_party/protobuf/third_party/googletest'
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty/third_party/protobuf/third_party/benchmark'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/bloaty/third_party/protobuf/third_party/googletest'...
Submodule path 'third_party/bloaty/third_party/protobuf/third_party/benchmark': checked out '5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8'
Submodule path 'third_party/bloaty/third_party/protobuf/third_party/googletest': checked out '5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081'
Submodule path 'third_party/bloaty/third_party/re2': checked out '5bd613749fd530b576b890283bfb6bc6ea6246cb'
Submodule path 'third_party/bloaty/third_party/zlib': checked out 'cacf7f1d4e3d44d871b605da3b647f07d718623f'
Submodule path 'third_party/boringssl-with-bazel': checked out 'b9232f9e27e5668bc0414879dcdedb2a59ea75f2'
Submodule path 'third_party/cares/cares': checked out '6654436a307a5a686b008c1d4c93b0085da6e6d8'
Submodule path 'third_party/envoy-api': checked out 'bf6154e482bbd5e6f64032993206e66b6116f2bd'
Submodule path 'third_party/googleapis': checked out '2f9af297c84c55c8b871ba4495e01ade42476c92'
Submodule path 'third_party/googletest': checked out '0e402173c97aea7a00749e825b194bfede4f2e45'
Submodule path 'third_party/libuv': checked out '02a9e1be252b623ee032a3137c0b0c94afbe6809'
Submodule path 'third_party/opencensus-proto': checked out '4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89'
Submodule path 'third_party/opentelemetry': checked out '60fa8754d890b5c55949a8c68dcfd7ab5c2395df'
Submodule path 'third_party/protobuf': checked out '24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb'
Submodule 'third_party/benchmark' (https://github.com/google/benchmark.git) registered for path 'third_party/protobuf/third_party/benchmark'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/protobuf/third_party/googletest'
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/protobuf/third_party/benchmark'...
Cloning into '/data/home/patphzhang/build_bear/subprojects/Source/grpc_dependency/third_party/protobuf/third_party/googletest'...
Submodule path 'third_party/protobuf/third_party/benchmark': checked out '5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8'
Submodule path 'third_party/protobuf/third_party/googletest': checked out '5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081'
Submodule path 'third_party/re2': checked out '8e08f47b11b413302749c0d8b17a1c94777495d5'
Submodule path 'third_party/xds': checked out 'cb28da3451f158a947dfc45090fe92b07b243bc1'
Submodule path 'third_party/zlib': checked out '04f42ceca40f73e2978b50e93806c2a18c1281fc'
[ 17%] No update step for 'grpc_dependency'
[ 23%] No patch step for 'grpc_dependency'
[ 29%] Performing configure step for 'grpc_dependency'
-- grpc_dependency configure command succeeded.  See also /home/patphzhang/build_bear/subprojects/Stamp/grpc_dependency/grpc_dependency-configure-*.log
[ 35%] Performing build step for 'grpc_dependency'
-- grpc_dependency build command succeeded.  See also /home/patphzhang/build_bear/subprojects/Stamp/grpc_dependency/grpc_dependency-build-*.log
[ 41%] Performing install step for 'grpc_dependency'
-- grpc_dependency install command succeeded.  See also /home/patphzhang/build_bear/subprojects/Stamp/grpc_dependency/grpc_dependency-install-*.log
[ 47%] Completed 'grpc_dependency'
[ 47%] Built target grpc_dependency
[ 52%] Creating directories for 'BearSource'
[ 58%] No download step for 'BearSource'
[ 64%] No update step for 'BearSource'
[ 70%] No patch step for 'BearSource'
[ 76%] Performing configure step for 'BearSource'
loading initial cache file /home/patphzhang/build_bear/subprojects/tmp/BearSource/BearSource-cache-Release.cmake
-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found nlohmann_json: /usr/local/share/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.11.3") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2") 
-- Checking for modules 'protobuf;grpc++'
--   Found protobuf, version 3.21.6.0
--   Found grpc++, version 1.49.2
-- Looking for spawn.h
-- Looking for spawn.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for sys/utsname.h
-- Looking for sys/utsname.h - found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for gnu/lib-names.h
-- Looking for gnu/lib-names.h - found
-- Looking for _NSGetEnviron
-- Looking for _NSGetEnviron - not found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for dlsym
-- Looking for dlsym - found
-- Looking for dlerror
-- Looking for dlerror - found
-- Looking for dlclose
-- Looking for dlclose - found
-- Looking for RTLD_NEXT
-- Looking for RTLD_NEXT - found
-- Looking for EACCES
-- Looking for EACCES - found
-- Looking for ENOENT
-- Looking for ENOENT - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for environ
-- Looking for environ - found
-- Looking for uname
-- Looking for uname - found
-- Looking for confstr
-- Looking for confstr - found
-- Looking for _CS_PATH
-- Looking for _CS_PATH - found
-- Looking for _CS_GNU_LIBC_VERSION
-- Looking for _CS_GNU_LIBC_VERSION - found
-- Looking for _CS_GNU_LIBPTHREAD_VERSION
-- Looking for _CS_GNU_LIBPTHREAD_VERSION - found
-- Looking for protoc ... /home/patphzhang/build_bear/subprojects/Install/grpc_dependency/bin/protoc
-- Looking for grpc_cpp_plugin ... /home/patphzhang/build_bear/subprojects/Install/grpc_dependency/bin/grpc_cpp_plugin
-- Configuring done (499.8s)
-- Generating done (0.2s)
-- Build files have been written to: /home/patphzhang/build_bear/subprojects/Build/BearSource
[ 82%] Performing build step for 'BearSource'
[  1%] Generating supervise.pb.h, supervise.grpc.pb.h, supervise.pb.cc, supervise.grpc.pb.cc
[  3%] Generating intercept.pb.h, intercept.grpc.pb.h, intercept.pb.cc, intercept.grpc.pb.cc
[  6%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Signal.cc.o
[  6%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Guard.cc.o
[ 10%] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Logger.cc.o
[ 10%] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Buffer.cc.o
[ 11%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Process.cc.o
[ 13%] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Paths.cc.o
[ 16%] Building CXX object libflags/CMakeFiles/flags_a.dir/source/Flags.cc.o
[ 16%] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Environment.cc.o
[ 18%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Os.cc.o
[ 20%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Path.cc.o
[ 22%] Building CXX object libshell/CMakeFiles/shell_a.dir/source/Command.cc.o
[ 25%] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Executor.cc.o
[ 25%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Errors.cc.o
[ 27%] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Linker.cc.o
[ 28%] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Session.cc.o
[ 30%] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Resolver.cc.o
[ 32%] Building CXX object intercept/proto/CMakeFiles/rpc_a.dir/supervise.pb.cc.o
[ 33%] Building CXX object intercept/proto/CMakeFiles/rpc_a.dir/supervise.grpc.pb.cc.o
[ 35%] Building CXX object intercept/proto/CMakeFiles/rpc_a.dir/intercept.pb.cc.o
[ 37%] Building CXX object intercept/proto/CMakeFiles/rpc_a.dir/intercept.grpc.pb.cc.o
[ 37%] Built target exec_a
[ 38%] Building CXX object intercept/CMakeFiles/exec.dir/source/report/libexec/lib.cc.o
[ 40%] Building CXX object intercept/CMakeFiles/exec.dir/source/report/libexec/std.cc.o
/home/patphzhang/Bear/source/libsys/source/Process.cc:55:10: fatal error: 'spdlog/spdlog.h' file not found
   55 | #include <spdlog/spdlog.h>
      |          ^~~~~~~~~~~~~~~~~
1 error generated.
make[5]: *** [libsys/CMakeFiles/sys_a.dir/build.make:132: libsys/CMakeFiles/sys_a.dir/source/Process.cc.o] Error 1
make[5]: *** Waiting for unfinished jobs....
[ 42%] Linking C shared library libexec.so
[ 42%] Built target exec
make[4]: *** [CMakeFiles/Makefile2:309: libsys/CMakeFiles/sys_a.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
[ 42%] Built target rpc_a
[ 42%] Built target shell_a
[ 42%] Built target flags_a
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/BearSource.dir/build.make:87: subprojects/Stamp/BearSource/BearSource-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/BearSource.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

But it also failed.
I tried to install the spdlog manually, but it did not work either.

[ 47%] Built target grpc_dependency
[ 47%] Built target nlohmann_json_dependency
[ 47%] Built target spdlog_dependency
[ 47%] Built target googletest_dependency
[ 47%] Built target fmt_dependency
[ 52%] Performing build step for 'BearSource'
[  1%] Built target shell_a
[  3%] Built target flags_a
[ 13%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Process.cc.o
[ 18%] Built target exec_a
[ 28%] Built target rpc_a
[ 30%] Building CXX object libmain/CMakeFiles/main_a.dir/source/ApplicationLogConfig.cc.o
[ 32%] Building CXX object libmain/CMakeFiles/main_a.dir/source/SubcommandFromArgs.cc.o
[ 33%] Building CXX object libmain/CMakeFiles/main_a.dir/source/ApplicationFromArgs.cc.o
[ 38%] Built target exec
[ 42%] Built target domain_a
/home/patphzhang/Bear/source/libmain/source/SubcommandFromArgs.cc:29:55: error: expected class name
   29 | template <> struct fmt::formatter<flags::Arguments> : ostream_formatter {};
      |                                                       ^
/home/patphzhang/Bear/source/libmain/source/ApplicationFromArgs.cc:27:55: error: expected class name
   27 | template <> struct fmt::formatter<flags::Arguments> : ostream_formatter {};
      |                                                       ^
1 error generated.
make[5]: *** [libmain/CMakeFiles/main_a.dir/build.make:104: libmain/CMakeFiles/main_a.dir/source/SubcommandFromArgs.cc.o] Error 1
make[5]: *** Waiting for unfinished jobs....
In file included from /home/patphzhang/Bear/source/libmain/source/ApplicationFromArgs.cc:22:
In file included from /usr/include/fmt/ostream.h:13:
In file included from /usr/include/fmt/format.h:44:
/usr/include/fmt/core.h:898:28: error: no member named 'parse' in 'fmt::formatter<flags::Arguments>'
  898 |     parse_ctx.advance_to(f.parse(parse_ctx));
      |                          ~ ^
/usr/include/fmt/core.h:883:21: note: in instantiation of function template specialization 'fmt::internal::value<fmt::basic_format_context<std::back_insert_iterator<fmt::internal::buffer<char>>, char>>::format_custom_arg<flags::Arguments, fmt::formatter<flags::Arguments>>' requested here
  883 |     custom.format = format_custom_arg<
      |                     ^
/usr/include/fmt/core.h:1217:10: note: in instantiation of function template specialization 'fmt::internal::value<fmt::basic_format_context<std::back_insert_iterator<fmt::internal::buffer<char>>, char>>::value<flags::Arguments>' requested here
 1217 |   return arg_mapper<Context>().map(val);
      |          ^
/usr/include/fmt/core.h:1354:25: note: in instantiation of function template specialization 'fmt::internal::make_arg<true, fmt::basic_format_context<std::back_insert_iterator<fmt::internal::buffer<char>>, char>, fmt::internal::type::custom_type, flags::Arguments, 0>' requested here
 1354 |         data_{internal::make_arg<
      |                         ^
/usr/include/fmt/core.h:1371:10: note: in instantiation of member function 'fmt::format_arg_store<fmt::basic_format_context<std::back_insert_iterator<fmt::internal::buffer<char>>, char>, flags::Arguments>::format_arg_store' requested here
 1371 |   return {args...};
      |          ^
/usr/include/fmt/format.h:3378:31: note: in instantiation of function template specialization 'fmt::make_format_args<fmt::basic_format_context<std::back_insert_iterator<fmt::internal::buffer<char>>, char>, flags::Arguments>' requested here
 3378 |                               make_format_args<context>(args...));
      |                               ^
/usr/include/spdlog/logger.h:88:18: note: in instantiation of function template specialization 'fmt::format_to<fmt::basic_string_view<char>, const flags::Arguments &, 250UL, char>' requested here
   88 |             fmt::format_to(buf, fmt, args...);
      |                  ^
/usr/include/spdlog/logger.h:98:9: note: in instantiation of function template specialization 'spdlog::logger::log<flags::Arguments>' requested here
   98 |         log(source_loc{}, lvl, fmt, args...);
      |         ^
/usr/include/spdlog/logger.h:110:9: note: in instantiation of function template specialization 'spdlog::logger::log<flags::Arguments>' requested here
  110 |         log(level::debug, fmt, args...);
      |         ^
/usr/include/spdlog/spdlog.h:147:27: note: in instantiation of function template specialization 'spdlog::logger::debug<flags::Arguments>' requested here
  147 |     default_logger_raw()->debug(fmt, args...);
      |                           ^
/home/patphzhang/Bear/source/libmain/source/ApplicationFromArgs.cc:48:25: note: in instantiation of function template specialization 'spdlog::debug<flags::Arguments>' requested here
   48 |                 spdlog::debug("arguments parsed: {0}", args);
      |                         ^
In file included from /home/patphzhang/Bear/source/libmain/source/ApplicationFromArgs.cc:22:
In file included from /usr/include/fmt/ostream.h:13:
In file included from /usr/include/fmt/format.h:44:
/usr/include/fmt/core.h:899:22: error: no member named 'format' in 'fmt::formatter<flags::Arguments>'
  899 |     ctx.advance_to(f.format(*static_cast<const T*>(arg), ctx));
      |                    ~ ^
3 errors generated.
make[5]: *** [libmain/CMakeFiles/main_a.dir/build.make:90: libmain/CMakeFiles/main_a.dir/source/ApplicationFromArgs.cc.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:335: libmain/CMakeFiles/main_a.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
[ 50%] Built target sys_a
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/BearSource.dir/build.make:87: subprojects/Stamp/BearSource/BearSource-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/BearSource.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Question: how can I fix this issue?
Thanks~

@rizsotto
Copy link
Owner

To me it looks version mismatch. I would recommend to look at the INSTALL.md file for what packages needs to be installed or what are the minimal versions of those. Also, check the third_party directory, that has a CMake file for each dependency.

Generally speaking, Bear build is expecting the dependencies installed. If not installed, it fetches and compile from source. If your machine is in a mixed state (some dependency is there, but some is missing) might cause issues.

And I would note that libspdlog and libfmt are both dependencies, but libspdlog also depends on libfmt. So, version numbers matter for these libraries.

@patrickphzhang
Copy link
Author

Thank you for the reply.
I have checked the version of each package. I think the main problem is the spdlog package (v1.5), which is installed by the yum command (yum install spdlog spdlog-devel). However, the include files are not fully installed on CentOS and the spdlog/fmt/bundled folder is missing. So I got the first error output.
I tried to install the spdlog manually but it also didn't work. That is why I tried to let the bear resolve the dependency by itself, as indicated in the INSTALL.md:

The dependencies can come from OS packages or the build will fetch the sources and build locally.

Then I got the second error output.
I am wondering if there are any pre-built packages on the CentOS.
Thanks again for your attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants