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

Synergistic IO dependency fix #1194

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

KrisThielemans
Copy link
Member

@KrisThielemans KrisThielemans commented May 11, 2023

Fixes #622 (I hope)

Currently sits on top of #1166, sorry. but I'll rebase once that's merged to master. i first wanted to see if this would work. It's really only the last commit at the moment)

The synergistic library/executables/tests have now been
adapted for DISABLE_Gadgetron etc.

The work-around in common/utilities.* has therefore been removed.

a job with DISABLE_Gadgetron has been added to GHA

Fixes SyneRBI#622
@KrisThielemans
Copy link
Member Author

now rebased on top of master

@KrisThielemans
Copy link
Member Author

KrisThielemans commented May 30, 2023

When using STIR release, we get when building pystir https://github.com/SyneRBI/SIRF/actions/runs/5073309434/jobs/9112163305?pr=1194#step:8:14957

[ 30%] Building CXX object src/common/CMakeFiles/_pysirf.dir/home/runner/install/share/stir/src/buildblock_registries.cxx.o
/home/runner/install/share/stir/src/buildblock_registries.cxx:23:10: fatal error: stir/SeparableCartesianMetzImageFilter.h: No such file or directory
   23 | #include "stir/SeparableCartesianMetzImageFilter.h"

while with STIR master

ImportError: /home/runner/install/python/sirf/_pysirf.so: undefined symbol: _ZTIN4stir8ExamDataE

which might just be the constructor is the typeinfo structure:

$ c++filt _ZTIN4stir8ExamDataE
typeinfo for stir::ExamData

- removed some superflous include statements
- removed some predeclarations and explicitly include iutilities.h
- add more conditionals to see if certain things can be built
- split csirf library into 2: csirf is now the C++ library, while
cinterface-sirf contains the C wrappers.
This is probably more logical, but also avoids a circular dependency on
ImageDataWrapper (which sits in csyn, but depends on creg etc).
ImageDataWrapper is currently not using in csirf, but only in cinterface-sirf
(i.e. Python/MATLAB)
- remove the option DISABLE_Synergistic when building Python/MATLAB stuff as
disabling it would lead to linking errors (as they need ImageDataWrapper)
@KrisThielemans
Copy link
Member Author

KrisThielemans commented Jun 1, 2023

The above problem is fixed now.

However, I still have a Python problem such as

ImportError: /home/sirfuser/devel/install/python/sirf/_pyreg.so: undefined symbol: deleteTextPrinter

@evgueni-ovtchinnikov deleteTextPrinter is declared in cReg.h, but it is not implemented in cReg*cpp. Is it using the implementation in cstir_tw.cpp? If so, creg depends on cstir, which I then should make explicit in the CMake file.

@evgueni-ovtchinnikov
Copy link
Contributor

Is it using the implementation in cstir_tw.cpp?

Apparently it is - when I do "Go To Definition" on the prototype in cReg.h, Visual Studio shows me the one in cstir_tw.cpp.

cinterface-Reg depends on STIR for TextWriter

Also fix some MATLAB things related to TextWriter (untested)
@KrisThielemans KrisThielemans added this to the 3.5 milestone Jun 1, 2023
@KrisThielemans KrisThielemans marked this pull request as ready for review June 1, 2023 22:33
@KrisThielemans
Copy link
Member Author

@evgueni-ovtchinnikov this is pretty much finished now. I've tried to give descriptive log messages, so maybe that helps in the review. Most important change is that csirf is now split into csirf (C++ lib) and cinterface-sirf (for Python/MATLAB), and same for cReg. I did this for 2 reasons:

  • it's cleaner
  • it also avoids the circular dependency of csirf (actually p/msirf) needing cSyn (for ImageDataWrapper), which needs csirf.

There are a few things that we could still do here:

  • do the same split cinterface-stir and cinterface-gadgetron
  • move iutilities.* (containing C functions for DataHandle) to common (and add it to cinterface-sirf I guess). This is more logical now that we have common. We can then remove the iutilities library (also in Python), but I suppose we'd have to keep it as an empty library until 4.0.
  • rename csirf (again) to common. It is the more logical choice.

These things would be nice, but we could also do them later. Would be cleanest to do the first bullet though (and it's very simple, so I can still do that).

@KrisThielemans KrisThielemans changed the title Synergistic IO fix Synergistic IO dependency fix Jun 1, 2023
@evgueni-ovtchinnikov
Copy link
Contributor

Main comment: I very much welcome suggested changes (thought about them myself, but never attempted for lack of understanding of CMake intricacies), but they look too dramatic to me for 3.5 - should this not go to 4.0?

I need more time to study your PR, for now just one minor comment that cannot wait: frankly, I find cinterface-sirf rather ugly. I would rather use csirf for C interface library and cppsirf for C++ library.

@KrisThielemans KrisThielemans modified the milestones: 3.5, v4.0 Jun 8, 2023
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

Successfully merging this pull request may close these issues.

compilation failure with DISABLE_GADGETRON=ON due to syn_utilities
2 participants