我正在尝试安装 udunits。我从以下网址下载了 udunits-2.2.28.tar.gzhttps://artifacts.unidata.ucar.edu/service/rest/repository/browse/downloads-udunits/
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
首先我使用以下命令安装 cmake:
version=3.19
build=1
mkdir ~/temp
cd ~/temp
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz
cd cmake-$version.$build/
sudo apt install libssl-dev
./bootstrap
make -j$(nproc)
sudo make install
cmake --version
Returns:
cmake version 3.19.6
CMake suite maintained and supported by Kitware (kitware.com/cmake).
然后我导航到解压 udunits 文件的目录
cd /mnt/c/Users/Downloads/udunits-2.2.28/
mkdir build
cd build
cmake ..
这是我得到的答复:
DEFAULT_UDUNITS2_XML_PATH = "/mnt/c/Users/Downloads/udunits-2.2.28/../share/udunits/udunits2.xml"
CMake Warning at CMakeLists.txt:132 (MESSAGE):
makeinfo(1) not found. Existing documentation will be used.
-- Unable to find CUnit library. Unit-testing not enabled.
CMake Error: File /mnt/c/Users/Downloads/udunits-2.2.28/config.h.cmake does not exist.
CMake Error at CMakeLists.txt:206 (CONFIGURE_FILE):
CONFIGURE_FILE Problem configuring file
Texinfo-file "udunits2lib.texi" will not be processed.
Texinfo-file "udunits2prog.texi" will not be processed.
Texinfo-file "udunits2.texi" will not be processed.
-- Configuring incomplete, errors occurred!
有人可以帮忙吗?我在这里看到了这个话题:
但它并没有帮助我继续。我对 Ubuntu 很陌生,似乎每次我修复一个问题(缺少库或其他东西)时都会抛出另一个错误。我需要知道是否真的可以使用 Ubuntu 安装这个库。有人这样做过吗?
答案1
您不需要编译打包的应用程序, 真的。
只需打开终端并输入:
sudo apt-add-repository universe
sudo apt-get install libudunits2-dev
然后使用乌德尼茨以源代码形式(作为构建时依赖项)或二进制形式(udunits2
可从udunits-bin包裹)。