1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <META http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
5 <TITLE>Gdcm source installation</TITLE>
10 <!#######################################################################>
11 <H1>Installing gdcm from sources</H1>
12 <HR size="1"><ADDRESS style="align: right;"></ADDRESS>
14 <!###################################>
15 <H2> <A CLASS="anchor" NAME="gdcmRequirements">Requirements</A></H2>
17 <LI> For the core C++ library you shall need a C++ compiler with the
18 "list" and "map" STL containers.
20 Gdcm is developped and tested under:
22 <LI> GNU/linux (gcc 3.2.x)
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).
32 <LI> Optionnaly, for the
33 <A HREF="VtkGdcm.html">VTK wrappers</A>
34 you will additionaly need :
36 <LI> Optionnaly, for the
37 <A HREF="html.developper/DoxyPythonComplete.html">Python wrappers</A>
38 you will additionaly need :
40 <LI> <A HREF="http://www.python.org/2.2.2/">Python version 2.2.x</A>
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)
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>.
52 <LI>for Win32 you shall need to compile
53 <A HREF="http://www.swig.org/download.html">the sources</A>
60 <!###################################>
61 <H2> GNU/Linux walkthrough for the impatient bash user</H2>
63 <LI><TT>cd SOMEWHERE</TT>
66 export CVSROOT=:pserver:anonymous@cvs.creatis.insa-lyon.fr:2402/cvs/public
69 <LI><TT>cvs login</TT> (at prompt <TT>CVS password</TT>
70 answer with <TT>anonymous</TT>)
72 <LI><TT>cvs co gdcm</TT>
74 <LI>[Optional, for test suite]
75 <TT>cvs co gdcmData</TT>
77 <LI><TT>mkdir gdcmInstall</TT>
79 <LI><TT>mkdir gdcmBin</TT>
81 <LI><TT>cd gdcmBin</TT>
83 <LI><TT>ccmake ../gdcm</TT>
86 Toggle and adjust the required options and parameters
88 (see below for more info)
91 (a couple times, until no stars appear, in order configure)
93 <LI> hit <TT>g</TT> (generate makefiles)
95 <LI> hit <TT>q</TT> (quit ccmake)
101 <LI> <TT>make install</TT>
103 <LI>[Optional] <TT>make test</TT>
107 <!###################################>
108 <H2> Step by step recompilation</H2>
112 sources of gdcm through cvs</A>
113 and expand them in a source directory that we
114 shall refer as <TT>gdcmSOURCES</TT>.
116 <LI> Create a compile directory (e.g. <TT>gdcmBin</TT>) that
117 we shall refer as <TT>gdcmBINARY</TT>.
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>.
123 <LI> Change working directory to <TT>gdcmBINARY</TT>.
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.
130 Hit <B><TT>c</TT></B> for a first automatic configuration
133 <LI> Select the options that best suits your needs. Basically this means
134 toggling ON or OFF the following parameters
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>.
141 <LI> <TT>GDCM_WRAP_PYTHON</TT>
142 if you wish to generate the
143 <A HREF="html.developper/DoxyPythonComplete.html">Python wrappers</A>.
145 <LI> <TT>GDCM_DOXYGEN</TT>
146 if you wish to generate the doxygen documentation,
150 <LI> Among the other options, you might consider
151 toggling ON or OFF the following parameters
153 <LI> <TT>CMAKE_INSTALL_PREFIX</TT>
154 should be set to <TT>gdcmINSTALL</TT>.
156 <LI> <TT>BUILD_EXAMPLES</TT>
157 if you wish to generate the C++ gdcm examples,
159 <LI> <TT>BUILD_TESTING</TT>
160 if you wish to generate gdcm test suite. When doing so you will
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>.
167 <LI> setup cmake <TT>GDCM_DATA_ROOT</TT> to <TT>gdcmDATA</TT>.
171 <LI> <TT>CMAKE_BUILD_TYPE</TT> can be set up to <TT>Debug</TT>
172 if you plan to use your native debugger.
174 <LI> <TT>CMAKE_CXX_FLAGS</TT> for cautious developpers should be
176 <TT>-g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter
177 -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated
184 Hit <B><TT>c</TT></B> a couple times until they are no remaining "*"
185 (star character) preceeding the values of the gdcm variables.
187 If you get warnings about
188 <TT>CMake forcing CMAKE_CXX_FLAGS</TT> (or other compiler variables)
189 simply ignore them and hit <B><TT>e</TT></B> to resume configuration.
192 Hit <B><TT>g</TT></B> in order to generate the makefiles (on Un*x)
193 or the workspace and project (on Win32).
196 Hit <B><TT>q</TT></B> to exit from <TT>ccmake</TT>.
198 <LI> On Un*x launch <TT>make</TT>. On Win32 enter the VC++ gdcm.dsw
199 and lauch a <TT>build all</TT>.
203 <!###################################>
204 <H2>Installation</H2>
205 This is an optional stage for developpers.
207 On Un*x proceed with the install stage with <TT>make install</TT>.
209 <!###################################>
210 <H2>Running the test suite</H2>
211 The impatient can run the full test suite with <TT>make test</TT>.
213 For the test suite to be effective, you must have set
214 <TT>BUILD_TESTING</TT> to <TT>ON</TT> when configuring <TT>ccmake</TT>.
218 <LI> if you run the tests BEFORE installing then
219 positionate the environment variable <TT>GDCM_DICT_PATH</TT>
220 to <TT>gdcmSOURCES/Dicts</TT>
221 (e.g. <TT>export GDCM_DICT_PATH=$(gdcmSOURCES)/Dicts</TT>)
223 <LI> if you run the tests AFTER installing then
224 positionate the environment variable <TT>GDCM_DICT_PATH</TT>
225 to <TT>gdcmINSTALL/share</TT>
226 (e.g. <TT>export GDCM_DICT_PATH=$(gdcmINSTALL)/Dicts</TT>)
230 <LI>Assuming your current working directory is <TT>gdcmBINARY</TT>
231 the gdcm tests can be run in three different modes:
233 <LI> Interactive access by number: run
234 <TT>./bin/gdcmTests</TT>
235 and select the number of the test you wish to run.
237 <LI> Access to a test through it's name : pass the name of the
238 test as an argument to
239 <TT>./bin/gdcmTests</TT>
241 <TT>./Test/gdcmTests TestAllEntryVerify</TT>.
243 <LI> Launch the full test suite : (again we assume the
244 current working directory is <TT>gdcmBINARY</TT>)
245 run <B><TT>ctest</TT></B>. This is equivalent to <TT>make test</TT>.
247 ctest supports some options (refer to the
248 <A HREF="http://www.cmake.org">CMake documentation</A>
251 <LI> a verbose mode e.g. <TT>ctest -V</TT>
253 <LI> argument filtering with regexp e.g. <TT>ctest -R print -V</TT>
254 runs the tests containing "print" in their name and
255 makes a verbose output.
263 <HR size="1"><ADDRESS style="align: right;"></ADDRESS>