I am trying to use O2 software on MacOS Catalina 10.15.6 and I have several builds installed. All worked for me before, but now when I tried to use command ‘alienv enter O2/latest-dev-o2’ (or any other tag), I get an error message ’ ERROR: O2/latest-dev-o2 was not found’. Also, when I try to enter ‘alienv q’, it is not finding anything. However, I can see all the builds in ‘~/alice/sw/BUILD/’. Could anyone help me with this?
Hi,
I have managed to solve this issue yesterday.
It turns out that alienv q uses brew -t avail to list all installed modules.
Next, it pipes stderr to stdout, so instead of crashing, it just pipes the error message to the next step (this will become important later).
This masked the underlying problem, which was caused by modulecmd which is used to access all available O2 packages.
For some reason, I assume during migration from v3 to v4, as per commit https://github.com/alisw/alibuild/commit/ca5754cc83918974fdd15599eac0e5fa5e082510, the command is expected to be modulecmd-compat.
Presumably, in my case, easy_install pip updates Homebrew as well, which regenerated files in libexec directory, where modulecmd-compat used to reside, and was removed after the update.
This causes modulecmd to fail via the file simply not existing.
Since stderr is being piped to stdout and not treated as a proper error, grep down the pipeline can’t find anything that would resemble O2 modules, and simply prints nothing, thus hiding the real error.
A quick patch for this was to create a symlink named modulecmd-compat targeting /usr/local/Cellar/modules/4.6.0/libexec/modulecmd.tcl in the same location as modulecmd.tcl.
This looks like a botched alienv migration to module4… :-/ I think now we are modules4 safe (and if not, we should fix the modules). Can you try dropping completely the reference to module-compat in alienv and see if that works?
I have just posted my solution to this problem, that was to reinstall modules 4.5.3 (the latest version 4.6.0 has different behaviour and the modulecmd bash -t avail does not produce the expected output):
Dear all,
can’t update alienv instead of downgrading modules?
I’ve checked that if I comment out: export MODULES_USE_COMPAT_VERSION=1
inside alienv, it works without any further error.
But of course I did not try if this breaks some other systems.
==> Build of O2 successfully completed on `bb-mdw91f47ww.epfl.ch'.
Your software installation is at:
/Users/lcristel/alice_2024Dec/sw/osx_x86-64
You can use this package by loading the environment:
alienv enter O2/latest-dev-o2
==> Build directory for devel package O2:
/Users/lcristel/alice_2024Dec/sw/BUILD/O2-latest/O2
2024-12-10@09:21:55:DEBUG:O2:O2:0: Everything done
(base) lcristel@bb-mdw91f47ww alice_2024Dec $ alienv enter O2/latest-dev-o2
ERROR: O2/latest-dev-o2 was not found
Also, alienv q does not return anything.
All the installation and build steps were executed within a conda env (the base in the second last line above), may that be the issue?
I deactivated the conda environment and alienv still fails in the same way.
I tried with ln -s /usr/local/Cellar/modules/5.5.0/libexec/modulecmd.tcl /usr/local/Cellar/modules/5.5.0/libexec/modulecmd-compat
but doesn’t help.
Any hint?
$ aliBuild version
aliBuild version: 1.17.13 (osx_x86-64)
In my case the problem is that “libtclenvmodules.dylib” is built for x86_64 (while I am running on arm64):
$ modulecmd
ERROR: dlopen(/usr/local/Cellar/modules/5.5.0/lib/libtclenvmodules.dylib, 0x000A): tried: '/usr/local/Cellar/modules/5.5.0/lib/libtclenvmodules.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/modules/5.5.0/lib/libtclenvmodules.dylib' (no such file), '/usr/local/Cellar/modules/5.5.0/lib/libtclenvmodules.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
while executing
"load [file normalize [getConf tcl_ext_lib]] Envmodules"
I “solved” the issue by forcing alienv to run under Rosetta: arch -x86_64 alienv ...