File: LinuxCompilation.txt

package info (click to toggle)
orthanc 0.8.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,112 kB
  • ctags: 5,342
  • sloc: cpp: 33,492; ansic: 3,770; python: 548; xml: 167; sh: 148; sql: 101; makefile: 44
file content (238 lines) | stat: -rw-r--r-- 7,406 bytes parent folder | download
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
This file is a complement to "INSTALL", which contains instructions
that are specific to Linux.


Static linking for Linux
========================

The most simple way of building Orthanc under 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 all the Linux
distributions.

We make the assumption that Orthanc source code is placed in the
folder "~/Orthanc" and that the binaries will be compiled to
"~/OrthancBuild".


To build binaries with debug information:

# cd ~/OrthancBuild
# cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Debug ~/Orthanc
# make
# make doc


To build a release version:

# cd ~/OrthancBuild
# cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ~/Orthanc
# make
# make doc


Note: When the "STATIC_BUILD" option is set to "ON", the build tool
will not ask you the permission to download packages from the
Internet.


Use system-wide libraries under Linux
=====================================

Under 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 Linux distributions. Because using system libraries is
the default behavior, you just have to use:

# cd ~/OrthancBuild
# cmake -DCMAKE_BUILD_TYPE=Debug ~/Orthanc
# make


However, on some 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 Linux distribution, it is
also sometimes required to fine-tune some options.

You will find below build instructions for specific Linux
distributions. Distributions tagged by "SUPPORTED" are tested by
Sébastien Jodogne. Distributions tagged by "CONTRIBUTED" come from
Orthanc users.


SUPPORTED - Debian Squeeze (6.x)
--------------------------------

# sudo apt-get install build-essential unzip cmake mercurial \
       	       	       uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \
       	       	       libgoogle-glog-dev libpng-dev libgtest-dev \
       	       	       libsqlite3-dev libssl-dev zlib1g-dev

# cmake -DALLOW_DOWNLOADS=ON \
  	-DUSE_SYSTEM_BOOST=OFF \
	-DUSE_SYSTEM_DCMTK=OFF \
	-DUSE_SYSTEM_MONGOOSE=OFF \
	-DUSE_SYSTEM_JSONCPP=OFF \
	-DUSE_SYSTEM_PUGIXML=OFF \
        -DENABLE_JPEG=OFF \
        -DENABLE_JPEG_LOSSLESS=OFF \
	~/Orthanc 


SUPPORTED - Debian Wheezy (7.x)
-------------------------------

# sudo apt-get install build-essential unzip cmake mercurial \
       	       	       uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \
       	       	       libgtest-dev libpng-dev libsqlite3-dev \
       	       	       libssl-dev zlib1g-dev libdcmtk2-dev \
       	       	       libboost-all-dev libwrap0-dev libjsoncpp-dev

# cmake -DALLOW_DOWNLOADS=ON \
        -DUSE_SYSTEM_GOOGLE_LOG=OFF \
	-DUSE_SYSTEM_MONGOOSE=OFF \
        -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \
	-DUSE_SYSTEM_PUGIXML=OFF \
        -DENABLE_JPEG=OFF \
        -DENABLE_JPEG_LOSSLESS=OFF \
	~/Orthanc


SUPPORTED - Debian Jessie/Sid
-----------------------------

# sudo apt-get install build-essential unzip cmake mercurial \
       	       	       uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \
       	       	       libgoogle-glog-dev libgtest-dev libpng-dev \
       	       	       libsqlite3-dev libssl-dev zlib1g-dev libdcmtk2-dev \
                       libboost-all-dev libwrap0-dev libjsoncpp-dev libpugixml-dev

# cmake -DALLOW_DOWNLOADS=ON \
	-DUSE_SYSTEM_MONGOOSE=OFF \
        -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \
        -DDCMTK_LIBRARIES=dcmjpls \
	~/Orthanc

Note: Have also a look at the official package:
http://anonscm.debian.org/viewvc/debian-med/trunk/packages/orthanc/trunk/debian/


