SlicerRt / SlicerRT

Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), structure comparison and morphology, isodose line/surface generation, etc.
https://slicerrt.org
124 stars 60 forks source link

Linux SlicerRT (Plastimatch) build is failed after Slicer ITK 5.3 update #206

Closed MichaelColonel closed 2 years ago

MichaelColonel commented 2 years ago

Plastimatch build is failed after ITK-5.3 upgrade on Linux. CDash shows that Windows build is OK, Linux build is failed!

Problem files:

  1. https://gitlab.com/plastimatch/plastimatch/-/blob/master/src/plastimatch/register/itk_tps.h
  2. https://gitlab.com/plastimatch/plastimatch/-/blob/master/src/plastimatch/standalone/beamdata_gen_gui.cpp
  3. https://gitlab.com/plastimatch/plastimatch/-/blob/master/src/plastimatch/standalone/gamma_gui.cpp

If i understood correctly, the problem is with a itkImageFileReader include. If this include is commented and there are no readers in these files, the compilation finishes without problems.

lassoan commented 2 years ago

You can ask help for these on the ITK forum. Even if you could figure out how to resolve these issues, good advice may help to sort them out quicker. It is also important for ITK developers to be aware if backward-incompatible changes causes headaches for ITK users.

MichaelColonel commented 2 years ago

There was a predefined constant, which conflicts with a POSIX enumeration constant from ITK KWSys Status class. I've made a workaround to prevent a compilation error. ITK forum question.

/// This workaround prevents a compilation fail with ITK-5.3
/// Something defines POSIX in preprocessor, and it conflicts
/// with ITK KWSys POSIX enumeration constant
#if (ITK_VERSION_MAJOR == 5) && (ITK_VERSION_MINOR > 2) && defined(POSIX)
#define PLMPOSIX_TMP (POSIX)
#undef POSIX
#endif

#include "itkImageFileReader.h"

#ifdef PLMPOSIX_TMP
#define POSIX (PLMPOSIX_TMP)
#undef PLMPOSIX_TMP
#endif
MichaelColonel commented 2 years ago

I've made a PR to plastimatch gitlab repository.