Cmake 找不到 X11 库

Cmake 找不到 X11 库

我正在尝试在 RHEL 7.2(XFCE 环境)上编译基于 GUI 的包。但每次我运行时cmake ..,都会失败并报告:

[user@localhost build]$ cmake ..
-- BUILD TYPE set to the default type:  'Release'
-- Setting fallback CUDA_ARCH=35
-- Setting cpu precision to double
-- Setting gpu precision to single
-- Using cuda wrapper to compile....
-- Cuda version is >= 7.5 and single-precision build, enable double usage warning.
-- MPI_INCLUDE_PATH : /usr/local/openmpi-3.0/include
-- MPI_LIBRARIES : /usr/local/openmpi-3.0/lib/libmpi.so
-- MPI_CXX_INCLUDE_PATH : /usr/local/openmpi-3.0/include
-- MPI_CXX_LIBRARIES : /usr/local/openmpi-3.0/lib/libmpi.so
-- 
-- ------------------ YOU HAVE NO X11-LIBS ------------------
-- CCmake found no X11-libs on your system, which are required for the GUI.
--  You CAN add the flag -DGUI=OFF to avoid using X11
CMake Error at CMakeLists.txt:200 (message):
  X11 is required for GUI.

我还检查了系统中已安装的 X11 库:

[root@localhost build]# rpm -qa | grep libX11
libX11-devel-1.6.5-1.el7.x86_64
libX11-common-1.6.5-1.el7.noarch
libX11-1.6.5-1.el7.x86_64

尽管如此,其他 GUI 程序运行良好。我该如何解决这个问题?

答案1

CentOS 7 示例,构建 Relion。

# yum install openmpi-devel fftw-devel fltk-devel
# cp /usr/lib64/openmpi/bin/* /usr/bin/

git clone https://github.com/3dem/relion.git
cd relion/
mkdir -p external/fltk/lib      // 'make install' fails if no (empty) lib/ folder
mkdir build
cd build/
cmake ..
make
.
[100%] Built target tiltpair_plot

# make install

结果:Relion-git.040918-1.el7.x86_64.rpm(2.0MB)https://drive.google.com/file/d/1c3loJFCladmqvemHyKu44FxZzdOr-XJN/view?usp=sharing→ 提供/usr/local/bin/{45个文件}, /usr/local/lib/{ gui_background.xpm,librelion_gui_lib.so, librelion_lib.so}

下载并安装 :cd Downloads/ && yum install ./Relion-git.040918-1.el7.x86_64.rpm

$ relion:Relion GUI 打开成功。


$ ldd relion | grep Xlib
        libXrender.so.1 => /lib64/libXrender.so.1 (0x00007f2cf841c000)
        libXcursor.so.1 => /lib64/libXcursor.so.1 (0x00007f2cf8211000)
        libXfixes.so.3 => /lib64/libXfixes.so.3 (0x00007f2cf800b000)
        libXext.so.6 => /lib64/libXext.so.6 (0x00007f2cf7df8000)
        libXft.so.2 => /lib64/libXft.so.2 (0x00007f2cf7be2000)
        libXinerama.so.1 => /lib64/libXinerama.so.1 (0x00007f2cf77a1000)
        libX11.so.6 => /lib64/libX11.so.6 (0x00007f2cf7463000)
        libXau.so.6 => /lib64/libXau.so.6 (0x00007f2cf60b7000)

# yum provides */libXcursor.so.1
等等来决定你的“missing libX**-devel”的名称。

相关内容