繁体   English   中英

在 pkg-config 搜索路径中找不到 Package

[英]Package was not found in the pkg-config search path

我正在尝试在 ubuntu 18.04 上安装package。 安装说明说安装命令应如下所示:

- autoreconf -i -f
- ./configure --with-libmaus2=${LIBMAUSPREFIX} \
    --prefix=${HOME}/biobambam2
- make install

第一行似乎没有任何错误。 当我尝试像这样运行第二行时:

./configure --with-libmaus2=/SOFT/libmaus2-2.0.794-release-20210706224245/ --prefix=/SOFT/biobambam2-2.0.182-release-20210412001032/

我收到以下错误:

configure: error: Package requirements (libmaus2 >= 2.0.774) were not met:

Package libmaus2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libmaus2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libmaus2', required by 'world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables libmaus2_CFLAGS
and libmaus2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

我知道./configure看不到我提供的库目录,但我不知道如何修复它。

您需要正确安装 libmaus2 并正确设置 PKG_CONFIG_PATH:

  1. 以这种方式配置和编译 libmaus2: ./configure --prefix=/SOFT/libmaus2 && make -j8 install
  2. export PKG_CONFIG_PATH=/SOFT/libmaus2/lib/pkgconfig
  3. ./configure --prefix=/SOFT/biobambam2 && make -j8 install

一般来说,安装适当的开发者版本的库就可以了。

“配置”搜索所需的库,例如:

    pkg-config --modversion libmaus2

通常,Ubuntu 分发两个版本:一个是普通库。 另一个是开发者版本,包含 pc 文件和 header 文件等用于 pkg-config,并在 pkg 名称中添加了“-dev”。 您可以检查可用的库作为

    apt-cache search libmaus

返回(在我的系统上 Ubuntu 22)

    libmaus2-2
    libmaus2-dev

如果安装 libmaus2-dev,名为 libmaus2.pc 的 pc 文件将被安装到,例如,/usr/lib/x86_64-linux-gnu/pkgconfig/libmaus2.pc Install libmaus2 不会得到那个。

如果您必须自己构建 libmaus 并安装到不在 pkg-config 搜索路径中的路径,请执行类似

    export PKG_CONFIG_PATH=/special/path/to/pkgconfig:${PKG_CONFIG_PATH}

注意:使用以下命令检查 pkg-config 搜索路径:

    pkg-config --variable pc_path pkg-config

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM