Debugging the list of loaded libraries

Hi,

I’m getting a very strange error when I try to compile some macros, as AClic is complaining (rightfully) about some non existing libraries. Turns out I’m not able to trace back the origin of those strange libraries, which are already visible after just loading the macro and doing a gSystem->ListLibraries() :

... list of legit libraries
-lfakelink
-lapple_nghttp2
-lnetwork
-lsqlite3
-lz.1
-lenergytrace
-lMobileGestalt
-lcoretls
-lcoretls_cfhelpers
-lxar.1
-lcompression
-larchive.2
-lxml2.2
-lpcap.A
-ldns_services
-llzma.5
-lbz2.1.0
-liconv.2
-lcharset.1
-lCheckFix
-lmecabra
-lmecab
-lgermantok
-lThaiTokenizer
-lChineseTokenizer
-lcmph
-lutil
-lapp_launch_measurement
-lxslt.1
-lspindump
-late
-lexpat.1
-lIOReport
-lSMC
-lmis
-lheimdal-asn1
-lAudioStatistics
-lperfcheck
... more legit libraries

Is there a way to pinpoint the origin of those libs ?
I’ve tried to otool -L my (>100) legit libraries but none of them (as far as can tell) refer to those.


ROOT Version: 6.24.00
Platform: macOS (BigSur)
Compiler: apple-clang-12.0.5


macOS loads them into the process automatically. We can suppress those that cause problems - which ones are those? For us, on BigSur. ACLiC works, so there must be something special here.

FYI, I get this list of non-ROOT libraries:

-lz.1
-lfakelink
-lapple_nghttp2
-lnetwork
-lsqlite3
-lenergytrace
-lMobileGestalt
-lcoretls
-lcoretls_cfhelpers
-lxar.1
-lcompression
-larchive.2
-lxml2.2
-lpcap.A
-ldns_services
-llzma.5
-lbz2.1.0
-liconv.2
-lcharset.1
-lCheckFix
-lmecabra
-lmecab
-lgermantok
-lThaiTokenizer
-lChineseTokenizer
-lcmph
-lutil
-lapp_launch_measurement
-lxslt.1
-lspindump
-late
-lexpat.1
-lIOReport
-lSMC
-lmis
-lheimdal-asn1
-lAudioStatistics
-lperfcheck
-lncurses.5.4
-lsandbox.1
-lCoreStorage
-lcsfde
-lMatch.1

Well, the complain is about fakelink for that particular macro.
I’m attaching the (unedited) full log of the compilation attempt.

fail.log.txt (36.4 KB)

For the record, in other instances, I get ld: library not found for -lcrypto.44

Getting back to this issue.
Actually even for a very simple macro I can reproduce the issue :

📦dev🚀~/tmp$ cat test.C
#include <iostream>

void test() {
std::cout << "this is a test macro\n";
}
📦dev🚀~/tmp$ root -b
   ------------------------------------------------------------------
  | Welcome to ROOT 6.24/02                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosx64 on Jun 28 2021, 09:28:51                      |
  | From tags/v6-24-02@v6-24-02                                      |
  | With Apple clang version 12.0.5 (clang-1205.0.22.11)             |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

root [0] .L test.C++
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/laurent/tmp/compiled_macros//Users/laurent/tmp/./test_C.so
ld: library not found for -lfakelink
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
Error in <ACLiC>: Executing 'cd "/Users/laurent/tmp/compiled_macros//Users/laurent/tmp" ; clang++ -fPIC -c -O2 -std=c++17 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++  -I$ROOTSYS/include -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/etc/" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/etc//cling" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/include/" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/python-3.8.10-44evhd5djtshjofdpmemzr6irocnjvgb/include/python3.8" -I"/usr/local/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/include" -I"/private/var/folders/sk/tqly2lp512s0n9c1pc2njkkc0000gn/T/laurent/spack-stage/spack-stage-root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/spack-build-jk742nu/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/pcre-8.44-uepbfidmqaxlriok2472ce2bvkgduned/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/xxhash-0.7.4-lhv3wec5xxct2mk5u2qjaoium7wdanlr/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/lz4-1.9.3-exrsopfzkim7nxzv7bo6edqdivrcm3py/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/nlohmann-json-3.9.1-qbegteatr4uwv5wg72ig7mfi4oqxrfn4/include" -I"/private/var/folders/sk/tqly2lp512s0n9c1pc2njkkc0000gn/T/laurent/spack-stage/spack-stage-root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/spack-build-jk742nu/include/"   -D__ACLIC__ "/Users/laurent/tmp/compiled_macros//Users/laurent/tmp/test_C_ACLiC_dict.cxx" ; clang++ -O2 "/Users/laurent/tmp/compiled_macros//Users/laurent/tmp/test_C_ACLiC_dict.o" -dynamiclib -Wl,-headerpad_max_install_names -m64 -single_module -Wl,-dead_strip_dylibs   "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/lib/libRint.6.24.02.so" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/lib/libCore.6.24.02.so" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/pcre-8.44-uepbfidmqaxlriok2472ce2bvkgduned/lib/libpcre.1.dylib" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/xz-5.2.5-k2yumgxwq6ijubivfpbjpmrrbzyqcoot/lib/liblzma.5.dylib" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/xxhash-0.7.4-lhv3wec5xxct2mk5u2qjaoium7wdanlr/lib/libxxhash.0.dylib" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/lz4-1.9.3-exrsopfzkim7nxzv7bo6edqdivrcm3py/lib/liblz4.1.dylib" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/lib/libz.1.dylib" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/zstd-1.5.0-a2qzewaj3za5kn645tmptm55aksblu7l/lib/libzstd.1.5.0.dylib" "-lfakelink" "-lapple_nghttp2" "-lnetwork" "-lsqlite3" "-lz.1" "-lenergytrace" "-lMobileGestalt" "-lcoretls" "-lcoretls_cfhelpers" "-lxar.1" "-lcompression" "-larchive.2" "-lxml2.2" "-lpcap.A" "-ldns_services" "-llzma.5" "-lbz2.1.0" "-liconv.2" "-lcharset.1" "-lCheckFix" "-lmecabra" "-lmecab" "-lgermantok" "-lThaiTokenizer" "-lChineseTokenizer" "-lcmph" "-lutil" "-lapp_launch_measurement" "-lxslt.1" "-lspindump" "-late" "-lexpat.1" "-lIOReport" "-lSMC" "-lmis" "-lheimdal-asn1" "-lAudioStatistics" "-lperfcheck" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/lib/libRIO.6.24.02.so" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/lib/libThread.6.24.02.so" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/lib/libCling.6.24.02.so" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/ncurses-6.2-53i52xrlltmpygd5zs44ouv5yfevl5y4/lib/libtinfo.6.dylib" "/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-jk742nui2mwzqhbjkafpnewcsraf747f/lib/libMathCore.6.24.02.so" -o "/Users/laurent/tmp/compiled_macros//Users/laurent/tmp/./test_C.so"' failed!

Are there some other checks I could try to see if my root build is correct otherwise ?

Actually I think I’ve found the issue : my root is compiled with an external clang that ends up in the path, before the macOS clang (see below), so it seems ACliC uses that external clang instead of the system one.

A call to .L test.C++v confirms that the invocation is a plain call to clang++ (without any path) : is there a way to get ACliC to use e.g. the TSystem::GetBuildCompiler() (which has a full path) instead of just issuing a basic call to clang++ ?

📦dev🚀~/alice/spack/laurent/dev$ echo $PATH | tr ":" "\n"
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-unt72vkca6lj6lq7ucoru47sljdi625k/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/zstd-1.5.0-a2qzewaj3za5kn645tmptm55aksblu7l/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/xxhash-0.7.4-lhv3wec5xxct2mk5u2qjaoium7wdanlr/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/pythia8-8304-ankiosxal7mifd3adiy7kf5giqojelvg/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/pcre-8.44-uepbfidmqaxlriok2472ce2bvkgduned/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/openblas-0.3.13-a4rjfjbdjynbz5ij6szxqj266tfq6foe/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/libjpeg-turbo-2.0.6-rpa5ki4njlvvf444rxz7m3xevlrrwitz/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/gsl-2.6-w3atlurflcv2puogtempfvd4kolt5hel/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/glew-2.1.0-gmifow425kgj37sojcat23zn4vvlcx5w/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/freetype-2.10.4-s5ybu6seckgjixmkm4bbhdgdxfupxnt4/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/libpng-1.6.37-pquyow5yrqp3kbudajzrhppm53jio5fe/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/davix-0.7.6-fg2hmseyjhmbm46usnlln47vnyhyt6eh/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/protobuf-3.17.3-7eal3ry47dbbavh6rt27ijuyje74gptz/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/lz4-1.9.3-exrsopfzkim7nxzv7bo6edqdivrcm3py/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/llvm-12.0.0-an3pf7ileoxk5eug7mb735ju77mrhrvz/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/z3-4.8.10-of67h2j7ds67hz2cix3olxpgbtjgadcq/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/py-setuptools-50.3.2-qjckr6on4kl43a2e3jeiqho2trtotf4z/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/python-3.8.10-44evhd5djtshjofdpmemzr6irocnjvgb/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/sqlite-3.35.5-24aoql3zu56jh5usklhebm3hstma7t6h/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/openssl-1.1.1k-vjcrecwudi5jriudpxwcjiiii66gr42v/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/gettext-0.21-h65agkursingppbyb5dnek4ev222zexr/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/tar-1.34-jrtvewk6toxgnbo2sc7nbt2fccfv62ln/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/gdbm-1.19-vh6di3ikxfotpwsshsjhqqdzm2bfxocy/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/readline-8.1-qgy3v4lyh32yulje7wfzonauhe7q634w/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/expat-2.3.0-o42mhfsdk4kpkjeb5uvfyin5xlvgyla4/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/hwloc-2.4.1-t3aoi4o35kivwxg3npz3ur222bxevw3t/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/ncurses-6.2-53i52xrlltmpygd5zs44ouv5yfevl5y4/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/libxml2-2.9.10-vqjn3mdwju2acliweaj6sd34e5lgozq2/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/xz-5.2.5-k2yumgxwq6ijubivfpbjpmrrbzyqcoot/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/libiconv-1.16-jmtxossd4aawvvvgn5igb3wjl5lmh3g3/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/flatbuffers-2.0.0-jr7wxasng4mqnrjs2uanx6fpbywzosks/bin
/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/bzip2-1.0.8-7d5woqtbigdeew2nv6pa4sq7v4zxdtnc/bin
/usr/bin
/Users/laurent/github.com/spack/spack/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Applications/VMware Fusion.app/Contents/Public
/Library/TeX/texbin
/Library/Apple/usr/bin
/Users/laurent/github.com/spack/spack/var/spack/environments/bare/.spack-env/view/bin
/Users/laurent/github.com/spack/spack/var/spack/environments/devtools/.spack-env/view/bin
/Users/laurent/.fzf/bin

The best but longer route, configure root in an empty build directory with:

CXX=full_path_to_correct_clang++ CC=full_path_to_correct_clang cmake ....

Faster route, but needs to be done at each invocation of root.exe

const char *path = gSystem->Getenv("PATH");

// Humm ... replace this with the "right" one, of course !
const char *clang = gSystem->Which(path, "clang++"); 

TString cmd = gSystem->GetMakeSharedLib();
cmd.ReplaceAll("c++", clang)
gSystem->SetMakeSharedLib(cmd)

Cheers,
Philippe.

ok, that’s actually a bit more complicated when building with Spack as Spack uses compiler wrappers… In addition, the build/unix/compiledata.sh script is actually using basename $CXX anyway…

What I tried then is patch the compiledata.sh (in the root spack recipe) to end up with a makeshared that I believe should work (note the absolute path to the compiler, which is what I want/need) :

root [0] gSystem->GetMakeSharedLib()
(const char *) "cd $BuildDir; /usr/bin/clang++ -fPIC -c $Opt -std=c++17 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++ $IncludePath $SourceFiles; /usr/bin/clang++ $Opt $ObjectFiles -dynamiclib -Wl,-headerpad_max_install_names -m64 -single_module -Wl,-dead_strip_dylibs   -o $SharedLib"

But I get another error then :

dev🚀~/tmp$ root -b
.   ------------------------------------------------------------------
  | Welcome to ROOT 6.24/02                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosx64 on Jun 28 2021, 09:28:51                      |
  | From tags/v6-24-02@v6-24-02                                      |
  | With Apple clang version 12.0.5 (clang-1205.0.22.11)             |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

root [0] .L test.C++
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/laurent/tmp/compiled_macros//Users/laurent/tmp/./test_C.so
Undefined symbols for architecture x86_64:
  "TVersionCheck::TVersionCheck(int)", referenced from:
      __GLOBAL__sub_I_test_C_ACLiC_dict.cxx in test_C_ACLiC_dict.o
  "TROOT::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int> > > const&, char const**, bool)", referenced from:
      (anonymous namespace)::TriggerDictionaryInitialization_test_C_ACLiC_dict_Impl() in test_C_ACLiC_dict.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in <ACLiC>: Executing 'cd "/Users/laurent/tmp/compiled_macros//Users/laurent/tmp"; /usr/bin/clang++ -fPIC -c -O2 -std=c++17 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++  -I$ROOTSYS/include -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-rle6frk5sdtwrtigt4n6jbrz6ukhm2q3/etc/" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-rle6frk5sdtwrtigt4n6jbrz6ukhm2q3/etc//cling" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-rle6frk5sdtwrtigt4n6jbrz6ukhm2q3/include/" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/python-3.8.10-44evhd5djtshjofdpmemzr6irocnjvgb/include/python3.8" -I"/usr/local/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/root-6.24.02-rle6frk5sdtwrtigt4n6jbrz6ukhm2q3/include" -I"/private/var/folders/sk/tqly2lp512s0n9c1pc2njkkc0000gn/T/laurent/spack-stage/spack-stage-root-6.24.02-rle6frk5sdtwrtigt4n6jbrz6ukhm2q3/spack-build-rle6frk/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/pcre-8.44-uepbfidmqaxlriok2472ce2bvkgduned/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/xxhash-0.7.4-lhv3wec5xxct2mk5u2qjaoium7wdanlr/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/lz4-1.9.3-exrsopfzkim7nxzv7bo6edqdivrcm3py/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/include" -I"/Users/laurent/opt/spack/spack_path_placeholder/spack_path_place/darwin-bigsur-skylake/apple-clang-12.0.5/nlohmann-json-3.9.1-qbegteatr4uwv5wg72ig7mfi4oqxrfn4/include" -I"/private/var/folders/sk/tqly2lp512s0n9c1pc2njkkc0000gn/T/laurent/spack-stage/spack-stage-root-6.24.02-rle6frk5sdtwrtigt4n6jbrz6ukhm2q3/spack-build-rle6frk/include/"   -D__ACLIC__ "/Users/laurent/tmp/compiled_macros//Users/laurent/tmp/test_C_ACLiC_dict.cxx"; /usr/bin/clang++ -O2 "/Users/laurent/tmp/compiled_macros//Users/laurent/tmp/test_C_ACLiC_dict.o" -dynamiclib -Wl,-headerpad_max_install_names -m64 -single_module -Wl,-dead_strip_dylibs   -o "/Users/laurent/tmp/compiled_macros//Users/laurent/tmp/./test_C.so"' failed!

We will have to suppress those. I’ll get to it. To make sure I don’t forget - is there a chance you could open an issue?

that is (still) weird :slight_smile:

To debug this, do:

root [0] .L test.C++kv

this will print the actual command line used by ACLiC and thus we should be able to play with its content directly (copy/pasting in a script if we need to re-run a tweaked version)

From that we should be able to tell why it does not pick up the right ROOT library and/or compile in a such of way that it is incompatible.

Please find attached a (hand curated) script obtained from .L test.C++kv

Note that I actually have two different errors…

📦dev🚀~/tmp$ source byhand.simplified.sh
0
1
2
Undefined symbols for architecture x86_64:
  "TVersionCheck::TVersionCheck(int)", referenced from:
      __GLOBAL__sub_I_test_C_ACLiC_dict.cxx in test_C_ACLiC_dict.o
  "TROOT::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), 
[byhand.simplified.sh.txt|attachment](upload://z8OlZoLfkYC7v5UM1UfSqZhUTnT.txt) (5.2 KB)
std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int> > > const&, char const**, bool)", referenced from:
      (anonymous namespace)::TriggerDictionaryInitialization_test_C_ACLiC_dict_Impl() in test_C_ACLiC_dict.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
3
4
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

byhand.simplified.sh.txt (5.2 KB)

@Axel sorry I did not catch what you are referring to : suppress what exactly ?

Indeed looking once more at the .L test.C++v output I see the generation of shared lib from the dictionary is not using any library at all, hence the missing symbol.
Turn out that in my Spack recipe patch I made a typo (EXPLINKLIBS instead of EXPLLINKLIBS) … Correcting this solved it.

So basically a pilot error for the last part (and the original problem is due to a non-system Clang being present in the PATH).

Sorry for the long thread, and thanks a lot for the help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.