phScholz / SAPPHIRE

Sapphire is a statistical nuclear reaction and decay code
https://phscholz.github.io/SAPPHIRE/
GNU General Public License v3.0
0 stars 0 forks source link

Installation Issue: Linking CXX executable sapphire #100

Closed rkelmar closed 4 years ago

rkelmar commented 4 years ago

When I run build.sh on Linux system I get the error

Linking CXX executable sapphire CMakeFiles/sapphire.dir/Modules/Module_OldSapphire.cpp.o: In function Module_OldSapphire::parseCommandLineForDecay(std::vector<std::string, std::allocator<std::string> >&, int&, int&, double&, int&, double&, double&, int&)': Module_OldSapphire.cpp:(.text+0x513f): undefined reference toTString::TString(std::string const&)' Module_OldSapphire.cpp:(.text+0x5242): undefined reference to TString::TString(std::string const&)' Module_OldSapphire.cpp:(.text+0x52de): undefined reference toTString::TString(std::string const&)' Module_OldSapphire.cpp:(.text+0x5587): undefined reference to TString::TString(std::string const&)' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::compare(unsigned long, unsigned long, char const, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libtbb.so.2: undefined reference tostd::length_error::length_error(char const)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libGraf.so: undefined reference to std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_mutate(unsigned long, unsigned long, wchar_t const*, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference toVTT for std::cxx11::basic_stringstream<char, std::char_traits, std::allocator >@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libTreePlayer.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::find_first_not_of(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libHist.so: undefined reference to `std::cxx11::basic_string<char, std::char_traits, std::allocator >::assign(char const)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libGraf.so: undefined reference to std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_assign(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libGraf.so: undefined reference tostd::cxx11::basic_string<wchar_t, std::char_traits, std::allocator >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to `std::cxx11::basic_string<char, std::char_traits, std::allocator >::~basic_string()@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libtbb.so.2: undefined reference to __cxa_init_primary_exception@CXXABI_1.3.11' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_erase(unsigned long, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libRIO.so: undefined reference to typeinfo for std::thread::_State@GLIBCXX_3.4.22' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libTreePlayer.so: undefined reference tostd::__cxx11::basic_string<char, std::char_traits, std::allocator >::find_last_not_of(char const, unsigned long, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned long, unsigned long, unsigned long, char)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::_M_assign(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libRIO.so: undefined reference to std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libRIO.so: undefined reference tostd::thread::_State::~_State()@GLIBCXX_3.4.22' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libHist.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rfind(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::append(char const)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libROOTDataFrame.so: undefined reference to `std::runtime_error::runtime_error(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::_M_append(char const*, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libHist.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rfind(char, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::_M_construct(unsigned long, char)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tocxa_throw_bad_array_new_length@CXXABI_1.3.8' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libRIO.so: undefined reference to `std::invalid_argument::invalid_argument(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libRIO.so: undefined reference to std::invalid_argument::invalid_argument(char const*)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libGraf.so: undefined reference tostd::cxx11::basic_string<wchar_t, std::char_traits, std::allocator >::_M_replace(unsigned long, unsigned long, wchar_t const, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libtbb.so.2: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void)@CXXABI_1.3.11' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned long, unsigned long, char const*) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libROOTDataFrame.so: undefined reference toVTT for std::cxx11::basic_istringstream<char, std::char_traits, std::allocator >@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::runtime_error::runtime_error(char const*)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::reserve(unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::out_of_range::out_of_range(char const*)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long, char)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::push_back(char)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libGraf.so: undefined reference tostd::cxx11::basic_string<wchar_t, std::char_traits, std::allocator >::_M_construct(unsigned long, wchar_t)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::substr(unsigned long, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libROOTDataFrame.so: undefined reference tostd::cxx11::basic_istringstream<char, std::char_traits, std::allocator >::~basic_istringstream()@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_last_of(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::operator=(std::cxx11::basic_string<char, std::char_traits, std::allocator >&&)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libRIO.so: undefined reference to std::domain_error::domain_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::_M_replace(unsigned long, unsigned long, char const, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libROOTDataFrame.so: undefined reference tovtable for std::__cxx11::basic_istringstream<char, std::char_traits, std::allocator >@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libtbb.so.2: undefined reference to `std::range_error::range_error(char const)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libRIO.so: undefined reference to std::out_of_range::out_of_range(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_stringbuf<char, std::char_traits, std::allocator >::str(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libROOTDataFrame.so: undefined reference tostd::cxx11::basic_stringbuf<char, std::char_traits, std::allocator >::_M_sync(char, unsigned long, unsigned long)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits, std::allocator >::find_first_of(char const, unsigned long, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to `std::cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::~basic_ostringstream()@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libtbb.so.2: undefined reference tooperator delete(void, unsigned long)@CXXABI_1.3.9' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::cxx11::basic_string<char, std::char_traits, std::allocator >::swap(std::cxx11::basic_string<char, std::char_traits, std::allocator >&)@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libtbb.so.2: undefined reference to `operator delete[](void, unsigned long)@CXXABI_1.3.9' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference to vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21' /afs/crc.nd.edu/user/n/nsl/nuclear/x86_64_linux_el6/install/root_v6.14.06/lib/libCore.so: undefined reference tostd::__cxx11::basic_stringbuf<char, std::char_traits, std::allocator >::str() const@GLIBCXX_3.4.21' collect2: error: ld returned 1 exit status make[2]: [src/sapphire] Error 1 make[1]: [src/CMakeFiles/sapphire.dir/all] Error 2 make: *** [all] Error 2

phScholz commented 4 years ago

Apparently, this is a bug resulting from incompatibilities with the root version 6.14. due to the TString::TString(std::string const&) method.

Workaround: use an older root version.

TODO: Fix incompatibility with root 6.14.

phScholz commented 4 years ago

It seems like the problem is fixed by explicitly setting the CXX compiler for Cmake to g++ instead of gcc in the CMakeLists.txt files.

Problem should be solved now.