"Failed to materialize symbols" when running first.py on MacOS

1,314 views
Skip to first unread message

MSik

unread,
Apr 17, 2023, 6:15:21 PM4/17/23
to ns-3-users
I scrubbed the forum and didn't see any questions about this yet so wanted to start a thread.My Specs:
ns-3 version 3.38
MacOS Ventura 13.2 (Intel)
Python 3.7 installed with Homebrew.
We also have Python 3.9 installed that came with the OS, but it is not on PATH
xcode 14.2
Apple clang version 14.0.0 (clang-1400.0.29.202)./ns3 configure works fine,
./ns3 build can run C++, no problems,cppyy is installed and validated and tested this with import cppyy with python interpreter.Get this error when running first.py on MacOS.
Building and running natively on MacOS, not inside a container.Full Error Message
```
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { __GLOBAL__sub_I_cling_module_36, ____orc_init_func.cling-module-36, $.cling-module-36.__inits.0, ___cxx_global_var_initcling_module_36_, __ZN3ns3L16g_TimeStaticInitE }) }
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { ____orc_init_func.cling-module-36 }) }
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { __ZZN3ns34Time14PeekResolutionEvE10resolution, __ZGVZN3ns34Time14PeekResolutionEvE10resolution, __ZN3ns34TimeD1Ev, ___clang_call_terminate, __GLOBAL__sub_I_cling_module_55, ____orc_init_func.cling-module-55, $.cling-module-55.__inits.0, ___cxx_global_var_initcling_module_55_, __ZN3ns3L27UE_MEASUREMENT_REPORT_DELAYE }) }
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { ____orc_init_func.cling-module-55 }) }
cling JIT session error: Failed to materialize symbols: { (main, { ___clang_call_terminate }) }
Traceback (most recent call last):
 File "/Users/msikka/Downloads/ns-allinone-3.38/ns-3.38/examples/tutorial/first.py", line 35, in <module>
  devices = pointToPoint.Install(nodes)
TypeError: none of the 5 overloaded methods succeeded. Full details:
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(std::string aNode, std::string bNode) =>
  TypeError: takes at least 2 arguments (1 given)
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::Ptr<ns3::Node> a, std::string bName) =>
  TypeError: takes at least 2 arguments (1 given)
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(std::string aName, ns3::Ptr<ns3::Node> b) =>
  TypeError: takes at least 2 arguments (1 given)
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::NodeContainer c) =>
  ValueError: nullptr result where temporary expected
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::Ptr<ns3::Node> a, ns3::Ptr<ns3::Node> b) =>
  TypeError: takes at least 2 arguments (1 given)
cling JIT session error: Failed to materialize symbols: { (main, { ___clang_call_terminate }) }
Command 'python3 /Users/msikka/Downloads/ns-allinone-3.38/ns-3.38/examples/tutorial/first.py' returned non-zero exit status 1.
```

Ashley Tharp

unread,
Apr 17, 2023, 6:37:51 PM4/17/23
to ns-3-users
Also working on this issue with MSik hey all, 
this looks very much like a linker error because of the reference to symbols, which usually comes up when there is a missing .dylib file and such things. 
Static linking is also a type of linking and the output string "[runStaticInitializersOnce]" hints at perhaps a static linking step happening, 
"cling JIT session error: Failed to materialize symbols: { (main, { ___clang_call_terminate }) }" looks maybe like JIT (just in time) we are compiling something on the spot and then linking? Hard to parse this bit for clues. 
Also, it appears to me from this output:
 
```
File "/Users/msikka/Downloads/ns-allinone-3.38/ns-3.38/examples/tutorial/first.py", line 35, in <module>
  devices = pointToPoint.Install(nodes)
TypeError: none of the 5 overloaded methods succeeded. Full details:
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(std::string aNode, std::string bNode) =>
  TypeError: takes at least 2 arguments (1 given)
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::Ptr<ns3::Node> a, std::string bName) =>
  TypeError: takes at least 2 arguments (1 given)
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(std::string aName, ns3::Ptr<ns3::Node> b) =>
  TypeError: takes at least 2 arguments (1 given)
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::NodeContainer c) =>
  ValueError: nullptr result where temporary expected
 ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::Ptr<ns3::Node> a, ns3::Ptr<ns3::Node> b) =>
  TypeError: takes at least 2 arguments (1 given)
```
This looks very much like a Python call, and then the correct C++ function cannot be found. PointToPoint I believed came with core ns-3 and didn't need to be built as a special separate package, and also first.cc compiles and runs just fine, so we at least know that PointToPoint can be found on C++ side, 

Also, in this error message, if you notice, it doesn't fail until line 35, which is pretty far down the script, so that makes me believe that perhaps our Python isn't broken per se, but that perhaps we are missing some dylib file that has the PointToPointHelper::Install function we are missing. Perhaps PointToPoint library is dynamically loading at invocation time in Python and then we are exploding because we can't find the symbol we need. 

image.png

We spent some time googling this issue and didn't find that much, so wanted to query the group and see if anyone else has had such a sighting. 

Gabriel Ferreira

unread,
Apr 18, 2023, 10:58:23 PM4/18/23
to ns-3-users
This is a new issue that appears on Cppyy==3.0.0.
We have fixes for some of these issues in pending merge requests, but for now stay on Cppyy 2.4.3.

Gabriel Ferreira

unread,
Apr 18, 2023, 11:08:17 PM4/18/23
to ns-3-users
Just reported it to the Cppyy maintainer: https://github.com/wlav/cppyy/issues/156

Ashley Tharp

unread,
Apr 21, 2023, 12:17:17 PM4/21/23
to ns-3-users

Hey thanks so much for responding and reporting to the maintainer!! These are fantastic tips and we will try it out with 2.4.3 and report back. Yall are the best. 
Reply all
Reply to author
Forward
0 new messages