Home | News | Documentation | Download

gSystem->Load() Vs. R__LOAD_LIBRARY with ACLiC

I have a library libABC.so which I want to use in a script which I run like so:
root -x myscript.cxx+
In my .rootlogon.C, I have
gSystem->Load("libABC.so");
Everything works as expect.

But now, I don’t want to modify .rootlogon.C. Instead I want to use R__LOAD_LIBRARY inside the myscript.cxx like so:

#include "ABC.h"
R__LOAD_LIBRARY(libABC.so)

This fails to link the library. How can I get same effect as having gSystem->Load("libABC.so") in rootlogon.C?

Create a rootmap file for libABC.so, see e.g. Rootmap generation with rootcling (v6.00.00)

This is not a root-based library. There is no LinkDef. I am just using the library inside an ACLiC compiled script.

I just want to tell root (inside the script to be compiled) to load the library without explicitly putting gSystem->Load("libABC.so") in my rootlogon.C

EDIT:

That is, how do tell root to load the library before it compiles it? I thought that was why R__LOAD_LIBRARY exists?

Example:

Using fmt (compiled with -DBUILD_SHARED_LIBRARIES=ON).

#include <iostream>

#include <fmt/core.h>
#include <fmt/ostream.h>
R__LOAD_LIBRARY(libfmt.so)

void fmt_test() {
  fmt::print(std::cout, "{:>5.3f}, {:>5.3f}\n", 1.0,2.0);
}

Then running

root -x fmt_test.cxx++

Gives many undefined symbol errors.

Processing fmt_test.cxx++...                                                                                                                                                 
Info in <TUnixSystem::ACLiC>: creating shared library /home/whit/.root_build_dir//home/whit/./fmt_test_cxx.so                                              cling::DynamicLibraryManager::loadLibrary(): /home/whit/.root_build_dir/home/whit/fmt_test_cxx.so: undefined symbol: _ZN3fmt2v58internal10basic_dataIvE6DIG
ITSE                                                                                                                                                                        
/usr/lib/x86_64-linux-gnu/crt1.o: In function `_start':                                                                                                                      
(.text+0x20): undefined reference to `main'                                                                                                                                 
/home/whit/.root_build_dir//home/whit/fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::internal::count_digits(unsigned long)':                             
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal12count_digitsEm[_ZN3fmt2v58internal12count_digitsEm]+0x46): undefined reference to `fmt::v5::internal::basic_data<void>::POWERS_OF_10_64'                                                                                                                                                         
/home/whit/.root_build_dir//home/whit/fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::internal::count_digits(unsigned int)':                              fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal12count_digitsEj[_ZN3fmt2v58internal12count_digitsEj]+0x40): undefined reference to `fmt::v5::internal::basic_data<void
>::POWERS_OF_10_32'
...

Adding gSystem->Load("libfmt.so"); to my $HOME/.rootlogon.C (which I want to avoid doing!) and everything works just fine (even without R__LOAD_LIBRARY).

Processing fmt_test.cxx++...
Info in <TUnixSystem::ACLiC>: creating shared library /home/whit/.root_build_dir//home/whit/./fmt_test_cxx.so
1.000, 2.000

Is this a bug in R__LOAD_LIBRARY?

Note that you can have a “rootlogon.C” file in your “current directory” (i.e. where you work with “myscript.cxx” and/or “fmt_test.cxx”).

