Error when compiling ROOT macro with ACLiC

I’m trying to compile a macro with the command:

$ .L nstars1.C+

and get the following error:

Info in <TMacOSXSystem::ACLiC >: creating shared library /Users/garciaduarte1/Documents/Projects/MonteCarlo/./nstars1_C.so
ld: library not found for -lCheckFix
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in <ACLiC>: Executing 'cd "/Users/garciaduarte1/Documents/Projects/MonteCarlo" ; clang++ -fPIC -c -O3 -DNDEBUG -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/usr/local/Cellar/root/6.26.06_1/include/root -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" -I"/usr/local/Cellar/root/6.26.06_1/etc/root" -I"/usr/local/Cellar/root/6.26.06_1/etc/root/cling" -I"/usr/local/Cellar/root/6.26.06_1/etc/root/cling/plugins/include" -I"/usr/local/Cellar/root/6.26.06_1/include/root" -I"/usr/local/Cellar/root/6.26.06_1/include"   -D__ACLIC__ "/Users/garciaduarte1/Documents/Projects/MonteCarlo/nstars1_C_ACLiC_dict.cxx" ; clang++ -O3 -DNDEBUG "/Users/garciaduarte1/Documents/Projects/MonteCarlo/nstars1_C_ACLiC_dict.o" -dynamiclib -Wl,-headerpad_max_install_names -m64 -single_module -Wl,-dead_strip_dylibs -undefined dynamic_lookup   "/usr/local/Cellar/root/6.26.06_1/lib/root/libRint.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libCore.so" "/usr/local/opt/pcre/lib/libpcre.1.dylib" "/usr/local/opt/xz/lib/liblzma.5.dylib" "/usr/local/opt/lz4/lib/liblz4.1.dylib" "/usr/local/opt/zlib/lib/libz.1.dylib" "/usr/local/opt/zstd/lib/libzstd.1.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" "/usr/local/Cellar/root/6.26.06_1/lib/root/libRIO.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libThread.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libCling.so" "-lncurses.5.4" "/usr/local/Cellar/root/6.26.06_1/lib/root/libMathCore.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libImt.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libMultiProc.so" "/usr/local/opt/tbb/lib/libtbb.12.dylib" "/usr/local/Cellar/root/6.26.06_1/lib/root/libNet.so" "/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib" "/usr/local/Cellar/openssl@1.1/1.1.1q/lib/libcrypto.1.1.dylib" "-lsandbox.1" "-lCoreStorage" "-lcsfde" "-lMatch.1" -o "/Users/garciaduarte1/Documents/Projects/MonteCarlo/./nstars1_C.so" ' failed!

I installed ROOT using the command:

$ brew install root

everything was fine, no errors, it is up to date. Does anyone has a clue why am I having this error?

ROOT Version: 6.26/06
Platform: MacOS Big Sur 11.6.7


What does gInterpreter->GetSharedLibs() say before and after you try .L nstars1.C+?

It says the same thing.
Before:

root [1] gInterpreter->GetSharedLibs()
(const char *) "/usr/local/Cellar/root/6.26.06_1/lib/root/libRint.so /usr/local/Cellar/root/6.26.06_1/lib/root/libCore.so /usr/local/opt/pcre/lib/libpcre.1.dylib /usr/local/opt/xz/lib/liblzma.5.dylib /usr/local/opt/lz4/lib/liblz4.1.dylib /usr/local/opt/zlib/lib/libz.1.dylib /usr/local/opt/zstd/lib/libzstd.1.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 /usr/local/Cellar/root/6.26.06_1/lib/root/libRIO.so /usr/local/Cellar/root/6.26.06_1/lib/root/libThread.so /usr/local/Cellar/root/6.26.06_1/lib/root/libCling.so -lncurses.5.4 /usr/local/Cellar/root/6.26.06_1/lib/root/libMathCore.so /usr/local/Cellar/root/6.26.06_1/lib/root/libImt.so /usr/local/Cellar/root/6.26.06_1/lib/root/libMultiProc.so /usr/local/opt/tbb/lib/libtbb.12.dylib /usr/local/Cellar/root/6.26.06_1/lib/root/libNet.so /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib /usr/local/Cellar/openssl@1.1/1.1.1q/lib/libcrypto.1.1.dylib -lsandbox.1 -lCoreStorage -lcsfde -lMatch.1 /usr/local/Cellar/root/6.26.06_1/lib/root/libMathMore.so /usr/local/opt/gsl/lib/libgsl.27.dylib /usr/local/opt/gsl/lib/libgslcblas.0.dylib /usr/local/Cellar/root/6.26.06_1/lib/root/libHist.so /usr/local/Cellar/root/6.26.06_1/lib/root/libMatrix.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGpad.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGraf.so /usr/local/Cellar/root/6.26.06_1/lib/root/libMinuit.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGCocoa.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGQuartz.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGui.so /usr/local/Cellar/root/6.26.06_1/lib/root/libASImage.so /usr/local/Cellar/root/6.26.06_1/lib/root/libHistPainter.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGed.so /usr/local/Cellar/root/6.26.06_1/lib/root/libTree.so"

