sst-core icon indicating copy to clipboard operation
sst-core copied to clipboard

Component Not Found Issue in SST Registration + Loading

Open jleidel opened this issue 1 year ago • 3 comments

As discussed at the SST user group meeting, there are often times where external developers working on non SST-Elements derived components/subcomponents encounter Component Not Found errors when attempting to query and/or load elements. This is almost always due to a missing destructor symbol that has not been defined to override the base level component/subcomponent class destructors. We have developed a script that runs when installing Rev via make install that checks for missing symbols. While the script is currently Rev-specific, it would easily be made generic and/or added to standard component development tutorials. This might be something to adapt into the actual loader (dlopen) code within sst-register, sst-info, etc.

The entire script exists as follows:

#!/bin/sh

if ! [ -f "$1" ]; then
   cat>&2 <<EOF
usage: $0 librevcpu.so

Tests for unresolved Rev symbols in shared library
EOF
   exit 1
fi

if ldd -r "$1" 2>&1 | c++filt | grep "\bundefined\b.*\bSST::RevCPU::" >&2; then
    exit 1
else
    exit 0
fi

jleidel avatar Sep 27 '23 01:09 jleidel

The script has been updated to highlight red error message for unresolved symbols on terminals:

https://github.com/tactcomplabs/rev/blob/devel/scripts/test_undefined_symbols.sh

leekillough avatar Sep 27 '23 18:09 leekillough

@jleidel Is this still an issue?

jwilso avatar Mar 28 '24 16:03 jwilso