Skip to content
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

OSX 12.3.1 not OK remotely #1395

Closed
alaingdl opened this issue Nov 11, 2022 · 12 comments
Closed

OSX 12.3.1 not OK remotely #1395

alaingdl opened this issue Nov 11, 2022 · 12 comments

Comments

@alaingdl
Copy link
Contributor

Accessing to this
After updating Brew and compiling twice (don't ask me why the first compilation was not OK !), I succeed to compile current Git today (not last week, and not tuesday ) with the script on a recent version of OSX : 12.3.1. Great.

But I was not able to open window through the network. (before 1.0.1 it was working well). xclock appears fine, and previously GDL plots too.

alain@mac:~/GDL/gdl-1.0.1git221111/]$ ./install/bin/gdl 
2022-11-12 00:09:56.343 gdl[39591:12415964] XType: com.apple.fonts is not accessible.
2022-11-12 00:09:56.343 gdl[39591:12415964] XType: XTFontStaticRegistry is enabled.
  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): /Users/alain/GDL/gdl-1.0.1git221111/install/share/gnudatalanguage/lib
- Using WxWidgets as graphics library (windows and widgets).
- Using local drivers in /Users/alain/GDL/gdl-1.0.1git221111/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> help,/dev
Available Graphics Devices: NULL PS SVG Z X 
Current graphics device: X
GDL> window, 0
./src/common/dpycmn.cpp(130): assert ""IsOk()"" failed in GetGeometry(): invalid wxDisplay object
Collecting stack trace information, please wait...Trace/BPT trap: 5

(exactly the same message when calling plot, findgen(10))

[alain@mac:~/GDL/gdl-1.0.1git221111/]$ sw_vers 
ProductName:	macOS
ProductVersion:	12.3.1
BuildVersion:	21E258

I like to compile and make tests on this hardware !

$ sysctl -a | grep brand_
machdep.cpu.brand_string: Intel(R) Xeon(R) W-2140B CPU @ 3.20GHz

...
machdep.cpu.core_count: 8
machdep.cpu.thread_count: 16
@GillesDuvert
Copy link
Contributor

@alaingdl the gdl build on OSX using build_gdl.sh creates a full-featured desktop-only user gdl with wxwidgets interface, as reported in the startup screen:
- Using WxWidgets as graphics library (windows and widgets).
As only X11 windows can be transmitted over the network, I think the error comes from wxWindow trying to open a local cocoa window when there is no local display. To get remote windows via ssh -X: I suspect only X11 does provide this. Using a remote desktop facility (TeamViewer, Apple remote desktop) is IMHO the sole way to get wxWidgets=cocoa windows appear remotely. (help wanted on this)
The solution is to enable and use X11 plot windows in your macOSX build.
Unfortunately the script does not check if X11 is present, so it does not compile the X11 support in GDL, which would have permitted to switch to X11 plot windows (calling gdl --no-use-wx) . This should be corrected.
You can certainly add the X11 support with the -DX11 switch of cmake in the build directory, then make and install should give a X11-enabled gdl.

@alaingdl
Copy link
Contributor Author

  • I suspect that WxWidgets can be used through the network from OSX (I don't see why it would not be able). ASAP I will try to compile wxwidget basic code + X11 on OSX to check that.

  • (as said) I did tried to compile without the script, just using Cmake passing -DX11 (as usual). Before (e.g. rc3) it was OK (plot OK) but no more today (since 1.0.1 and now in the git version)

To be clear again : cmake -DX11=on -DWXWIDGETS=off did work until 1.0.1rc3 on OSX to have plots through the network with ssh -X. It is no more OK, since circa 1.0.1.

@GillesDuvert
Copy link
Contributor

Using latest GDL on a Catalina running in a VM, remotely:

$ ssh -X me@192.168.0.27
Password:
X11 forwarding request failed on channel 0
Last login: Thu Nov 17 17:36:08 2022
me@gildass-iMac ~ % ~/gdl.app/Contents/MacOS/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): /Users/gildas/gdl/install/share/gnudatalanguage/lib
- Using WxWidgets as graphics library (windows and widgets).
- Using local drivers in /Users/gildas/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> surface, dist(100)
% Compiled module: DIST.
GDL> 

Of course the plot is on the mac display, not on my linux display. Because cocoa does not know about X11 at all.

Now, after installing XQuartz, enable X11 frowarding, reboot, compiling gdl with -DX11:

cd gdl/build;
cmake -DX11=ON .. 

and calling remotely gdl using the x11 driver:


