Dyld error on Catalina

ROOT Version: 6.20/00 and 6.18/04
Platform: macOS 10.15.3 (Catalina)
Compiler: Apple clang version 11.0.0 (clang-1100.0.33.17)

When ROOT is installed under /usr/local on a Catalina Mac, I get the following error only when I try to compile a ROOT macro.

$ cat test.C
void test() {
$ root
root [0] .x test.C+
Info in <ACLiC>: modified script has already been compiled and loaded
Info in <ACLiC>: it will be regenerated and reloaded!
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/oxon/./test_C.so
dyld: Library not loaded: @rpath/libRIO.so
  Referenced from: /usr/local/root-6.20.00/obj/bin/rootcling
  Reason: image not found
Error in <ACLiC>: Dictionary generation failed!

But if I move the same directory into $HOME, ACLiC works as expected.

A similar problem happens when I try to build my own ROOT library.

Generating dictionary ...
rootcling -f src/ROBASTDict.cxx -c -p -Iinclude -rmf libROBAST.rootmap -rml libROBAST.so include/A2x2ComplexMatrix.h include/ABorderSurfaceCondition.h include/ACauchyFormula.h include/ACorsikaIACTEventHeader.h include/ACorsikaIACTFile.h include/ACorsikaIACTRunHeader.h include/AFilmetrixDotCom.h include/AFocalSurface.h include/AGeoAsphericDisk.h include/AGeoBezierPcon.h include/AGeoBezierPgon.h include/AGeoUtil.h include/AGeoWinstonCone2D.h include/AGeoWinstonConePoly.h include/AGlassCatalog.h include/ALens.h include/AMirror.h include/AMixedRefractiveIndex.h include/AMultilayer.h include/AObscuration.h include/AOpticalComponent.h include/AOpticsManager.h include/ARay.h include/ARayArray.h include/ARayShooter.h include/ARefractiveIndex.h include/ARefractiveIndexDotInfo.h include/ASchottFormula.h include/ASellmeierFormula.h include/ROBASTInit.h include/LinkDef.h
dyld: Library not loaded: @rpath/libRIO.so
  Referenced from: /usr/local/root-6.20.00/bin/rootcling
  Reason: image not found
make: *** [src/ROBASTDict.cxx] Abort trap: 6

I can temporality use $HOME/root-6.20.00 but it is very helpful for Mac users who have been using /usr/local if you can tell us how to resolve this issue. I suppose it is related to the SIP update in macOS, though /usr/local is still allowed to use for developers.

$ ll -d /usr/local           
drwxr-xr-x  21 root  wheel  672 Mar  2 15:15 /usr/local
$ ll -d /usr/local/root-6.20.00       
drwxr-xr-x@ 54 oxon  staff  1728 Mar  2 14:11 /usr/local/root-6.20.00

It looks the reason was that I moved the ROOT directory from another place to /usr/local after building ROOT. I remember this was OK for Mojave and earlier, but it is not for Catalina.

Hi @oxon,
I don’t think ROOT builds are that easily relocatable.
@Axel or @amadio might be able to comment on what’s needed to make a ROOT build easily relocatable.


If you copied the build directory over, that’s not supported. You should use make install and configure ROOT to install directly to the final place, i.e. with -DCMAKE_INSTALL_PREFIX=/usr/local.

1 Like

It is supported but not if configured with CMAKE_INSTALL_PREFIX which promises that ROOT will be run from that directory :slight_smile: We use RPATH to make sure a build is relocatable. So I’d still like to understand what’s failing here. @oxon could you share how you configured ROOT?

It is not possible to configure without a CMAKE_INSTALL_PREFIX. The build directory itself is always not relocatable. If you move it, you cannot even rebuild ROOT as far as I can tell.

To the best of my knowledge that’s both incorrect. RConfig.h looks different with and without CMAKE_INSTALL_PREFIX. Our released binaries are clearly relocatable, and they are tared artifacts from the build directory.

Either way I guess you and I agree it would be good to see @oxon 's CMakeCache.txt / the CMake invocation?

ROOT 6.20/00 was built on an almost clean 10.15.3 virtual-machine environment, on which only basic tools such as the command line tools and CMake (via Homebrew) were additionally installed.

Please let me know if you need any further information.

$ clang --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$ which cmake
$ cmake --version
cmake version 3.16.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ pwd
$ cmake .. 
-- The C compiler identification is AppleClang
-- The CXX compiler identification is AppleClang
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.21.1 (Apple Git-122.3)") 
-- ROOT default compression algorithm: zlib
bash: -m: command not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found a Mac OS X System 10.15
-- Found a 64bit system
-- Found LLVM compiler collection
-- Performing Test GLIBCXX_USE_CXX11_ABI
-- Performing Test GLIBCXX_USE_CXX11_ABI - Failed
-- ROOT Platform: macosx
-- ROOT Architecture: macosx64
-- Build Type: Release (flags = '-O2 -DNDEBUG')
-- Compiler Flags: -O2 -DNDEBUG  -std=c++11 -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 -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++
-- Looking for ZLib
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11") 
-- Building freetype version 2.6.1 included in ROOT itself
-- Looking for PCRE
-- Could NOT find PCRE (missing: PCRE_INCLUDE_DIR) 
-- PCRE not found. Switching on builtin_pcre option
-- Looking for LZMA
-- Looking for lzma_auto_decoder in /usr/lib/liblzma.dylib
-- Looking for lzma_auto_decoder in /usr/lib/liblzma.dylib - found
-- Looking for lzma_easy_encoder in /usr/lib/liblzma.dylib
-- Looking for lzma_easy_encoder in /usr/lib/liblzma.dylib - found
-- Looking for lzma_lzma_preset in /usr/lib/liblzma.dylib
-- Looking for lzma_lzma_preset in /usr/lib/liblzma.dylib - found
-- Could NOT find LibLZMA (missing: LIBLZMA_INCLUDE_DIR) 
-- LZMA not found. Switching on builtin_lzma option
-- Building LZMA version 5.2.4 included in ROOT itself
-- Looking for ZSTD
-- ZSTD not found. Switching on builtin_zstd option
-- Performing Test CXX_FLAG_STD_CPLUSPLUS11
-- Performing Test CXX_FLAG_STD_CPLUSPLUS11 - Success
-- Performing Test C_FLAG_STD_C99
-- Performing Test C_FLAG_STD_C99 - Success
-- Performing Test C_FLAG_WALL
-- Performing Test C_FLAG_WALL - Success
-- Performing Test CXX_FLAG_WALL
-- Performing Test CXX_FLAG_WALL - Success
-- Performing Test C_FLAG_WEXTRA
-- Performing Test C_FLAG_WEXTRA - Success
-- Performing Test CXX_FLAG_WEXTRA
-- Performing Test CXX_FLAG_WEXTRA - Success
-- Performing Test C_FLAG_WUNDEF
-- Performing Test C_FLAG_WUNDEF - Success
-- Performing Test CXX_FLAG_WUNDEF
-- Performing Test CXX_FLAG_WUNDEF - Success
-- Performing Test C_FLAG_WSHADOW
-- Performing Test C_FLAG_WSHADOW - Success
-- Performing Test CXX_FLAG_WSHADOW
-- Performing Test CXX_FLAG_WSHADOW - Success
-- Performing Test C_FLAG_WCAST_ALIGN
-- Performing Test C_FLAG_WCAST_ALIGN - Success
-- Performing Test CXX_FLAG_WCAST_ALIGN
-- Performing Test CXX_FLAG_WCAST_ALIGN - Success
-- Performing Test C_FLAG_WCAST_QUAL
-- Performing Test C_FLAG_WCAST_QUAL - Success
-- Performing Test CXX_FLAG_WCAST_QUAL
-- Performing Test CXX_FLAG_WCAST_QUAL - Success
-- Performing Test C_FLAG_WSTRICT_PROTOTYPES - Success
-- Looking for xxHash
-- Could NOT find xxHash (missing: xxHash_LIBRARY xxHash_INCLUDE_DIR) 
-- xxHash not found. Switching on builtin_xxhash option
-- Looking for LZ4
-- Could NOT find LZ4 (missing: LZ4_LIBRARY LZ4_INCLUDE_DIR) 
-- LZ4 not found. Switching on builtin_lz4 option
-- Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR) 
-- Looking for AfterImage
-- AfterImage not found. Switching on builtin_afterimage option
-- Building AfterImage library included in ROOT itself
-- Looking for GSL
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
-- Could NOT find GSL: Found unsuitable version "", but required is at least "1.10" (found GSL_INCLUDE_DIR-NOTFOUND)
-- GSL not found. Set variable GSL_ROOT_DIR to point to your GSL installation
--                Alternatively, you can also enable the option 'builtin_gsl' to build the GSL libraries internally'
--                For the time being switching OFF 'mathmore' option
-- Looking for python
-- Preferring Python version 2
-- Found Python2: /usr/bin/python2.7 (found version "2.7.16") found components: Interpreter Development 
-- Found Python2: /usr/bin/python2.7 (found version "2.7.16") found components: Interpreter Development NumPy 
-- Looking for OpenGL
-- Found OpenGL: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework   
-- Looking for GLEW
-- GLEW not found. Switching on builtin_glew option
-- Looking for gl2ps
-- Could NOT find GL2PS (missing: GL2PS_LIBRARY GL2PS_INCLUDE_DIR) 
-- gl2ps not found. Switching on builtin_gl2ps option
-- Looking for LibXml2
-- Found LibXml2: /usr/lib/libxml2.dylib (found version "2.9.4") 
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR) 
-- OpenSSL not found, switching ON 'builtin_openssl' option.
-- Found OpenSSL: /Users/oxon/root-6.20.00/obj/builtins/openssl/OPENSSL-prefix/include (found version "1.0.2s") 
-- Looking for MySQL
-- MySQL not found. Switching off mysql option
-- Looking for Oracle
-- Oracle not found.
-- Oracle: You can specify includes: -DORACLE_PATH_INCLUDES=/usr/include/oracle/
--    currently found includes: 
-- Oracle: You can specify libs: -DORACLE_PATH_LIB=/usr/lib/oracle/
-- Oracle not found. Switching off oracle option
-- Looking for PostgreSQL
-- Could NOT find PostgreSQL (missing: PostgreSQL_INCLUDE_DIR) 
-- PostgreSQL not found. Switching off pgsql option
-- Looking for SQLite
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
-- Found Sqlite: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include  
-- Looking for Pythia6
-- Pythia6 not found. Switching off pythia6 option
-- Looking for Pythia8
-- Could NOT find Pythia8 (missing: PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARY) 
-- Pythia8 not found. Switching off pythia8 option
-- Looking for FFTW3
-- FFTW3 not found. Set [environment] variable FFTW_DIR to point to your FFTW3 installation
--                  Alternatively, you can also enable the option 'builtin_fftw3' to build FFTW3 internally'
--                  For the time being switching OFF 'fftw3' option
-- Looking for CFITSIO
-- CFITSIO not found. You can enable the option 'builtin_cfitsio' to build the library internally'
--                    For the time being switching off 'fitsio' option
-- Looking for XROOTD
-- XROOTD not found. Set environment variable XRDSYS to point to your XROOTD installation
--                   Alternatively, you can also enable the option 'builtin_xrootd' to build XROOTD internally
--                   For the time being switching OFF 'xrootd' option
-- GFAL library not found. Set variable GFAL_DIR to point to your gfal installation
                      and the variable SRM_IFCE_DIR to the srm_ifce installation
-- For the time being switching OFF 'gfal' option
-- ftgl library not found. Set variable FTGL_ROOT_DIR to point to your installation
-- For the time being switching ON 'builtin_ftgl' option
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
-- Looking for uuid_generate_random in uuid
-- Looking for uuid_generate_random in uuid - not found
-- Found uuid: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include  
-- Davix not found, switching ON 'builtin_davix' option.
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for TBB
-- Could NOT find TBB (missing: TBB_ROOT_DIR TBB_INCLUDE_DIR TBB_LIBRARY) (Required is at least version "2018")
-- TBB not found, enabling 'builtin_tbb' option
-- Performing Test CXX_HAS_mno_rtm
-- Performing Test CXX_HAS_mno_rtm - Success
-- Looking for VDT
-- Could NOT find Vdt (missing: VDT_INCLUDE_DIR VDT_LIBRARY) (Required is at least version "0.4")
-- VDT not found. Ensure that the installation of VDT is in the CMAKE_PREFIX_PATH
--                Switching ON 'builtin_vdt' option
-- Looking for BLAS for optional parts of TMVA
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for dgemm_
-- Looking for dgemm_ - found
-- Found BLAS: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Accelerate.framework  
-- Performing Test ROOT_HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Building LLVM in 'Release' mode.
-- The ASM compiler identification is Clang
-- Found assembler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Found libtool - /Library/Developer/CommandLineTools/usr/bin/libtool
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include  
-- Native target architecture is X86
-- Threads disabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Found ld64 - /Library/Developer/CommandLineTools/usr/bin/ld
-- LLVM host triple: x86_64-apple-darwin19.3.0
-- LLVM default target triple: x86_64-apple-darwin19.3.0
-- Building with -fPIC
-- Found PythonInterp: /usr/bin/python2.7 (found version "2.7.16") 
-- Constructing LLVMBuild project information
-- SysLibs: curses;/usr/lib/libz.dylib
-- Targeting X86
-- Targeting NVPTX
-- Clang version: 5.0.0
-- Cling version (from VERSION file): ROOT_0.7~dev
-- Cling will look for C++ headers in '/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1' at runtime.
-- And if not found, will invoke: '/Library/Developer/CommandLineTools/usr/bin/c++ ' for them.
-- Performing Test __result
-- Performing Test __result - Failed
-- Performing Test CXX_HAS_fno_rtti
-- Performing Test CXX_HAS_fno_rtti - Success
-- Performing Test CXX_HAS_Wno_conditional_uninitialized
-- Performing Test CXX_HAS_Wno_conditional_uninitialized - Success
-- Performing Test C_HAS_Wno_strict_overflow
-- Performing Test C_HAS_Wno_strict_overflow - Success
-- Performing Test C_HAS_Wno_maybe_uninitialized
-- Performing Test C_HAS_Wno_maybe_uninitialized - Failed
-- Performing Test C_HAS_Wno_parentheses_equality
-- Performing Test C_HAS_Wno_parentheses_equality - Success
-- Looking for m
-- Looking for m - not found
-- Performing Test CXX_HAS_fno_strict_aliasing
-- Performing Test CXX_HAS_fno_strict_aliasing - Success
-- Performing Test CXX_HAS_Wno_parentheses_equality
-- Performing Test CXX_HAS_Wno_parentheses_equality - Success
-- Performing Test CXX_HAS_Wno_cast_function_type
-- Performing Test CXX_HAS_Wno_cast_function_type - Failed
-- Performing Test CXX_HAS_Wno_deprecated_register
-- Performing Test CXX_HAS_Wno_deprecated_register - Success
-- Performing Test CXX_HAS_Wno_register
-- Performing Test CXX_HAS_Wno_register - Success
-- Performing Test found_setresuid
-- Performing Test found_setresuid - Failed
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Success
-- Performing Test found_stod_stringview
-- Performing Test found_stod_stringview - Failed
-- Performing Test found_opplusequal_stringview
-- Performing Test found_opplusequal_stringview - Success
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Failed
-- Performing Test found_stdinvoke
-- Performing Test found_stdinvoke - Failed
-- Performing Test found_stdindexsequence
-- Performing Test found_stdindexsequence - Failed
-- Performing Test found_attribute_always_inline
-- Performing Test found_attribute_always_inline - Success
-- Performing Test has_found_attribute_noinline
-- Performing Test has_found_attribute_noinline - Success
Running /Users/oxon/root-6.20.00/build/unix/compiledata.sh
Making /Users/oxon/root-6.20.00/obj/include/compiledata.h
-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_davix builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_lz4 builtin_lzma builtin_openssl builtin_pcre builtin_tbb builtin_vdt builtin_xxhash builtin_zstd clad cocoa dataframe davix exceptions gdml http imt libcxx mlp opengl python roofit shared sqlite ssl tmva tmva-cpu tmva-pymva spectrum vdt xml
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/oxon/root-6.20.00/obj
$ make -j 8
[100%] Generating tutorials/hsimple.root

Processing hsimple.C...
hsimple   : Real Time =   0.09 seconds Cpu Time =   0.05 seconds
(TFile *) 0x7fd988caa270
[100%] Built target hsimple
$ cd
$ . ~/root-6.20.00/obj/bin/thisroot.sh 
$ cat test.C 
void test() {}
$ root
  | Welcome to ROOT 6.20/00                        https://root.cern |
  | (c) 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosx64 on Mar 11 2020, 09:41:00                      |
  | From tag , 26 February 2020                                      |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |

root [0] .x test.C+
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/oxon/./test_C.so
$ sudo mv root-6.20.00 /usr/local/
$ . /usr/local/root-6.20.00/obj/bin/thisroot.sh 
$ root
  | Welcome to ROOT 6.20/00                        https://root.cern |
  | (c) 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosx64 on Mar 11 2020, 09:41:00                      |
  | From tag , 26 February 2020                                      |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |

root [0] .x test.C++
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/oxon/./test_C.so
dyld: Library not loaded: @rpath/libRIO.so
  Referenced from: /usr/local/root-6.20.00/obj/bin/rootcling
  Reason: image not found
Error in <ACLiC>: Dictionary generation failed!

Here is my CMakeCache.txt.
CMakeCache.txt (120.1 KB)

Thanks, that is supposed to work. I will check why it fails, but the fix will be too late for 6.20/02 and only make it into /04.


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