Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distributed Nifti library is out-of-date and can conflict with more recent versions #117

Open
KrisThielemans opened this issue Sep 30, 2024 · 2 comments

Comments

@KrisThielemans
Copy link
Contributor

I have ITK 5.4 installed via conda, which installs a more recent version of the nifti library, see e.g. https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/NIFTI/src/nifti/niftilib/nifti1.h and https://github.com/NIFTI-Imaging/nifti_clib/commits/master/niftilib/nifti1.h vs https://github.com/KCL-BMEIS/niftyreg/blob/master/reg-io/nifti/nifti1.h.

This causes problems when building our SIRF software that depends on both ITK and NiftyReg such as

/home/kris/devel/install/include/nifti1_io.h:255:10: error: conflicting declaration of C function 'char* nifti_intent_string(int)'
  255 |    char *nifti_intent_string     ( int ii ) ;
      |          ^~~~~~~~~~~~~~~~~~~
/home/kris/miniconda3/envs/cilsirfbuildGTROOT/include/ITK-5.4/nifti1_io.h:249:13: note: previous declaration 'const char* nifti_intent_string(int)'
  249 | char const *nifti_intent_string     ( int ii ) ;

There are a few ways to avoid version conflicts like this:

  • upgrade nifti library here and hope there is no conflict anymore
  • offer to build with extern nifti
  • rename all nifti files and functions in the local version

I suppose the 2nd option is the least painful.

@KrisThielemans
Copy link
Contributor Author

Actually, the 2nd option wouldn't help in my case. ITK distributes nifti include files with the original names, but the libraries are renamed to avoid conflicts (e.g. libITKniftiio-5.4.so).

@KrisThielemans
Copy link
Contributor Author

KrisThielemans commented Sep 30, 2024

Looks like ITK updated its nifti version here InsightSoftwareConsortium/ITK@9c2c9fa, which was first incorporated in ITK 5.3 (released Nov 24, 2022), which is why we didn't see this before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant