这块不熟,我现在遇到的问题
libheif 依赖 aom 而 aom 编译后的文件使用了 @rpath, 导致环境变量中必须设置 export DYLD_LIBRARY_PATH="/usr/local/aom/3.6.0/lib/:$DYLD_LIBRARY_PATH" 后 libheif 可以正常 找到 aom 的 dylib ,这倒是没有问题,但问题是我编译安装其它软件时,所有依赖 libheif 的编译,都会提示:
dyld: Library not loaded: @rpath/libaom.3.dylib Referenced from: /usr/local/libheif/1.15.2/lib/libheif.1.dylib Reason: image not found
cmake 编译如何去除这个 @rpath 改为绝对路径, 如 @rpath/libaom.3.dylib 改为 /usr/local/aom/3.6.0/lib/libaom.3.dylib
有一些参数,目前试过没有成功 CMAKE_SKIP_BUILD_RPATH CMAKE_BUILD_WITH_INSTALL_RPATH CMAKE_INSTALL_RPATH_USE_LINK_PATH
git clone https://aomedia.googlesource.com/aom cd aom mkdir -p ../aom_build cd ../aom_build
cmake /Users/xx/Downloads/aom -DCMAKE_INSTALL_PREFIX=/usr/local/aom/3.6.0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=1 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 -DBUILD_SHARED_LIBS=1 -DCONFIG_TUNE_BUTTERAUGLI=1 -DCONFIG_TUNE_VMAF=1 这里改怎么设置
aom:
otool -L /usr/local/aom/3.6.0/bin/aomenc
/usr/local/aom/3.6.0/bin/aomenc:
@rpath/libaom.3.dylib (compatibility version 3.0.0, current version 3.6.0) #要改这里为绝对路径
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.7.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
heif:
otool -L /usr/local/libheif/1.15.2/bin/heif-enc
/usr/local/libheif/1.15.2/bin/heif-enc:
/usr/local/libheif/1.15.2/lib/libheif.1.dylib (compatibility version 17.0.0, current version 17.2.0)
@rpath/libaom.3.dylib (compatibility version 3.0.0, current version 3.6.0)
/usr/local/opt/libvmaf/lib/libvmaf.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/jpeg-xl@0.6.1/lib/libjxl.0.6.dylib (compatibility version 0.6.0, current version 0.6.1)
/usr/local/opt/libde265/lib/libde265.0.dylib (compatibility version 2.0.0, current version 2.4.0)
/usr/local/opt/x265/lib/libx265.199.dylib (compatibility version 199.0.0, current version 199.0.0)
/usr/local/opt/jpeg-turbo/lib/libjpeg.8.dylib (compatibility version 8.0.0, current version 8.2.2)
/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 56.0.0, current version 56.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.