After:

root [3] gInterpreter->GetSharedLibs()
(const char *) "/usr/local/Cellar/root/6.26.06_1/lib/root/libRint.so /usr/local/Cellar/root/6.26.06_1/lib/root/libCore.so /usr/local/opt/pcre/lib/libpcre.1.dylib /usr/local/opt/xz/lib/liblzma.5.dylib /usr/local/opt/lz4/lib/liblz4.1.dylib /usr/local/opt/zlib/lib/libz.1.dylib /usr/local/opt/zstd/lib/libzstd.1.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 /usr/local/Cellar/root/6.26.06_1/lib/root/libRIO.so /usr/local/Cellar/root/6.26.06_1/lib/root/libThread.so /usr/local/Cellar/root/6.26.06_1/lib/root/libCling.so -lncurses.5.4 /usr/local/Cellar/root/6.26.06_1/lib/root/libMathCore.so /usr/local/Cellar/root/6.26.06_1/lib/root/libImt.so /usr/local/Cellar/root/6.26.06_1/lib/root/libMultiProc.so /usr/local/opt/tbb/lib/libtbb.12.dylib /usr/local/Cellar/root/6.26.06_1/lib/root/libNet.so /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib /usr/local/Cellar/openssl@1.1/1.1.1q/lib/libcrypto.1.1.dylib -lsandbox.1 -lCoreStorage -lcsfde -lMatch.1 /usr/local/Cellar/root/6.26.06_1/lib/root/libMathMore.so /usr/local/opt/gsl/lib/libgsl.27.dylib /usr/local/opt/gsl/lib/libgslcblas.0.dylib /usr/local/Cellar/root/6.26.06_1/lib/root/libHist.so /usr/local/Cellar/root/6.26.06_1/lib/root/libMatrix.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGpad.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGraf.so /usr/local/Cellar/root/6.26.06_1/lib/root/libMinuit.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGCocoa.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGQuartz.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGui.so /usr/local/Cellar/root/6.26.06_1/lib/root/libASImage.so /usr/local/Cellar/root/6.26.06_1/lib/root/libHistPainter.so /usr/local/Cellar/root/6.26.06_1/lib/root/libGed.so /usr/local/Cellar/root/6.26.06_1/lib/root/libTree.so"

…and that includes -lCheckFix ! Good.

Now we need to find out where that comes from. Is the “before” case right after your start up ROOT, or do you do things in between?

% root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.26/06                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosx64 on Jul 28 2022, 18:08:51                      |
  | From tags/v6-26-06@v6-26-06                                      |
  | With Apple clang version 13.0.0 (clang-1300.0.29.30)             |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

