I tried install using the zipped file generated by make package. I also tried copy the libs to slicer related folder but I get the same error.
Just checked now, they only work using Slicer-build/Slicer but not the installed binary Slicer. What should I do to make them works in the binary as they used to do.
Your build seems to be ABI incompatible with the official Slicer build binaries.
If you are lucky then you may be able to create an ABI-compatible library on a different computer, if you use exactly the same build environment and libraries, but practically you can only ensure compatibility if you build Slicer core and all extensions on the same computer. It can be your computer - for private distributions; or the Slicer build machines - for public distribution.
I don’t understand, what changed? the extension works before, why I have this incompatibility now with the new build that supposed to be the same as the binary 4.8.1? I thought Cmake take care of these things. I also tested with skipping RPATH but I get the same error.
Thank Jean for the info.
I modify SuperBuild/External_ITKv4.cmake to enable make ITKV3_Compatibility. I also enabled the related module in ITKv4-build then rebuilt Slicer. After that, I rebuilt the extension but I got this error
You should not have to modify the ITKV3_Compatibility option of Slicer. Instead, it should be possible to update your extension code to note use any legacy code. This is definitively the way forward.
How are you building your Slicer extension ?
Could you confirm you do something like this:
mkdir my-extension-build
cd my-extension-build
cmake -DSlicer_DIR:PATH=/path/to/Slicer-Superbuild/Slicer-build ../my-extension-src
make
In the my-extension-build/CMakeCache.txt of your extension, what is the value for ITK_DIR ? It should be /path/to/Slicer-Superbuild/ITKv4-build
You are right. I will try to update the code and rebuild again. It is just not clear why it works before and not working now.
I build the extension the same way you mentioned. I checked CMakeCashe.txt , ITK_DIR uses my Slicer-build/ITKv4-build
Update:
I package my Slicer build using
Slicer-build/make package
I installed extensions from Slicer but it does not work. Looks like the build is incompatible as @lassoan mentioned. I rebuild again but the problem is still there.
What could possible gone wrong? I am using the source code for the same binary revision 4.8.1 using the same tools versions as mentioned in the instruction web-page e.g. Qt4.8.7.
There is no problem with the locally built extensions and the locally Slicer. The problem is with the extensions built locally with the binary Slicer downloaded from Slicer website.
Today, I built Slicer in 2 different machines (Ubuntu 16). I got the same error. So probably there is something wrong with the source or there is something installed affect the build.
I will make a clean install of Ubuntu 16 and try again. Is there a away to test the ABI incompatibility without building and testing the extensions?
no problem with the locally built extensions and the locally Slicer
Great
summary
problem is with the extensions built locally with the binary Slicer downloaded from Slicer website
Could you indicate which binary you downloaded (version of Slicer)
I built Slicer in 2 different machines (Ubuntu 16). I got the same error. So probably there is something wrong with the source or there is something installed affect the build.
To clarify, you build locally Slicer on two different machine:
local machine 1 (Ubuntu 16)
local machine 2 (Ubuntu 16)
Then, you locally built your extension on machine 1 and created a package from it (using make package)
Finally, you copied the packaged created on machine 1 onto machine 2.
Could you indicate which binary you downloaded (version of Slicer)
The stable version. Slicer 4.8.1 r26813. I thought by building the source of the same revision in release mode, I will get a compatible build.
To clarify …
Everything is as you mentioned expect I am trying to run the locally build extension using the downloaded binary above.
In each machine I did:
build Slicer r26813 in release mode.
build the extension in release mode using the same build and packaged it.
downloaded Slicer 4.8.1 and install the plugin using “install from a file” method.
When I run the extension the error “undefined symbol” appeared.
Do you have itk locally installed on any of the machine ?
All the machines has ITK locally build and installed (in addition to the one in Slicer superbuild).
It may be useful to try running the application setting the LD_DEBUG env variable.
Running LD_DEBUG=symbol ~/mySlicerBinaryPath/Slicer – launch ./my_cli some_argument 2> LD_DEBUG_Output.txt produced thousands of lines, large part of the output is missing in the txt file.
Update
Tried a Slicer build using qt4t easy. I tested after the build, still not compatible.
If anyone was able to build a compatible Slicer version in Ubuntu 16.04, I would like to know how he did it.
I think the source is not the same. I noticed there is a small change in the “about window” (one has the date in the second line while the other has not). As I have number of ITK extensions don’t work, probably the ITK version or the ITK configuration is different?
one has the date in the second line while the other has not
This is normal, to build a release that do not include the date, you would have to set the option -DSlicer_RELEASE_TYPE:STRING=Stable. See ReleaseProcess checklist.
But the impact is only cosmetic.
If anyone was able to build a compatible Slicer
You can not build extension using Ubuntu 16.04 and expect them to be compatible with the Slicer 4.8.1 release.
Indeed, the Slicer 4.8.1 release was done using Ubuntu 10.04.
Considering it is not possible to install such an old distribution, there is we now docker images allowing to reproduce builds.
Following this guide will allow you to build your extension and have it working with the Slicer 4.8.1 Linux release.
Why not using the last stable Ubuntu i.e. 16.04 instead of Ubuntu 10.04? with the script above, I was able to build Slicer without any problem in different machines including virtualbox machine. I will try the docker approach as well.
To ensure the generated binaries can run a broad set of linux distribution, it is important to use an older distribution requiring an older version of GLIBC and GLIBCXX .
For the upcoming release depending on qt5, we will use centos7
Great. Wait until tomorrow, updated images are being generated and should be available on dockerhub shortly. The current ubuntu1004-gcc4 has gcc version 4.4.3 but Slicer binaries were generated with gcc 4.6. See here
I just tried it, it was some how complicated because I am trying to get the concept of the docker and there was was some problems regarding permissions and c++ code in my extensions but finally it works now . Thanks for your effort.
I hope, I am not asking too much maybe in the future, it is much simpler if you provide an actual build of some popular Linux systems using the recent stable version as everything can be done automatically via scripting. Some download statistics can help in deciding this based on which operating systems the downloaders use.