Skip to content

Use x11 and make no interactive graphics at all possible #1407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

GillesDuvert
Copy link
Contributor

should solve #1395

Should permit to reconstruct (using CMAKE) GDL with no X11 and wxWidgets (so-called HEADLESS mode)
build_gdl.sh now adds support for xwin, the X11 plplot driver, for unix and macos. x11 is present on unix, and homebrew provides libx11 on mac.
Using a X11 plot window on a mac is the only way to get remote plot windows through a ssh -X connection.

@alaingdl
Copy link
Contributor

Sorry but problem to get the code on OSX ... (+ "double" factor Id)

On the Linux side :

  • super happy, the basic X11 is back ! cmake .. -DX11=on -DWXWIDGETS=off
    and then display is perfect and immediate
  • problem at the end with the script : after make install I have :
$ install/bin/gdl 
  GDL - GNU Data Language, Version 1.0.1 Git
- For basic information type HELP,/INFO
- Default library routine search path used (GDL_PATH/IDL_PATH env. var. not set): /home/alain/GDL/TestGilles221121/gdl/install/share/gnudatalanguage/lib
- Using WxWidgets as graphics library (windows and widgets).
- Using local drivers in /home/alain/GDL/TestGilles221121/gdl/install/share/gnudatalanguage/drivers
- No startup file read (GDL_STARTUP/IDL_STARTUP env. var. not set). 
- Please report bugs, feature or help requests and patches at: https://github.com/gnudatalanguage/gdl

GDL> plot, findgen(10)
% PLplot installation lacks the requested driver: wxwidgets
% Execution halted at: $MAIN$          
GDL> 

just a detail for sure.

  • running the script version + ./gdl --no-use-wx is OK, plots are immediate and OK

Now copying and compiling on OSX 😄

@alaingdl
Copy link
Contributor

super important point for me on Linux ! the 4 fabs' are back on windows ! (see #1368)

@alaingdl
Copy link
Contributor

