1Orthanc - A Lightweight, RESTful DICOM Server 2============================================= 3 4 5Dependencies 6------------ 7 81) CMake: Orthanc uses CMake (http://www.cmake.org/) to automate its 9 building process. 10 112) Python: Some code is autogenerated through Python 12 (http://www.python.org/). 13 143) Mercurial: To use the cutting edge code, a Mercurial client must be 15 installed (http://mercurial.selenic.com/). We recommend TortoiseHg. 16 17W) 7-Zip: For the native build under Windows, the 7-Zip tool is used 18 to uncompress the third-party packages (http://www.7-zip.org/). 19 20You thus have to download and install CMake, Python, Mercurial and 21possibly 7-Zip first. The path to their executable must be in the 22"PATH" environment variable. 23 24The other third party dependencies are automatically downloaded by the 25CMake scripts. The downloaded packages are stored in the 26"ThirdPartyDownloads" directory. 27 28 29Building Orthanc at a glance 30---------------------------- 31 32To build Orthanc, you must: 33 341) Download the source code (either using Mercurial, or through the 35 official releases). For the examples below, we assume the source 36 directory is "~/Orthanc". 37 382) Create a build directory. For the examples below, we assume the 39 build directory is "~/Orthanc/Build". 40 413) Depending on your platform, follow the build instructions below. 42 43 44WARNING 1: If you do not create a fresh "~/Orthanc/Build" directory 45after upgrading the source code (i.e. if you reuse the build directory 46that was used to build a different version of Orthanc), the build 47might fail because of changes in the compilation/linking flags. Always 48prefer to force a re-build in a new directory. 49 50WARNING 2: If cmake complains about not being able to uncompress 51third-party dependencies, delete the "~/Orthanc/ThirdPartyDownloads/" 52folder, then restart cmake. 53 54WARNING 3: If performance is important to you, make sure to add the 55option "-DCMAKE_BUILD_TYPE=Release" when invoking cmake. Indeed, by 56default, run-time debug assertions are enabled, which can seriously 57impact performance, especially if your Orthanc server stores a lot of 58DICOM instances. 59 60 61Native GNU/Linux Compilation 62---------------------------- 63 64See the file "LinuxCompilation.txt". 65 66 67Native OS X Compilation 68----------------------- 69 70See the file "DarwinCompilation.txt". 71 72 73 74Native Windows build with Microsoft Visual Studio 2008 75------------------------------------------------------ 76 77# cd [...]\Orthanc\Build 78# cmake -DSTANDALONE_BUILD=ON -DSTATIC_BUILD=ON -DALLOW_DOWNLOADS=ON \ 79 -DUSE_LEGACY_JSONCPP=ON -G "Visual Studio 9 2008" [...]\OrthancServer 80 81Then open the "[...]\Orthanc\Build\Orthanc.sln" with Visual Studio. 82 83NOTES: 84* More recent versions of Visual Studio than 2008 should also 85 work. Type "cmake" without arguments to have the list of generators 86 that are available on your computer. 87* You will have to install the Platform SDK (version 6 or above) for 88 Visual Studio 2005: 89 http://en.wikipedia.org/wiki/Microsoft_Windows_SDK. 90 Read the CMake FAQ: http://goo.gl/By90B 91* The "-DUSE_LEGACY_JSONCPP=ON" must be set for versions of 92 Visual Studio that do not support C++11 93 94 95Orthanc as compiled above will not work properly with some Asian 96encodings (unit tests will fail). In international setups, you can 97compile Orthanc together with ICU as follows: 98 99# cmake -DSTANDALONE_BUILD=ON -DSTATIC_BUILD=ON -DALLOW_DOWNLOADS=ON \ 100 -DBOOST_LOCALE_BACKEND=icu -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON \ 101 -G "Visual Studio 9 2008" [...]\Orthanc 102 103 104 105Native Windows build with Microsoft Visual Studio 2015, Ninja and QtCreator 106--------------------------------------------------------------------------- 107 108Open a Visual Studio 2015 x64 Command Prompt. 109 110# cd [...]\Orthanc\Build 111# cmake -G Ninja -DSTATIC_BUILD=ON [...]\OrthancServer 112# ninja 113 114Then, you can open an existing project in QtCreator: 115* Select the CMakeLists.txt in [...]\OrthancServer 116* Import build from [...]\Build 117 118 119Instructions to include support for Asian encodings: 120 121# cmake -G Ninja -T host=x64 -DSTATIC_BUILD=ON -DBOOST_LOCALE_BACKEND=icu [...]\OrthancServer 122 123The option "-T host=x64" is necessary to prevent error "C1060: 124compiler is out of heap space" when compiling Orthanc with ICU. 125 126 127Native 64-bit Windows build with Microsoft Visual Studio 2017 (msbuild) 128----------------------------------------------------------------------- 129# cd [...]\Build 130# cmake -G "Visual Studio 15 2017 Win64" -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON [...]\OrthancServer 131 132Instructions to include support for Asian encodings: 133# cmake -G "Visual Studio 15 2017 Win64" -T host=x64 -DSTATIC_BUILD=ON -DBOOST_LOCALE_BACKEND=icu -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON [...]\OrthancServer 134 135 136Native 64-bit Windows build with Microsoft Visual Studio 2019 (msbuild) 137----------------------------------------------------------------------- 138# cd [...]\Build 139# cmake -G "Visual Studio 16 2019" -A x64 -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON [...]\OrthancServer 140 141Instructions to include support for Asian encodings: 142# cmake -G "Visual Studio 16 2019" -A x64 -T host=x64 -DSTATIC_BUILD=ON -DBOOST_LOCALE_BACKEND=icu -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON [...]\OrthancServer 143 144 145Cross-Compilation for Windows under GNU/Linux 146--------------------------------------------- 147 148Some versions of MinGW-W64 might have problems with C++11 (notably 149those shipped in Ubuntu 16.04 LTS, in the "mingw-w64" package). Use 150the following command to disable C++11: 151 152# cd ~/Orthanc/Build 153# cmake ../OrthancServer \ 154 -DCMAKE_BUILD_TYPE=Debug \ 155 -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGW-W64-Toolchain32.cmake \ 156 -DSTANDALONE_BUILD=ON \ 157 -DSTATIC_BUILD=ON \ 158 -DUSE_LEGACY_JSONCPP=ON 159# make 160 161NB: Use the toolchain "MinGW-W64-Toolchain64.cmake" to produce 64bit 162Windows binaries. 163 164 165 166Legacy MinGW32 compilers (notably those shipped in Ubuntu 14.04 LTS, 167in the "mingw32" package) are incompatible with DCMTK 3.6.2 and 168C++11. Use the following command to force using DCMTK 3.6.0 and 169disable C++11: 170 171# cd ~/Orthanc/Build 172# cmake ../OrthancServer \ 173 -DCMAKE_BUILD_TYPE=Debug \ 174 -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGWToolchain.cmake \ 175 -DSTANDALONE_BUILD=ON \ 176 -DSTATIC_BUILD=ON \ 177 -DDCMTK_STATIC_VERSION=3.6.0 \ 178 -DUSE_LEGACY_JSONCPP=ON 179# make 180