You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Readme misleads proper loading order of artifacts (header->library) instead of (library->header) #123
importcppjitcppjit.include('zlib.h') # bring in the declarationscppjit.load_library('libz') # load the symbolscppjit.gbl.zlibVersion() # '1.3'; call the library directly
This can cause same "Failure to materialize" issues as in wlav/cppyy#156.
importcppjitcppjit.load_library('libz') # load the symbolscppjit.include('zlib.h') # bring in the declarationscppjit.gbl.zlibVersion() # '1.3'; call the library directly
For ns-3 in particular, we build the library dependency tree (inspecting symbols in the binary). From there we determine the order to load (root library, then first level, second level, etc), then load libraries followed by their respective headers for each library of the simulator.
Before we had a crazy weird workaround that worked who knows why. Something like this in the header
class Time
{
public:
static StaticInit(); // defined in .cpp
};
// broken code did this: would not call Time::StaticInit due to symbol materialization issue
bool g_staticInit = Time::StaticInit();
// workaround code (before I realized I needed to load library before header): calls Time::StaticInit in spite of symbol materialization issue of g_staticInit
class TimeInitHelper
{
public:
TimeInitHelper()
{
Time::StaticInit();
}
};
static TimeInitHelper g_staticInit; // g_staticInit fails to be materialized, but StaticInit is called anyways
Activity
aaronj0 commentedon Oct 6, 2026
Yeah this makes sense. I'll update the README before our next release and address this along with that. Thanks for the report!