Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

[COMPILATION ERROR] Tulip 3.5.1 doesn't compile on Fedora 31 #167

Closed
lynerlok opened this issue Jan 28, 2020 · 15 comments
Closed

[COMPILATION ERROR] Tulip 3.5.1 doesn't compile on Fedora 31 #167

lynerlok opened this issue Jan 28, 2020 · 15 comments

Comments

@lynerlok
Copy link

Hello,

I have some trouble when I want compile Tulip 5.3.1 on virtualized Fedora 31. The host is Fedora 31 also. I attach Cmake log files. All libs are installed.

CMakeError.log
CMakeOutput.log

Tell me if you want other information.

@p-mary
Copy link
Contributor

p-mary commented Jan 29, 2020

There was an error when cmake checked for pthread_create function.
In CMakeError.log the lines
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_e0ae1.dir/CheckFunctionExists.c.o -o cmTC_e0ae1 -lpthreads /usr/bin/ld : ne peut trouver -lpthreads indicates that the pthreads library cannot be found.
If you look for /usr/lib64/libpthread* files, I think you should find /usr/lib64/libpthread.so and /usr/lib64/libpthread.a files but no /usr/lib64/libpthreads.* files.
So -lpthread should be used instead of -lpthreads; but I have no idea why it is not the case.

@lynerlok
Copy link
Author

Yes I had doubt about that... But where I change this ?

@p-mary
Copy link
Contributor

p-mary commented Jan 29, 2020

May be https://stackoverflow.com/questions/31948521/building-error-using-cmake-cannot-find-lpthreads could give an answer.
Or some other reports found when googling 'cmake lpthreads'.

@anlambert
Copy link
Contributor

@lynerlok , what is exactly your compilation error ?

The content of the CMakeError.log you attached is simply a dump of errors encountered by CMake during Tulip compilation configuration. This does not mean they are critical to compile Tulip. Here CMake simply tries to locate the pthread library on your system. On some system, it is named pthreads so CMake will try to locate that one first, then it tries the more classical name. See the CMake configuration output below for Tulip 5.3.1 obtained on Fedora 31 using docker (Pay attention to the Looking for pthread_create lines).

[root@5472757a4762 tulip_build]# cmake ../tulip
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.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
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- Found Qhull: /usr/lib64/libqhull.so  
-- Found yajl: /usr/lib64/libyajl.so  
CMake Warning (dev) at /usr/share/cmake/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:306 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib64/libOpenGL.so   
-- Found GLEW: /usr/include (found version "2.1.0") 
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.37") 
-- Found Freetype: /usr/lib64/libfreetype.so (found version "2.10.0") 
-- Found Qt5 (version 5.13)
-- Found QUAZIP: /usr/lib64/libquazip5.so  
-- Found PythonInterp: /usr/bin/python (found version "3.7.6") 
-- Found PythonLibs: /usr/lib64/libpython3.7m.so (found version "3.7.6") 
-- Found SIP 4.19.17: /root/tulip_build/thirdparty/sip-4.19.17/sipgen/sip
Unable to build 'GeographicView': QtWebKit and QtWebEngine are missing
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE) 
CMake Warning (dev) at doc/CMakeLists.txt:32 (MESSAGE):
  Sphinx not found: unable to generate the documentation.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
CMake Warning (dev) at doc/CMakeLists.txt:40 (MESSAGE):
  doxygen not found: unable to generate the Tulip API documentation.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /root/tulip_build

@lynerlok
Copy link
Author

lynerlok commented Jan 30, 2020

Yes I put errors here ! I could try with docker to... Maybe it an error due to virtualization...

-- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP: TRUE
CMake Warning (dev) at /usr/share/cmake/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:306 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Could NOT find QUAZIP (missing: QUAZIP_LIBRARIES)
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake/Modules/FindPythonLibs.cmake:310 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/TulipPython.cmake:79 (FIND_PACKAGE)
CMakeLists.txt:334 (INCLUDE)

-- Configuring incomplete, errors occurred!
See also "/tulip-5.3.1/build/CMakeFiles/CMakeOutput.log".
See also "/tulip-5.3.1/build/CMakeFiles/CMakeError.log".

@lynerlok
Copy link
Author

I test with change PATH in CMAKE-gui to but no more results

@anlambert
Copy link
Contributor

@lynerlok , you need to install the following dependencies in Fedora 31 to be able to compile Tulip:

