|
From: Jun T. <tak...@kb...> - 2015-08-27 15:34:43
|
The reason why the current wxt on Mac is single-threaded is documented in the following: http://sourceforge.net/p/gnuplot/patches/544/ In short, on Mac (or at least with Cocoa), the GUI loop need be in the main thread. A multi-threded wxt would be better, but "single-threaded" does not necessarily mean that it does not work. But there seems to be another problem. At line 4022 and below in wxt_gui.cpp (in wxt_atexit()), gnuplot fork() and the parent exits, while the child continues running. But "fork() without exec()" is not recommended on Mac. See, for example, http://stackoverflow.com/questions/18854708/why-is-it-prohivited-to-use-fork-without-exec-in-mac If I comment out the line 4041: freopen("/dev/null","w",stderr); then I get lots of the following message: The process has forked and you cannot use this CoreFoundation \ functionality safely. You MUST exec() If I #undef HAVE_WORKING_FORK then the problem that the wxt window is closed immediately after it is opened seeks to be fixed. For example the followings work as expected: $ cat test.plt | gnuplot -d $ gnuplot -d test.plt < /dev/null (where test.plot contains set term wxt; plot something; pause mouse close) But then the plot window is not closed also at the end of $ make check # i.e., check-noninteractive and I need to manually close it. So it's not the complete solution. |