Building xjalienfs fails on MacOS Ventura

Dear experts,

Building O2 fails on xjalienfs@1.5.9. I recently updated MacOS to Ventura 13.6.4, installed Xcode 15.2, reinstalled alibuild with brew, updated alidist and also python3. Any hint? The log is rather long and is available here:

https://cernbox.cern.ch/index.php/s/6xfscEJBrhKNkTW

Thanks for your help,
Antonio

Dear @auras , all,
I have observed the same problem. The issue occurred when I updated with brew the python version to v3.12.
From the log, it looks like gnureadline does not compile properly with python 3.12. If I remove this dependency it compiles, but when I launch alien.py I have this exception in the log:

INFO:2024-02-29 15:29:47,513 Request connection to: alice-jcentral.cern.ch:8097/websocket/json
INFO:2024-02-29 15:29:47,719 GOT SOCKET TO: 128.142.249.31:8097
INFO:2024-02-29 15:29:48,207 CONNECTED: 128.142.249.31:8097
ERROR:2024-02-29 15:30:09,608 

>>>   EXCEPTION   <<<
Traceback (most recent call last):
  File "/Users/stocco/opus/projects/alice/software/sw/osx_arm64/xjalienfs/o2-master-local1/lib/python/site-packages/alienpy/alien.py", line 1980, in main
    sys.exit(JAlien(arg_list))
             ^^^^^^^^^^^^^^^^
  File "/Users/stocco/opus/projects/alice/software/sw/osx_arm64/xjalienfs/o2-master-local1/lib/python/site-packages/alienpy/alien.py", line 1866, in JAlien
    setupHistory(ALIENPY_GLOBAL_WB)  # Setup command history
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stocco/opus/projects/alice/software/sw/osx_arm64/xjalienfs/o2-master-local1/lib/python/site-packages/alienpy/tools_history.py", line 45, in setupHistory
    rl.read_history_file(histfile)
OSError: [Errno 22] Invalid argument
ERROR:2024-02-29 15:30:09,611 

According to some mail exchanges in the list alice-project-analysis-task-force, it would seem that going back to python 3.11 would solve the issue (I’ve not yet tried it though).
However, if the gnureadline issue is solved in python 3.12, it might be better.

Thanks!
Cheers,
Diego

Hi Diego, all,

I had the same issue. I tried going back to python 3.11 on my old mac (intel processor), by adding it in my PATH:
export PATH=“/usr/local/opt/python@3.11/libexec/bin:$PATH”

But then ROOT compilation failed. From the log the reason is that it does not find python3, because it is looking at it in /usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/bin/. I imagine it gets there by following the symlinks. In the default version of python3 in brew (currently python@3.12), there is a symlink from python3.12 to python3 in the corresponding directory, but for non-default version like 3.11 now, this symlink does not exit.

I added manually the symlink from python3.11 to python3 in /usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/bin/. and now both ROOT and xjalienfs compiled (O2 is still compiling but no problem so far).

This is a dirty manual hack, so I hope a clever solution can be found.

Cheers,
Philippe

Hi @dstocco, @ppillot, thanks for the feedback. Since I don’t have any /usr/local/opt directory I added this to my ~/.profile:

PATH=“/opt/homebrew/opt/python@3.11/bin:$PATH”

and when asking which python3 I have:

auras@lyoalice07 alice % which python3
/opt/homebrew/opt/python@3.11/bin/python3

while without the line above I had:

auras@lyoalice07 alice % which python3
/opt/homebrew/bin/python3

which points to /opt/homebrew/Frameworks/Python.framework/Versions/3.12/bin/python3.12

However, the problem with the building of xjalienfs is still there :frowning:

Cheers,
Antonio

Hi @ppillot ,
I think that the problem is in line 99 of alidist/root.sh:

python_exec=$(python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_var("exec_prefix"))')/bin/python3

This finds the path to /usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11, but then it forces python to be called python3.
I’ve just added: PYTHON_EXECUTABLE="$(which python3)" in line 114 and then root compiles: no need to add symlinks.

Cheers,
Diego

Ciao @auras ,
did you try to recompile from scratch after the hack proposed by @ppillot ?
If not, try at least to do:

aliBuild clean --aggressive-cleanup
rm -rf $ALIBUILD_WORK_DIR/osx_arm64/Python-modules*

and recompile.
I think that, when compiling xjalienfs, it uses the python3 that it found when compiling python-modules…so better get rid of those as well before trying to recompile.

Ciao,
Diego

Ciao @dstocco, I tried to recompile from scratch with python@3.11 but now I have again the original problem with python-modules, which was fixed by python@3.12 :

++ unset VIRTUAL_ENV
++ python3 -m venv --copies /Users/auras/alice/sw/INSTALLROOT/b8db7b4e956834f0068e3e1f1cc62468460f00d8/osx_arm64/Python-modules/1.0-local1
Error: Command ‘[’/Users/auras/alice/sw/INSTALLROOT/b8db7b4e956834f0068e3e1f1cc62468460f00d8/osx_arm64/Python-modules/1.0-local1/bin/python3.11’, ‘-m’, ‘ensurepip’, ‘–upgrade’, ‘–default-pip’]’ died with <Signals.SIGABRT: 6>.

Have you ever had such a message?

Ciao
Antonio

@twilken i seen some python + SIGABRT on xrootd issues
Any idea if we are using the compiler flags that were found that generate the problem?

Ciao @auras ,
unfortunately for you (but fortunately for me :wink: ) I cannot reproduce your problem. I had no issue when recompiling from scratch.

Notice that, differently from @ppillot , I installed and run alibuild within a python venv (using python 3.11). But I’m not sure if this helps. After all, it works for @ppillot who is not using venv.

Cheers,
Diego

Hi @asevcenc, are you aware of any trick I could apply, waiting for an official fix? I’m a bit stuck and I need the software for the multiplicity analysis… Thanks!!

Unfortunately no … the macos is a big inconsistent mess and i’m not an user (nor i want to) … i seen recently an email where someone said that it had a good installation after deleting everything in sw/ folder, set ALL python to 3.11 (with the proper and latest alibuild install) … so you might want to try this (also make sure the alidist is fresh)

Hi @asevcenc, I think this is exactly what I’ve done… when asking “which python3” I get:

auras@lyoalice07 alice % which python3
/opt/homebrew/opt/python@3.11/bin/python3

And I reinstalled alibuild after having deleted the whole content of the ~/alice directory (including the sw sub-directory), then redone the installation procedure from scratch, but then I get the problem with the building of python-modules I mentioned in my previous message:

++ unset VIRTUAL_ENV
++ python3 -m venv --copies /Users/auras/alice/sw/INSTALLROOT/b8db7b4e956834f0068e3e1f1cc62468460f00d8/osx_arm64/Python-modules/1.0-local1
Error: Command ‘[’/Users/auras/alice/sw/INSTALLROOT/b8db7b4e956834f0068e3e1f1cc62468460f00d8/osx_arm64/Python-modules/1.0-local1/bin/python3.11’, ‘-m’, ‘ensurepip’, ‘–upgrade’, ‘–default-pip’]’ died with <Signals.SIGABRT: 6>.

I really don’t know how to proceed…

i found these:

@twilken any idea about this?

Hi @asevcenc, I removed python@3.12 in order python@3.11 to be used, but I noticed that when reinstalling alibuild python@3.12 is automatically installed:

==> Reinstalling alisw/system-deps/alibuild
==> Installing dependencies for alisw/system-deps/alibuild: python@3.12
==> Installing alisw/system-deps/alibuild dependency: python@3.12

Is there a way to avoid this?

@twilken Any idea about this? Given the problems with gnureadline maybe it would be best to no request latest python

The SIGABRT thing sounds like you have the wrong binaries installed – e.g. you have installed binaries for Intel processors on a machine with an ARM processor. The advice given in the links @asevcenc found sounds good – completely uninstall and reinstall brew, making sure not to use Rosetta or anything like that.

About python 3.12: I don’t think we can avoid having it installed – it is the default version after all, and things like gtk-doc (which we need for building) depend on it as well.

Dear @twilken, I finally uninstalled and reinstalled brew, but now ROOT the building fails on ROOT: CERNBox. Any idea? Thanks!