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

[package] boost/1.75.0: Undefined symbols for boost_fiber with option boost:shared=True #4339

Closed
DominikDeak opened this issue Jan 22, 2021 · 1 comment · Fixed by #7348
Closed
Labels
bug Something isn't working

Comments

@DominikDeak
Copy link

When I try building shared libraries for boost via the Xcode toolchain, I get undefined symbols errors for boost_fiber library. See more verbose log snippets at the bottom of this post.

      Undefined symbols for architecture x86_64:
        "boost::fibers::context::active()", referenced from:
            boost::fibers::numa::algo::work_stealing::pick_next() in work_stealing.o
        "boost::fibers::context::attach(boost::fibers::context*)", referenced from:
            boost::fibers::numa::algo::work_stealing::pick_next() in work_stealing.o
        "boost::fibers::context::detach()", referenced from:
            boost::fibers::numa::algo::work_stealing::awakened(boost::fibers::context*) in work_stealing.o
      ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)

Package and Environment Details

  • Package Name/Version: boost/1.75.0
  • Operating System+version: macOS Catalina 10.15.4 (19E287)
  • Compiler+version: Xcode Version 12.3 (12C33)
  • Conan version: 1.31.4
  • Python version: 2.7.16 and 3.9.1

Conan profile

Note that the profile has compiler.cppstd=14 added due to this issue: #4097

[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=12.0
compiler.libcxx=libc++
compiler.cppstd=14
build_type=Release
[options]
[build_requires]
[env]

Steps to reproduce

Run the command:

conan install boost/1.75.0@ --build -o boost:shared=True

Logs

Click to expand log
      <snip>

      clang-darwin.compile.c++ /Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/fiber/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/numa/algo/work_stealing.o
      clang-darwin.link.dll /Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/fiber/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/libboost_fiber_numa.dylib
      Undefined symbols for architecture x86_64:
        "boost::fibers::context::active()", referenced from:
            boost::fibers::numa::algo::work_stealing::pick_next() in work_stealing.o
        "boost::fibers::context::attach(boost::fibers::context*)", referenced from:
            boost::fibers::numa::algo::work_stealing::pick_next() in work_stealing.o
        "boost::fibers::context::detach()", referenced from:
            boost::fibers::numa::algo::work_stealing::awakened(boost::fibers::context*) in work_stealing.o
      ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)

          "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk" "-arch" "x86_64" -stdlib=libc++  -o "/Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/fiber/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/libboost_fiber_numa.dylib" -single_module -dynamiclib -install_name "@rpath/libboost_fiber_numa.dylib" "/Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/fiber/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/numa/pin_thread.o" "/Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/fiber/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/numa/topology.o" "/Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/fiber/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/numa/algo/work_stealing.o" "/Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/context/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/libboost_context.dylib" "/Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/filesystem/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/libboost_filesystem.dylib"         -fPIC -m64 -fvisibility=hidden -fvisibility-inlines-hidden

      ...failed clang-darwin.link.dll /Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/fiber/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/libboost_fiber_numa.dylib...
      ...skipped <p/Users/dom/.conan/data/boost/1.75.0/_/_/package/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/lib>libboost_fiber_numa.dylib for lack of <p/Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/fiber/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn>libboost_fiber_numa.dylib...

      <snip>
                                                 ^
      3 warnings generated.
      clang-darwin.link.dll /Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/boost/bin.v2/libs/graph/build/clng-drwn-12.0/rls/nm-on/thrd-mlt/vsblt-hdn/libboost_graph.dylib
      common.copy /Users/dom/.conan/data/boost/1.75.0/_/_/package/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102/lib/libboost_graph.dylib
      ...failed updating 1 target...
      ...skipped 1 target...
      ...updated 16911 targets...
      boost/1.75.0: 
      boost/1.75.0: ERROR: Package 'd53c46e71a0ac5a2eb8c24b35a5a529c49f71102' build failed
      boost/1.75.0: WARN: Build folder /Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102
      ERROR: boost/1.75.0: Error in build() method, line 663
              self.run(full_command, run_environment=True)
              ConanException: Error 1 while executing DYLD_LIBRARY_PATH="/Users/dom/.conan/data/zlib/1.2.11/_/_/package/647afeb69d3b0a2d3d316e80b24d38c714cc6900/lib:/Users/dom/.conan/data/bzip2/1.0.8/_/_/package/75fe66fbfe61230e9fcbb361f13b6b3baa483e0a/lib:/Users/dom/.conan/data/xz_utils/5.2.5/_/_/package/647afeb69d3b0a2d3d316e80b24d38c714cc6900/lib:/Users/dom/.conan/data/zstd/1.4.5/_/_/package/647afeb69d3b0a2d3d316e80b24d38c714cc6900/lib:/Users/dom/.conan/data/libiconv/1.16/_/_/package/647afeb69d3b0a2d3d316e80b24d38c714cc6900/lib" DYLD_FRAMEWORK_PATH="" b2 -q numa=on target-os=darwin architecture=x86 address-model=64 binary-format=mach-o abi=sysv --layout=system --user-config=/Users/dom/.conan/data/boost/1.75.0/_/_/source/source_subfolder/tools/build/user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=0 -sNO_ZSTD=0 boost.locale.iconv=on boost.locale.icu=off define=LZMA_API_STATIC threading=multi link=shared variant=release --with-atomic --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-wave toolset=clang-darwin cxxflags=-std=c++14 pch=on -sICONV_PATH=/Users/dom/.conan/data/libiconv/1.16/_/_/package/647afeb69d3b0a2d3d316e80b24d38c714cc6900 linkflags="-stdlib=libc++" cxxflags="-fPIC -stdlib=libc++" install --prefix=/Users/dom/.conan/data/boost/1.75.0/_/_/package/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102 -j8 --abbreviate-paths --debug-configuration --build-dir="/Users/dom/.conan/data/boost/1.75.0/_/_/build/d53c46e71a0ac5a2eb8c24b35a5a529c49f71102"
@DominikDeak DominikDeak added the bug Something isn't working label Jan 22, 2021
@dmn-star
Copy link
Contributor

dmn-star commented Jan 23, 2021

try to patch /Users/xxxx/.conan/data/boost/1.75.0///source/source_subfolder/libs/fiber/build/Jamfile.v2

add <link>shared:<library>.//boost_fiber

lib boost_fiber_numa
    : numa_sources
      numa/algo/work_stealing.cpp
    : 
    <link>shared:<library>.//boost_fiber
    :
    <conditional>@numa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants