Dear experts,
I am having a problem linking the shared library on MacOS.
I have a very simple setup to reproduce the problem.
The repository is here:
I am making the repository using cmake
on my Mac:
inside the test
repository:
mkdir build
cd build
cmake ../
make -j8
But this is the error that I am getting:
[ 33%] Generating G__LUXESimEventDict.cxx, libLUXESimEventDict_rdict.pcm, libLUXESimEventDict.rootmap
[ 66%] Building CXX object CMakeFiles/G__LUXESimEventDict.dir/G__LUXESimEventDict.cxx.o
[ 66%] Built target G__LUXESimEventDict
[100%] Linking CXX shared library libLUXESimEventDict.dylib
ld: warning: -pie being ignored. It is only used when linking a main executable
Undefined symbols for architecture x86_64:
"Fatal(char const*, char const*, ...)", referenced from:
ROOT::Detail::TCollectionProxyInfo::Iterators<std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, false>::next(void*, void const*) in G__LUXESimEventDict.cxx.o
"TVersionCheck::TVersionCheck(int)", referenced from:
__GLOBAL__sub_I_G__LUXESimEventDict.cxx in G__LUXESimEventDict.cxx.o
"ROOT::AddClassAlternate(char const*, char const*)", referenced from:
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::Class_ShowMembers(TClass*, void const*, TMemberInspector&)", referenced from:
Dummy::ShowMembers(TMemberInspector&) const in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::SetNewArray(void* (*)(long, void*))", referenced from:
ROOT::GenerateInitInstanceLocal(Dummy const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::SetDestructor(void (*)(void*))", referenced from:
ROOT::GenerateInitInstanceLocal(Dummy const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::SetDeleteArray(void (*)(void*))", referenced from:
ROOT::GenerateInitInstanceLocal(Dummy const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::GetImplFileLine()", referenced from:
Dummy::ImplFileLine() in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::GetImplFileName()", referenced from:
Dummy::ImplFileName() in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::AdoptCollectionProxyInfo(ROOT::Detail::TCollectionProxyInfo*)", referenced from:
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::SetNew(void* (*)(void*))", referenced from:
ROOT::GenerateInitInstanceLocal(Dummy const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::GetClass()", referenced from:
Dummy::Dictionary() in G__LUXESimEventDict.cxx.o
Dummy::Class() in G__LUXESimEventDict.cxx.o
Dummy::Streamer(TBuffer&) in G__LUXESimEventDict.cxx.o
Dummy::IsA() const in G__LUXESimEventDict.cxx.o
Dummy::ShowMembers(TMemberInspector&) const in G__LUXESimEventDict.cxx.o
ROOT::vectorlEtuplelEintcOdoublegRsPgR_Dictionary() in G__LUXESimEventDict.cxx.o
ROOT::maplEunsignedsPlongcOvectorlEtuplelEintcOdoublegRsPgRsPgR_Dictionary() in G__LUXESimEventDict.cxx.o
...
"ROOT::TGenericClassInfo::SetDelete(void (*)(void*))", referenced from:
ROOT::GenerateInitInstanceLocal(Dummy const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::TGenericClassInfo(char const*, int, char const*, int, std::type_info const&, ROOT::Internal::TInitBehavior const*, TClass* (*)(), TVirtualIsAProxy*, int, int)", referenced from:
ROOT::GenerateInitInstanceLocal(Dummy const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::TGenericClassInfo::~TGenericClassInfo()", referenced from:
ROOT::GenerateInitInstanceLocal(Dummy const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::Internal::DefineBehavior(void*, void*)", referenced from:
ROOT::GenerateInitInstanceLocal(Dummy const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"ROOT::Internal::HasConsistentHashMember(char const*)", referenced from:
Dummy::CheckTObjectHashConsistency() const in G__LUXESimEventDict.cxx.o
"ROOT::Internal::HasConsistentHashMember(TClass&)", referenced from:
Dummy::CheckTObjectHashConsistency() const in G__LUXESimEventDict.cxx.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_libLUXESimEventDict_Impl() in G__LUXESimEventDict.cxx.o
"TIsAProxy::TIsAProxy(std::type_info const&)", referenced from:
ROOT::GenerateInitInstanceLocal(std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>> const*) in G__LUXESimEventDict.cxx.o
ROOT::GenerateInitInstanceLocal(std::__1::map<unsigned long, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, std::__1::less<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>>>> const*) in G__LUXESimEventDict.cxx.o
"_kAssertMsg", referenced from:
ROOT::Detail::TCollectionProxyInfo::Iterators<std::__1::vector<std::__1::tuple<int, double>, std::__1::allocator<std::__1::tuple<int, double>>>, false>::next(void*, void const*) in G__LUXESimEventDict.cxx.o
ld: symbol(s) not found for architecture x86_64
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libLUXESimEventDict.dylib] Error 1
make[1]: *** [CMakeFiles/LUXESimEventDict.dir/all] Error 2
make: *** [all] Error 2
Interestingly, the same setup works for a Linux machine:
ROOT Version: 6.30/04
Platform: Ubuntu 22.04.4, 64-bit
Compiler: GCC 11.4.0
May I know what may be the problem with my Mac?
Mac system specifications are given below [1].
Do I need to add any additional lines on CMakeLists.txt
?
Thank you,
Arka
[1]
_ROOT Version:6.26/04 (installed using conda)
_Platform: MacOS (x86_64, Intel i9)
_Compiler: Clang 13.0.1