ryzom / ryzomcore

Ryzom Core is the open-source project related to the Ryzom game. This community repository is synchronized with the Ryzom Forge repository, based on the Core branch.
https://wiki.ryzom.dev
GNU Affero General Public License v3.0
330 stars 89 forks source link

[CMAKE build error] CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle): #684

Closed Langerz82 closed 9 months ago

Langerz82 commented 9 months ago

Operating System: Ubuntu 22.04.3

Followed the tutorial here: https://wiki.ryzom.dev/nel/compile_linux

Command:

sudo cmake -G "Ninja" -DWITH_NEL_TOOLS=ON -DWITH_NEL_SAMPLES=ON -DWITH_ASSIMP=ON -DWITH_NEL_TESTS=OFF -DWITH_MFC=OFF -DWITH_QT=OFF -DWITH_RYZOM=OFF -DWITH_NELNS=OFF -DWITH_SNOWBALLS=OFF -DWITH_EXTERNAL=OFF -DWITH_STATIC_LIBXML2=OFF -DWITH_STATIC_CURL=OFF -DWITH_STATIC_DRIVERS=ON -DWITH_LUA51=OFF -DWITH_LUA52=ON ..

CMake Output:

CMake Warning (dev) at /usr/share/cmake-3.22/Modules/Documentation.cmake:30 (message):
  Policy CMP0106 is not set: The Documentation module is removed.  Run "cmake
  --help-policy CMP0106" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  Documentation.cmake is VTK-specific code and should not be used in non-VTK
  projects.  This logic in this module is best shipped with the project using
  it rather than with CMake.
Call Stack (most recent call first):
  CMakeLists.txt:68 (INCLUDE)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Deprecation Warning at CMakeLists.txt:82 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Generating Ninja project
CMake Deprecation Warning at CMakeModules/GetRevision.cmake:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  CMakeModules/ConfigureChecks.cmake:2 (INCLUDE)
  CMakeLists.txt:216 (NL_CONFIGURE_CHECKS)

-- Found Iconv: optimized;/usr/lib/x86_64-linux-gnu/libc.so;debug;/usr/lib/x86_64-linux-gnu/libc.so
-- Found asset importer library: optimized;/usr/lib/x86_64-linux-gnu/libassimp.so;/usr/lib/x86_64-linux-gnu/libz.so
-- Found Luabind: /lib/x86_64-linux-gnu/libluabind.so
-- Luabind is using Lua 5.2
-- Found Luabind: /lib/x86_64-linux-gnu/libluabind.so
-- Found FreeType: /usr/lib/x86_64-linux-gnu/libfreetype.so
-- Found Ogg: /lib/x86_64-linux-gnu/libogg.so
-- Found Vorbis: /lib/x86_64-linux-gnu/libvorbis.so
-- Found VorbisFile: /lib/x86_64-linux-gnu/libvorbisfile.so
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindOpenGL.cmake:315 (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/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/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):
  nel/src/3d/driver/opengl/CMakeLists.txt:11 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Squish: /lib/x86_64-linux-gnu/libsquish.so
-- Found Squish: /lib/x86_64-linux-gnu/libsquish.so
-- Configuring done
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
  "nel3d" of type SHARED_LIBRARY
    depends on "nel_drv_opengl" (weak)
  "nel_drv_opengl" of type STATIC_LIBRARY
    depends on "nel3d" (weak)
At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies are allowed only among static libraries.
CMake Generate step failed.  Build files cannot be regenerated correctly.
Langerz82 commented 9 months ago

-DWITH_STATIC_DRIVERS=OFF seems to fix the error, but I think it may be needed. Am I doing something wrong?

nimetu commented 9 months ago

You need to add -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON By default it compiled libnel.so shared library and then drivers needs to be shared libraries aswell.

Langerz82 commented 9 months ago

@nimetu builds find with -DWITH_STATIC=ON added, thanks allot and closing issue, cheers.