在Macos Monterey上建造Libcamera

发布于 2025-02-13 09:26:42 字数 609 浏览 0 评论 0原文

我正在尝试在Macos Monterey上构建Libcamera,因为这是

MESON构建如上所述此处正在进入错误src/libcamera/meson.build:68:0:错误:c共享或静态库'gnutls'找不到

试图解决这个问题,我通过Homebrew安装了Gnutls。由于这没有帮助,我也尝试通过MacPorts安装Gnutls-Devel。这也无济于事。

执行pkg-config -list-all | Grep Gnutls返回 Gnutls Gnutls- GNU系统的运输安全层实现

有人知道如何解决吗?我还想了解在MacOS下为Linux开发类似依赖性的首选方法是什么。

谢谢!

I'm trying to build libcamera on MacOS Monterey because it is a required dependency for raspberrypi/libcamera-apps.

meson build as described here is running into the error src/libcamera/meson.build:68:0: ERROR: C shared or static library 'gnutls' not found.

Trying to remediate the issue, I installed gnutls via homebrew. Since this didn't help I also tried to install gnutls-devel via MacPorts. This didn't help either.

Executing pkg-config --list-all | grep gnutls returns
gnutls GnuTLS - Transport Security Layer implementation for the GNU system.

Does anyone know how to resolve that? I would also like to understand what is the preferred way of managing similar dependencies when developing for linux under MacOS.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

当爱已成负担 2025-02-20 09:26:42

为了解决上述问题,我已经找出了MacBook上Gnutls上的位置。作为下一步,我通过执行export libral_path =/opt/local/lib/lib,将环境变量library_path设置为此位置。

To resolve the above issue I have figured out the location on gnutls on my MacBook. As next step, I set the environment variable LIBRARY_PATH to this location by executing export LIBRARY_PATH=/opt/local/lib.

水晶透心 2025-02-20 09:26:42

如果Meson找不到软件包,并且已安装了包裹,则可能只需要链接它即可。

以下是大多数库的一般步骤:

步骤1:不要尝试通过ls ing或cd ing ing 探索根目录)。

步骤2:使用查找命令查找匹配.dylib文件。


find / -name "*[library name]*.dylib" 2> /dev/null


# Since we are looking for the gnutls library:
find / -name "*gnutls*.dylib" 2> /dev/null

输出:

/usr/local/Caskroom/miniconda/base/lib/python3.11/site-packages/cv2/.dylibs/libgnutls.30.dylib
/usr/local/Caskroom/miniconda/base/envs/metagpt/lib/python3.10/site-packages/cv2/.dylibs/libgnutls.30.dylib
/usr/local/lib/libgnutls.30.dylib
/usr/local/lib/libgnutlsxx.dylib
/usr/local/lib/libgnutls.dylib
/usr/local/lib/python3.10/site-packages/cv2/.dylibs/libgnutls.30.dylib
/usr/local/lib/libgnutls-dane.dylib
/usr/local/lib/libgnutlsxx.30.dylib
/usr/local/lib/libgnutls-dane.0.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutls.30.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutlsxx.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutls.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutls-dane.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutlsxx.30.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutls-dane.0.dylib
...

/告诉查找要搜索需要很长时间的整个根目录。如果您安装了gnutls brew selplist gnutls难以捉摸的.dylib应在/usr/usr/local/local(Intel Mac)下)或/opt/local(苹果硅)。因此,只需单独运行这些命令:

find /usr/local -name "*gnutls*.dylib" 2> /dev/null
find /opt/local -name "*gnutls*.dylib" 2> /dev/null

步骤3:正如他的答案中提到的OP:在我的情况下,添加包含的目录,libgnutls.30.dylib,将像这样:


export LIBRARY_PATH=$LIBRARY_PATH:/usr/local
#                   -------------
#                   Very Important!

应添加$ library_path:,只有libers_path环境变量已经存在。添加它会将我们的新路径附加到列表中,而不是完全覆盖它。

If meson can't find a package and you have it installed, you probably just need to link it.

Here are the general steps for most libraries like this:

Step 1: DO NOT try to manually find the library by lsing or cding around (unless your new and want to explore the root directory).

Step 2: Use the find command to find the matching .dylib file.


find / -name "*[library name]*.dylib" 2> /dev/null


# Since we are looking for the gnutls library:
find / -name "*gnutls*.dylib" 2> /dev/null

Output:

/usr/local/Caskroom/miniconda/base/lib/python3.11/site-packages/cv2/.dylibs/libgnutls.30.dylib
/usr/local/Caskroom/miniconda/base/envs/metagpt/lib/python3.10/site-packages/cv2/.dylibs/libgnutls.30.dylib
/usr/local/lib/libgnutls.30.dylib
/usr/local/lib/libgnutlsxx.dylib
/usr/local/lib/libgnutls.dylib
/usr/local/lib/python3.10/site-packages/cv2/.dylibs/libgnutls.30.dylib
/usr/local/lib/libgnutls-dane.dylib
/usr/local/lib/libgnutlsxx.30.dylib
/usr/local/lib/libgnutls-dane.0.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutls.30.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutlsxx.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutls.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutls-dane.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutlsxx.30.dylib
/usr/local/Cellar/gnutls/3.8.4/lib/libgnutls-dane.0.dylib
...

The / tells find to search the entire root directory which takes a long time. If you installed gnutls with brew install gnutls the elusive .dylib should be under /usr/local (Intel Mac) or /opt/local (Apple Silicon). So just run these commands separately:

find /usr/local -name "*gnutls*.dylib" 2> /dev/null
find /opt/local -name "*gnutls*.dylib" 2> /dev/null

Step 3: As the OP mentioned in his answer: add the directory containing, in my case, libgnutls.30.dylib, to your LIBRARY_PATH like so:


export LIBRARY_PATH=$LIBRARY_PATH:/usr/local
#                   -------------
#                   Very Important!

The $LIBRARY_PATH: should be added just incase a LIBRARY_PATH environment variable already exists. Adding it appends our new path to the list rather than completely overwriting it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文