]> Creatis software - gdcm.git/blob - Doc/Website/Installation.html
ENH: Update -Wunused defined all the other -Wunused*
[gdcm.git] / Doc / Website / Installation.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML>
3 <HEAD>
4    <META http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
5    <TITLE>Gdcm source installation</TITLE>
6 </HEAD>
7                                                                                 
8 <BODY>
9                                                                                 
10 <!#######################################################################>
11 <H1>Installing gdcm from sources</H1>
12 <HR size="1"><ADDRESS style="align: right;"></ADDRESS>
13
14 <!###################################>
15 <H2> <A CLASS="anchor" NAME="gdcmRequirements">Requirements</A></H2>
16 <UL>
17 <LI> For the core C++ library you shall need a C++ compiler with the
18     "list" and "map" STL containers.
19     <BR>
20     Gdcm is developped and tested under:
21     <UL>
22     <LI> GNU/linux (gcc 3.2.x)
23     </LI>
24     <LI> Win32/VC++ 6.x
25     </LI>
26     </UL>
27 </LI>
28 <LI> <A HREF="http://www.cmake.org">Cmake</A>
29    is used by gdcm for generating Un*x makefiles or VC++ projects.
30    Grab latest release (at least 2.0.3).
31 </LI>
32 <LI> Optionnaly, for the
33    <A HREF="VtkGdcm.html">VTK wrappers</A>
34    you will additionaly need :
35 </LI>
36 <LI> Optionnaly, for the
37    <A HREF="html.developper/DoxyPythonComplete.html">Python wrappers</A>
38    you will additionaly need :
39    <UL> 
40    <LI> <A HREF="http://www.python.org/2.2.2/">Python version 2.2.x</A>
41    </LI>
42    <LI> <A HREF="http://www.swig.org">Swig</A>
43        at least version 1.3.17x (in order to handle C++ member overloading,
44        shadow classes and static methods)
45        <UL>
46        <LI>Rpms for GNU/linux:
47      <A HREF="http://www.creatis.insa-lyon.fr/rpm/swig13-1.3.17-1.i386.rpm">
48             swig13-1.3.17-1.i386.rpm</A>,
49      <A HREF="http://www.creatis.insa-lyon.fr/rpm/swig13-1.3.17-1.src.rpm">
50             swig13-1.3.17-1.src.rpm</A>.
51        </LI>
52        <LI>for Win32 you shall need to compile 
53             <A HREF="http://www.swig.org/download.html">the sources</A>
54        </LI>
55        </UL>
56    </LI>
57    </UL>
58 </UL>
59
60 <!###################################>
61 <H2> GNU/Linux walkthrough for the impatient bash user</H2>
62 <UL>
63    <LI><TT>cd SOMEWHERE</TT>
64    </LI>
65    <LI><TT>
66      export CVSROOT=:pserver:anonymous@cvs.creatis.insa-lyon.fr:2402/cvs/public
67       </TT>
68    </LI>
69    <LI><TT>cvs login</TT> (at prompt <TT>CVS password</TT>
70        answer with <TT>anonymous</TT>)
71    </LI>
72    <LI><TT>cvs co gdcm</TT>
73    </LI>
74    <LI>[Optional, for test suite]
75       <TT>cvs co gdcmData</TT>
76    </LI>
77    <LI><TT>mkdir gdcmInstall</TT>
78    </LI>
79    <LI><TT>mkdir gdcmBin</TT>
80    </LI>
81    <LI><TT>cd gdcmBin</TT>
82    </LI>
83    <LI><TT>ccmake ../gdcm</TT>
84       <UL>
85       <LI>
86          Toggle and adjust the required options and parameters
87          <BR>
88          (see below for more info)
89       </LI>
90       <LI> hit <TT>c</TT>
91          (a couple times, until no stars appear, in order configure)
92       </LI>
93       <LI> hit <TT>g</TT> (generate makefiles)
94       </LI>
95       <LI> hit <TT>q</TT> (quit ccmake)
96       </LI>
97       </UL>
98    </LI>
99    <LI> <TT>make</TT>
100    </LI>
101    <LI> <TT>make install</TT>
102    </LI>
103    <LI>[Optional] <TT>make test</TT>
104    </LI>
105 </UL>
106
107 <!###################################>
108 <H2> Step by step recompilation</H2>
109 <UL>
110 <LI> Retrieve the
111    <A HREF="Cvs.html">
112           sources of gdcm through cvs</A>
113    and expand them in a source directory that we
114    shall refer as <TT>gdcmSOURCES</TT>.
115 </LI>
116 <LI> Create a compile directory (e.g. <TT>gdcmBin</TT>) that 
117    we shall refer as <TT>gdcmBINARY</TT>.
118 </LI>
119 <LI> [Optional] if you wish to install in a temporary installation
120    directory, create it. We shall refer to this directory
121    as <TT>gdcmINSTALL</TT>.
122 </LI>
123 <LI> Change working directory to <TT>gdcmBINARY</TT>.
124 </LI>
125 <LI> Invoke ccmake (from <TT>gdcmBINARY</TT>) with <TT>gdcmSOURCES</TT>
126    as source directory e.g. <TT>ccmake ../gdcm</TT> on Un*ces or
127    invoke <TT>CMakeSetup</TT> on Win32 and setup the source directory
128    and the compile directory.
129    <BR>
130    Hit <B><TT>c</TT></B> for a first automatic configuration
131   of your platteform.
132 </LI>
133 <LI> Select the options that best suits your needs. Basically this means
134    toggling ON or OFF the following parameters
135    <UL>
136    <LI> <TT>GGDCM_VTK</TT>
137       if you wish to generate the <A HREF="VtkGdcm.html">VTK wrappers</A>.
138       When automatic configuration fails you should manually set up
139       the cmake variable <TT>VTK_DIR</TT>.
140    </LI>
141    <LI> <TT>GDCM_WRAP_PYTHON</TT>
142       if you wish to generate the 
143       <A HREF="html.developper/DoxyPythonComplete.html">Python wrappers</A>.
144    </LI>
145    <LI> <TT>GDCM_DOXYGEN</TT>
146       if you wish to generate the doxygen documentation,
147    </LI>
148    </UL>
149 </LI>
150 <LI> Among the other options, you might consider
151    toggling ON or OFF the following parameters
152    <UL>
153    <LI> <TT>CMAKE_INSTALL_PREFIX</TT>
154       should be set to <TT>gdcmINSTALL</TT>.
155    </LI>
156    <LI> <TT>BUILD_EXAMPLES</TT>
157       if you wish to generate the C++ gdcm examples,
158    </LI>
159    <LI> <TT>BUILD_TESTING</TT>
160       if you wish to generate gdcm test suite. When doing so you will
161       need to
162       <UL>
163       <LI> <A HREF="GdcmDataCvs.html">retrieve gdcmData</A>
164          i.e. the set of Dicom image used in the test suite and
165          expand them in a directory refered as <TT>gdcmDATA</TT>.
166       </LI>
167       <LI> setup cmake <TT>GDCM_DATA_ROOT</TT> to <TT>gdcmDATA</TT>.
168       </LI>
169       </UL>
170    </LI>
171    <LI> <TT>CMAKE_BUILD_TYPE</TT> can be set up to <TT>Debug</TT>
172       if you plan to use your native debugger.
173    </LI>
174    <LI> <TT>CMAKE_CXX_FLAGS</TT> for cautious developpers should be
175       set to
176      <TT>-g -O0 -Wall -W -Wshadow -Wunused -Wno-system-headers -Wno-deprecated
177          -Woverloaded-virtual
178      </TT>
179    </LI>
180    </UL>
181 </LI>
182 <LI>
183    Hit <B><TT>c</TT></B> a couple times until they are no remaining "*"
184    (star character) preceeding the values of the gdcm variables.
185    <BR>
186    If you get warnings about
187    <TT>CMake forcing CMAKE_CXX_FLAGS</TT> (or other compiler variables)
188    simply ignore them and hit <B><TT>e</TT></B> to resume configuration.
189 </LI>
190 <LI>
191    Hit <B><TT>g</TT></B> in order to generate the makefiles (on Un*x)
192    or the workspace and project (on Win32).
193 </LI>
194 <LI>
195    Hit <B><TT>q</TT></B> to exit from <TT>ccmake</TT>.
196 </LI>
197 <LI> On Un*x launch <TT>make</TT>. On Win32 enter the VC++ gdcm.dsw
198    and lauch a <TT>build all</TT>.
199 </LI>
200 </UL>
201
202 <!###################################>
203 <H2>Installation</H2>
204 This is an optional stage for developpers.
205 <BR>
206 On Un*x proceed with the install stage with <TT>make install</TT>.
207
208 <!###################################>
209 <H2>Running the test suite</H2>
210 The impatient can run the full test suite with <TT>make test</TT>.
211 <BR>
212 For the test suite to be effective, you must have set
213 <TT>BUILD_TESTING</TT> to <TT>ON</TT> when configuring <TT>ccmake</TT>.
214 <UL>
215 <LI>
216    <UL>
217    <LI> if you run the tests BEFORE installing then
218       positionate the environment variable <TT>GDCM_DICT_PATH</TT>
219       to <TT>gdcmSOURCES/Dicts</TT>
220       (e.g. <TT>export GDCM_DICT_PATH=$(gdcmSOURCES)/Dicts</TT>)
221    </LI>
222    <LI> if you run the tests AFTER installing then
223       positionate the environment variable <TT>GDCM_DICT_PATH</TT>
224       to <TT>gdcmINSTALL/share</TT>
225       (e.g. <TT>export GDCM_DICT_PATH=$(gdcmINSTALL)/Dicts</TT>)
226    </LI>
227    </UL>
228 </LI>
229 <LI>Assuming your current working directory is <TT>gdcmBINARY</TT>
230    the gdcm tests can be run in three different modes:
231    <OL>
232    <LI> Interactive access by number: run 
233       <TT>./bin/gdcmTests</TT> 
234       and select the number of the test you wish to run.
235    </LI>
236    <LI> Access to a test through it's name : pass the name of the
237       test as an argument to
238       <TT>./bin/gdcmTests</TT> 
239       e.g.
240       <TT>./Test/gdcmTests TestAllEntryVerify</TT>.
241    </LI>
242    <LI> Launch the full test suite : (again we assume the
243       current working directory is <TT>gdcmBINARY</TT>)
244       run <B><TT>ctest</TT></B>. This is equivalent to <TT>make test</TT>.
245       <BR>
246       ctest supports some options (refer to the
247       <A HREF="http://www.cmake.org">CMake documentation</A> 
248       for other options) :
249       <UL>
250       <LI> a verbose mode e.g. <TT>ctest -V</TT>
251       </LI>
252       <LI> argument filtering with regexp e.g. <TT>ctest -R print -V</TT>
253          runs the tests containing "print" in their name and
254          makes a verbose output.
255       </LI>
256       </UL>
257    </LI>
258    </OL>
259 </LI>
260 </UL>
261
262 <HR size="1"><ADDRESS style="align: right;"></ADDRESS>
263                                                                                 
264 </BODY>
265 </HTML>
266