编译LuisaRender时它的子目录assimp会报一个warning:
"-- Checking for module 'zzip-zlib-config' -- No package 'zzip-zlib-config' found"
网上的答案通常是这样的:
1. chatgpt:
sudo apt update
sudo apt install libzzip-dev zlib1g-dev
export LD_LIBRARY_PATH=/path/to/zzip/lib:/path/to/zlib/lib:$LD_LIBRARY_PATH
cmake -DCMAKE_PREFIX_PATH="/path/to/zzip;/path/to/zlib" /path/to/source
pkg-config --list-all | grep zzip
pkg-config --list-all | grep zlib
2.
c++ - Error in building Assimp in Cmake - Stack Overflow
Please try the latest version of assimp ( 4.1.0 ). The cygwin-cmake file was broken. This shall work with the latest version.
As a workaround diable the tools-support for assimp ( the library will be build, but the qt5-based viewer not ):
cmake CMakelists.txt -DASSIMP_BUILD_ASSIMP_TOOLS=OFF
This will fix your cmake-error, because the tools will not be affected by cmake.
两个都试了然并卵,属于答非所问....
真正的解决思路:
下载源码
git clone --recursive https://github.com/gdraheim/zziplib
cd zziplib
先搜索哪些文件包含这个字段:
grep -r zzip-zlib-config
结果:
docs/64on32.htm:zzip-zlib-config zzip-zlib-config - ZLib Config (for ZZipLib)
docs/configs.htm: zzip-zlib-config zzip-zlib-config - ZLib Config (for ZZipLib)
docs/configs.htm: The two entries like "zzip-sdl-config" and "zzip-zlib-config"
docs/configs.htm: $ pkg-config zzip-zlib-config --modversion
docs/configs.htm: $ pkg-config zzip-zlib-config --libs
old.configure:ax_create_pkgconfig_requires="zzip-zlib-config"
old.configure.ac:[zzip/zziplib.pc], [zzip-zlib-config],[-lzzip],,[ ])
testbuilds.py: A='"s:zzip-zlib-config:zlib:"'
testbuilds.py: cmd = "docker exec {testname1} bash -c 'find /usr/local -name zzip-zlib-config.pc -exec rm -v {item} {end}'"
testbuilds.py: A='"s:zzip-zlib-config:zlib:"'
testbuilds.py: cmd = "docker exec {testname1} bash -c 'find /usr/local -name zzip-zlib-config.pc -exec rm -v {item} {end}'"
testbuilds.py: A='"s:zzip-zlib-config:zlib:"'
testbuilds.py: cmd = "docker exec {testname1} bash -c 'find /usr/local -name zzip-zlib-config.pc -exec rm -v {item} {end}'"
testbuilds.py: A='"s:zzip-zlib-config:zlib:"'
testbuilds.py: cmd = "docker exec {testname1} bash -c 'find /usr/local -name zzip-zlib-config.pc -exec rm -v {item} {end}'"
zzip/Makefile.am:pkgconfig_HEADERS= zzip-zlib-config.pc zziplib.pc \
zzip/Makefile.am:zzip-zlib-config.pc : Makefile
zzip/Makefile.am: @ echo "Name: zzip-zlib-config" >>$@
zzip/Makefile.am: echo 'Requires: zzip-zlib-config' >>$@
zzip/Makefile.in:pkgconfig_HEADERS = zzip-zlib-config.pc zziplib.pc \
zzip/Makefile.in:zzip-zlib-config.pc : Makefile
zzip/Makefile.in: @ echo "Name: zzip-zlib-config" >>$@
先编译安装库文件
make
make install
查看下多了哪些内容
git status
启用旧的配置文件好生成 zzip-zlib-config.pc
mv old.configure.ac configure.ac
mv old.configure configure
重新配置一下:
./configure
查看下多了哪些内容 :
git status
zzip下面会多一个MakeFile
cd zzip
make
git status
此时 zzip-zlib-config.pc已经生成
make install
这一步会将zzip-zlib-config.pc拷贝到zzip-zlib-config.pc
保险起见我们在拷贝一份到/usr/lib/x86_64-linux-gnu/pkgconfig/目录下
cp zzip-zlib-config.pc /usr/lib/x86_64-linux-gnu/pkgconfig/
# locate zzip-zlib-config
/usr/lib/x86_64-linux-gnu/pkgconfig/zzip-zlib-config.pc
/usr/local/lib/pkgconfig/zzip-zlib-config.pc
# pkg-config zzip-zlib-config --libs
-lz
搞定!