首页 > 解决方案 > 在 CentOS8 上构建的 hardinfo 无法找到库,即使它们安装在默认位置

问题描述

我正在我的一台机器上安装新的 CentOS 8,并且我正在尝试构建 hardinfo 包(请参阅https://github.com/lpereira/hardinfo)。根据说明,我在源代码树中构建了一个空的构建目录,在那里进行了更改,然后运行“cmake ..”,但会发生以下情况:

$ cmake ..
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- LOCALEDIR = /usr/local/share/locale
-- Building HardInfo for architecture: linux-x86
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2") 
-- Building for GTK2
-- Checking for modules 'gtk+-2.0>=2.10;glib-2.0>=2.10;gthread-2.0>=2.10;gmodule-export-2.0>=2.10'
--   Found gtk+-2.0, version 2.24.32
--   Found glib-2.0, version 2.56.4
--   Found gthread-2.0, version 2.56.4
--   Found gmodule-export-2.0, version 2.56.4
-- Checking for module 'libsoup-2.4>=2.42'
--   Package 'libsoup-2.4', required by 'virtual:world', not found
-- Checking for module 'json-glib-1.0'
--   Package 'json-glib-1.0', required by 'virtual:world', not found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:418 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:585 (_pkg_check_modules_internal)
  CMakeLists.txt:92 (pkg_check_modules)


-- Configuring incomplete, errors occurred!
See also "/home/tgirsch/Downloads/hardinfo-master/build/CMakeFiles/CMakeOutput.log".

但是包裹在那里:

$ sudo yum -y list installed | egrep "libsoup|json-glib"
json-glib.x86_64                                         1.4.4-1.el8                                    @BaseOS      
libsoup.i686                                             2.62.3-1.el8                                   @BaseOS      
libsoup.x86_64                                           2.62.3-1.el8                                   @BaseOS      

正如我所料,这些库位于 /usr/lib64 中:

$ ls -la /usr/lib64 | egrep "libsoup|json-glib"
lrwxrwxrwx.   1 root root       27 May 11  2019 libjson-glib-1.0.so.0 -> libjson-glib-1.0.so.0.400.4
-rwxr-xr-x.   1 root root   175896 May 11  2019 libjson-glib-1.0.so.0.400.4
lrwxrwxrwx.   1 root root       20 May 11  2019 libsoup-2.4.so.1 -> libsoup-2.4.so.1.8.0
-rwxr-xr-x.   1 root root  1072744 May 11  2019 libsoup-2.4.so.1.8.0
lrwxrwxrwx.   1 root root       26 May 11  2019 libsoup-gnome-2.4.so.1 -> libsoup-gnome-2.4.so.1.8.0
-rwxr-xr-x.   1 root root    13216 May 11  2019 libsoup-gnome-2.4.so.1.8.0

说明声称可以通过使用 -DHARDINFO_NOSYNC=1 运行 cmake 来跳过 libsoup 的内容,但我得到了相同的结果:

$ cmake .. -DHARDINFO_NOSYNC=1
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
[ ... snip ... ]
-- Building HardInfo for architecture: linux-x86
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2") 
-- Building for GTK2
-- Checking for modules 'gtk+-2.0>=2.10;glib-2.0>=2.10;gthread-2.0>=2.10;gmodule-export-2.0>=2.10'
--   Found gtk+-2.0, version 2.24.32
--   Found glib-2.0, version 2.56.4
--   Found gthread-2.0, version 2.56.4
--   Found gmodule-export-2.0, version 2.56.4
-- Checking for module 'libsoup-2.4>=2.42'
--   Package 'libsoup-2.4', required by 'virtual:world', not found
-- Checking for module 'json-glib-1.0'
--   Package 'json-glib-1.0', required by 'virtual:world', not found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:418 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:585 (_pkg_check_modules_internal)
  CMakeLists.txt:92 (pkg_check_modules)

有没有人成功地为 CentOS 8 构建了这个软件包或遇到了这个问题?

TIA,

标签: cmakecentos8

解决方案


推荐阅读