SUPPORTED - Ubuntu 12.04 LTS
----------------------------

# sudo apt-get install build-essential unzip cmake mercurial \
       	       	       uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \
       	       	       libgtest-dev libpng-dev libsqlite3-dev libssl-dev \
		       zlib1g-dev libdcmtk2-dev libboost-all-dev libwrap0-dev

# cmake "-DDCMTK_LIBRARIES=wrap;oflog" \
        -DALLOW_DOWNLOADS=ON \
	-DUSE_SYSTEM_MONGOOSE=OFF \
	-DUSE_SYSTEM_JSONCPP=OFF \
	-DUSE_SYSTEM_GOOGLE_LOG=OFF \
	-DUSE_SYSTEM_PUGIXML=OFF \
        -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \
	~/Orthanc


SUPPORTED - Ubuntu 12.10
------------------------

# sudo apt-get install build-essential unzip cmake mercurial \
       	       	       uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \
       	       	       libgoogle-glog-dev libgtest-dev libpng-dev \
       	       	       libsqlite3-dev libssl-dev zlib1g-dev \
       	       	       libdcmtk2-dev libboost-all-dev libwrap0-dev libcharls-dev

With JPEG:

# cmake "-DDCMTK_LIBRARIES=CharLS;dcmjpls;wrap;oflog" \
        -DALLOW_DOWNLOADS=ON \
	-DUSE_SYSTEM_MONGOOSE=OFF \
	-DUSE_SYSTEM_JSONCPP=OFF \
        -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \
	-DUSE_SYSTEM_PUGIXML=OFF \
	~/Orthanc


Without JPEG:

# cmake "-DDCMTK_LIBRARIES=wrap;oflog" \
        -DALLOW_DOWNLOADS=ON \
	-DUSE_SYSTEM_MONGOOSE=OFF \
	-DUSE_SYSTEM_JSONCPP=OFF \
        -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \
	-DUSE_SYSTEM_PUGIXML=OFF \
        -DENABLE_JPEG=OFF \
        -DENABLE_JPEG_LOSSLESS=OFF \
	~/Orthanc


SUPPORTED - Ubuntu 13.10
------------------------

# sudo apt-get install build-essential unzip cmake mercurial \
       	       	       uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \
       	       	       libgoogle-glog-dev libgtest-dev libpng-dev \
       	       	       libsqlite3-dev libssl-dev zlib1g-dev \
       	       	       libdcmtk2-dev libboost-all-dev libwrap0-dev libjsoncpp-dev

# cmake "-DDCMTK_LIBRARIES=wrap;oflog" \
        -DALLOW_DOWNLOADS=ON \
	-DUSE_SYSTEM_MONGOOSE=OFF \
        -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \
	-DUSE_SYSTEM_PUGIXML=OFF \
        -DENABLE_JPEG=OFF \
        -DENABLE_JPEG_LOSSLESS=OFF \
	~/Orthanc



SUPPORTED - Fedora 19/20
------------------------

# sudo yum install make automake gcc gcc-c++ python cmake \
                   boost-devel curl-devel dcmtk-devel glog-devel \
                   gtest-devel libpng-devel libsqlite3x-devel libuuid-devel \
                   mongoose-devel openssl-devel jsoncpp-devel lua-devel pugixml-devel

# cmake  "-DDCMTK_LIBRARIES=CharLS" \
         -DSYSTEM_MONGOOSE_USE_CALLBACKS=OFF \
         ~/Orthanc
       
Note: Have also a look at the official package:
http://pkgs.fedoraproject.org/cgit/orthanc.git/tree/?h=f18





Other Linux distributions?
--------------------------

Please send us your build instructions (by a mail to
s.jodogne@gmail.com)!

You can find build instructions for Orthanc up to 0.7.0 on the
following Wiki page:
https://code.google.com/p/orthanc/wiki/LinuxCompilationUpTo070

These instructions will not work as such beyond Orthanc 0.7.0, but
they might give indications.




Using ccache
============

Under 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 ~/Orthanc [Other Options]