简体   繁体   English

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

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

I am trying to install this package on ubuntu 18.04.我正在尝试在 ubuntu 18.04 上安装package。 The installation instructions say that the installation command should look like the following:安装说明说安装命令应如下所示:

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

The first line seems to work without any errors.第一行似乎没有任何错误。 When I try to run the second line like so:当我尝试像这样运行第二行时:

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

I get the following error:我收到以下错误:

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.

I understand that ./configure does not see the library directory I provided, but I have no idea how to fix it.我知道./configure看不到我提供的库目录,但我不知道如何修复它。

you need to install correctly libmaus2 and set correctly PKG_CONFIG_PATH:您需要正确安装 libmaus2 并正确设置 PKG_CONFIG_PATH:

  1. configure and compile libmaus2 this way: ./configure --prefix=/SOFT/libmaus2 && make -j8 install以这种方式配置和编译 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

In general, install proper developer version of the library would work.一般来说,安装适当的开发者版本的库就可以了。

"Configure" searches the required library with something like: “配置”搜索所需的库,例如:

    pkg-config --modversion libmaus2

Typically, Ubuntu distributes two versions: one is the normal lib.通常,Ubuntu 分发两个版本:一个是普通库。 The other is a developer version with pc file and header files etc for pkg-config, and with added "-dev" to the pkg name.另一个是开发者版本,包含 pc 文件和 header 文件等用于 pkg-config,并在 pkg 名称中添加了“-dev”。 You can check available library as您可以检查可用的库作为

    apt-cache search libmaus

that returns (on my system Ubuntu 22)返回(在我的系统上 Ubuntu 22)

    libmaus2-2
    libmaus2-dev

If install libmaus2-dev, the pc file named libmaus2.pc would get installed to, for example, /usr/lib/x86_64-linux-gnu/pkgconfig/libmaus2.pc Install libmaus2 would not get that.如果安装 libmaus2-dev,名为 libmaus2.pc 的 pc 文件将被安装到,例如,/usr/lib/x86_64-linux-gnu/pkgconfig/libmaus2.pc Install libmaus2 不会得到那个。

If you have to build libmaus yourself and install to a path not in pkg-config search paths, do something like如果您必须自己构建 libmaus 并安装到不在 pkg-config 搜索路径中的路径,请执行类似

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

NOTE: Use the following to check pkg-config search paths:注意:使用以下命令检查 pkg-config 搜索路径:

    pkg-config --variable pc_path pkg-config

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

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