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