Skip to content

Building on MacOS: Library not loaded: @rpath/libzstd.1.dylib #143515

Open
@liamsemeria

Description

@liamsemeria

When building LLVM 20.1.6 on MacOS 15.5,

cmake --debug-output -S llvm -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_ARCHITECTURES='arm64' -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
and
ninja -C build

I ran into the following error while building:
[203/3857] Building AArch64TargetParserDef.inc... FAILED: include/llvm/TargetParser/AArch64TargetParserDef.inc /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/include/llvm/TargetParser/AArch64TargetParserDef.inc cd /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/include/llvm/TargetParser && /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/bin/llvm-min-tblgen -gen-arm-target-def -I /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/llvm/lib/Target/AArch64/ -I /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/llvm/include/llvm/TargetParser -I/Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/include -I/Users/Liam/Desktop/Projects/issues-llvm/llvm-project/llvm/include /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/llvm/lib/Target/AArch64/AArch64.td --write-if-changed -o AArch64TargetParserDef.inc -d AArch64TargetParserDef.inc.d && /Applications/CMake.app/Contents/bin/cmake -E cmake_transform_depfile Ninja gccdepfile /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/llvm /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/llvm/include/llvm/TargetParser /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/include/llvm/TargetParser /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/include/llvm/TargetParser/AArch64TargetParserDef.inc.d /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/CMakeFiles/d/6abe058c5bbb01a0082f24ba8f776f373be590dc987385a9e249c8f27a983164.d dyld[58469]: Library not loaded: @rpath/libzstd.1.dylib Referenced from: <9FBFD963-EB84-3BBC-A647-2F8F7AD92E74> /Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/bin/llvm-min-tblgen Reason: tried: '/Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/bin/../lib/libzstd.1.dylib' (no such file), '/Users/Liam/Desktop/Projects/issues-llvm/llvm-project/build/bin/../lib/libzstd.1.dylib' (no such file)

I have libzstd.1.dylib in usr/local/lib. To resolve the error I had to do -DLLVM_USE_STATIC_ZSTD=TRUE.
I was building LLVM recently without having to do this, could something have changed to cause this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions