comparison LinuxCompilation.txt @ 634:d775a3cb5a06

refactoring of CMake scripts
author jodogne
date Tue, 29 Oct 2013 10:31:02 +0100
parents
children cd3b60f6e7d4
comparison
equal deleted inserted replaced
633:e207b33216db 634:d775a3cb5a06
1 This file is a complement to "INSTALL", which contains instructions
2 that are specific to Linux.
3
4
5 Static linking for Linux
6 ========================
7
8 The most simple way of building Orthanc under Linux consists in
9 statically linking against all the third-party dependencies. In this
10 case, the system-wide libraries will not be used. The build tool
11 (CMake) will download the sources of all the required packages and
12 automatically compile them. This process should work on all the Linux
13 distributions.
14
15
16 To build binaries with debug information:
17
18 # cd ~/OrthancBuild
19 # cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Debug ~/Orthanc
20 # make
21 # make doc
22
23
24 To build a release version:
25
26 # cd ~/OrthancBuild
27 # cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ~/Orthanc
28 # make
29 # make doc
30
31
32 Note: When the "STATIC_BUILD" option is set to "ON", the build tool
33 will not ask you the permission to download packages from the
34 Internet.
35
36
37 Use system-wide libraries under Linux
38 =====================================
39
40 Under Linux, by default, Orthanc links against the shared libraries of
41 your system (the "STATIC_BUILD" option is set to "OFF"). This greatly
42 speeds up the compilation. This is also required when building
43 packages for Linux distributions. Because using system libraries is
44 the default behavior, you just have to use:
45
46 # cd ~/OrthancBuild
47 # cmake -DCMAKE_BUILD_TYPE=Debug ~/Orthanc
48 # make
49
50
51 However, on some Linux distributions, it is still required to download
52 and static link against some third-party dependencies, e.g. when the
53 system-wide library is not shipped or is outdated. Because of
54 difference in the packaging of the various Linux distribution, it is
55 also sometimes required to fine-tune some options.
56
57 You will find below build instructions for specific Linux
58 distributions. Distributions tagged by "SUPPORTED" are tested by
59 Sébastien Jodogne. Distributions tagged by "CONTRIBUTED" come from
60 Orthanc users.
61
62
63 SUPPORTED - Debian Squeeze (6.0)
64 --------------------------------
65
66 # sudo apt-get install build-essential unzip cmake mercurial \
67 uuid-dev libcurl4-gnutls-dev liblua5.1-0-dev
68
69 # cmake -DALLOW_DOWNLOADS=ON \
70 -DUSE_SYSTEM_BOOST=OFF \
71 -DUSE_SYSTEM_DCMTK=OFF \
72 -DUSE_SYSTEM_MONGOOSE=OFF \
73 -DUSE_SYSTEM_JSONCPP=OFF \
74 ~/Orthanc
75
76
77
78 Other Linux distributions?
79 --------------------------
80
81 Please send us your build instructions (by a mail to
82 s.jodogne@gmail.com)!
83
84 You can find build instructions for Orthanc up to 0.7.0 on the
85 following Wiki page:
86 https://code.google.com/p/orthanc/wiki/LinuxCompilationUpTo070
87
88 These instructions will not work as such beyond Orthanc 0.7.0, but
89 they might give indications.
90
91
92
93
94 Using ccache
95 ============
96
97 Under Linux, you also have the opportunity to use "ccache" to
98 dramatically decrease the compilation time when rebuilding
99 Orthanc. This is especially useful for developers. To this end, you
100 would use:
101
102 # CC="ccache gcc" CXX="ccache g++" cmake ~/Orthanc [Options]