Loadable module crashing binary Slicer

I have an error with my loadable module. I’ve built the Slicer stable version (revision 26489) and I’ve built my module against it without errors. The module works as intended when I launch the built Slicer version. However, if I try to launch module with the binary Slicer release (downloaded from the website, the 4.8.0 version - same as the built revision) the Slicer crashes before opening and I get the following error:
“terminate called after throwing an instance of ‘H5::DataSpaceIException’”

Has anyone encountered such an error and do you know how to fix it? I’m using Slicer on Linux.

Best regards,
Kristjan

Generally speaking, mixing self-built binaries with slicer.org packaged versions is not supported (for any OS). The linux factory runs a relatively old OS and compiler suite in order to maximize system library compatibility, which means there can easily be ABI mismatches if you build with newer default compilers. You can see the factory version information here.

Given the error message, the specific problem might be mixing different HDF5 libraries in the same process, which is unlikely to work due to e.g. mismatched allocators (and other possible problems).

1 Like

If your extension is open-source then you can submit it to the Slicer extension index and Slicer factory machines will build it for you on all platforms and make available for download through the extension manager.

If it’s a proprietary module, then you have to distribute your custom extension along with your custom-built Slicer. You can include your extension in the Slicer package (so that you have a single installer) and can set custom application name, settings, etc. (see full set of customization options here).

1 Like

I think that’s a good idea and I will submit it to Slicer extension index.

A different question on that regard - my module depends on Segment Comparison Module from Slicer RT extension. I can change the cmake files so that it builds on my machine, but I don’t know how to do it properly so it can also be build anywhere. Do you have maybe an example that I could follow?

Extension dependencies can be set in the main CMakeLists file, for example

The factory machines do the building properly, and when someone installs your extension (in Extension Manager) that depends on another, dependent extensions are automatically installed too.

Expecting people to manually build everything is not reasonable anyway, so if your module is not in an extension yet, then it’s time to make one.
If for some reason you don’t want to do that, you can create packages yourself by building the “package” project. It generates a zip file that you can install from Extension Manager using a menu option under the wrench icon next to the search bar.

I’ve made changes to CMakeList file to include SlicerRT, however I still get error when compiling:

/usr/bin/ld: cannot find -lplmsys
/usr/bin/ld: cannot find -lplmbase
/usr/bin/ld: cannot find -ldevillard
/usr/bin/ld: cannot find -lnkidecompress
/usr/bin/ld: cannot find -lplmutil
/usr/bin/ld: cannot find -lspecfun
/usr/bin/ld: cannot find -lplmdose
/usr/bin/ld: cannot find -llbfgs
/usr/bin/ld: cannot find -lplmregister

Which I guess are the missing plastimatch libraries? My CMake knowledge is pretty poor, so I don’t know how to change the CMakeList file to include the missing libraries.

If I understand correctly what you are trying to do, there should be no need to link with those libraries. You should only need to link with the SlicerRT shared libraries.

How did you get the list of library dependencies?

The list of library dependencies shows when I run the make command.
Maybe my two CMakeLists files will help. Here is the main one:

And the one in Logic subfolder, where the SegementationComparision module is needed: