O2 Build error at XRootD@v5.4.3 on macOs Big Sur 11.6

Dear experts,

After an alidist and O2 update, I can’t install O2 anymore because of a build error when building XRootD@v5.4.3.

The most relevant error is there :

  c++ -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/herrmann/opt/anaconda3/include -I/Users/herrmann/opt/anaconda3/include -fPIC -O2 -isystem /Users/herrmann/opt/anaconda3/include --std=c++14 -std=c++17 -arch x86_64 -I/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/src -I/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/build/src -I/Users/herrmann/opt/anaconda3/include/python3.9 -c /Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/PyXRootDURL.cc -o build/temp.macosx-10.9-x86_64-cpython-39/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/PyXRootDURL.o -g
  c++ -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/herrmann/opt/anaconda3/include -I/Users/herrmann/opt/anaconda3/include -fPIC -O2 -isystem /Users/herrmann/opt/anaconda3/include --std=c++14 -std=c++17 -arch x86_64 -I/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/src -I/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/build/src -I/Users/herrmann/opt/anaconda3/include/python3.9 -c /Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/Utils.cc -o build/temp.macosx-10.9-x86_64-cpython-39/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/Utils.o -g
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -bundle -undefined dynamic_lookup -Wl,-rpath,/Users/herrmann/opt/anaconda3/lib -L/Users/herrmann/opt/anaconda3/lib -L/Users/herrmann/opt/anaconda3/lib -Wl,-rpath,/Users/herrmann/opt/anaconda3/lib -L/Users/herrmann/opt/anaconda3/lib -Wl,-rpath,$ORIGIN/../../.. -std=c++17 -arch x86_64 build/temp.macosx-10.9-x86_64-cpython-39/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/PyXRootDCopyProcess.o build/temp.macosx-10.9-x86_64-cpython-39/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/PyXRootDCopyProgressHandler.o build/temp.macosx-10.9-x86_64-cpython-39/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/PyXRootDFile.o build/temp.macosx-10.9-x86_64-cpython-39/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/PyXRootDFileSystem.o build/temp.macosx-10.9-x86_64-cpython-39/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/PyXRootDModule.o build/temp.macosx-10.9-x86_64-cpython-39/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/PyXRootDURL.o build/temp.macosx-10.9-x86_64-cpython-39/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/bindings/python/src/Utils.o -L/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/build/src -L/Users/herrmann/alice/sw/BUILD/be06fa8d69ddab0656975affe3c970e73b02c498/XRootD/build/src/XrdCl -lXrdCl -lXrdUtils -ldl -o build/lib.macosx-10.9-x86_64-cpython-39/pyxrootd/client.cpython-39-darwin.so
  ld: library not found for -ldl
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  error: command '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++' failed with exit code 1
  error: subprocess-exited-with-error
  
  × Running setup.py install for xrootd did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

The full log is attached.
I tried a lot of different things, uninstalling and reinstalling Xcode, the command line tools, I reinstalled the prerequisites and alibuild with brew.
Here is the list of my building tools and their version:
brew list --versions | sort
alibuild 1.11.7
alice-build-machine 20.3-1
autoconf 2.71
automake 1.16.5
berkeley-db 18.1.40_1
ca-certificates 2022-07-19_1
clang-format 14.0.6
cmake 3.24.1
consul 1.13.1
coreutils 9.1
docbook 5.1_1
docbook-xsl 1.79.2_1
freetype 2.12.1
gcc 12.2.0
gdbm 1.23
gettext 0.21
glfw 3.3.8
gmp 6.2.1_1
gsl 2.7.1
gtk-doc 1.33.2_1
htop 3.2.1
hub 2.14.2
icu4c 70.1
isl 0.25
libcbor 0.9.0
libevent 2.1.12
libfido2 1.11.0
libidn2 2.3.3
libmpc 1.2.1
libomp 14.0.6
libpng 1.6.37
libsodium 1.0.18_1
libtool 2.4.7
libunistring 1.0
libxml2 2.10.1 2.10.2
libyaml 0.2.5
llvm 14.0.6_1
llvm@13 13.0.1_1
lz4 1.9.4
m4 1.4.19
make 4.3
modules 5.1.1
mpdecimal 2.5.1
mpfr 4.1.0
msgpack 4.0.0
mysql 8.0.30
ncurses 6.3
ninja 1.11.0
o2-full-deps 21.06-1
openjdk 18.0.2.1
openssl@1.1 1.1.1q
openssl@3 3.0.5
pcre 8.45
perl 5.34.0
pigz 2.7_1
pkg-config 0.29.2_3
protobuf 21.5
python@3.10 3.10.6_1
python@3.8 3.8.13_3
python@3.9 3.9.13_4
readline 8.1.2
s3cmd 2.2.0_3
six 1.16.0_1 1.16.0_2
sqlite 3.39.2
tcl-tk 8.6.12_1
utf8proc 2.7.0
xz 5.2.6
zeromq 4.3.4
zlib 1.2.12
zopfli 1.0.3_1
zstd 1.5.2

I also tried this command brew reinstall llvm@13, and I did a check for ldl library with echo 'int main() { return 0; }' | c++ -ldl -xc++ -std=c++17 -arch x86_64 - -o/dev/null && echo OK || echo error $? and it returned OK.

Any help would be highly appreciated, I am really runnning out of ideas.
Thanks in advance,
Sarah
log.log (103.2 KB)

Hi ! I solved the problem
Basically when I ran brew doctor it gave me:

(base) herrmann@lyoalice10 alice % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users/herrmann/opt/anaconda3/bin/icu-config
  /Users/herrmann/opt/anaconda3/bin/krb5-config
  /Users/herrmann/opt/anaconda3/bin/freetype-config
  /Users/herrmann/opt/anaconda3/bin/xslt-config
  /Users/herrmann/opt/anaconda3/bin/libpng16-config
  /Users/herrmann/opt/anaconda3/bin/libpng-config
  /Users/herrmann/opt/anaconda3/bin/xml2-config
  /Users/herrmann/opt/anaconda3/bin/python3.9-config
  /Users/herrmann/opt/anaconda3/bin/onig-config
  /Users/herrmann/opt/anaconda3/bin/python3-config
  /Users/herrmann/opt/anaconda3/bin/curl-config
  /Users/herrmann/opt/anaconda3/bin/ncursesw6-config

Which is because I installed Anaconda at one point quite long ago. So what I did, since I didn’t use anaconda anyway, is that I just removed /Users/herrmann/opt/anaconda3/. And then I reinstalled aliBuild and the prerequisites, and finally XRootD built correctly !
Hope that can help somebody in the future.
Cheers,
Sarah