$ root
------------------------------------------------------------
| Welcome to ROOT 6.16/00 https://root.cern |
| (c) 1995-2018, The ROOT Team |
| Built for macosx64 on Jun 19 2019, 14:05:00 |
| From tag , 23 January 2019 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
root [0] .x test.C
root [1] .x test.C
test¥nIncrementalExecutor::executeFunction: symbol '_ZNSt3__1L9use_facetINS_5ctypeIcEEEERKT_RKNS_6localeE' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ctype<char> const& std::__1::use_facet<std::__1::ctype<char> >(std::__1::locale const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L9addressofIKcEEPT_RS2_' unresolved while linking [cling interface function]!
You are probably missing the definition of char const* std::__1::addressof<char const>(char const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L16__to_raw_pointerIKcEEPT_S3_' unresolved while linking [cling interface function]!
You are probably missing the definition of char const* std::__1::__to_raw_pointer<char const>(char const*)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNKSt3__18ios_base5flagsEv' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ios_base::flags() const
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNKSt3__18ios_base5widthEv' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ios_base::width() const
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__18ios_base5widthEl' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ios_base::width(long)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__18ios_base8setstateEj' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ios_base::setstate(unsigned int)
Maybe you need to load the corresponding shared library?
The problem I reported in the first post was not reproduced on this environment.
$ cat test.C
void test() {
std::cout << "test" << std::endl;
}
$ root
------------------------------------------------------------
| Welcome to ROOT 6.16/00 https://root.cern |
| (c) 1995-2018, The ROOT Team |
| Built for macosx64 on Jan 23 2019, 09:06:13 |
| From tags/v6-16-00@v6-16-00 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
root [0] .x test.C
test
root [1] .x test.C
test
However, if I build ROOT 6.16/00 myself using the same environment and additional CMake installation via Homebrew, the example scripts fails when being executed twice.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install cmake
$ brew list
cmake
$ cd root-6.16.00/obj
$ cmake ..
$ make -j8
$ root
------------------------------------------------------------
| Welcome to ROOT 6.16/00 https://root.cern |
| (c) 1995-2018, The ROOT Team |
| Built for macosx64 on Jun 20 2019, 18:44:00 |
| From tag , 23 January 2019 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
root [0] .x test.C
test
root [1] .x test.C
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L9use_facetINS_5ctypeIcEEEERKT_RKNS_6localeE' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ctype<char> const& std::__1::use_facet<std::__1::ctype<char> >(std::__1::locale const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L9addressofIKcEEPT_RS2_' unresolved while linking [cling interface function]!
You are probably missing the definition of char const* std::__1::addressof<char const>(char const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L16__to_raw_pointerIKcEEPT_S3_' unresolved while linking [cling interface function]!
You are probably missing the definition of char const* std::__1::__to_raw_pointer<char const>(char const*)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNKSt3__18ios_base5flagsEv' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ios_base::flags() const
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNKSt3__18ios_base5widthEv' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ios_base::width() const
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L4endlIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__18ios_base5widthEl' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ios_base::width(long)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__18ios_base8setstateEj' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::ios_base::setstate(unsigned int)
Maybe you need to load the corresponding shared library?
Compiling the script first and executing them twice is OK.
root [0] .x test.C+
test
root [1] .x test.C
test
root [2] .x test.C
test
I meant to ask why the pre-compiled ROOT distribution oot_v6.16.00.macosx64-10.14-clang100.tar.gz works. It seems that the loading/unloading procedures are different in the pre-compiled ROOT binary and self-cmake-built one on my Mac.
$ cat tmp2.C
void tmp2() {
std::ifstream fin("tmp.C");
}
$ root
root [0] .x tmp2.C
root [1] .x tmp2.C
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L4moveIRPFiP7__sFILEEEEONS_16remove_referenceIT_E4typeEOS7_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::remove_reference<int (*&)(__sFILE*)>::type&& std::__1::move<int (*&)(__sFILE*)>(int (*&&&)(__sFILE*))
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L3minImEERKT_S3_S3_' unresolved while linking [cling interface function]!
You are probably missing the definition of unsigned long const& std::__1::min<unsigned long>(unsigned long const&, unsigned long const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L7forwardIRP7__sFILEEEOT_RNS_16remove_referenceIS4_E4typeE' unresolved while linking [cling interface function]!
You are probably missing the definition of __sFILE*&&& std::__1::forward<__sFILE*&>(std::__1::remove_reference<__sFILE*&>::type&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L3maxIlEERKT_S3_S3_' unresolved while linking [cling interface function]!
You are probably missing the definition of long const& std::__1::max<long>(long const&, long const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L16__throw_bad_castEv' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::__throw_bad_cast()
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L9use_facetINS_7codecvtIcc11__mbstate_tEEEERKT_RKNS_6localeE' unresolved while linking [cling interface function]!
You are probably missing the definition of std::__1::codecvt<char, char, __mbstate_t> const& std::__1::use_facet<std::__1::codecvt<char, char, __mbstate_t> >(std::__1::locale const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L9has_facetINS_7codecvtIcc11__mbstate_tEEEEbRKNS_6localeE' unresolved while linking [cling interface function]!
You are probably missing the definition of bool std::__1::has_facet<std::__1::codecvt<char, char, __mbstate_t> >(std::__1::locale const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZNSt3__1L7forwardIPFiP7__sFILEEEEOT_RNS_16remove_referenceIS5_E4typeE' unresolved while linking [cling interface function]!
You are probably missing the definition of int (*&&std::__1::forward<int (*)(__sFILE*)>(std::__1::remove_reference<int (*)(__sFILE*)>::type&))(__sFILE*)
Maybe you need to load the corresponding shared library?
The former does not work either on another (virtual) Mac with clean installation.
This is unstable, whether it works or not depends on tons of things, e.g. where the first declaration comes from. This needs some time to get fixed, else I’d have done it long time ago