Building Orthanc 1.10.1 on Debian 11

Hi all,
for a project i need the functionality of orthanc-python 4.0 (Orthanc 1.10.1+dfsg-2).

After a try with bookworm repo on a test machine i now need to compile and package both Orthanc and orthanc-python for Debian 11 (i cannot utilize the bookworm repo in production).

Since Debian 11 comes with dcmtk / libdcmtk15 / libdcmtk-dev (v3.6.5-1)

After cloning Debian Med / orthanc · GitLab and positioning to debian/1.10.1+dfsg-2

i removed the 3.6.7 patch

rm debian/patches/dcmtk-3.6.7 
vim debian/patches/series #to remove the line

I am trying to go with dpkg-buildpackage -us -uc

But it fails at Linking CXX executable UnitTests:

[100%] Linking CXX executable UnitTests
/usr/bin/ld: /opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/libOrthancFramework.a(FromDcmtkBridge.cpp.o): in function `Orthanc::FromDcmtkBridge::InitializeCodecs()':
./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp:2316: undefined reference to `DJLSDecoderRegistration::registerCodecs(JLS_UIDCreation, JLS_PlanarConfiguration, bool, bool)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp:2318: undefined reference to `DJLSEncoderRegistration::registerCodecs(unsigned short, unsigned short, unsigned short, unsigned short, bool, unsigned int, bool, JLS_UIDCreation, bool, DJLSCodecParameter::interleaveMode, bool)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp:2324: undefined reference to `DJDecoderRegistration::registerCodecs(E_DecompressionColorSpaceConversion, E_UIDCreation, E_PlanarConfiguration, bool, bool, bool)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp:2326: undefined reference to `DJEncoderRegistration::registerCodecs(E_CompressionColorSpaceConversion, E_UIDCreation, bool, int, int, unsigned int, bool, E_SubSampling, bool, bool, unsigned long, unsigned long, double, double, unsigned long, unsigned long, unsigned long, unsigned long, bool, bool, bool, bool, bool)'
/usr/bin/ld: /opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/libOrthancFramework.a(FromDcmtkBridge.cpp.o): in function `Orthanc::FromDcmtkBridge::FinalizeCodecs()':
./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp:2342: undefined reference to `DJLSDecoderRegistration::cleanup()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp:2344: undefined reference to `DJLSEncoderRegistration::cleanup()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp:2350: undefined reference to `DJDecoderRegistration::cleanup()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp:2352: undefined reference to `DJEncoderRegistration::cleanup()'
/usr/bin/ld: /opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/libOrthancFramework.a(DicomImageDecoder.cpp.o): in function `Orthanc::DicomImageDecoder::Decode(DcmDataset&, unsigned int)':
./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:782: undefined reference to `DJCodecParameter::DJCodecParameter(E_CompressionColorSpaceConversion, E_DecompressionColorSpaceConversion, E_UIDCreation, E_PlanarConfiguration, bool, bool, bool, bool, int, int, unsigned int, bool, E_SubSampling, bool, bool, unsigned long, unsigned long, double, double, unsigned long, unsigned long, unsigned long, unsigned long, bool, bool, bool, bool, bool)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:783: undefined reference to `DJ_RPLossy::DJ_RPLossy(int)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:737: undefined reference to `DJLSRepresentationParameter::DJLSRepresentationParameter(unsigned short, bool)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:739: undefined reference to `DJLSCodecParameter::DJLSCodecParameter(JLS_UIDCreation, JLS_PlanarConfiguration, bool, bool)'
/usr/bin/ld: /opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/libOrthancFramework.a(DicomImageDecoder.cpp.o): in function `DJLSLosslessDecoder::DJLSLosslessDecoder()':
/usr/include/dcmtk/dcmjpls/djcodecd.h:321: undefined reference to `DJLSDecoderBase::DJLSDecoderBase()'
/usr/bin/ld: /usr/include/dcmtk/dcmjpls/djcodecd.h:321: undefined reference to `vtable for DJLSLosslessDecoder'
/usr/bin/ld: /opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/libOrthancFramework.a(DicomImageDecoder.cpp.o): in function `Orthanc::DicomImageDecoder::Decode(DcmDataset&, unsigned int)':
./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:739: undefined reference to `DJLSCodecParameter::~DJLSCodecParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:737: undefined reference to `DJLSRepresentationParameter::~DJLSRepresentationParameter()'
/usr/bin/ld: /opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/libOrthancFramework.a(DicomImageDecoder.cpp.o): in function `DJLSNearLosslessDecoder::DJLSNearLosslessDecoder()':
/usr/include/dcmtk/dcmjpls/djcodecd.h:332: undefined reference to `DJLSDecoderBase::DJLSDecoderBase()'
/usr/bin/ld: /usr/include/dcmtk/dcmjpls/djcodecd.h:332: undefined reference to `vtable for DJLSNearLosslessDecoder'
/usr/bin/ld: /opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/libOrthancFramework.a(DicomImageDecoder.cpp.o): in function `Orthanc::DicomImageDecoder::Decode(DcmDataset&, unsigned int)':
./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:815: undefined reference to `DJDecoderP14SV1::DJDecoderP14SV1()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:783: undefined reference to `DJ_RPLossy::~DJ_RPLossy()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:782: undefined reference to `DJCodecParameter::~DJCodecParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:810: undefined reference to `DJDecoderLossless::DJDecoderLossless()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:805: undefined reference to `DJDecoderProgressive::DJDecoderProgressive()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:800: undefined reference to `DJDecoderSpectralSelection::DJDecoderSpectralSelection()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:795: undefined reference to `DJDecoderExtended::DJDecoderExtended()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:790: undefined reference to `DJDecoderBaseline::DJDecoderBaseline()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:783: undefined reference to `DJ_RPLossy::~DJ_RPLossy()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:782: undefined reference to `DJCodecParameter::~DJCodecParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:739: undefined reference to `DJLSCodecParameter::~DJLSCodecParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:737: undefined reference to `DJLSRepresentationParameter::~DJLSRepresentationParameter()'
/usr/bin/ld: /opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/libOrthancFramework.a(DcmtkTranscoder.cpp.o): in function `Orthanc::DcmtkTranscoder::InplaceTranscode(Orthanc::DicomTransferSyntax&, DcmFileFormat&, std::set<Orthanc::DicomTransferSyntax, std::less<Orthanc::DicomTransferSyntax>, std::allocator<Orthanc::DicomTransferSyntax> > const&, bool)':
./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:147: undefined reference to `DJ_RPLossy::DJ_RPLossy(int)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:147: undefined reference to `DJ_RPLossy::~DJ_RPLossy()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:163: undefined reference to `DJ_RPLossy::DJ_RPLossy(int)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:163: undefined reference to `DJ_RPLossy::~DJ_RPLossy()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:177: undefined reference to `DJ_RPLossless::DJ_RPLossless(int, int)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:177: undefined reference to `DJ_RPLossless::~DJ_RPLossless()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:205: undefined reference to `DJLSRepresentationParameter::DJLSRepresentationParameter(unsigned short, bool)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:205: undefined reference to `DJLSRepresentationParameter::~DJLSRepresentationParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:191: undefined reference to `DJ_RPLossless::DJ_RPLossless(int, int)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:191: undefined reference to `DJ_RPLossless::~DJ_RPLossless()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:195: undefined reference to `DJ_RPLossless::~DJ_RPLossless()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:214: undefined reference to `DJLSRepresentationParameter::~DJLSRepresentationParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:225: undefined reference to `DJLSRepresentationParameter::DJLSRepresentationParameter(unsigned short, bool)'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:225: undefined reference to `DJLSRepresentationParameter::~DJLSRepresentationParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:181: undefined reference to `DJ_RPLossless::~DJ_RPLossless()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:152: undefined reference to `DJ_RPLossy::~DJ_RPLossy()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:167: undefined reference to `DJ_RPLossy::~DJ_RPLossy()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:234: undefined reference to `DJLSRepresentationParameter::~DJLSRepresentationParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:225: undefined reference to `DJLSRepresentationParameter::~DJLSRepresentationParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:191: undefined reference to `DJ_RPLossless::~DJ_RPLossless()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:147: undefined reference to `DJ_RPLossy::~DJ_RPLossy()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:163: undefined reference to `DJ_RPLossy::~DJ_RPLossy()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:205: undefined reference to `DJLSRepresentationParameter::~DJLSRepresentationParameter()'
/usr/bin/ld: ./BuildStaticFramework/./OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp:177: undefined reference to `DJ_RPLossless::~DJ_RPLossless()'
collect2: error: ld returned 1 exit status
make[7]: *** [CMakeFiles/UnitTests.dir/build.make:421: UnitTests] Error 1
make[7]: Leaving directory '/opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/UnitTests-prefix/src/UnitTests-build'
make[6]: *** [CMakeFiles/Makefile2:95: CMakeFiles/UnitTests.dir/all] Error 2
make[6]: Leaving directory '/opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/UnitTests-prefix/src/UnitTests-build'
make[5]: *** [Makefile:149: all] Error 2
make[5]: Leaving directory '/opt/orthanc_source/orthanc/orthanc/BuildStaticFramework/UnitTests-prefix/src/UnitTests-build'
make[4]: *** [CMakeFiles/UnitTests.dir/build.make:133: UnitTests-prefix/src/UnitTests-stamp/UnitTests-build] Error 2
make[4]: Leaving directory '/opt/orthanc_source/orthanc/orthanc/BuildStaticFramework'
make[3]: *** [CMakeFiles/Makefile2:128: CMakeFiles/UnitTests.dir/all] Error 2
make[3]: Leaving directory '/opt/orthanc_source/orthanc/orthanc/BuildStaticFramework'
make[2]: *** [Makefile:152: all] Error 2
make[2]: Leaving directory '/opt/orthanc_source/orthanc/orthanc/BuildStaticFramework'
dh_auto_build: error: cd BuildStaticFramework && make -j1 "INSTALL=install --strip-program=true" returned exit code 2
make[1]: *** [debian/rules:71: override_dh_auto_build] Error 2
make[1]: Leaving directory '/opt/orthanc_source/orthanc/orthanc'
make: *** [debian/rules:20: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

Am i missing something or simply it’s not possible to compile Ortanc 1.10.1 with dcmtk 3.6.5-1?

Thanks in advance
Daniele

Hi all,
with help from a collegue i was able to find a solution:

  1. Reverted the commit: 3a22d6b fix build against DCMTK 3.6.7
  2. In debian/rules re-inserted dcmjpls dcmjpeg dcmimage in the parameter -DORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES (removed in commit: 738fb35 cont)
  3. Built package with DEB_BUILD_OPTIONS=nocheck debuild -us -uc

Hope this helps.