Build error to find randr
Hello,
I’m trying to compile OTB 6.6.1 in a centos7 docker using the SuperBuild with cmake3 version 3.14.6 and gcc (GCC) 5.5.0.
When it is time to download and compile GLFW I have a problem with the randr lib. I’m getting the following error (from cat /install/OTB/build/GLFW/src/GLFW-stamp/GLFW-configure-err.log
`) :
CMake Deprecation Warning at CMakeLists.txt:8 (cmake_policy):
The OLD behavior for policy CMP0042 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Warning (dev) at /usr/share/cmake3/Modules/FindOpenGL.cmake:275 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
FindOpenGL found both a legacy GL library:
OPENGL_gl_LIBRARY: /usr/lib64/libGL.so
and GLVND libraries for OpenGL and GLX:
OPENGL_opengl_LIBRARY: /usr/lib64/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib64/libGLX.so
OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
CMakeLists.txt:88 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at CMakeLists.txt:269 (message):
The RandR library and headers were not found
• I tried to install the following libs but didn’t worked yum -y install mesa-libGL mesa-libGL-devel nx-proto-devel libXrandr xorg-x11-server-source
• I check if the lib were well installed with locate randr
and I got the following (my $LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64):
/usr/include/X11/extensions/randr.h
/usr/include/X11/extensions/randrproto.h
/usr/include/nx-X11/extensions/randr.h
/usr/include/nx-X11/extensions/randrproto.h
/usr/include/xcb/randr.h
/usr/lib64/libXrandr.so.2
/usr/lib64/libXrandr.so.2.2.0
/usr/lib64/libxcb-randr.so
/usr/lib64/libxcb-randr.so.0
/usr/lib64/libxcb-randr.so.0.1.0
/usr/lib64/girepository-1.0/xrandr-1.3.typelib
/usr/lib64/pkgconfig/xcb-randr.pc
/usr/share/pkgconfig/randrproto.pc
/usr/share/xorg-x11-server-source/randr
/usr/share/xorg-x11-server-source/hw/xwin/winrandr.c
/usr/share/xorg-x11-server-source/randr/Makefile.am
/usr/share/xorg-x11-server-source/randr/randr.c
/usr/share/xorg-x11-server-source/randr/randrstr.h
/usr/share/xorg-x11-server-source/randr/rrcrtc.c
/usr/share/xorg-x11-server-source/randr/rrdispatch.c
/usr/share/xorg-x11-server-source/randr/rrinfo.c
/usr/share/xorg-x11-server-source/randr/rrlease.c
/usr/share/xorg-x11-server-source/randr/rrmode.c
/usr/share/xorg-x11-server-source/randr/rrmonitor.c
/usr/share/xorg-x11-server-source/randr/rroutput.c
/usr/share/xorg-x11-server-source/randr/rrpointer.c
/usr/share/xorg-x11-server-source/randr/rrproperty.c
/usr/share/xorg-x11-server-source/randr/rrprovider.c
/usr/share/xorg-x11-server-source/randr/rrproviderproperty.c
/usr/share/xorg-x11-server-source/randr/rrscreen.c
/usr/share/xorg-x11-server-source/randr/rrsdispatch.c
/usr/share/xorg-x11-server-source/randr/rrtransform.c
/usr/share/xorg-x11-server-source/randr/rrtransform.h
/usr/share/xorg-x11-server-source/randr/rrxinerama.c
• I tried to create the file /usr/lib64/pkgconfig/xrandr.pc with the following content :
prefix=/usr
libdir=/usr/lib64
includedir=/usr/include/nx-X11/extensions
Name: Xrandr
Description: X RandR Library
Version: 1.5.1
Requires: xproto randrproto >= 1.5
Requires.private: x11 xext xrender
Cflags: -I${includedir}
Libs: -L${libdir} -lXrandr
• I tryed to compile with cmake 3.11 and 3.3 but I don't know why curl had problem using the https protocol
• I tried to add cmake_policy(SET CMP0072 NEW)
in the root and superbuild CMakeList.txt, the error at the beginning comes from this try. ButI saw it was useless as /install/OTB/build/GLFW/src/GLFW/CMakeLists.txt (generated file) does a cmake_policy(SET CMP0042 NEW)
• I wasn’t able to find a “FindPackage” for randr. But in the file /install/OTB/otb/Packaging/PackageGlobals.cmake “libXrandr.so*” is added to SYSTEM_DLLS. The list is then process by setif_value_in_list(is_system "${result}" SYSTEM_DLLS)
but I don’t know what happen after…
Can someone help me with this? Does it come from cmake version ? I still need more header ? As I said I'm in a docker container based on CentOs 7 image.
Step I followed :
wget https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/archive/6.6.1/otb-6.6.1.tar.gz
tar xvf otb-6.6.1.tar.gz
mv otb-6.6.1 $OTB_SOURCE # /install/OTB/otb
mkdir -p $OTB_BUILD # /install/OTB/build
mkdir -p $OTB_INSTALL # /install/OTB/install
cd $OTB_BUILD
cmake -DCMAKE_INSTALL_PREFIX=$OTB_INSTALL -DOTB_USE_QT=OFF $OTB_SOURCE/SuperBuild
cd $OTB_BUILD
make
Thanks for help
PS : I've also been in error for libkml and qt module. The filed download (http://ftp.de.debian.org/debian/pool/main/libk/libkml/libkml_1.3.0~r864+dfsg.orig.tar.gz and http://download.qt.io/official_releases/qt/5.12/5.12.1/single/qt-everywhere-src-5.12.1.tar.xz) are not available anymore. To correct this I did
sed -i '/211ed5fdf2dd45aeb9c0abc8e1fe42be/d' $OTB_SOURCE/SuperBuild/CMake/External_libkml.cmake #delete the line
# Replace libkml_1.3.0~r863.orig.tar.gz by libkml_1.3.0~r864+dfsg.orig.tar.gz in $OTB_SOURCE/SuperBuild/CMake/External_libkml.cmake
sed -i 's/libkml_1.3.0~r863.orig.tar.gz/libkml_1.3.0~r864+dfsg.orig.tar.gz/g' $OTB_SOURCE/SuperBuild/CMake/External_libkml.cmake
sed -i '/7e167b9617e7bd64012daaacb85477af/d' $OTB_SOURCE/SuperBuild/CMake/External_qt5.cmake # delete the line
#Replace 5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz by 5.12/5.12.1/single/qt-everywhere-src-5.12.1.tar.xz in $OTB_SOURCE/SuperBuild/CMake/External_qt5.cmake
sed -i 's/5.10\/5.10.1\/single\/qt-everywhere-src-5.10.1.tar.xz/5.12\/5.12.1\/single\/qt-everywhere-src-5.12.1.tar.xz/g' $OTB_SOURCE/SuperBuild/CMake/External_qt5.cmake
Is it the good way to do ? I didn't reach these steps again so I don't know