root [0] .L nstars1.C++
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo/./nstars1_C.so
ld: library not found for -lCheckFix
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in <ACLiC>: Executing 'cd "/Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo" ; clang++ -fPIC -c -O3 -DNDEBUG -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/usr/local/Cellar/root/6.26.06_1/include/root -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" -I"/usr/local/Cellar/root/6.26.06_1/etc/root" -I"/usr/local/Cellar/root/6.26.06_1/etc/root/cling" -I"/usr/local/Cellar/root/6.26.06_1/etc/root/cling/plugins/include" -I"/usr/local/Cellar/root/6.26.06_1/include/root" -I"/usr/local/Cellar/root/6.26.06_1/include"   -D__ACLIC__ "/Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo/nstars1_C_ACLiC_dict.cxx" ; clang++ -O3 -DNDEBUG "/Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo/nstars1_C_ACLiC_dict.o" -dynamiclib -Wl,-headerpad_max_install_names -m64 -single_module -Wl,-dead_strip_dylibs -undefined dynamic_lookup   "/usr/local/Cellar/root/6.26.06_1/lib/root/libRint.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libCore.so" "/usr/local/opt/pcre/lib/libpcre.1.dylib" "/usr/local/opt/xz/lib/liblzma.5.dylib" "/usr/local/opt/lz4/lib/liblz4.1.dylib" "/usr/local/opt/zlib/lib/libz.1.dylib" "/usr/local/opt/zstd/lib/libzstd.1.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" "/usr/local/Cellar/root/6.26.06_1/lib/root/libRIO.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libThread.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libCling.so" "-lncurses.5.4" "/usr/local/Cellar/root/6.26.06_1/lib/root/libMathCore.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libImt.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libMultiProc.so" "/usr/local/opt/tbb/lib/libtbb.12.dylib" "/usr/local/Cellar/root/6.26.06_1/lib/root/libNet.so" "/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib" "/usr/local/Cellar/openssl@1.1/1.1.1q/lib/libcrypto.1.1.dylib" "-lsandbox.1" "-lCoreStorage" "-lcsfde" "-lMatch.1" -o "/Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo/./nstars1_C.so"' failed!
root [1] gInterpreter->GetSharedLibs()
(const char *) "/usr/local/Cellar/root/6.26.06_1/lib/root/libRint.so /usr/local/Cellar/root/6.26.06_1/lib/root/libCore.so /usr/local/opt/pcre/lib/libpcre.1.dylib /usr/local/opt/xz/lib/liblzma.5.dylib /usr/local/opt/lz4/lib/liblz4.1.dylib /usr/local/opt/zlib/lib/libz.1.dylib /usr/local/opt/zstd/lib/libzstd.1.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 /usr/local/Cellar/root/6.26.06_1/lib/root/libRIO.so /usr/local/Cellar/root/6.26.06_1/lib/root/libThread.so /usr/local/Cellar/root/6.26.06_1/lib/root/libCling.so -lncurses.5.4 /usr/local/Cellar/root/6.26.06_1/lib/root/libMathCore.so /usr/local/Cellar/root/6.26.06_1/lib/root/libImt.so /usr/local/Cellar/root/6.26.06_1/lib/root/libMultiProc.so /usr/local/opt/tbb/lib/libtbb.12.dylib /usr/local/Cellar/root/6.26.06_1/lib/root/libNet.so /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib /usr/local/Cellar/openssl@1.1/1.1.1q/lib/libcrypto.1.1.dylib -lsandbox.1 -lCoreStorage -lcsfde -lMatch.1"
root [2] .L nstars1.C++
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo/./nstars1_C.so
ld: library not found for -lCheckFix
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in <ACLiC>: Executing 'cd "/Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo" ; clang++ -fPIC -c -O3 -DNDEBUG -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/usr/local/Cellar/root/6.26.06_1/include/root -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" -I"/usr/local/Cellar/root/6.26.06_1/etc/root" -I"/usr/local/Cellar/root/6.26.06_1/etc/root/cling" -I"/usr/local/Cellar/root/6.26.06_1/etc/root/cling/plugins/include" -I"/usr/local/Cellar/root/6.26.06_1/include/root" -I"/usr/local/Cellar/root/6.26.06_1/include"   -D__ACLIC__ "/Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo/nstars1_C_ACLiC_dict.cxx" ; clang++ -O3 -DNDEBUG "/Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo/nstars1_C_ACLiC_dict.o" -dynamiclib -Wl,-headerpad_max_install_names -m64 -single_module -Wl,-dead_strip_dylibs -undefined dynamic_lookup   "/usr/local/Cellar/root/6.26.06_1/lib/root/libRint.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libCore.so" "/usr/local/opt/pcre/lib/libpcre.1.dylib" "/usr/local/opt/xz/lib/liblzma.5.dylib" "/usr/local/opt/lz4/lib/liblz4.1.dylib" "/usr/local/opt/zlib/lib/libz.1.dylib" "/usr/local/opt/zstd/lib/libzstd.1.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" "/usr/local/Cellar/root/6.26.06_1/lib/root/libRIO.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libThread.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libCling.so" "-lncurses.5.4" "/usr/local/Cellar/root/6.26.06_1/lib/root/libMathCore.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libImt.so" "/usr/local/Cellar/root/6.26.06_1/lib/root/libMultiProc.so" "/usr/local/opt/tbb/lib/libtbb.12.dylib" "/usr/local/Cellar/root/6.26.06_1/lib/root/libNet.so" "/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib" "/usr/local/Cellar/openssl@1.1/1.1.1q/lib/libcrypto.1.1.dylib" "-lsandbox.1" "-lCoreStorage" "-lcsfde" "-lMatch.1" -o "/Users/garciaduarte1/Documents/Projects/NeutronSTARS/MonteCarlo/./nstars1_C.so"' failed!

It is right after my start up ROOT.

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