I'm trying to compile a GUI-based package on my RHEL 7.2 (XFCE environment). But every time I run cmake .. , it fails with the report:

[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.

I also checked for the installed X11 libraries in my system:

[root@localhost build]# rpm -qa | grep libX11

Despite this other GUI programs are running fine. How can I solve this issue?

  • X11 files are a lot more than libX11-devel. And some build scripts will reply for any missing parts of X11 without being specific. Please do # yum install libXmu-devel, which will install "the usual required X11 collection". – Knud Larsen Apr 9 '18 at 7:32
  • @Kund I have libXmu-devel libSM-devel libICE-devel installed in my system, still cant proceed with cmake. – diffracteD Apr 9 '18 at 8:16
  • Is cmake still asking for X11-libs ? – Knud Larsen Apr 9 '18 at 9:54
  • Yes. Still giving the same error. @Kund – diffracteD Apr 9 '18 at 10:08
  • I'm not building an XFCE package. I'm building an open source package on XFCE env – diffracteD Apr 9 '18 at 12:48

CentOS 7 example, building 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 ..
[100%] Built target tiltpair_plot

# make install

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

Download, and install : cd Downloads/ && yum install ./Relion-git.040918-1.el7.x86_64.rpm

$ relion : The Relion GUI opens OK.

$ 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,
Etc. etc. to decide the names of your "missing libX**-devel".

  • I performed the exact same steps, yet I'm stuck with the same error ! – diffracteD Apr 10 '18 at 6:02
  • Solution : Get the rpm package, and install it with yum. ( No CUDA ) – Knud Larsen Apr 10 '18 at 8:43
  • Alright but without CUDA its highly time-inefficient to use the package. – diffracteD Apr 10 '18 at 9:01
  • @Kund I have all the Xlib (you mentioned) present in /usr/lib64, however can't resolve the issue. I don't get it why cmake cant find these !! Is there any way to manually point the libraries to cmake ? – diffracteD Apr 15 '18 at 10:41
  • Did you install all libX[name]-devel ? ... I.e. "so.1" won't do for cmake. Files required for compiling are libX[name].so , found in packages-devel. .... And by the way, no reason to build anything when you can install Relion-git.040918-1.el7.x86_64.rpm – Knud Larsen Apr 15 '18 at 13:01

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.