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

macOS with g++-14: Error: ld: library 'asan' not found #71

Open
ClausKlein opened this issue Nov 7, 2024 · 1 comment
Open

macOS with g++-14: Error: ld: library 'asan' not found #71

ClausKlein opened this issue Nov 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ClausKlein
Copy link
Collaborator

/Users/clausklein/Workspace/cpp/beman-project/execution26
bash-5.2$ CXX=g++-14 cmake --workflow --preset debug --fresh 
Executing workflow step 1 of 3: configure preset "debug"

Preset CMake variables:

  CMAKE_BUILD_TYPE="Debug"
  CMAKE_CXX_EXTENSIONS:BOOL="FALSE"
  CMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined"
  CMAKE_CXX_STANDARD="23"
  CMAKE_CXX_STANDARD_REQUIRED:BOOL="TRUE"
  CMAKE_EXPORT_COMPILE_COMMANDS:BOOL="TRUE"
  CMAKE_INSTALL_PREFIX:PATH="/Users/clausklein/Workspace/cpp/beman-project/execution26/stagedir"
  CMAKE_PREFIX_PATH:STRING="/Users/clausklein/Workspace/cpp/beman-project/execution26/stagedir"
  CMAKE_SKIP_TEST_ALL_DEPENDENCY:BOOL="FALSE"

-- The CXX compiler identification is GNU 14.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/local/bin/g++-14
-- Check for working CXX compiler: /usr/local/bin/g++-14 - broken
CMake Error at /usr/local/Cellar/cmake/3.30.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
  The C++ compiler

    "/usr/local/bin/g++-14"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/clausklein/Workspace/cpp/beman-project/execution26/build/debug/CMakeFiles/CMakeScratch/TryCompile-ajlZfX'
    
    Run Build Command(s): /usr/local/bin/ninja -v cmTC_2947e
    [1/2] /usr/local/bin/g++-14   -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined  -std=c++23 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -o CMakeFiles/cmTC_2947e.dir/testCXXCompiler.cxx.o -c /Users/clausklein/Workspace/cpp/beman-project/execution26/build/debug/CMakeFiles/CMakeScratch/TryCompile-ajlZfX/testCXXCompiler.cxx
    [2/2] : && /usr/local/bin/g++-14 -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/llvm/lib/c++ CMakeFiles/cmTC_2947e.dir/testCXXCompiler.cxx.o -o cmTC_2947e   && :
    FAILED: cmTC_2947e 
    : && /usr/local/bin/g++-14 -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/llvm/lib/c++ CMakeFiles/cmTC_2947e.dir/testCXXCompiler.cxx.o -o cmTC_2947e   && :
    ld: library 'asan' not found
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:8 (project)


-- Configuring incomplete, errors occurred!
bash-5.2$ 
@dietmarkuehl dietmarkuehl added the bug Something isn't working label Nov 7, 2024
@dietmarkuehl
Copy link
Collaborator

That seems like an environment problem: the shared object isn't found. Maybe the DYLD_LIBRARY_PATH needs to be set up in some way?

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

No branches or pull requests

2 participants