doomsday2 builds assimp despite being provided by system

Despite assimp being provided by the system, and found(?) by cmake, doosmday nevertheless tries to build its own copy.
[   28s] -- Building a non-boost version of Assimp.
[   28s] -- Looking for ZLIB...
[   28s] -- Checking for module 'zzip-zlib-config'
[   28s] --   Found zzip-zlib-config, version 
[   28s] -- Found ZLIB: optimized;/usr/lib64/libz.so;debug;/usr/lib64/libz.so
[   28s] -- Checking for module 'minizip'
[   28s] --   Found minizip, version 1.2.8
[   29s] -- Enabled formats: 3DS COLLADA IRR MD2 MD3 MD5 MDL OBJ BLEND FBX
[   29s] -- Disabled formats: AC ASE ASSBIN ASSXML B3D BVH DXF CSM HMP LWO LWS MDC NFF NDO OFF OGRE OPENGEX PLY MS3D COB IFC XGL Q3D Q3BSP RAW SMD STL TERRAGEN 3D X
[   29s] -- Configuring libgui...
[   29s] -- Found Open Asset Import Library: $<TARGET_LINKER_FILE:assimp>
(…)
[   36s] … /usr/bin/c++   -DASSIMP_BUILD_BOOST_WORKARO(…)   -o CMakeFiles/assimp.dir/Assimp.cpp.o -c /home/abuild/rpmbuild/BUILD/doomsday-2.0.0/doomsday/external/assimp/code/Assimp.cpp
(…)
[  109s] /usr/bin/c++  (…) -shared -Wl,-soname,libdeng_gui.so.2.0 -o libdeng_gui.so.2.0.0 (…) ../libcore/libdeng_core.so.2.0.0 /usr/lib64/libQt5OpenGLExtensions.a /usr/lib64/libQt5Widgets.so.5.7.1 -lz -lminizip assimp/code/libassimp.a -lSM -lICE -lX11 -lXext /usr/lib64/libQt5X11Extras.so.5.7.1 -lXrandr -lXxf86vm /usr/lib64/libQt5Network.so.5.7.1 /usr/lib64/libQt5Gui.so.5.7.1 /usr/lib64/libQt5Core.so.5.7.1 
[  109s] /home/abuild/rpmbuild/BUILD/doomsday-2.0.0/doomsday/external/assimp/code/FBXParser.cpp:571: undefined reference to `inflateInit_'
I can't tell if TARGET_LINKER_FILE:assimp is the right thing, but seeing that Assimp.cpp gets compiled tells me cmake is refusing to use the system-provided assimp.

Comments

  • That is correct, Doomsday has been configured to always build Assimp from "doomsday/external/assimp/" as a static library that gets linked into libgui.

    The custom version of Assimp is compiled because I'm using a handful of my own patches in there (mostly minor tweaks to MD5 and MD2 loaders), and this way I can control which format importers are enabled and thus supported in Doomsday.
  • edited 2017 Apr 27
    Then it seems to have truly forgotten adding `-lz` and `-lGL` after assimp.a: https://build.opensuse.org/build/games/openSUSE_Leap_42.2/x86_64/doomsday/_log
  • I did a test build on openSUSE Leap 42.2 with GCC 5, using the Doomsday master branch. (The default GCC 4.8 is too old for Doomsday.)

    There was a build failure because CMake did not detect which compiler was being used. I applied a fix, after which the build succeeded.
  • Note that the build service (the "automated" environment) always builds with the equivalent of `-Wl,--as-needed`, which is not activated in a normal ("desktop") installation. Library symbol satisfaction happens from left-to-right, so the "-lz" in the command line does not satisfy assimp.a; this must be reversed. First assimp.a, then -lz and -lGL.
  • I'll look into it. However, the command line flags are entirely produced by CMake, but I believe it should respect the order the libraries are requested to be linked.

    Of course, if you have any patches for me, would appreciate it. :)
Sign In or Register to comment.