Dear Orthanc users and developers,
I’m looking into compiling Orthanc using the Linux Standard Base standard/method. I’m not sure how to perform this.
I’ve installed redhat-lsb on my CentOS machine but didn’t really manage to compile properly with it.
I found this article online https://www.linuxjournal.com/article/7067 and the following man page https://manpages.ubuntu.com/manpages/precise/man1/lsbcc.1.html but I’m afraid I’m not proficient enough to get this going properly.
Anyone had a set of instructions to compile binaries with the LSB option?
Thank you!
Best,
Sylvain
Dear Sylvain,
Here is the exact command-line that is used on our CIS (continuous integration server) to build the release version of Orthanc:
$ cmake ~/Orthanc -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DENABLE_PKCS11=ON -DENABLE_LUA_MODULES=ON -DUSE_LEGACY_LIBICU=ON -DBOOST_LOCALE_BACKEND=icu -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON
For this to work, you’ll have to install the official SDK of LSB (Linux Standard Base), that is available for download at:
http://ftp.linuxfoundation.org/pub/lsb/bundles/released-5.0.0/sdk/
HTH,
Sébastien-
Thank you so much, Sebastien!
Works like a charm for Orthanc :).
I tried the same cmake command for the OrthancWebViewer plugin but I do get an error:
`
[ 56%] Building C object Utilities/gdcmjpeg/12/CMakeFiles/gdcmjpeg12.dir/__/jdshuff.c.o
[ 56%] Built target gdcmjpeg16
[ 56%] Linking C static library …/…/…/bin/libgdcmjpeg12.a
[ 56%] Built target gdcmjpeg12
[ 56%] Linking C static library …/…/…/…/…/bin/libgdcmopenjp2.a
[ 56%] Built target gdcmopenjp2
gmake[4]: *** [Source/MediaStorageAndFileFormat/CMakeFiles/gdcmMSFF.dir/rule] Error 2
gmake[3]: *** [gdcmMSFF] Error 2
make[2]: *** [GDCM-prefix/src/GDCM-stamp/GDCM-build] Error 2
make[1]: *** [CMakeFiles/GDCM.dir/all] Error 2
make: *** [all] Error 2
`
Is there a different set of CMake options?
I used the following toolchain file:
`
-DCMAKE_TOOLCHAIN_FILE=~/OrthancWebViewer/Resources/Orthanc/LinuxStandardBaseToolchain.cmake
`
Thank you!
Best,
Sylvain
The DICOMweb and Web viewer plugins use GDCM >= 3.x, that uses C++11 constructions. Unfortunately, the version of gcc that is bundled in the LSB SDK is very old, and only supports C++11 in an experimental mode. This prevents compiling DICOMweb and Web plugins using the Linux Standard Base.
To compile the DICOMweb and Web viewer plugins, we use Holy Build Box (the resulting binaries are slightly less portable than LSB):
https://github.com/phusion/holy-build-box
The corresponding build scripts can be found in the source repositories:
https://hg.orthanc-server.com/orthanc-webviewer/file/tip/Resources/holy-build-box-compile.sh
https://hg.orthanc-server.com/orthanc-dicomweb/file/tip/Resources/holy-build-box-compile.sh
We are currently working on DICOM transcoding. This work will have the important side-effect of moving the dependency on GDCM within a separate, optional plugin. As a consequence, the DICOMweb and Web viewers plugins will be again compatible with the LSB SDK once Orthanc 1.7.0 is released.
On a side note, the same problem wrt. C++11 holds for the Google Cloud Platform plugin. This is also why the “USE_LEGACY_JSONCPP” and “USE_LEGACY_ICU” must be set to “ON” when compiling the Orthanc core using the LSB SDK.
HTH,
Sébastien-
To add another idea: Open Build Service can compile for CentOS and RHEL as well, and the spec files for Orthanc are already there . May be an option to try?
https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
Thank you Sebastien. The Holy Build Box compile script worked like a charm.
Awesome job!
Thanks again.
Best,
Sylvain
Thank you Axel! I managed to get things going with the Holy Build Box but it’s great to know about this Open Build Service as well!
Best,
Sylvain