无法弄清楚如何 link 我想编译成库的 C++ 包
Can't figure out how to link C++ package I want to compile to a library
我想编译 biobambam2 package which is dependent on libmaus2 库。两者都是一个目录中的单独文件夹。我编译了 libmaus2,libmaus2.pc 文件在它的基本目录中。现在,如果我尝试使用此命令编译 biobambam2:
- autoreconf -i -f
- ./configure --with-libmaus2=/SOFT/libmaus2-2.0.794-release-20210706224245 \
--prefix=/SOFT/biobambam2-2.0.182-release-20210412001032
- make install
我收到以下错误:
...
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.
如果我尝试像这样手动设置 PKG_CONFIG_PATH 变量:
autoreconf -i -f && \
export PKG_CONFIG_PATH="/SOFT/libmaus2-2.0.794-release-20210706224245/:$PKG_CONFIG_PATH" && \
./configure --prefix=/SOFT/biobambam2-2.0.182-release-20210412001032/ && \
make install
错误如下所示:
...
checking for libmaus2... yes
checking whether we can compile a program using libmaus2... no
configure: error: Required libmaus2 is not available.
谁能告诉我如何解决这个问题?我已经坚持了几个小时。
Ubuntu 18.04 示例:在 /home/name/tmp/
中构建
sudo apt install python3-pygments libsnappy-dev libgmp-dev
从 Ubuntu 20.04 下载 https://packages.ubuntu.com/focal/libdeflate-dev →
sudo gdebi libdeflate0_1.5-3_amd64.deb && sudo gdebi libdeflate-dev_1.5-3_amd64.deb
已安装 gcc94-c++_9.4.0-9_amd64.deb https://drive.google.com/file/d/1xTbHe8ktjKR2gSmQ0Qcw0WEuMoKR8s_w/view?usp=sharing → sudo gdebi gcc94-c++_9.4.0-9_amd64.deb
git clone https://gitlab.com/german.tischler/libmaus2.git
cd libmaus2/
libtoolize && aclocal && autoheader && automake --add-missing && autoconf
export CC=gcc94 CXX=g++94 && ./configure --prefix=/usr libdir=/usr/lib/x86_64-linux-gnu
make
sudo make install-strip
git clone https://gitlab.com/german.tischler/biobambam2.git
cd biobambam2/
libtoolize && aclocal && autoheader && automake --add-missing && autoconf
export CC=gcc94 CXX=g++94 && ./configure
make
sudo make install-strip
没有错误。
我想编译 biobambam2 package which is dependent on libmaus2 库。两者都是一个目录中的单独文件夹。我编译了 libmaus2,libmaus2.pc 文件在它的基本目录中。现在,如果我尝试使用此命令编译 biobambam2:
- autoreconf -i -f
- ./configure --with-libmaus2=/SOFT/libmaus2-2.0.794-release-20210706224245 \
--prefix=/SOFT/biobambam2-2.0.182-release-20210412001032
- make install
我收到以下错误:
...
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.
如果我尝试像这样手动设置 PKG_CONFIG_PATH 变量:
autoreconf -i -f && \
export PKG_CONFIG_PATH="/SOFT/libmaus2-2.0.794-release-20210706224245/:$PKG_CONFIG_PATH" && \
./configure --prefix=/SOFT/biobambam2-2.0.182-release-20210412001032/ && \
make install
错误如下所示:
...
checking for libmaus2... yes
checking whether we can compile a program using libmaus2... no
configure: error: Required libmaus2 is not available.
谁能告诉我如何解决这个问题?我已经坚持了几个小时。
Ubuntu 18.04 示例:在 /home/name/tmp/
中构建sudo apt install python3-pygments libsnappy-dev libgmp-dev
从 Ubuntu 20.04 下载 https://packages.ubuntu.com/focal/libdeflate-dev →
sudo gdebi libdeflate0_1.5-3_amd64.deb && sudo gdebi libdeflate-dev_1.5-3_amd64.deb
已安装 gcc94-c++_9.4.0-9_amd64.deb https://drive.google.com/file/d/1xTbHe8ktjKR2gSmQ0Qcw0WEuMoKR8s_w/view?usp=sharing → sudo gdebi gcc94-c++_9.4.0-9_amd64.deb
git clone https://gitlab.com/german.tischler/libmaus2.git
cd libmaus2/
libtoolize && aclocal && autoheader && automake --add-missing && autoconf
export CC=gcc94 CXX=g++94 && ./configure --prefix=/usr libdir=/usr/lib/x86_64-linux-gnu
make
sudo make install-strip
git clone https://gitlab.com/german.tischler/biobambam2.git
cd biobambam2/
libtoolize && aclocal && autoheader && automake --add-missing && autoconf
export CC=gcc94 CXX=g++94 && ./configure
make
sudo make install-strip
没有错误。