Out of curiosity … have you tried to put R__LOAD_LIBRARY(libfmt) as the very first line of your “fmt_test.cxx” macro (i.e. before any #include)?

Yes I have. Still no go. These don’t work either:

R__LOAD_LIBRARY(libfmt) 
R__LOAD_LIBRARY(libfmt.so)
R__LOAD_LIBRARY($HOME/lib/libfmt.so)
R__LOAD_LIBRARY(/home/whit/lib/libfmt.so)

The whole point is to avoid the rootlogon.C files. Actually it would be neat if they could just be embedded at the top of root scripts. For example, something like this:

#ifdef __ROOTLOGON__
{
gSystem->Load("libfmt.so");
}
#endif

#include <iostream>

#include <fmt/core.h>
#include <fmt/ostream.h>

void fmt_test() {
  fmt::print(std::cout, "{:>5.3f}, {:>5.3f}\n", 1.0,2.0);
}

EDIT:

A possible work-around is

root -e "gSystem->Load(\"libfmt.so\");" -x test_fmt.cxx++

which I don’t like but it works because TRint processes the input list in order.

@Axel … Well, I played with this, too.

Without the “rootlogon.C” file (i.e. without prior gSystem->Load("libfmt");) …

… the cling JIT-ed code works fine:

[...]$ root -q -l fmt_test.cxx

Processing fmt_test.cxx...
1.000, 2.000

… but ACLiC fails (Ubuntu 14.04 LTS / x86_64, gcc 4.8.4, ROOT 6.14/00):

[...]$ root -q -l fmt_test.cxx++

Processing fmt_test.cxx++...
Info in <TUnixSystem::ACLiC>: creating shared library /..././fmt_test_cxx.so
cling::DynamicLibraryManager::loadLibrary(): /.../fmt_test_cxx.so: undefined symbol: _ZTIN3fmt2v512format_errorE
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 21
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::format_error::format_error(char const*)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512format_errorC2EPKc[_ZN3fmt2v512format_errorC5EPKc]+0x66): undefined reference to `vtable for fmt::v5::format_error'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::internal::count_digits(unsigned long)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal12count_digitsEm[_ZN3fmt2v58internal12count_digitsEm]+0x45): undefined reference to `fmt::v5::internal::basic_data<void>::POWERS_OF_10_64'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::internal::count_digits(unsigned int)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal12count_digitsEj[_ZN3fmt2v58internal12count_digitsEj]+0x3f): undefined reference to `fmt::v5::internal::basic_data<void>::POWERS_OF_10_32'
/.../fmt_test_cxx_ACLiC_dict.o: In function `void fmt::v5::internal::parse_format_string<fmt::v5::internal::null_terminating_iterator<char>, fmt::v5::format_handler<fmt::v5::arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >, char, fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char> >, char> >&>(fmt::v5::internal::null_terminating_iterator<char>, fmt::v5::format_handler<fmt::v5::arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >, char, fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char> >, char> >&)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal19parse_format_stringINS1_25null_terminating_iteratorIcEERNS0_14format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS9_EcEEEEEEvT_OT0_[_ZN3fmt2v58internal19parse_format_stringINS1_25null_terminating_iteratorIcEERNS0_14format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS9_EcEEEEEEvT_OT0_]+0xd0): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal19parse_format_stringINS1_25null_terminating_iteratorIcEERNS0_14format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS9_EcEEEEEEvT_OT0_[_ZN3fmt2v58internal19parse_format_stringINS1_25null_terminating_iteratorIcEERNS0_14format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS9_EcEEEEEEvT_OT0_]+0x1cc): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal19parse_format_stringINS1_25null_terminating_iteratorIcEERNS0_14format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS9_EcEEEEEEvT_OT0_[_ZN3fmt2v58internal19parse_format_stringINS1_25null_terminating_iteratorIcEERNS0_14format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS9_EcEEEEEEvT_OT0_]+0x1df): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::format_handler<fmt::v5::arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >, char, fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char> >, char> >::on_format_specs(fmt::v5::internal::null_terminating_iterator<char>)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v514format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS6_EcEEE15on_format_specsENS4_25null_terminating_iteratorIcEE[_ZN3fmt2v514format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS6_EcEEE15on_format_specsENS4_25null_terminating_iteratorIcEE]+0x196): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::internal::id_adapter<fmt::v5::format_handler<fmt::v5::arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >, char, fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char> >, char> >&, char>::on_error(char const*)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal10id_adapterIRNS0_14format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS7_EcEEEEcE8on_errorEPKc[_ZN3fmt2v58internal10id_adapterIRNS0_14format_handlerINS0_13arg_formatterINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEEEcNS0_20basic_format_contextISt20back_insert_iteratorIS7_EcEEEEcE8on_errorEPKc]+0x22): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o:fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal17handle_char_specsIcNS1_18arg_formatter_baseINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEE17char_spec_handlerEEEvRKNS0_18basic_format_specsIT_EEOT0_[_ZN3fmt2v58internal17handle_char_specsIcNS1_18arg_formatter_baseINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEE17char_spec_handlerEEEvRKNS0_18basic_format_specsIT_EEOT0_]+0x91): more undefined references to `fmt::v5::internal::error_handler::on_error(char const*)' follow
/.../fmt_test_cxx_ACLiC_dict.o: In function `void fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::write_double<double>(double, fmt::v5::basic_format_specs<char> const&)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE12write_doubleIdEEvT_RKNS0_18basic_format_specsIcEE[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE12write_doubleIdEEvT_RKNS0_18basic_format_specsIcEE]+0x3f6): undefined reference to `int fmt::v5::internal::char_traits<char>::format_float<double>(char*, unsigned long, char const*, unsigned int, int, double)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `void fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::write_double<long double>(long double, fmt::v5::basic_format_specs<char> const&)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE12write_doubleIeEEvT_RKNS0_18basic_format_specsIcEE[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE12write_doubleIeEEvT_RKNS0_18basic_format_specsIcEE]+0x3b9): undefined reference to `int fmt::v5::internal::char_traits<char>::format_float<long double>(char*, unsigned long, char const*, unsigned int, int, long double)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `void fmt::v5::internal::handle_cstring_type_spec<char, fmt::v5::internal::arg_formatter_base<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::cstring_spec_handler>(char, fmt::v5::internal::arg_formatter_base<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::cstring_spec_handler&&)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal24handle_cstring_type_specIcNS1_18arg_formatter_baseINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEE20cstring_spec_handlerEEEvT_OT0_[_ZN3fmt2v58internal24handle_cstring_type_specIcNS1_18arg_formatter_baseINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEE20cstring_spec_handlerEEEvT_OT0_]+0x4c): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `void fmt::v5::internal::check_string_type_spec<char, fmt::v5::internal::error_handler>(char, fmt::v5::internal::error_handler&&)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal22check_string_type_specIcNS1_13error_handlerEEEvT_OT0_[_ZN3fmt2v58internal22check_string_type_specIcNS1_13error_handlerEEEvT_OT0_]+0x2a): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `void fmt::v5::internal::check_pointer_type_spec<char, fmt::v5::internal::error_handler>(char, fmt::v5::internal::error_handler&&)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal23check_pointer_type_specIcNS1_13error_handlerEEEvT_OT0_[_ZN3fmt2v58internal23check_pointer_type_specIcNS1_13error_handlerEEEvT_OT0_]+0x2a): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_parse_context<char, fmt::v5::internal::error_handler>::on_error(char const*)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v519basic_parse_contextIcNS0_8internal13error_handlerEE8on_errorEPKc[_ZN3fmt2v519basic_parse_contextIcNS0_8internal13error_handlerEE8on_errorEPKc]+0x1f): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<int, fmt::v5::basic_format_specs<char> >::on_num()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIiNS0_18basic_format_specsIcEEE6on_numEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIiNS0_18basic_format_specsIcEEE6on_numEv]+0x35): undefined reference to `char fmt::v5::internal::thousands_sep<char>(fmt::v5::locale_provider*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<int, fmt::v5::basic_format_specs<char> >::on_error()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIiNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIiNS0_18basic_format_specsIcEEE8on_errorEv]+0x2a): undefined reference to `fmt::v5::format_error::~format_error()'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIiNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIiNS0_18basic_format_specsIcEEE8on_errorEv]+0x2f): undefined reference to `typeinfo for fmt::v5::format_error'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<unsigned int, fmt::v5::basic_format_specs<char> >::on_num()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIjNS0_18basic_format_specsIcEEE6on_numEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIjNS0_18basic_format_specsIcEEE6on_numEv]+0x35): undefined reference to `char fmt::v5::internal::thousands_sep<char>(fmt::v5::locale_provider*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<unsigned int, fmt::v5::basic_format_specs<char> >::on_error()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIjNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIjNS0_18basic_format_specsIcEEE8on_errorEv]+0x2a): undefined reference to `fmt::v5::format_error::~format_error()'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIjNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIjNS0_18basic_format_specsIcEEE8on_errorEv]+0x2f): undefined reference to `typeinfo for fmt::v5::format_error'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<long long, fmt::v5::basic_format_specs<char> >::on_num()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIxNS0_18basic_format_specsIcEEE6on_numEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIxNS0_18basic_format_specsIcEEE6on_numEv]+0x3b): undefined reference to `char fmt::v5::internal::thousands_sep<char>(fmt::v5::locale_provider*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<long long, fmt::v5::basic_format_specs<char> >::on_error()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIxNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIxNS0_18basic_format_specsIcEEE8on_errorEv]+0x2a): undefined reference to `fmt::v5::format_error::~format_error()'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIxNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIxNS0_18basic_format_specsIcEEE8on_errorEv]+0x2f): undefined reference to `typeinfo for fmt::v5::format_error'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<unsigned long long, fmt::v5::basic_format_specs<char> >::on_num()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIyNS0_18basic_format_specsIcEEE6on_numEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIyNS0_18basic_format_specsIcEEE6on_numEv]+0x3b): undefined reference to `char fmt::v5::internal::thousands_sep<char>(fmt::v5::locale_provider*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<unsigned long long, fmt::v5::basic_format_specs<char> >::on_error()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIyNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIyNS0_18basic_format_specsIcEEE8on_errorEv]+0x2a): undefined reference to `fmt::v5::format_error::~format_error()'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIyNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIyNS0_18basic_format_specsIcEEE8on_errorEv]+0x2f): undefined reference to `typeinfo for fmt::v5::format_error'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::float_spec_handler<char>::on_error()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v518float_spec_handlerIcE8on_errorEv[_ZN3fmt2v518float_spec_handlerIcE8on_errorEv]+0x2a): undefined reference to `fmt::v5::format_error::~format_error()'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v518float_spec_handlerIcE8on_errorEv[_ZN3fmt2v518float_spec_handlerIcE8on_errorEv]+0x2f): undefined reference to `typeinfo for fmt::v5::format_error'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::internal::arg_formatter_base<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::write(char const*)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal18arg_formatter_baseINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEE5writeEPKc[_ZN3fmt2v58internal18arg_formatter_baseINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEE5writeEPKc]+0x35): undefined reference to `fmt::v5::format_error::~format_error()'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal18arg_formatter_baseINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEE5writeEPKc[_ZN3fmt2v58internal18arg_formatter_baseINS0_17back_insert_rangeINS1_12basic_bufferIcEEEEE5writeEPKc]+0x3a): undefined reference to `typeinfo for fmt::v5::format_error'
/.../fmt_test_cxx_ACLiC_dict.o: In function `void fmt::v5::internal::set_dynamic_spec<fmt::v5::internal::width_checker, unsigned int, fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char> >, char>, fmt::v5::internal::error_handler>(unsigned int&, fmt::v5::basic_format_arg<fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char> >, char> >, fmt::v5::internal::error_handler)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal16set_dynamic_specINS1_13width_checkerEjNS0_20basic_format_contextISt20back_insert_iteratorINS1_12basic_bufferIcEEEcEENS1_13error_handlerEEEvRT0_NS0_16basic_format_argIT1_EET2_[_ZN3fmt2v58internal16set_dynamic_specINS1_13width_checkerEjNS0_20basic_format_contextISt20back_insert_iteratorINS1_12basic_bufferIcEEEcEENS1_13error_handlerEEEvRT0_NS0_16basic_format_argIT1_EET2_]+0x75): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `void fmt::v5::internal::set_dynamic_spec<fmt::v5::internal::precision_checker, int, fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char> >, char>, fmt::v5::internal::error_handler>(int&, fmt::v5::basic_format_arg<fmt::v5::basic_format_context<std::back_insert_iterator<fmt::v5::internal::basic_buffer<char> >, char> >, fmt::v5::internal::error_handler)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal16set_dynamic_specINS1_17precision_checkerEiNS0_20basic_format_contextISt20back_insert_iteratorINS1_12basic_bufferIcEEEcEENS1_13error_handlerEEEvRT0_NS0_16basic_format_argIT1_EET2_[_ZN3fmt2v58internal16set_dynamic_specINS1_17precision_checkerEiNS0_20basic_format_contextISt20back_insert_iteratorINS1_12basic_bufferIcEEEcEENS1_13error_handlerEEEvRT0_NS0_16basic_format_argIT1_EET2_]+0x75): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<unsigned long, fmt::v5::basic_format_specs<char> >::on_num()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerImNS0_18basic_format_specsIcEEE6on_numEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerImNS0_18basic_format_specsIcEEE6on_numEv]+0x3b): undefined reference to `char fmt::v5::internal::thousands_sep<char>(fmt::v5::locale_provider*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<unsigned long, fmt::v5::basic_format_specs<char> >::on_error()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerImNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerImNS0_18basic_format_specsIcEEE8on_errorEv]+0x2a): undefined reference to `fmt::v5::format_error::~format_error()'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerImNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerImNS0_18basic_format_specsIcEEE8on_errorEv]+0x2f): undefined reference to `typeinfo for fmt::v5::format_error'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<char, fmt::v5::basic_format_specs<char> >::on_num()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIcNS0_18basic_format_specsIcEEE6on_numEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIcNS0_18basic_format_specsIcEEE6on_numEv]+0x35): undefined reference to `char fmt::v5::internal::thousands_sep<char>(fmt::v5::locale_provider*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `fmt::v5::basic_writer<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char> > >::int_writer<char, fmt::v5::basic_format_specs<char> >::on_error()':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIcNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIcNS0_18basic_format_specsIcEEE8on_errorEv]+0x2a): undefined reference to `fmt::v5::format_error::~format_error()'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIcNS0_18basic_format_specsIcEEE8on_errorEv[_ZN3fmt2v512basic_writerINS0_17back_insert_rangeINS0_8internal12basic_bufferIcEEEEE10int_writerIcNS0_18basic_format_specsIcEEE8on_errorEv]+0x2f): undefined reference to `typeinfo for fmt::v5::format_error'
/.../fmt_test_cxx_ACLiC_dict.o: In function `std::enable_if<fmt::v5::internal::is_integer<int>::value, unsigned long long>::type fmt::v5::internal::width_checker<fmt::v5::internal::error_handler>::operator()<int>(int)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIiEENSt9enable_ifIXsrNS1_10is_integerIT_EE5valueEyE4typeES8_[_ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIiEENSt9enable_ifIXsrNS1_10is_integerIT_EE5valueEyE4typeES8_]+0x2d): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `std::enable_if<fmt::v5::internal::is_integer<unsigned int>::value, unsigned long long>::type fmt::v5::internal::width_checker<fmt::v5::internal::error_handler>::operator()<unsigned int>(unsigned int)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIjEENSt9enable_ifIXsrNS1_10is_integerIT_EE5valueEyE4typeES8_[_ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIjEENSt9enable_ifIXsrNS1_10is_integerIT_EE5valueEyE4typeES8_]+0x2d): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `std::enable_if<fmt::v5::internal::is_integer<long long>::value, unsigned long long>::type fmt::v5::internal::width_checker<fmt::v5::internal::error_handler>::operator()<long long>(long long)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIxEENSt9enable_ifIXsrNS1_10is_integerIT_EE5valueEyE4typeES8_[_ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIxEENSt9enable_ifIXsrNS1_10is_integerIT_EE5valueEyE4typeES8_]+0x30): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `std::enable_if<fmt::v5::internal::is_integer<unsigned long long>::value, unsigned long long>::type fmt::v5::internal::width_checker<fmt::v5::internal::error_handler>::operator()<unsigned long long>(unsigned long long)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIyEENSt9enable_ifIXsrNS1_10is_integerIT_EE5valueEyE4typeES8_[_ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIyEENSt9enable_ifIXsrNS1_10is_integerIT_EE5valueEyE4typeES8_]+0x30): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o: In function `std::enable_if<!fmt::v5::internal::is_integer<bool>::value, unsigned long long>::type fmt::v5::internal::width_checker<fmt::v5::internal::error_handler>::operator()<bool>(bool)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIbEENSt9enable_ifIXntsrNS1_10is_integerIT_EE5valueEyE4typeES8_[_ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIbEENSt9enable_ifIXntsrNS1_10is_integerIT_EE5valueEyE4typeES8_]+0x21): undefined reference to `fmt::v5::internal::error_handler::on_error(char const*)'
/.../fmt_test_cxx_ACLiC_dict.o:fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIcEENSt9enable_ifIXntsrNS1_10is_integerIT_EE5valueEyE4typeES8_[_ZN3fmt2v58internal13width_checkerINS1_13error_handlerEEclIcEENSt9enable_ifIXntsrNS1_10is_integerIT_EE5valueEyE4typeES8_]+0x21): more undefined references to `fmt::v5::internal::error_handler::on_error(char const*)' follow
/.../fmt_test_cxx_ACLiC_dict.o: In function `char* fmt::v5::internal::format_decimal<unsigned int, char, fmt::v5::internal::add_thousands_sep<char> >(char*, unsigned int, unsigned int, fmt::v5::internal::add_thousands_sep<char>)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal14format_decimalIjcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_[_ZN3fmt2v58internal14format_decimalIjcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_]+0x77): undefined reference to `fmt::v5::internal::basic_data<void>::DIGITS'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal14format_decimalIjcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_[_ZN3fmt2v58internal14format_decimalIjcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_]+0xa3): undefined reference to `fmt::v5::internal::basic_data<void>::DIGITS'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal14format_decimalIjcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_[_ZN3fmt2v58internal14format_decimalIjcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_]+0x10a): undefined reference to `fmt::v5::internal::basic_data<void>::DIGITS'
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal14format_decimalIjcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_[_ZN3fmt2v58internal14format_decimalIjcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_]+0x136): undefined reference to `fmt::v5::internal::basic_data<void>::DIGITS'
/.../fmt_test_cxx_ACLiC_dict.o: In function `char* fmt::v5::internal::format_decimal<unsigned long, char, fmt::v5::internal::add_thousands_sep<char> >(char*, unsigned long, unsigned int, fmt::v5::internal::add_thousands_sep<char>)':
fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal14format_decimalImcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_[_ZN3fmt2v58internal14format_decimalImcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_]+0xab): undefined reference to `fmt::v5::internal::basic_data<void>::DIGITS'
/.../fmt_test_cxx_ACLiC_dict.o:fmt_test_cxx_ACLiC_dict.cxx:(.text._ZN3fmt2v58internal14format_decimalImcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_[_ZN3fmt2v58internal14format_decimalImcNS1_17add_thousands_sepIcEEEEPT0_S6_T_jT1_]+0xd7): more undefined references to `fmt::v5::internal::basic_data<void>::DIGITS' follow
collect2: error: ld returned 1 exit status

… where:

[...]$ ldd libfmt.so
        linux-vdso.so.1 =>  (0x00007ffe2287a000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007faff9b98000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007faff9982000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007faff95b9000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007faff92b3000)
        /lib64/ld-linux-x86-64.so.2 (0x00007faffa0ea000)

Aha! Thank you, now I see my mistake :blush:. I was still using ACLiC (i.e. postfixed “+” or “++” commands) because that is what was needed in the past. But R__LOAD_LIBRARY is cling macro, and now that all the clinks (cling-kinks) have been worked out I can stop my old-timer habits and do things the easy way. :smile:

Thanks for your help!

Actually, I also expected ACLiC (via “rootcling” / “rootcint”, which are automatically executed) to respect “R__LOAD_LIBRARY”, “R__ADD_INCLUDE_PATH” and “R__ADD_LIBRARY_PATH” macros. Apparently, it is not the case in the current ROOT (e.g. 6.14/08 and 6.16/00).

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

@pcanal - should we extend ACLiC to link R__LOAD_LIBRARY'ed libraries?

This has always been the plan. It requires to update rootlcing to ‘understand’ R__LOAD_LIBRARY and to pass the information down when --lib-list-prefix is used (by ACLiC).

1 Like