Looks like libgdcmMSFF is underlinked with libjpeg. It is easy to expose that issue by add -Wl,--asneeded options to linker options (LDFLAGS:
[ 67%] Linking CXX executable ../../../../bin/gdcmMSFFTests
cd /home/tkloczko/rpmbuild/BUILD/GDCM-3.1.0/x86_64-redhat-linux-gnu/Testing/Source/MediaStorageAndFileFormat/Cxx && /usr/bin/cmake -E cmake_link_script CMakeFiles/gdcmMSFFTests.dir/link.txt --verbose=1
/usr/bin/g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none -O2 -g -DNDEBUG -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin CMakeFiles/gdcmMSFFTests.dir/gdcmMSFFTests.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestAnonymizer.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestDataSetHelper.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestEquipmentManufacturer.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileChangeTransferSyntax1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileChangeTransferSyntax2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileChangeTransferSyntax3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileChangeTransferSyntax4.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileStreamer1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileStreamer2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileStreamer3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileStreamer4.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileStreamer5.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileStreamer6.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileAnonymizer1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileAnonymizer2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileAnonymizer3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileAnonymizer4.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestIconImageFilter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestParseXPATH.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestValidate.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestAnonymizeEvent.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileDerivation.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestSegmentedPaletteColorLookupTable.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestPNMCodec.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestSpacing.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestSerieHelper.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileExplicitFilter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageFragmentSplitter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestTagPath.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestOrientation.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestIconImage.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageHelper.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageToImageFilter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageChangeTransferSyntax1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageChangeTransferSyntax2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageChangeTransferSyntax3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageChangeTransferSyntax4.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageChangeTransferSyntax6.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageChangeTransferSyntax7.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageApplyLookupTable.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFileDecompressLookupTable.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageChangePlanarConfiguration.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestCoder.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestDecoder.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestRescaler1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestRescaler2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestDumper.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestDictPrinter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestApplicationEntity.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestStringFilter1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestStringFilter2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestStringFilter3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestUIDGenerator.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestUUIDGenerator.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestXMLPrinter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestPrinter1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestPrint.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestSorter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageReader.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestStreamImageReader.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageRegionReader1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageRegionReader2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageRegionReader3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageReaderRandomEmpty.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestDirectionCosines.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageWriter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestCodec.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestPDFCodec.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestRLECodec.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestAudioCodec.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImage.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestPhotometricInterpretation.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestLookupTable.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestOverlay.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestOverlay3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestCurve.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestCurve2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestPixelFormat.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestPersonName.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageCodec.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageConverter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestJPEGCodec.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestRAWCodec.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestDICOMDIR.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestWaveform.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestFiducials.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestEncapsulatedDocument.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestSpectroscopy.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestSurfaceWriter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestSurfaceWriter2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestSplitMosaicFilter3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestStrictScanner1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestStrictScanner2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestScanner1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestScanner2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageHelper2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestPrinter2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestIPPSorter.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestIPPSorter2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestIPPSorter3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestCopyDataSet.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestDataElementValueAsSQ.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageWriter2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestDICOMDIRGenerator1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestDICOMDIRGenerator2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestAnonymizer2.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestAnonymizer3.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestJSON1.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestImageChangeTransferSyntax5.cxx.o CMakeFiles/gdcmMSFFTests.dir/TestUIDGenerator2.cxx.o -o ../../../../bin/gdcmMSFFTests -Wl,-rpath,/home/tkloczko/rpmbuild/BUILD/GDCM-3.1.0/x86_64-redhat-linux-gnu/bin ../../../../bin/libgdcmMSFF.so.3.1.0 -lpthread ../../../../bin/libgdcmDICT.so.3.1.0 ../../../../bin/libgdcmIOD.so.3.1.0 ../../../../bin/libgdcmDSED.so.3.1.0 ../../../../bin/libgdcmCommon.so.3.1.0 -Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/GDCM-3.1.0/x86_64-redhat-linux-gnu/bin
/usr/bin/ld: ../../../../bin/libgdcmMSFF.so.3.1.0: undefined reference to JpegLsReadHeader'
/usr/bin/ld: ../../../../bin/libgdcmMSFF.so.3.1.0: undefined reference toJpegLsEncode'
/usr/bin/ld: ../../../../bin/libgdcmMSFF.so.3.1.0: undefined reference to `JpegLsDecode'
collect2: error: ld returned 1 exit status
PS. did you think about move bug tracking system to github as well? It would be good to have everything in one place. SF is really outdated and does not change from long time ..
I doubt this is the case since I can build the entire project using static libs. Care to send the me output when you do:
I'm not sure which one jpe library it is in this case.
Looks like gdcm is using libjpeg-turbo and libopenjp2
BTW I think that it would be good to switch to pkgcongfig based libraries detection like it is in case of libopenjp2.
From my spec file:
[tkloczko@barrel SPECS]$ grep BuildRequires gdcm.spec
BuildRequires: CharLS-devel >= 2.0
BuildRequires: cmake
BuildRequires: dcmtk-devel
BuildRequires: docbook5-style-xsl
BuildRequires: docbook-style-xsl
BuildRequires: doxygen
BuildRequires: expat-devel
BuildRequires: fontconfig-devel
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gl2ps-devel
BuildRequires: graphviz
BuildRequires: json-c-devel
BuildRequires: libogg-devel
BuildRequires: libtheora-devel
BuildRequires: libuuid-devel
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: mesa-libOSMesa-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libopenjp2)
BuildRequires: poppler-devel
BuildRequires: python3-devel
BuildRequires: sqlite-devel
BuildRequires: swig
Almost all devel bits could be detected using pkgconfig and using it will shorten many cmake files.
Last edit: Tomasz Kłoczko 2020-05-13
Great. Feel free to re-open when you can provide the missing bits about CharLS.
What you mean "missing bits about CharLS"?
I gave instructions at:
I suspect something broke with CharLS 2.1. And this variable is not populated. I need to know what happen on your side to know for sure.
Which one variabble?
Loos like none of those variabes has any content.
Here is cmake params and output:
I do not see the string "Full path to JPEG-LS lib:" in the output. It appears you forgot to apply the patch I suggested.
variable is empty which was possible to check looking on "clake -L" output
In CMakeLists.txt is:
To be honet I have no idea how cmake suppose to detect that library if CharLS 2.0.0 and 2.1.0 does not provide any cmake module or pkgconfig library description.
Just checked https://github.com/team-charls/charls/ and yopu can see that there is no any cmake module ior pkgconfig description.
I'm trying to use CharLS 2.1.0 and just checked that CharLS 2.0.0 had not cmake module or pkgconfig description https://github.com/team-charls/charls/tree/2.0.0
gdcm cmake suggests that someone heve been trying to use it against CharLS 2.0.0 but I think that it was not possible to buid it against 2.0.0.
In other words probably it woud be good first to add pkgconfig .pc file for CharLS then it will be possible to detect it.
I've checked SuSE, Debian and few other distributions an none of them provides CharLS with cmake module or pkgcoonfig .pc file
I found some kind of work around for lack of detection of CharLS.
It ispossible to pass CharLS libarry name in "-D CHARLS_LIBRARIES=-lcharls" in cmake parametrs.
However even wiy that it is not possible to build all code because another issue:
And yet another observatiopn: seems like gdcm is using two xml parser libraries (libxml-2.0 and expat).
Any comments/updates? :P
I've closed this one (#404) and kept #405 open to track progress. Thanks for report.
OK. Please let me know if you will habve some new patches for gdcm.
I'm tryig to use latest gdcm version to build latest opencv.
Probably today or tomorrow will try to submit PR for CharLS to add install CharLS.pc file so than it will be possible to detect CharLS using pkgconfig
In mean time I think that trick with passing "-D CHARLS_LIBRARIES=-lcharls" could be used to test gdcm agaoinst latest CharLS :)
Just found yert another small issue in gdcm.
Quote from build log:
If you will have look closer you can fioing in above my CFLAGS which I'm passing to the cmake ev variables:
However looks like gdcm cmake fiels are adding after that own part "-O2 -g -DNDEBUG".
This should be not done that way because it wiill cancel for example trying to complile gdcm with optimisation for size.
When will find where it is added that will try to submit PR to reorder that part.