Cmake can't find X11 libs
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 ..
make
.
[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".
Related videos on Youtube
diffracteD
hi ! Interested in programming languages, more specifically and currently in python. Currently investigating atomic behaviors using quantum chemistry. Major research interest includes structure determination of membrane proteins.
Updated on September 18, 2022Comments
-
diffracteD over 1 year
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 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
Despite this other GUI programs are running fine. How can I solve this issue?
-
Knud Larsen about 6 yearsX11 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". -
diffracteD about 6 years@Kund I have
libXmu-devel libSM-devel libICE-devel
installed in my system, still cant proceed withcmake
. -
Knud Larsen about 6 yearsIs cmake still asking for X11-libs ?
-
diffracteD about 6 yearsYes. Still giving the same error. @Kund
-
diffracteD about 6 yearsI'm not building an XFCE package. I'm building an open source package on XFCE env
-
diffracteD about 6 yearsRelion-2.3 is the package @Knud
-
-
diffracteD about 6 yearsI performed the exact same steps, yet I'm stuck with the same error !
-
Knud Larsen about 6 yearsSolution : Get the rpm package, and install it with
yum
. ( No CUDA ) -
diffracteD about 6 yearsAlright but without CUDA its highly time-inefficient to use the package.
-
diffracteD about 6 years@Kund I have all the Xlib (you mentioned) present in
/usr/lib64
, however can't resolve the issue. I don't get it whycmake
cant find these !! Is there any way to manually point the libraries tocmake
? -
Knud Larsen about 6 yearsDid 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 installRelion-git.040918-1.el7.x86_64.rpm
-
diffracteD about 6 years@Kund I had installed the
rpm
but after successful installation when I ranrelion
it gave me an error:relion: error while loading shared libraries: librelion_lib.so: cannot open shared object file: No such file or directory
. That is why I'm trying to build it. -
Knud Larsen about 6 years? May be you lost /usr/local/bin/ from the LD_LIBRARY_PATH ? → See edited answer.
-
diffracteD about 6 yearsBuilding on my previous attempt for building from Source > Including X11 header files manually to the ''/usr/include'' moved the installation quite a bit but again stuck at:
/usr/include/X11/Xlib.h:1686:1: error: ‘_X_DEPRECATED’ does not name a type _X_DEPRECATED ^ /usr/include/X11/Xlib.h:3571:3: error: expected initializer before ‘_X_SENTINEL’ ) _X_SENTINEL(0);
-
diffracteD about 6 yearsThank you. Both worked for me.
.rpm
also worked and simultaneously I have been able to build from the source. Thanks a lot !