[edit] I also tried using native Python installations (without conda) and various ITK version (4.12, 4.13, 5.0) … all ended with errors under macOS while everything seems to work perfectly with Windows/Linux
Could not find the reason why it doesn’t work on mac …
I do suspect a problem with travis build but to be fair I did not investigate further.
Last ‘problem’ that I’m facing that you may help with concerns the versionning / dependencies requirements. Since I’ve build the module for both ITK 4 & 5, I would like to distribute them through PyPI. I created two versions (4.x and 5.x, one from each branch - yes bad naming of the versions) but pip install fails with ITK 4.13, I do have to force pip install module==4.x …
Does it come from the version numbering ? is there a ‘standard’ way to do this without forcing the upgrade to ITK v5 ?
if someone have an answer it might be a good addition to the external module tuto
I tried to reproduce locally, but I could not reproduce the segfault with a Debug or Release build. @T4mmi Do you observe the segfault with local builds, the TravisCI package, or both?
Inspecting the code, these lines
needs to be changed to:
template <class TInputImage, class TOutputImage>
class ITK_TEMPLATE_EXPORT BinaryThinningImageFilter3D : public ImageToImageFilter<TInputImage, TOutputImage>
The ITK_TEMPLATE_EXPORT is required for correct symbol exports on macOS. It is likely that a missing ITK_TEMPLATE_EXPORT somewhere causes the segfaults that are observed.
Good question and suggestion. I added the following to the external module tutorial:
On the 5.X development branch, set the version= value in setup.py to a pre-release version, i.e. X.YaN, X.YbN, or X.YrcN where X.Y are higher numbers than the versions on the 4.X branch. This will ensure that a user can install the 4.X-based package with pip install itk-mymodule or the 5.X-based package with pip install --pre itk-mymodule.
Please let me know if that is unclear or can be improved.
I tried to reproduce locally, but I could not reproduce the segfault with a Debug or Release build.
I would say good news then ! The problem might come from my setup (sorry for the issues) …
@T4mmi Do you observe the segfault with local builds, the TravisCI package, or both?
I observe it using the TravisCI package (directly and through PyPI) since I did not compile locally the module (I should try it).
The ITK_TEMPLATE_EXPORT is required for correct symbol exports on macOS. It is likely that a missing ITK_TEMPLATE_EXPORT somewhere causes the segfaults that are observed.
Ok, thanks I’ll change that ! ( it’s always good to learn )
On the 5.X development branch, set the version= value in setup.py to a pre-release version, i.e. X.YaN, X.YbN, or X.YrcN where X.Y are higher numbers than the versions on the 4.X branch. This will ensure that a user can install the 4.X-based package with pip install itk-mymodule or the 5.X-based package with pip install --pre itk-mymodule.
Please let me know if that is unclear or can be improved.
That’s perfect !
I didn’t know for the letters that were considered as pre-release version…
Thanks again for your help during this first ITK wrapping
I’ll try to port some of our algorithms to ITK and provide Python modules for wider use.