|
From: Daniel J S. <dan...@ie...> - 2017-07-05 01:17:58
|
On 07/04/2017 08:07 PM, Daniel J Sebald wrote: > On 07/04/2017 06:23 PM, sfeam via gnuplot-beta wrote: >> On Wednesday, 05 July 2017 01:08:35 Petr Mikulik wrote: >>>>> I have troubles compiling rc2 on Linux (OpenSUSE 42.2, and some >>>>> Ubuntu) - >>>>> linking fails. >>>>> >>>>> It is this problem: >>>>> https://sourceforge.net/p/gnuplot/support-requests/196/ >>>>> >>>>> The workaround >>>>> configure --with-X11 >>>>> described above does not help, while >>>>> TERMLIBS="-lX11" ./configure >>>>> let me gnuplot compile. >>>>> >>>>> Can this be fixed? >>>> >>>> No. It is a bug in the configuration files distributed for libwxgtk. >>> >>> Unfortunately it seems to be a wide-spread bug. It is quite >>> embarassing that a >>> compile needs googling to fix it locally. >>> >>> Cannot "./configure" take care of this? I.e. add the "-lX11" flag if >>> "something"? >> >> That "something" is exactly the problem. Only some versions of >> wxWidgets need this, and only for some configurations. The >> wx-config tool is supposed to tell us what libraries are needed so >> we can link them. But it doesn't mention X11. So how are we to know? > > Actually, I think this is gnuplot's responsibility. If I do > > sebald@ ~ $ wx-config --libs > -L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0 > -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 > -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 > > in that list is "pthread" which I believe is to inform the gcc/c++ > compiler that posix threads are to be used in compiling and linking. (I > think pthread is standard across compilers, but I'm not sure.) In other > words, it's supposed to be the responsibility of the compiler to deal > with all the threads issues so long as wxWidgets follows posix. > > In the fix for this bug > > http://gnuplot.10905.n7.nabble.com/crash-when-using-wxt-in-Ubuntu-12-04-td17318.html > > > the following line was added: > > /* Define a new application type, each gui should derive a class from > wxApp */ > class wxtApp : public wxApp > { > public: > #if defined(WXT_MULTITHREADED) && defined(WX_NEEDS_XINITTHREADS) && > defined(X11) > /* Magic fix needed by wxgtk3.0 */ > wxtApp() : wxApp() { XInitThreads(); } > #endif I'm not having any problems building/running if I just comment out this line. Then again, from my wx-config test, I might be using GTK2 rather than GTK3, which might be the issue if "wxgtk3.0" is in the comment. This looks to have been a thread from 2013. Maybe we should open a bug report and move the discussion there in hopes of finding someone for which that crash can be replicated when there is no XInitThreads(). Dan |