Closed smanders closed 6 years ago
I believe this issue is complete with the commits referenced above - if not, other commits will also reference this issue...
additional system libraries are needed for wxWidgets
/usr/bin/x86_64-linux-gnu-ld: /home/smanders/src/externpro/_bld/externpro_18.04.1-13-g49aabf4-gcc640-64/lib/libwx_baseu-3.1.a(baselib_threadpsx.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
links with info on last commit (see details) regarding -pthread
externpro has several projects that aren't built via cmake on linux with gcc: boost, wxWidgets, fftw to name a few
we have another externpro-like project that builds internal/proprietary projects which we call internpro
internpro has projects that are built via cmake and depend on boost and wxWidgets
the problem is that the
BOOST_LIBRARIES
andWXWIDGETS_LIBRARIES
returned from their use scripts are hard-coded absolute paths, specific to the system internpro is built on -- and so the cmake-generated targets.cmake files from these projects that depend on boost and wx haveINTERFACE_LINK_LIBRARIES
like the following:set_target_properties(mbview PROPERTIES INTERFACE_LINK_LIBRARIES "-L/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib;-pthread;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_gtk3u_aui-3.1.a;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_gtk3u_propgrid-3.1.a;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_gtk3u_richtext-3.1.a;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_gtk3u_gl-3.1.a;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_baseu_net-3.1.a;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_gtk3u_html-3.1.a;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_gtk3u_adv-3.1.a;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_gtk3u_core-3.1.a;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_baseu_xml-3.1.a;/home/smanders/src/externpro/_bld/externpro_18.04.1-4-g6159bb8-gcc640-64/lib/libwx_baseu-3.1.a;-lGL;-lGLU;-lgthread-2.0;-lX11;-lXxf86vm;-lSM;-lgtk-3;-lgdk-3;-lpangocairo-1.0;-lpango-1.0;-latk-1.0;-lcairo-gobject;-lcairo;-lgdk_pixbuf-2.0;-lgio-2.0;-lgobject-2.0;-lglib-2.0;-lwxregexu-3.1;-lwxexpat-3.1;-lwxtiff-3.1;-lwxjpeg-3.1;-lwxpng-3.1;-lwxzlib-3.1;-ldl;-lm" )
I've been working around this by clearing
INTERFACE_LINK_LIBRARIES
of any externpro libraries and setting it to the internal libraries it depends on, for example the palam library mb depends on async (another palam library) and boost (from externpro), so I set it to only show it depends on async:most of the time the linking has worked out and these externpro library dependencies are in the link line in an order that works and things have just worked
except when they didn't... for example I found that I had to add the wx libraries back in the palam use script for mbview:
recently a new unit test for a Scheduler library was being developed which depends on the palam async library - and there is a link error (Debug build):
what you can see from the link line is that the boost libraries are there, the async library is there - but the boost libraries come first - and the link error is from the palam async library complaining that it's missing some boost things:
perhaps there are some hacks to put on top of the hacks to solve link issues like this...
but the real solution, to me, is to stop clearing out the
INTERFACE_LINK_LIBRARIES
and figure out a way to not have hard-coded, absolute, build-system-specific paths in the targets.cmake files