~/gdl.app/Contents/MacOS/gdl --no-use-wx
X11 connection rejected because of wrong authentication.
No protocol specified

  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): /Users/gildas/gdl/install/share/gnudatalanguage/lib
- Using local drivers in /Users/gildas/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> surface, dist(100)
% Compiled module: DIST.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
No protocol specified

% Cannot connect to X server
% Execution halted at: $MAIN$ 

Not so bad since I do not know how to convince the mac to authenticate with my linux.

@alaingdl
Copy link
Contributor Author

This is quite simple despite the fact it is erased by updates ... You should change few lines in /etc/ssh/sshd_config

UsePAM yes   # not sure it is mandatory
AllowAgentForwarding yes
X11Forwarding yes

then after you can restart the service without rebooting (I used that) :

sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

(killing sshd is also documented ...)

@GillesDuvert
Copy link
Contributor

thanks.
There was a problem with xauth but by removing all .Xauthority* andtouch .Xauthorityall went well, xeyes works for example.
But indeed:

~/gdl.app/Contents/MacOS/gdl --no-use-wx
  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): /Users/gildas/gdl/install/share/gnudatalanguage/lib
- Using local drivers in /Users/gildas/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> surface, dist(100)
% Compiled module: DIST.
Unable to locate dispatch table initialization function for driver: xwin.
zsh: segmentation fault  ~/gdl.app/Contents/MacOS/gdl --no-use-wx

probably easy to solve -- after all the initialization function for driver wxwidgets is found.

@GillesDuvert
Copy link
Contributor

Formula code: plplot.rb on GitHub does not create the x11 driver (even if XQuartz is present) ---> no chance to get a X11 output using homebrew's plplot.
However build_gdl.sh recompiles plplot after editing the above formula. Stay tuned.

@GillesDuvert
Copy link
Contributor

OK succeded. Now it is time to get this working automatically. Here a list of the point to take into account:

  • The current cmake is OK for OSX, it needs not be changed.
  • X11 devel must be present on the system, so X.h is present and option -LX11 will be added by cmake to the link command, for both the xwin driver in gdl/src/plplotdriver and for gdl itself
  • plplot must be installed on the system with options -DPLD_xwin=ON -DENABLE_wxwidgets=ON -DPLD_wxwidgets=ON -DENABLE_DYNDRIVERS=ON
  • cmake for gdl must be invoked with option -DX11=ON -DINTERACTIVE_GRAPHICS=ON -DWXWIDGETS=ON

This creates the same gdl as on linux platform, that uses wxWidgets by default and X11 if gdl is called with option --no-use-wx or environment variable GDL_DISABLE_WX_PLOTS is set to 1 (export GDL_DISABLE_WX_PLOTS=1 ; gdl) . Only in the second case can the plot window be redirected to a display connected by ssh -X, and provided all the abovementioned difficulties with X authentication are solved, but this is not a GDL problem.

Provided the script build_gdl.sh does all theses things, we can probably use X11 in parallell of wxWidgets for unix and osx for future releases.

@GillesDuvert
Copy link
Contributor

I note that not having wxWidgets (-DWXWIDGETS=OFF) (or worse no wxWidgets and no X11 ) is not an option anymore and will crash the compilation. This must be corrected, not in build_gdl.sh which is for interactive uses, but in cmake for manual installation.
Also, it is not clear where OSX cmake fails to add -lX11 to the link command, and what should be the provider of the xlib-devel package? homebrew? xcode? This is creepy.

@GillesDuvert
Copy link
Contributor

@alaingdl please test this PR

@alaingdl
Copy link
Contributor Author

😄 searching my notes how to test a given PR !

one problem is the 16-core Mac I am using for such tests has lost the way to use Git,
as it happen time to time (known problem since 10.15). I have to copy the files
through some tunnel ...

@alaingdl
Copy link
Contributor Author

alaingdl commented Dec 3, 2022

Concerning issue with Git after system update : I found a solution here
https://stackoverflow.com/questions/72486457/fatal-unable-to-connect-to-github-com-github-com0-140-82-121-4-errno-unkno

git config --global url.https://github.com/.insteadOf git://github.com/

@alaingdl
Copy link
Contributor Author

alaingdl commented Dec 3, 2022

OK, the current version (after PR #1407) can again been compiled with and without Wxwidgets. Remotely I do have windows when starting gdl with --no-use-wx

the quality of the plot is problematic but it will be in another issue

then I think we can close this issue since we are back to normal behavior

@alaingdl alaingdl closed this as completed Dec 3, 2022
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

No branches or pull requests

2 participants