YES ! Victory ! Thanks you so much @GillesDuvert

  • On OSX (12.3.1) remotely with ssh -X, with the script, and launching using ./gdl --no-use-wx
    I do have the plot 😃

  • on same OSX, using : cmake .. -DWXWIDGETS=off -DX11=on -DREADLINE=off -DHDF=OFF -DOPENMP=OFF before running the previous script, not working at Cmake level (as expected due to plplot)

  • on same OSX, using same line after running the script (ie compiling dynamically plplot) the link fails

  • on same OSX, after script + after doing export LIBRARY_PATH=/usr/local/lib/, compilation completed and plots OK
    (but message :
    *** PLPLOT ERROR, ABORTING OPERATION *** plInitDispatchTable: Could not open drivers directory, aborting operation

Another tricky detail : on Linux, opening a new terminal, this time running ./install/bin/gdl is not OK.

GDL> plot, findgen(10)
% PLplot installation lacks the requested driver: wxwidgets

(it was OK at the compilation time, in the terminal used for that)

When those few details will be fixed, I vote for a urgent release ASAP since 1.0.1 is not usable (e.g. on Debian)

@brandy125
Copy link

brandy125 commented Nov 22, 2022 via email

@alaingdl
Copy link
Contributor

did you really got the PR version ?

I am very bad for that but I successfully used yesterday and checked today again for you :

$ mkdir test
$ cd test
$ git clone https://github.com/gnudatalanguage/gdl/
$ cd gdl
$ gh pr list

Showing 4 of 4 open pull requests in gnudatalanguage/gdl

#1407  Use x11 and make no interactive graphics at...  GillesDuvert:useX11andEnableNoInteractiveG...
#1317  add tests for the convol results and CHOLDC...  Jeanne-jw:master
#1074  [WIP] macOS dmg release                         macos-dmg
#1041  bug #704 fix - randomu out of range with la...  eloirozier:randomu-fix

$ gh pr checkout  1407
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 23 (delta 16), reused 23 (delta 16), pack-reused 0
Dépaquetage des objets: 100% (23/23), 3.14 Kio | 401.00 Kio/s, fait.
Depuis https://github.com/gnudatalanguage/gdl
 * [nouvelle référence] refs/pull/1407/head -> useX11andEnableNoInteractiveGraphics

(yesterday I need to confirm some code with Github, totally unclear for me)

HTH

@brandy125
Copy link

brandy125 commented Nov 22, 2022 via email

@alaingdl
Copy link
Contributor

Just a comment : gh is not available directly for Debian 10 (it does appears in Debian 11)
https://packages.debian.org/unstable/utils/gh
https://github.com/cli/cli/blob/trunk/docs/install_linux.md

@alaingdl
Copy link
Contributor

I have to problems with this PR :

  • (as mention) in a new CLI, if I try to plot with the version compiled with the script, I have :
GDL> plot, findgen(10)
% PLplot installation lacks the requested driver: wxwidgets
% Execution halted at: $MAIN$          

Yes I try several ways to solve that (LD_LIBRARY_PATh, going in the paths ... but no progress)

  • with the cmake .. -DWXWIDGETS=off -DX11=on version, we do have a clear regression on horizontal AXIS (as it can be see calling test_axis.pro)

@GillesDuvert
Copy link
Contributor Author

GDL> plot, findgen(10)
% PLplot installation lacks the requested driver: wxwidgets
% Execution halted at: $MAIN$  

hm, confirmed --- with a fresh install . Let's see...

@GillesDuvert
Copy link
Contributor Author

@alaingdl referring to #1407 (comment)

On OSX (12.3.1) remotely with ssh -X, with the script, and launching using ./gdl --no-use-wx
I do have the plot 

😄

on same OSX, using : cmake .. -DWXWIDGETS=off -DX11=on -DREADLINE=off -DHDF=OFF -DOPENMP=OFF before running the previous script, not working at Cmake level (as expected due to plplot)

OK --- let it be clear from now that plplot NEEDS to be compiled with so-called dynamic drivers. At least, until plplot code is incorporated to GDL, removing the need to rely on an external problematic library.

on same OSX, using same line after running the script (ie compiling dynamically plplot) the link fails

should be OK now

on same OSX, after script + after doing export LIBRARY_PATH=/usr/local/lib/, compilation completed and plots OK
(but message :
*** PLPLOT ERROR, ABORTING OPERATION *** plInitDispatchTable: Could not open drivers directory, aborting operation

not seen here --- message above is contradictory since gdl crashes when plplot cannot open drivers directory, so no plots can be OK. A warning: /usr/local/lib may be in conflict between homebrew and other installers in your case.

Another tricky detail : on Linux, opening a new terminal, this time running ./install/bin/gdl is not OK.

GDL> plot, findgen(10)
% PLplot installation lacks the requested driver: wxwidgets

works for me. Please check in the GDL startup message where it looks for drivers.

@GillesDuvert
Copy link
Contributor Author

workflows are not reliable.

@alaingdl
Copy link
Contributor

New tests :

  • debian 10, remotely, compilation with the script. OK. no more problem when starting the plot (just after installation, or from a new session). BUT problems for the plots them-selves : test_axis.pro : only one plot on the first window (should have 4). second and third windows stay black

  • same debian 10, remotely, compilation with the script, starting GDL with --no-use-wx. Now the plots are OK for test_axis.pro (except for the bug mentioned here above)

  • OSX 12.3.1, remotely, with the script. Can be started (but no plot as expected)

  • OSX 12.3.1, remotely, with the script. Plots are OK with --no-use-wx (but way slower than for the Debian one)

And I try with new sessions too. OK

Then I can say the problem I mentioned (path and locating the .so) seems to be fixed.

@GillesDuvert
Copy link
Contributor Author

I need precisions:

debian 10, remotely, compilation with the script. OK. no more problem when starting the plot (just after installation, or from a new session). BUT problems for the plots them-selves : test_axis.pro : only one plot on the first window (should have 4). second and third windows stay black

not the case for me on linux (mageia 8 for x86_64) , macOSX (Catalina) and Windows 10. Since it is OK with wxwidgets on my machine and OSX, I suspect a problem of version of wxWidgets.

same debian 10, remotely, compilation with the script, starting GDL with --no-use-wx. Now the plots are OK for test_axis.pro (except for the bug mentioned here above)

what bug? #1410 ? works for me too.

OSX 12.3.1, remotely, with the script. Can be started (but no plot as expected)

normal

OSX 12.3.1, remotely, with the script. Plots are OK with --no-use-wx (but way slower than for the Debian one)

X11 problem on OSX?

@alaingdl
Copy link
Contributor

alaingdl commented Nov 24, 2022

A regression when using "gdl --no-use-wx" : when too many calls to Window (eg calling two times plot_all_benchmark) goes to a mess-up of figures then a crash.
A regression when using the normal wx version : only 3 buttons on windows #1368

@GillesDuvert
Copy link
Contributor Author

what precisely the NUMBER of windows?
because:

GDL> for i=0,200 do window,i,xsize=100,ysize=100
% WINDOW: Window number 32 out of range or no more windows.
% Execution halted at: $MAIN$   

for the number of buttons this depends on the version of wxwidgets and of the window manager. Documentation is poor or wrong, especially on how to bypass window manager interferences.

@alaingdl
Copy link
Contributor

alaingdl commented Nov 24, 2022

As usual, not so simple to create a simple direct way to a bug which seems to be "unstable", but it is related
to interaction between WINDOW & WDELETE

GDL> for ii=0, 5 do window, ii
GDL> wdelete, 2
GDL> X window invalid.
wdelete, 3
GDL> X window invalid.
wdelete, 2
% WDELETE: Window number 2 invalid or no more windows.
% Execution halted at: $MAIN$          
GDL> X window invalid.

but it is still continuing to remove windows ... and sometines crash

A.

PS: ha, maybe is is just for gdl --no-use-wx
But since without that I do not have first plots .. I use gdl --no-use-wx

@GillesDuvert
Copy link
Contributor Author

you use gdl --no-use-wx because you are connected at a distance on an OSX server, yes?
because this works ok on any kind of desktop (just tested), and works also remotely on a Catalina vm (using --no-use-wx) on my machine.
So you have an, say, unusual configuration that is difficult to reproduce. Probably the X11 'link' is slow and GDL does not wait for the (very very time consuming) XFlush() properly.

@alaingdl
Copy link
Contributor

no non, it is fully local. The super simple code below can reproduce that. Both local or remote. And this behavior
did not exist before this PR (code few days ago don't have this problem)

pro test_win
 window, 0
 plot, findgen(10)
 window, 1
 plot, findgen(10)
 window, 2
 plot, findgen(10)
end

the second to this code has only one window, other windows are destroy I don't know why !

@GillesDuvert
Copy link
Contributor Author

On OSX?

@alaingdl
Copy link
Contributor

no, on my laptop.

In fact, remotely, using this PR up-to-date, through VPN + ssh -X, remote are Debian 10 & OSX 12.3.1, same behavior BUT, thanks to the latency due to the network, I can see that the intermediate windows are created then destroyed !

When using the wxwidget version, on local (u2204) and remotely (Deb 10), the first window has no "content"

@alaingdl
Copy link
Contributor

alaingdl commented Dec 1, 2022

OK.
1/ thanks for correction of AXIS, I tested (basically (wx and x11)), it is back to the correct behavior as tested in TEST_AXIS (limited but useful tests !)
2/ I can compile again with -DWXWIDGETS=off on U2204, Debian 10 + OSX 12, great. (#1381)
3/ I do consider remaining issues within wx are outside the field of this PR
(just for the record the critical issues with wx are : some contents of window are compiled twice (as see on remote), some windows which should contain plot or TV appear blank, 3 buttons instead of 4 in corner #1368 )
4/ I cannot help to solve the blocking issue here (CI don't pass)

then when 4 will be solve, I am OK this PR is merge 👍

And we will be able to close some issues.

Question to @GillesDuvert : should I create issues for each of the blocking issues in wx ?

@GillesDuvert
Copy link
Contributor Author

GillesDuvert commented Dec 1, 2022

yes @alaingdl please open a separate issue for each problem in your 3) above. Indicating it is a wx problem.
They will be solved quite easily I think, but we need to have the big PR #1407 merged first.

Could you also open an issue for case 4) or kindly remind me of the exact problem ("blocking" certainly but blocking what?) I'm a bit lost...

It would help also if you could close all the isues that you think are either obsoleted by #1407 or simply too old or solved.

@alaingdl
Copy link
Contributor

alaingdl commented Dec 1, 2022

Sorry for my poor english. Point 4 is the fact that here, this PR, in Continuous Integration, for build-linux-macos & build-windows , it is failing (2 red crosses)

I will ASAP open clear issues for each point in 3/

and hopefully no delay in showing the first window.
Focus problems must be treated at window manager level, not in GDL
…ight enough to set up the correct enviromnent variables for plplot drivers.
Until our memory() function is not 100% proof this test is just a pain in the ass.
@GillesDuvert GillesDuvert merged commit 4ad8648 into gnudatalanguage:master Dec 3, 2022
@GillesDuvert GillesDuvert deleted the useX11andEnableNoInteractiveGraphics branch December 28, 2022 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants