-
Notifications
You must be signed in to change notification settings - Fork 0
/
LinuxCompilation.txt
270 lines (196 loc) · 8.71 KB
/
LinuxCompilation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
This file is a complement to "INSTALL", which contains instructions
that are specific to GNU/Linux.
Static linking for GNU/Linux
============================
The most simple way of building Orthanc under GNU/Linux consists in
statically linking against all the third-party dependencies. In this
case, the system-wide libraries will not be used. The build tool
(CMake) will download the sources of all the required packages and
automatically compile them.
This process should work on any GNU/Linux distribution, provided that a
C/C++ compiler ("build-essential" in Debian-based systems), the Python
interpreter, CMake, the "unzip" system tool, and the development
package for libuuid ("uuid-dev" in Debian) are installed.
We now make the assumption that Orthanc source code is placed in the
folder "~/Orthanc" and that the binaries will be compiled to
"~/Orthanc/Build". To build binaries with debug information:
# cd ./Build
# cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Debug ../OrthancServer/
# make
# make doc
To build a release version:
# cd ./Build
# cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ../OrthancServer/
# make
# make doc
Note 1- When the "STATIC_BUILD" option is set to "ON", the build tool
will not ask you the permission to download packages from the
Internet.
Note 2- If the development package of libuuid was not installed when
first invoking cmake, you will have to manually remove the build
directory ("rm -rf ~/Orthanc/Build") after installing this package,
then run cmake again.
Note 3- To build the documentation, you will have to install doxygen.
Use system-wide libraries under GNU/Linux
=========================================
Under GNU/Linux, by default, Orthanc links against the shared
libraries of your system (the "STATIC_BUILD" option is set to
"OFF"). This greatly speeds up the compilation. This is also required
when building packages for GNU/Linux distributions. Because using
system libraries is the default behavior, you just have to use:
# cd ./Build
# cmake -DCMAKE_BUILD_TYPE=Debug ../OrthancServer
# make
Note that to build the documentation, you will have to install doxygen.
However, on some GNU/Linux distributions, it is still required to
download and static link against some third-party dependencies,
e.g. when the system-wide library is not shipped or is
outdated. Because of difference in the packaging of the various
GNU/Linux distribution, it is also sometimes required to fine-tune
some options.
You will find below build instructions for specific GNU/Linux
distributions. Distributions tagged by "SUPPORTED" are tested by
Sébastien Jodogne. Distributions tagged by "CONTRIBUTED" come from
Orthanc users.
SUPPORTED - Debian Jessie/Sid
-----------------------------
# sudo apt-get install build-essential unzip cmake mercurial patch \
uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \
libgtest-dev libpng-dev libjpeg-dev \
libsqlite3-dev libssl-dev zlib1g-dev libdcmtk2-dev \
libboost-all-dev libwrap0-dev libjsoncpp-dev libpugixml-dev
# cd ./Build
# cmake -DALLOW_DOWNLOADS=ON \
-DUSE_SYSTEM_CIVETWEB=OFF \
-DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \
-DDCMTK_LIBRARIES=dcmjpls \
-DCMAKE_BUILD_TYPE=Release \
../OrthancServer/
# make
Note: Have also a look at the official package:
http://anonscm.debian.org/viewvc/debian-med/trunk/packages/orthanc/trunk/debian/
SUPPORTED - Ubuntu 14.04 LTS
----------------------------
# sudo apt-get install build-essential unzip cmake mercurial patch \
uuid-dev libcurl4-openssl-dev \
libgtest-dev libpng-dev libsqlite3-dev libssl-dev libjpeg-dev \
zlib1g-dev libdcmtk2-dev libboost-all-dev libwrap0-dev \
libcharls-dev libjsoncpp-dev libpugixml-dev
# cd ./Build
# cmake -DALLOW_DOWNLOADS=ON \
-DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \
-DUSE_SYSTEM_BOOST=OFF \
-DUSE_SYSTEM_CIVETWEB=OFF \
-DUSE_SYSTEM_DCMTK=OFF \
-DUSE_SYSTEM_JSONCPP=OFF \
-DUSE_SYSTEM_LUA=OFF \
-DCIVETWEB_OPENSSL_API=1.0 \
-DCMAKE_BUILD_TYPE=Release \
../OrthancServer/
# make
SUPPORTED - Ubuntu 16.04 LTS
----------------------------
# sudo apt-get install build-essential unzip cmake mercurial patch \
uuid-dev libcurl4-openssl-dev liblua5.3-dev \
libgtest-dev libpng-dev libsqlite3-dev libssl-dev libjpeg-dev \
zlib1g-dev libdcmtk-dev libboost-all-dev libwrap0-dev \
libcharls-dev libjsoncpp-dev libpugixml-dev tzdata
# cd ./Build
# cmake -DALLOW_DOWNLOADS=ON \
-DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \
-DUSE_SYSTEM_CIVETWEB=OFF \
-DCIVETWEB_OPENSSL_API=1.0 \
-DDCMTK_LIBRARIES=dcmjpls \
-DCMAKE_BUILD_TYPE=Release \
../OrthancServer/
# make
NB: Instructions to use clang and ninja:
# sudo apt-get install ninja-build
# cd ./Build
# CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -G Ninja \
-DALLOW_DOWNLOADS=ON \
-DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \
-DUSE_SYSTEM_CIVETWEB=OFF \
-DDCMTK_LIBRARIES=dcmjpls \
-DCMAKE_BUILD_TYPE=Release \
../OrthancServer/
# ninja
SUPPORTED - Ubuntu 18.04 LTS
----------------------------
# sudo apt-get install build-essential unzip cmake mercurial patch \
uuid-dev libcurl4-openssl-dev liblua5.3-dev \
libgtest-dev libpng-dev libsqlite3-dev libssl-dev libjpeg-dev \
zlib1g-dev libdcmtk-dev libboost-all-dev libwrap0-dev \
libcharls-dev libjsoncpp-dev libpugixml-dev locales
# cd ./Build
# cmake -DALLOW_DOWNLOADS=ON \
-DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \
-DUSE_SYSTEM_CIVETWEB=OFF \
-DDCMTK_LIBRARIES=dcmjpls \
-DCMAKE_BUILD_TYPE=Release \
../OrthancServer/
# make
NB: A suitable environment for locales can be setup as follows:
# echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
# locale-gen
SUPPORTED - Fedora 20-22
------------------------
# sudo yum install unzip make automake gcc gcc-c++ python cmake \
boost-devel curl-devel dcmtk-devel \
gtest-devel libpng-devel libsqlite3x-devel libuuid-devel jpeg-devel \
mongoose-devel openssl-devel jsoncpp-devel lua-devel pugixml-devel
You will also have to install "gflags-devel" on Fedora 21&22:
# sudo yum install gflags-devel
# cd ./Build
# cmake "-DDCMTK_LIBRARIES=CharLS" \
-DCIVETWEB_OPENSSL_API=1.0 \
-DENABLE_CIVETWEB=OFF \
-DSYSTEM_MONGOOSE_USE_CALLBACKS=OFF \
-DCMAKE_BUILD_TYPE=Release \
../OrthancServer/
# make
Note: Have also a look at the official package:
http://pkgs.fedoraproject.org/cgit/orthanc.git/tree/?h=f18
SUPPORTED - FreeBSD 10.1
------------------------
# pkg install jsoncpp pugixml lua51 curl googletest dcmtk cmake jpeg \
e2fsprogs-libuuid boost-libs sqlite3 python libiconv
# cd ./Build
# cmake -DALLOW_DOWNLOADS=ON \
-DUSE_SYSTEM_CIVETWEB=OFF \
-DDCMTK_LIBRARIES="dcmdsig;charls;dcmjpls" \
-DCMAKE_BUILD_TYPE=Release \
../OrthancServer/
# make
Other GNU/Linux distributions?
------------------------------
Don't hesitate to send us your build instructions (by a mail to
s.jodogne@orthanc-labs.com)!
The file "./Resources/OldBuildInstructions.txt" contains build
instructions that once worked for older versions of Orthanc or older
GNU/Linux distributions, but are not tested anymore. Even if they may
not work anymore as such, they can serve as a basis.
You can find build instructions for Orthanc up to 0.7.0 on the
following Wiki page:
https://book.orthanc-server.com/faq/compiling-old.html
These instructions will not work as such beyond Orthanc 0.7.0, but
they might give indications.
Additional information
----------------------
* It has been reported that distributions coming with Boost >= 1.70.0
might need the option "-DBoost_NO_BOOST_CMAKE=ON" to be added to the
"cmake" command line.
https://groups.google.com/d/msg/orthanc-users/nXq2qOndw9c/0PGnaOqiAgAJ
* Starting with Orthanc 1.10.0, if you use a distribution with an old
version of gcc (typically gcc 4.8 on CentOS), you might have to add
the option "-DCMAKE_CXX_FLAGS=-std=c++11" when invoking the "cmake"
command line. This flag was previously automatically added, but this
feature was removed according to the following discussion:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000222
Using ccache
============
Under GNU/Linux, you also have the opportunity to use "ccache" to
dramatically decrease the compilation time when rebuilding
Orthanc. This is especially useful for developers. To this end, you
would use:
# CC="ccache gcc" CXX="ccache g++" cmake ../OrthancServer/ [Other Options]