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 -Wno-system-headers -Wno-deprecated
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.
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.
191 Hit <B><TT>g</TT></B> in order to generate the makefiles (on Un*x)
192 or the workspace and project (on Win32).
195 Hit <B><TT>q</TT></B> to exit from <TT>ccmake</TT>.
197 <LI> On Un*x launch <TT>make</TT>. On Win32 enter the VC++ gdcm.dsw
198 and lauch a <TT>build all</TT>.
202 <!###################################>
203 <H2>Installation</H2>
204 This is an optional stage for developpers.
206 On Un*x proceed with the install stage with <TT>make install</TT>.
208 <!###################################>
209 <H2>Running the test suite</H2>
210 The impatient can run the full test suite with <TT>make test</TT>.
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>.
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>)
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>)
229 <LI>Assuming your current working directory is <TT>gdcmBINARY</TT>
230 the gdcm tests can be run in three different modes:
232 <LI> Interactive access by number: run
233 <TT>./bin/gdcmTests</TT>
234 and select the number of the test you wish to run.
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>
240 <TT>./Test/gdcmTests TestAllEntryVerify</TT>.
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>.
246 ctest supports some options (refer to the
247 <A HREF="http://www.cmake.org">CMake documentation</A>
250 <LI> a verbose mode e.g. <TT>ctest -V</TT>
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.
262 <HR size="1"><ADDRESS style="align: right;"></ADDRESS>