gabime / spdlog

Fast C++ logging library.
Other
24.3k stars 4.54k forks source link

Undefined symbols for architecture x86_64: "___builtin_addcll" on Mac using intel compiler #2543

Closed billcxx closed 1 year ago

billcxx commented 1 year ago

I'm trying to compile spdlog with intel oneapi and gnu compiler on different platforms. Here are the results.

System Intel onapi Compiler Status
Linux icc/icx Good
Win10 icl/icx Good
Mac icc Fail
System GNU Compiler Status
Linux gnu Good
Win10 gnu(mingw64 with msys2) Good
Mac gnu12(homebrew) Good

So only the intel classic compiler on Mac fails. It fails when linking the example

[1/1] Linking CXX executable example/example
FAILED: example/example 
: && /opt/intel/oneapi/compiler/2022.0.0/mac/bin/intel64/icpc -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names  example/CMakeFiles/example.dir/example.cpp.o -o example/example  libspdlog.a && :
Undefined symbols for architecture x86_64:
  "___builtin_addcll", referenced from:
      __ZN3fmt2v96detail9dragonbox10to_decimalIdEENS2_10decimal_fpIT_EES5_ in libspdlog.a(bundled_fmtlib_format.cpp.o)
ld: symbol(s) not found for architecture x86_64
ninja: build stopped: subcommand failed.

There are also some warnings that I don't see on other platforms, such as this one:

[8/10] Building CXX object CMakeFiles/spdlog.dir/src/spdlog.cpp.o
/Users/xcheng/Documents/spdlog/include/spdlog/fmt/bundled/core.h(3055): warning #3924: attribute namespace "clang" is unrecognized
        FMT_FALLTHROUGH;
        ^
          detected during:
            instantiation of "auto fmt::v9::detail::parse_format_specs<T,ParseContext>(ParseContext &)->decltype((<expression>)) [with T=fmt::v9::remove_cvref_t<int &>={int}, ParseContext=fmt::v9::detail::compile_parse_context<fmt::v9::remove_cvref_t<const char &>={char}, fmt::v9::detail::error_handler>]" at line 2954
            instantiation of "fmt::v9::detail::format_string_checker<Char, ErrorHandler, Args...>::format_string_checker(fmt::v9::basic_string_view<Char>, ErrorHandler) [with Char=fmt::v9::remove_cvref_t<const char &>={char}, ErrorHandler=fmt::v9::detail::error_handler, Args=<fmt::v9::remove_cvref_t<int &>={int}>]" at line 3008
            instantiation of "void fmt::v9::detail::check_format_string<Args...,S,<unnamed>>(S) [with Args=<int &>, S=FMT_COMPILE_STRING, <unnamed>=0]" at line 3162
            instantiation of "fmt::v9::basic_format_string<Char, Args...>::basic_format_string(const S &) [with Char=char, Args=<int &>, S=FMT_COMPILE_STRING, <unnamed>=0]" at line 110 of "/Users/xcheng/Documents/spdlog/include/spdlog/details/fmt_helper.h"

Maybe this is intel compiler's problem? I just want to report this and see if anybody can reproduce this problem.

gabime commented 1 year ago

@billcxx Any news about this?

billcxx commented 1 year ago

@gabime Sorry, I didn't try to resolve the Mac ICC problem. My primary platform is Linux, Mac support for my program is something nice to have but not really necessary(also gnu already works on Mac).

I forgot to give the information about my system and the compiler version. I tested on two Mac both failed with the same error (the library file is compiled, but fails when linking the example).

System: Mac 11.6.2 intel core Compiler: icpc version 2021.5.0 (gcc version 4.9.0 compatibility)

Also tested on,

System: Mac 13.1 M1 core Compiler: icpc version 2021.4.0 (gcc version 4.9.0 compatibility)

gabime commented 1 year ago

Closed due to inactivity