How to compile Orthanc from source code on Ubuntu Server 22.04 LTS

Post Reply
User avatar
LHammonds
Site Admin
Site Admin
Posts: 1067
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

How to compile Orthanc from source code on Ubuntu Server 22.04 LTS

Post: # 1089Post LHammonds »

------------- WORK-IN-PROGRESS -------------

Space Requirements for Compiling (where it is compiled):
* At least 2 GB free in /root

Space Requirements for DICOM Router (where it is installed):
* Around 30 MB (log and data size not included)

Code: Select all

du -sh /usr/local/sbin/Orthanc /usr/local/share/orthanc /usr/local/bin/OrthancRecoverCompressedFile /usr/local/share/doc/orthanc /usr/local/include/orthanc
Install the prerequisites (listed in alphabetical order):

Code: Select all

sudo apt install build-essential cmake doxygen libboost-all-dev libcharls-dev libcurl4-openssl-dev libdcmtk-dev libgtest-dev libjpeg-dev libjsoncpp-dev liblua5.4-dev libpng-dev libpugixml-dev libsqlite3-dev libssl-dev libwrap0-dev mercurial uuid-dev zlib1g-dev
The following should already be installed on Ubuntu 22.04:

Code: Select all

unzip
python3
locales
Switch to the root user and create the default location for the source code and build:

Code: Select all

sudo su
mkdir -p ~/Orthanc/Build
mkdir -p ~/Orthanc/OrthancServer/ThirdPartyDownloads
Get the latest version of Orthanc from its download page (1.11.1 at the time of this writing).

Code: Select all

wget https://www.orthanc-server.com/downloads/get.php?path=/orthanc/Orthanc-1.11.1.tar.gz -O ~/Orthanc/Orthanc.tar.gz
tar -xzvf ~/Orthanc/Orthanc.tar.gz -C ~/Orthanc --strip-components=1
rm ~/Orthanc/Orthanc.tar.gz
cd ~/Orthanc
Optional - After the 1st time you compile (with auto-download enabled), it will download the following files. The next time you compile, it will not have to download them from the Internet. And if you copy them to a fresh server and compile for the 1st time, it will not need to access the Internet if it finds them already there.

Code: Select all

ls ~/Orthanc/OrthancServer/ThirdPartyDownloads/
boost_1_69_0_bcpdigest-1.5.6.tar.gz
civetweb-1.14-fixed.tar.gz
curl-7.77.0.tar.gz
dcmtk-3.6.6.tar.gz
e2fsprogs-1.44.5.tar.gz
jpegsrc.v9c.tar.gz
jsoncpp-1.9.4.tar.gz
libiconv-1.15.tar.gz
libpng-1.6.36.tar.gz
lua-5.3.5.tar.gz
openssl-3.0.1.tar.gz
pugixml-1.9.tar.gz
sqlite-amalgamation-3270100.zip
zlib-1.2.11.tar.gz
Compile the source code according to the instructions:

Code: Select all

cd ~/Orthanc/Build
cmake -DSTATIC_BUILD=ON -DALLOW_DOWNLOADS=ON -DUSE_SYSTEM_CIVETWEB=OFF -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON -DDCMTK_LIBRARIES=dcmjpls -DCMAKE_BUILD_TYPE=Release ../OrthancServer/
make
make doc
make install
The install copies files to the following locations:

Code: Select all

/usr/local/sbin/Orthanc
/usr/local/share/orthanc/plugins/
/usr/local/bin/OrthancRecoverCompressedFile
/usr/local/share/doc/orthanc/OrthancPlugin/
/usr/local/include/orthanc/OrthancCDatabasePlugin.h
/usr/local/include/orthanc/OrthancCPlugin.h
Post Reply