dnf install quazip-qt5-devel
dnf install python3-devel

@lynerlok
Copy link
Author

@anlambert , Ho yes I forgot these deps... Installation is ok now and configure is ok too. I'm building then I report result !

@lynerlok
Copy link
Author

@anlambert , Ok I have some errors on cmake linking with GLEW. I have glew and glew devel installed

[100%] Linking CXX executable tulip
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewVertexAttrib2s »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewVertexAttrib4s »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewBindBuffer »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniformMatrix2fv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewMultiTexCoord2f »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform4iv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform2i »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewGetUniformiv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « glewExperimental »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewBufferData »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform3fv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewGetUniformfv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewVertexAttrib1f »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniformMatrix3fv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewGetShaderiv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform1f »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewDeleteProgram »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewVertexAttrib3s »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform3f »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform4i »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewShaderSource »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewDeleteShader »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewGetAttribLocation »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform1fv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewVertexAttrib3f »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewVertexAttribPointer »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewVertexAttrib1s »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUseProgram »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewGetUniformLocation »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform4f »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewGetProgramiv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewGetShaderInfoLog »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform3i »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform2iv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform2fv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewGenBuffers »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniformMatrix4fv »
/usr/bin/ld : ../../library/tulip-gui/src/libtulip-gui-5.3.so : undefined reference to « __glewGenerateMipmap »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform2f »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewCreateProgram »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewDeleteBuffers »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewCompileShader »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform1i »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewVertexAttrib2f »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewAttachShader »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewGetProgramInfoLog »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform3iv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewLinkProgram »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewProgramParameteriEXT »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform4fv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « glewIsSupported »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewEnableVertexAttribArray »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewVertexAttrib4f »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewUniform1iv »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewCreateShader »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewDetachShader »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « __glewActiveTexture »
/usr/bin/ld : ../../library/tulip-ogl/src/libtulip-ogl-5.3.so : undefined reference to « glewInit »
collect2: erreur: ld a retourné le statut de sortie 1
make[2]: *** [software/tulip/CMakeFiles/tulip.dir/build.make:526: software/tulip/tulip] Error 1
make[1]: *** [CMakeFiles/Makefile2:8138: software/tulip/CMakeFiles/tulip.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

@anlambert
Copy link
Contributor

anlambert commented Jan 30, 2020

Indeed something is wrong with glew linkage on latest Fedora.

It seems you are not the only one that encountered that issue as it has already been reported
on the Tulip sourceforge bug tracker (development was hosted here before moving to GitHub).

I give a look and I get back to you.

@anlambert
Copy link
Contributor

Turns out that issue has been fixed in the master branch but indeed appears in the Tulip 5.3.1 release if you are using CMake >= 3.15 (Fedora 31 offers CMake 3.16.2 QED).

You can fix it by applying that diff to the root CMakeLists.txt: ed8f1a0#diff-af3b638bc2a3e6c650974192a53c7291

@lynerlok
Copy link
Author

Thank you, I try to compil with fedora in docker. I make this dockerfile is it correct ?

FROM fedora:31

WORKDIR /media/Datas

RUN dnf install -y
cmake
freetype
freetype-devel
zlib
zlib-devel
libjpeg
libjpeg-devel
qt5
qt5-devel
glew
glew-devel
qhull
qhull-devel
quazip
quazip-devel
quazip-qt5-devel
yajl
yajl-devel
sphinx
doxygen
sip
sip-devel
g++
make
python3-devel

ADD ./tulip-5.3.1 ./tulip-5.3.1

RUN cd ./tulip-5.3.1 && mkdir -p build && cd build && cmake .. && cmake --build .

@anlambert
Copy link
Contributor

@lynerlok , please find below a dockerfile that will suit your need:

FROM fedora:31

# install Tulip deps
RUN dnf install -y \
git \ 
cmake \
g++ \
make \
binutils-devel \
zlib-devel \
qhull-devel \
yajl-devel \
libjpeg-devel \
libpng-devel \
glew-devel \
freetype-devel \
qt5-qtbase-devel \
qt5-qtwebkit-devel \
quazip-qt5-devel \
python3-devel \
python3-sip-devel \
python3-sphinx \
doxygen

# clone Tulip repo
RUN git clone https://github.com/Tulip-dev/tulip
# checkout commit fixing the glew link issue on Fedora 31 (pushed just after the tulip_5_3_1 tag)
RUN cd tulip && git checkout ed8f1a059ebcf88cd14f072895c57a53a68ec97f
# build Tulip
RUN cd tulip && mkdir build && cd build && cmake .. && cmake --build .

@lynerlok
Copy link
Author

@anlambert Thanks ! it's ok I compiled and install. But when I run docker I have an error ( I have this error not only with tulip ). I think I need to create some links or somthing like that no ?

docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix fedora-tulip tulip_perspective
No protocol specified
qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

TLP_PLATEFORM linux
TLP_ARCH x86_64
TLP_COMPILER gcc
TLP_VERSION 5.3.1
TLP_STACK_BEGIN
#00 0x00007f68b9429625 in gsignal (+0x145) from /lib64/libc.so.6
#1 0x00007f68b94128d9 in abort (+0x12b) from /lib64/libc.so.6
#2 0x00007f68b99f8b25 in ?? (+0x8ab25) from /lib64/libQt5Core.so.5
#3 0x00007f68ba176d5f in QGuiApplicationPrivate::createPlatformIntegration() (+0x1bff) from /lib64/libQt5Gui.so.5
#4 0x00007f68ba177568 in QGuiApplicationPrivate::createEventDispatcher() (+0x38) from /lib64/libQt5Gui.so.5
#5 0x00007f68b9be4a55 in QCoreApplicationPrivate::init() (+0x625) from /lib64/libQt5Core.so.5
#6 0x00007f68ba178d23 in QGuiApplicationPrivate::init() (+0x33) from /lib64/libQt5Gui.so.5
#7 0x00007f68ba71b42d in QApplicationPrivate::init() (+0xd) from /lib64/libQt5Widgets.so.5
#8 0x000000000040bf2d in main (+0xcd) from tulip_perspective
#9 0x00007f68b94141a3 in __libc_start_main (+0xf3) from /lib64/libc.so.6
#10 0x000000000040ef2e in _start (+0x2e) from tulip_perspective
TLP_STACK_END
TLP_PLATEFORM linux
TLP_ARCH x86_64
TLP_COMPILER gcc
TLP_VERSION 5.3.1
TLP_STACK_BEGIN
#00 0x00007f68b94129c1 in abort (+0x213) from /lib64/libc.so.6
#1 0x00007f68b99f8b25 in ?? (+0x8ab25) from /lib64/libQt5Core.so.5
#2 0x00007f68ba176d5f in QGuiApplicationPrivate::createPlatformIntegration() (+0x1bff) from /lib64/libQt5Gui.so.5
#3 0x00007f68ba177568 in QGuiApplicationPrivate::createEventDispatcher() (+0x38) from /lib64/libQt5Gui.so.5
#4 0x00007f68b9be4a55 in QCoreApplicationPrivate::init() (+0x625) from /lib64/libQt5Core.so.5
#5 0x00007f68ba178d23 in QGuiApplicationPrivate::init() (+0x33) from /lib64/libQt5Gui.so.5
#6 0x00007f68ba71b42d in QApplicationPrivate::init() (+0xd) from /lib64/libQt5Widgets.so.5
#7 0x000000000040bf2d in main (+0xcd) from tulip_perspective
#8 0x00007f68b94141a3 in __libc_start_main (+0xf3) from /lib64/libc.so.6
#9 0x000000000040ef2e in _start (+0x2e) from tulip_perspective
TLP_STACK_END

@lynerlok
Copy link
Author

Sorry for the previous useless comment... QT run with non-root user and I run tulip as root !
So I close this issue with my docker file for future reference. Thank you so much for the help !

FROM fedora:31

WORKDIR /media/Datas

RUN dnf install -y
cmake
freetype
freetype-devel
zlib
zlib-devel
libjpeg
libjpeg-devel
qt5
qt5-devel
glew
glew-devel
qhull
qhull-devel
quazip
quazip-devel
quazip-qt5-devel
yajl
yajl-devel
sphinx
doxygen
sip
sip-devel
g++
make
python3-devel

ADD ./tulip-5.3.1 ./tulip-5.3.1

RUN cd ./tulip-5.3.1 && mkdir -p build && cd build && cmake .. && make -j4

RUN cd ./tulip-5.3.1/build && make install

RUN useradd -m user

USER user

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants