From f6b63e740d7a8e2d362187d8f78c5295420f1806 Mon Sep 17 00:00:00 2001 From: Duan Date: Fri, 16 Oct 2026 17:49:09 +0200 Subject: [PATCH] olex2: export OLEX2_ROOT from the modulefile, use it in the README checks --- olex2/README.md | 19 ++++++++++--------- olex2/modulefile | 7 ++++++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/olex2/README.md b/olex2/README.md index 7eb20f6..52bcfc3 100644 --- a/olex2/README.md +++ b/olex2/README.md @@ -57,7 +57,9 @@ exports `OLEX2_CCTBX_DIR`, `BOOST_ADAPTBX_*`, `OLEX2_GL_*`, inherited one would be imported by the embedded Python 3.8 and break it), sets `LIBGL_ALWAYS_SOFTWARE=1` for the GUI only, then `exec`s the binary. `unirun` is never run: `/opt/psi/MX` is shared and read-only, updates are -done by building a new module version. +done by building a new module version. The modulefile exports +`OLEX2_ROOT=$PREFIX` (our own name; the vendor's `OLEX2_DIR` re-targets the +updater and stays unset) and puts `$PREFIX/bin` on `PATH`. ### Bundled glibc 2.39 sysroot (why and how) @@ -147,12 +149,11 @@ GTK2/X11/OpenGL — also `olex2c` (wx is linked in statically). Check once per host type: ```sh -module load olex2/1.5-7665 -P=/opt/psi/MX/olex2/1.5-7665 -$P/sysroot/usr/lib64/ld-linux-x86-64.so.2 --list $P/olex2c | grep -E 'not found|libc.so.6|libstdc' +module load olex2/1.5-7665 # exports OLEX2_ROOT=/opt/psi/MX/olex2/1.5-7665 +$OLEX2_ROOT/sysroot/usr/lib64/ld-linux-x86-64.so.2 --list $OLEX2_ROOT/olex2c | grep -E 'not found|libc.so.6|libstdc' ``` -`libc.so.6`/`libstdc++.so.6` must resolve under `$P/sysroot`; every `not +`libc.so.6`/`libstdc++.so.6` must resolve under `$OLEX2_ROOT/sysroot`; every `not found` line is a host package to `dnf install` (expected candidates on a minimal RHEL9: `gtk2`, `mesa-libGL`, `mesa-libGLU`, `libSM`, `libXxf86vm`, `libxkbcommon`). Plain `ldd` on the raw binary also works after the patch @@ -161,13 +162,13 @@ minimal RHEL9: `gtk2`, `mesa-libGL`, `mesa-libGLU`, `libSM`, `libXxf86vm`, ## Verifying the install ```sh -which olex2c # -> /opt/psi/MX/olex2/1.5-7665/bin/olex2c -which olex2 # -> /opt/psi/MX/olex2/1.5-7665/bin/olex2 -cat /opt/psi/MX/olex2/1.5-7665/version.txt # SVN Revision No. 7665 +which olex2c # -> $OLEX2_ROOT/bin/olex2c (= /opt/psi/MX/olex2/1.5-7665/bin/olex2c) +which olex2 # -> $OLEX2_ROOT/bin/olex2 +cat $OLEX2_ROOT/version.txt # SVN Revision No. 7665 # console: starts, loads a shipped sample, refines, exits (writes to ~/.olex2 # and to a scratch copy of the sample - run it in a scratch dir) -cd $(mktemp -d) && cp /opt/psi/MX/olex2/1.5-7665/sample_data/sucrose/* . +cd $(mktemp -d) && cp $OLEX2_ROOT/sample_data/sucrose/* . olex2c # interactive prompt; then type: # reap sucrose.res # refine 4 diff --git a/olex2/modulefile b/olex2/modulefile index fbf9680..492fb9a 100644 --- a/olex2/modulefile +++ b/olex2/modulefile @@ -22,6 +22,11 @@ Per-user data (DataDir) lives in ~/.olex2. The vendor Python API (olx, olex modules) is only available from inside olex2/olex2c, not as a system python. " +# Install root (= Olex2 BaseDir): sample_data, sysroot, version.txt live here. +# Our own name on purpose - OLEX2_DIR is a vendor variable that re-targets +# the auto-updater, so it must stay unset. +setenv OLEX2_ROOT $PREFIX + # Launchers only: the raw binaries, the vendor 'start' script (auto-updater) # and the private python live under $PREFIX root and stay off PATH. -prepend-path PATH $PREFIX/bin +prepend-path PATH $PREFIX/bin