You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove the X11/Xt dependencies (native macOS/Windows clients) #232
ECCE links libX11 and libXt. Neither is needed for xterm (an external program). For native macOS and Windows clients (#133) both dependencies have to go or become Linux-only. Inventory on main (Coin3D build, the default since 9.0.0-alpha.4):
built only with -DECCE_USE_COIN=OFF; removed with #166 stage 5
Plan:
Remove the dead Motif code and unused X11 includes (no behaviour change).
Raise windows through one wx/GDK helper instead of X11 calls (X11, Wayland, macOS, Windows).
Replace the Xt event loop in eccejobstore with poll() and a self-pipe for signals; tests/launch and the jobstore tests must pass unchanged.
Put GLX/EGL behind one platform layer in the viewer: GLX/EGL on Linux, wx's GL canvas and Coin's offscreen rendering on macOS/Windows. Together with Port the viewer to Coin3D (9.0) #166 stage 5.
Make X11 and Xt optional in CMake (Linux/X11 only), so a macOS build needs no XQuartz.
Steps 1-3 and 5 also help Linux (no Xt dependency, Wayland). Estimated 3-4 days in total.
Related: the editor and terminal are already settings (Edit > Preferences, ECCE_EDITOR, ECCE_TERMINAL). The default editor stays vi on Linux; native clients default to tools present on every machine of that platform (TextEdit and Terminal.app on macOS, Notepad and Windows Terminal on Windows).
One more small thing. I have changed the preferences, and realized that I had thought it wasn't working because "Shell in calculation directory" still opens an xterm rather than a gnome-terminal, so that is not following the preferences. I had been changing the shell variables but only checking that so didn't see that things were actually working.
I have a student that will start helping me this week (I hope) to set up a homebrew build setup on my Mac to try to build a version under MacOS.
Steps 1 and 2 are on branch wip/232-x11-cleanup. Step 1 removed about 560 lines of dead Motif/Xt code and unused X11 includes. Step 2 added ewxRaiseWindow() in ewxWindowUtils, now used by WxDavAuth.C and HostKeyDialogApp.C. The remaining X11/GLX/Xt/EGL uses, for step 4 (and step 3 for JobStore.C):
Not checked whether they are compiled (the getDisplay() and XSGI* stereo code looks like it could be in disabled blocks): src/inv/wxinv/SoWxViewer.C:903-942,1584-1608, src/inv/wxinv/SoWxExaminerViewer.C:1024, src/inv/wxinv/SoWxRenderArea.C:348
CMakeLists.txt:470-495 link X11::X11 for builder, vizthumbnail and the other viewer apps
GDK-X11 (done, conditional)
src/wxgui/ewxClasses/ewxWindowUtils.C:21,57-60gdk_x11_get_server_time, only under GDK_WINDOWING_X11 with GDK_IS_X11_DISPLAY at runtime. The hostkeydialog no longer links GTK itself.
Vendored src/inv/db*, actions, nodes, interaction and misc were not touched. They go with #166 stage 5.
Step 4 is on branch wip/232-viewer-gl (fcf5968, d2dd1de, 0c6fb12). It is not merged yet.
Live X11/GLX/EGL uses in the Coin build, before this step. I found these by preprocessing each file with the build's own flags. Most grep hits are inside /* */, #ifdef __sgi or __sys_fonts blocks.
CoinEglOffscreen.C: EGL offscreen contexts, plus the glX* calls that save and restore the current context around them.
SoWx.C: calls CoinEglOffscreen::install() under OIV_COIN. That function exists only on Linux, so a macOS link would fail.
SoWxViewer.H: <X11/Intrinsic.h>. It was there only for the types of four dead Xt-era methods; those methods are now removed. MoPanel.C had been getting X11's False through this include.
SoWxViewer.C: X11's None ended the wx GL attribute list.
Not live: sysfonts.C compiles to nothing because __sys_fonts is never defined (labels are drawn by flclient/FreeType). The stereo code was SGI-only. The vendored SoOffscreenRenderer.H and SoWindowElement.H are used only with ECCE_USE_COIN=OFF.
Design.include/inv/SoWx/GlPlatform.H and src/inv/wxinv/GlPlatform.C hold the current-context query, release and restore (GLX), and installOffscreen(). ECCE_GL_X11 chooses the branch: 1 on Linux/FreeBSD, 0 elsewhere. With 0, the context calls do nothing and Coin uses its own CGL/WGL offscreen renderer. On-screen drawing was already wxGLCanvas/wxGLContext. There is no stereo function, because nothing live would call it.
Linux. Before and after, 69 renders are pixel-identical: built-in styles, labels, isosurface, thumbnails, the Builder calc scenes (water MO and normal modes, CrCO6 MO), and look_offscreen_shading (canvas, vizfile, offscreen). offscreen-check passes with and without DISPLAY, and the vendored build compiles the changed files.
Non-X11 compile. There is no wxOSX on Debian, so tools/nonx11/check.py approximates one. It compiles all 271 sources of eccewxinv, eccemoiv, eccevizsg and eccewxviz with ECCE_GL_X11=0, #error stubs for X11/GLX/EGL headers, and wxGTK's GLX canvas header swapped for the portable API. All 271 pass. nm shows no GLX/EGL/Xlib symbols in the layer or its callers. The rest of wx stays wxGTK, so this checks our code only. The real check is the macOS build itself.
What a macOS build should now get past: the viewer libraries (wxinv, moiv, viz, wxviz).
What remains:
Step 5, CMake:
find_package(X11 REQUIRED) (line 63) has to become Linux-only.
Drop X11::X11 from builder, vizthumbnail, viewer-scenes, render-rgb and viewer-bench (lines 463-488). The builder already has no libX11 in NEEDED.
Gate the OpenGL::EGL link on the same condition as ECCE_GL_X11 and pass ECCE_GL_X11 from CMake.
Make the gtk+-3.0/GDK-X11 part of ewxWindowUtils (line 329) conditional.
Remove the libegl-dev/libx11-dev build-deps from non-Linux packaging.
tools/viewer-bench still calls glX* directly. It is EXCLUDE_FROM_ALL.
Untested on a Mac: Coin's CGL offscreen renderer (used for thumbnails), and the alpha-buffer request, which now also applies on wxOSX.
Step 5 is on branch wip/232-cmake-x11 (one commit, not merged).
Change. The ECCE_GL_X11 option defaults to ON on UNIX but not APPLE. It is passed to every target as a compile definition and gates find_package(X11), the Xt check, X11::X11 in the app link lists, the EGL link and viewer-bench. Deb/rpm dependencies come from shlibdeps and are unchanged.
Linux. Builder, organizer, eccejobstore and vizthumbnail have identical link command lines before and after. A clean build of the first three gives identical ldd output; both builds stopped at 852/853. A configure with -DECCE_GL_X11=OFF has no X11/EGL in the builder link and no viewer-bench target, and tools/nonx11/check.py passes 271/271 against it. Not checked: a real Mac.
macOS CI (run 37358122449): configure passes and the build reaches 472/1112 before it stops. The Linux jobs pass. Next obstacles, none involving X11:
DirectTransport.C:315,539: sigtimedwait is not declared on macOS.
OpenSshTransport.C:724: SOCK_CLOEXEC is not declared on macOS.
More errors may follow, since ninja stops at the first failures.
The macOS job still installs XQuartz, which is no longer needed.
@mattasplund Thanks for the report about "Shell in calculation directory". It is fixed on main (20e4e87): every local shell or tail (Organizer, Launcher, MD Prepare) now uses Edit > Preferences > Terminal or ECCE_TERMINAL, in the calculation directory, the same way the remote shells already did. As a side effect, a calculation directory whose path contains a space now also works over ssh.
All five steps of this issue are now on main (48b2292):
dead Motif/Xt code removed;
windows are raised through one wx/GDK helper;
eccejobstore runs on poll() instead of the Xt event loop;
the viewer's GLX/EGL calls sit behind one layer, and macOS uses Coin's own offscreen renderer;
X11, Xt and EGL are found and linked only on Linux/X11.
A macOS build therefore no longer needs XQuartz or libX11/libXt. On Linux the change is invisible: 69 viewer renders are pixel-identical, and the launch, queue and jobstore suites pass.
macOS CI (Homebrew, Cocoa wxWidgets) now configures and gets to about 40% of the build (472 of 1112 steps). The next failures are not about X11 but about two Linux-only calls in the remote-shell code: sigtimedwait (src/comm/.../DirectTransport.C) and SOCK_CLOEXEC (OpenSshTransport.C). They are next; more may follow, since the build stops at the first errors. Your student will hit the same places, so it is worth waiting for those two fixes, or starting from them.
For the editor: vi stays the default on Linux. gedit works via Preferences or ECCE_EDITOR, but use gedit --wait, otherwise ECCE ends the edit session as soon as gedit hands the file to an already open window.
Closing: all five steps are on main (merge 48b2292): dead Motif/Xt code removed, windows raised through ewxRaiseWindow(), eccejobstore on poll() instead of the Xt event loop (src/comm/commxt/JobStore.C has no X11/Xt reference left), the viewer's GLX/EGL behind GlPlatform, and X11/Xt/EGL found and linked only when ECCE_GL_X11 is on (Linux/X11). Covered by tools/nonx11/check.py (271 viewer sources compiled with ECCE_GL_X11=0), the launch/queue/jobstore suites, and the macOS CI build, which now links. Matt's terminal report was fixed separately in 20e4e87. Reopen if a non-Linux build still needs libX11 or libXt.
Activity
mattasplund commentedon Oct 5, 2026
One more small thing. I have changed the preferences, and realized that I had thought it wasn't working because "Shell in calculation directory" still opens an xterm rather than a gnome-terminal, so that is not following the preferences. I had been changing the shell variables but only checking that so didn't see that things were actually working.
I have a student that will start helping me this week (I hope) to set up a homebrew build setup on my Mac to try to build a version under MacOS.
ohlincha commentedon Oct 5, 2026
Steps 1 and 2 are on branch
wip/232-x11-cleanup. Step 1 removed about 560 lines of dead Motif/Xt code and unused X11 includes. Step 2 addedewxRaiseWindow()inewxWindowUtils, now used byWxDavAuth.CandHostKeyDialogApp.C. The remaining X11/GLX/Xt/EGL uses, for step 4 (and step 3 forJobStore.C):Xt (step 3,
eccejobstore)src/comm/commxt/JobStore.C:34#include <X11/Intrinsic.h>,:209XtAppContext,:285-286XtToolkitInitialize/XtCreateApplicationContextsrc/comm/commxt/JobStore.C:1001XtNoticeSignal,:1087XtAppAddSignal,:1617/:1924XtAppAddInput,:1629/:1950XtRemoveInput,:1792XtRemoveTimeOut,:1795XtAppAddTimeOut,:1938XtAppProcessEventCMakeLists.txt:63-68find_package(X11)plus the libXt check,:235eccecommxtlinksX11::Xt X11::X11GLX/X11 in the viewer (step 4)
src/inv/moiv/sysfonts.C:130<GL/glx.h>,:141glXGetCurrentDisplay,:150,170,182,213,261,277XListFonts,:310glXUseXFont(live under__GLX)src/inv/wxinv/CoinEglOffscreen.C:9<GL/glx.h>; 13glX*calls (lines 30-135) that save and restore the GLX context around EGL offscreen renderinginclude/inv/SoOffscreenRenderer.H:63,67<GL/glx.h>,<X11/Xlib.h>include/inv/elements/SoWindowElement.H:60<GL/glx.h>include/inv/SoWx/SoWxViewer.H:10<X11/Intrinsic.h>getDisplay()andXSGI*stereo code looks like it could be in disabled blocks):src/inv/wxinv/SoWxViewer.C:903-942,1584-1608,src/inv/wxinv/SoWxExaminerViewer.C:1024,src/inv/wxinv/SoWxRenderArea.C:348CMakeLists.txt:470-495linkX11::X11for builder, vizthumbnail and the other viewer appsGDK-X11 (done, conditional)
src/wxgui/ewxClasses/ewxWindowUtils.C:21,57-60gdk_x11_get_server_time, only underGDK_WINDOWING_X11withGDK_IS_X11_DISPLAYat runtime. The hostkeydialog no longer links GTK itself.Vendored
src/inv/db*,actions,nodes,interactionandmiscwere not touched. They go with #166 stage 5.Merge wip/232-x11-cleanup: dead Motif/Xt code removed, windows raised…
Merge wip/232-jobstore-poll: eccejobstore event loop on poll() and a …
ohlincha commentedon Oct 5, 2026
Step 4 is on branch
wip/232-viewer-gl(fcf5968, d2dd1de, 0c6fb12). It is not merged yet.Live X11/GLX/EGL uses in the Coin build, before this step. I found these by preprocessing each file with the build's own flags. Most grep hits are inside
/* */,#ifdef __sgior__sys_fontsblocks.CoinEglOffscreen.C: EGL offscreen contexts, plus theglX*calls that save and restore the current context around them.SoWx.C: callsCoinEglOffscreen::install()underOIV_COIN. That function exists only on Linux, so a macOS link would fail.SoWxViewer.H:<X11/Intrinsic.h>. It was there only for the types of four dead Xt-era methods; those methods are now removed.MoPanel.Chad been getting X11'sFalsethrough this include.SoWxViewer.C: X11'sNoneended the wx GL attribute list.sysfonts.Ccompiles to nothing because__sys_fontsis never defined (labels are drawn by flclient/FreeType). The stereo code was SGI-only. The vendoredSoOffscreenRenderer.HandSoWindowElement.Hare used only withECCE_USE_COIN=OFF.Design.
include/inv/SoWx/GlPlatform.Handsrc/inv/wxinv/GlPlatform.Chold the current-context query, release and restore (GLX), andinstallOffscreen().ECCE_GL_X11chooses the branch: 1 on Linux/FreeBSD, 0 elsewhere. With 0, the context calls do nothing and Coin uses its own CGL/WGL offscreen renderer. On-screen drawing was alreadywxGLCanvas/wxGLContext. There is no stereo function, because nothing live would call it.Linux. Before and after, 69 renders are pixel-identical: built-in styles, labels, isosurface, thumbnails, the Builder calc scenes (water MO and normal modes, CrCO6 MO), and
look_offscreen_shading(canvas, vizfile, offscreen).offscreen-checkpasses with and withoutDISPLAY, and the vendored build compiles the changed files.Non-X11 compile. There is no wxOSX on Debian, so
tools/nonx11/check.pyapproximates one. It compiles all 271 sources of eccewxinv, eccemoiv, eccevizsg and eccewxviz withECCE_GL_X11=0,#errorstubs for X11/GLX/EGL headers, and wxGTK's GLX canvas header swapped for the portable API. All 271 pass.nmshows no GLX/EGL/Xlib symbols in the layer or its callers. The rest of wx stays wxGTK, so this checks our code only. The real check is the macOS build itself.What a macOS build should now get past: the viewer libraries (wxinv, moiv, viz, wxviz).
What remains:
find_package(X11 REQUIRED)(line 63) has to become Linux-only.X11::X11from builder, vizthumbnail, viewer-scenes, render-rgb and viewer-bench (lines 463-488). The builder already has no libX11 in NEEDED.OpenGL::EGLlink on the same condition asECCE_GL_X11and passECCE_GL_X11from CMake.libegl-dev/libx11-devbuild-deps from non-Linux packaging.tools/viewer-benchstill callsglX*directly. It is EXCLUDE_FROM_ALL.Merge wip/232-viewer-gl: viewer GL calls behind GlPlatform (GLX/EGL o…
Merge wip/local-shell-terminal: local shells and tails use the Termin…
ohlincha commentedon Oct 5, 2026
Step 5 is on branch wip/232-cmake-x11 (one commit, not merged).
Change. The
ECCE_GL_X11option defaults to ON on UNIX but not APPLE. It is passed to every target as a compile definition and gatesfind_package(X11), the Xt check,X11::X11in the app link lists, the EGL link and viewer-bench. Deb/rpm dependencies come from shlibdeps and are unchanged.Linux. Builder, organizer, eccejobstore and vizthumbnail have identical link command lines before and after. A clean build of the first three gives identical
lddoutput; both builds stopped at 852/853. A configure with-DECCE_GL_X11=OFFhas no X11/EGL in the builder link and no viewer-bench target, andtools/nonx11/check.pypasses 271/271 against it. Not checked: a real Mac.macOS CI (run 37358122449): configure passes and the build reaches 472/1112 before it stops. The Linux jobs pass. Next obstacles, none involving X11:
DirectTransport.C:315,539:sigtimedwaitis not declared on macOS.OpenSshTransport.C:724:SOCK_CLOEXECis not declared on macOS.Merge wip/232-cmake-x11: X11, Xt and EGL only where the viewer's GL i…
ohlincha commentedon Oct 5, 2026
@mattasplund Thanks for the report about "Shell in calculation directory". It is fixed on main (20e4e87): every local shell or tail (Organizer, Launcher, MD Prepare) now uses Edit > Preferences > Terminal or
ECCE_TERMINAL, in the calculation directory, the same way the remote shells already did. As a side effect, a calculation directory whose path contains a space now also works over ssh.All five steps of this issue are now on main (48b2292):
eccejobstoreruns onpoll()instead of the Xt event loop;A macOS build therefore no longer needs XQuartz or libX11/libXt. On Linux the change is invisible: 69 viewer renders are pixel-identical, and the launch, queue and jobstore suites pass.
macOS CI (Homebrew, Cocoa wxWidgets) now configures and gets to about 40% of the build (472 of 1112 steps). The next failures are not about X11 but about two Linux-only calls in the remote-shell code:
sigtimedwait(src/comm/.../DirectTransport.C) andSOCK_CLOEXEC(OpenSshTransport.C). They are next; more may follow, since the build stops at the first errors. Your student will hit the same places, so it is worth waiting for those two fixes, or starting from them.For the editor: vi stays the default on Linux. gedit works via Preferences or
ECCE_EDITOR, but usegedit --wait, otherwise ECCE ends the edit session as soon as gedit hands the file to an already open window.ohlincha commentedon Oct 7, 2026
Closing: all five steps are on main (merge 48b2292): dead Motif/Xt code removed, windows raised through
ewxRaiseWindow(),eccejobstoreonpoll()instead of the Xt event loop (src/comm/commxt/JobStore.Chas no X11/Xt reference left), the viewer's GLX/EGL behindGlPlatform, and X11/Xt/EGL found and linked only whenECCE_GL_X11is on (Linux/X11). Covered bytools/nonx11/check.py(271 viewer sources compiled withECCE_GL_X11=0), the launch/queue/jobstore suites, and the macOS CI build, which now links. Matt's terminal report was fixed separately in 20e4e87. Reopen if a non-Linux build still needs libX11 or libXt.