BabitMF / bmf

Cross-platform, customizable multimedia/video processing framework. With strong GPU acceleration, heterogeneous design, multi-language support, easy to use, multi-framework compatible and high performance, the framework is ideal for transcoding, AI inference, algorithm integration, live video streaming, and more.
https://babitmf.github.io/
Apache License 2.0
809 stars 71 forks source link

ld: library 'bfd' not found when compile bmf on MacOS #142

Open JackLau1222 opened 2 weeks ago

JackLau1222 commented 2 weeks ago

Follow the document to install binutils using brew, and you will encounter

ld: library 'bfd' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [output/bmf/lib/libhmp.dylib] Error 1
make[1]: *** [bmf/hml/src/CMakeFiles/hmp.dir/all] Error 2
make: *** [all] Error 2

binutils used by backward-cpp, and homebrew install binutils will miss libiberty, you will meet this problem if you add the environment variable.

ld: library 'iberty' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test_rectrace] Error 1
make[1]: *** [CMakeFiles/test_rectrace.dir/all] Error 2
ld: library 'iberty' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test_select_signals] Error 1
make[1]: *** [CMakeFiles/test_select_signals.dir/all] Error 2
ld: library 'iberty' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test_stacktrace] Error 1
make[1]: *** [CMakeFiles/test_stacktrace.dir/all] Error 2
[100%] Linking CXX executable test_suicide
ld: library 'iberty' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test_suicide] Error 1
make[1]: *** [CMakeFiles/test_suicide.dir/all] Error 2
make: *** [all] Error 2

so i recommend compile the binutils manually

wget https://ftp.gnu.org/gnu/binutils/binutils-2.43.1.tar.bz2
tar xvf binutils-2.43.1.tar.bz2
cd binutils
./configure --prefix=/usr/local/opt/binutils --enable-install-libiberty
sudo make -j8 altinstall

and you need add some environment variable before you compile bmf

export LIBRARY_PATH=/usr/local/opt/binutils/lib:$LIBRARY_PATH
export CMAKE_PREFIX_PATH=/usr/local/opt/binutils:$CMAKE_PREFIX_PATH

i will submit a PR into website repo later

JackLau1222 commented 2 weeks ago

done! https://github.com/BabitMF/BabitMF.github.io/pull/28