0
|
1 .. _compiling:
|
|
2
|
|
3 Compiling Orthanc
|
|
4 =================
|
|
5
|
42
|
6 Under GNU/Linux
|
|
7 ---------------
|
0
|
8
|
|
9 * Orthanc >= 0.7.1: See the `build instructions
|
|
10 <https://bitbucket.org/sjodogne/orthanc/src/default/LinuxCompilation.txt>`_
|
|
11 inside the source package.
|
|
12 * Orthanc <= 0.7.0: See the :ref:`compiling-old`.
|
|
13
|
|
14 Under Microsoft Windows
|
|
15 -----------------------
|
|
16
|
|
17 See the `build instructions for Windows
|
|
18 <https://bitbucket.org/sjodogne/orthanc/src/default/INSTALL>`_ inside
|
|
19 the source package.
|
|
20
|
|
21 Under OS X
|
|
22 ----------
|
|
23
|
|
24 The mainline of Orthanc can compile under Apple OS X, with the XCode
|
|
25 compiler, since June 24th, 2014. See the `build instructions for
|
|
26 Darwin
|
|
27 <https://bitbucket.org/sjodogne/orthanc/src/default/DarwinCompilation.txt>`_
|
|
28 inside the source package.
|
|
29
|
41
|
30 Performance warning
|
|
31 -------------------
|
|
32
|
|
33 If performance is important to you, make sure to add the option
|
|
34 ``-DCMAKE_BUILD_TYPE=Release`` when invoking ``cmake``. Indeed, by
|
|
35 default, `run-time debug assertions
|
|
36 <https://en.wikipedia.org/wiki/Assertion_(software_development)#Assertions_for_run-time_checking>`_
|
|
37 are enabled, which can seriously impact performance, especially if
|
|
38 your Orthanc server stores a lot of DICOM instances.
|
|
39
|
|
40
|
0
|
41
|
|
42 Please explain the build infrastructure
|
|
43 ---------------------------------------
|
|
44
|
|
45 The build infrastructure of Orthanc is based upon `CMake
|
25
|
46 <https://cmake.org/>`_. The build scripts are designed to embed all
|
0
|
47 the third-party dependencies directly inside the Orthanc
|
42
|
48 executable. This is the meaning of the ``-DSTATIC_BUILD=ON`` option,
|
0
|
49 as described in the `INSTALL
|
25
|
50 <https://bitbucket.org/sjodogne/orthanc/src/default/INSTALL>`_ file of Orthanc.
|
0
|
51
|
|
52 Such a static linking is very desirable under Windows, since the
|
|
53 Orthanc binaries do not depend on any external DLL, which results in a
|
|
54 straightforward installation procedure (just download the Windows
|
|
55 binaries and execute them), which eases the setup of the development
|
|
56 machines (no external library is to be manually installed, everything
|
|
57 is downloaded during the build configuration), and which avoids the
|
25
|
58 `DLL hell <https://en.wikipedia.org/wiki/Dll_hell>`_. As a downside,
|
0
|
59 this makes our build infrastructure rather complex.
|
|
60
|
42
|
61 Static linking is not as desirable under GNU/Linux than under
|
|
62 Windows. GNU/Linux prefers software that dynamically links against the
|
0
|
63 system-wide libraries: This is explained by the fact that whenever a
|
|
64 third-party dependency benefits from a bugfix, any software that is
|
|
65 linked against it also immediately benefits from this fix. This also
|
|
66 reduces the size of the binaries as well as the build time. Under
|
42
|
67 GNU/Linux, it is thus recommended to use the ``-DSTATIC_BUILD=OFF``
|
0
|
68 option whenever possible.
|
|
69
|
|
70 When the dynamic build is used, some third-party dependencies may be
|
42
|
71 unavailable or incompatible with Orthanc, depending on your GNU/Linux
|
0
|
72 distribution. Some CMake options have thus been introduced to force
|
|
73 the static linking against some individual third-party
|
|
74 dependencies. Here are the most useful:
|
|
75
|
42
|
76 * ``-DUSE_SYSTEM_DCMTK=OFF`` to statically link against DCMTK.
|
|
77 * ``-DUSE_SYSTEM_JSONCPP=OFF`` to statically link against JsonCpp.
|
0
|
78
|
86
|
79 You will also have to set the ``-DALLOW_DOWNLOADS=ON`` to explicitely
|
|
80 allow the CMake script to download the source code of any required
|
|
81 dependency. The source code of all these dependencies is self-hosted
|
|
82 on the Web server running our official homepage.
|
0
|
83
|
42
|
84 Please also note that the option ``-DSTANDALONE_BUILD=ON`` must be
|
0
|
85 used whenever your plan to move the binaries or to install them on
|
|
86 another computer. This option will embed all the external resource
|
|
87 files (notably Orthanc Explorer) into the resulting executable. If
|
42
|
88 this option is set to ``OFF``, the resources will be read from the
|
0
|
89 source directories.
|
|
90
|
|
91
|
|
92 Missing ``uuid-dev`` package
|
|
93 ----------------------------
|
|
94
|
|
95 Orthanc might fail to compile, complaining about missing ``uuid-dev`` package.
|
|
96
|
|
97 This problem seems to occur when fist building Orthanc without the
|
|
98 ``uuid-dev`` package installed, then installing ``uuid-dev``, then
|
|
99 rebuilding Orthanc. It seems that the build scripts do not update the
|
|
100 cached variable about the presence of ``uuid-dev``.
|
|
101
|
|
102 To solve this problem, `as reported
|
|
103 <https://groups.google.com/d/msg/orthanc-users/hQYulBBvJvs/S1Pm125o59gJ>`_
|
|
104 by Peter Somlo, it is necessary to entirely remove the build directory
|
|
105 (e.g. with ``rm -rf Build``) and start again the build from a fresh
|
|
106 directory.
|