Installing gdcm from sources
- For the core C++ library you shall need a C++ compiler with the
"list" and "map" STL containers.
Gdcm is developped and tested under:
- GNU/linux (gcc 3.2.x)
- Win32/VC++ 6.x
- Cmake
is used by gdcm for generating Un*x makefiles or VC++ projects.
Grab latest release (at least 2.0.3).
- Optionnaly, for the
VTK wrappers
you will additionaly need :
- Optionnaly, for the
Python wrappers
you will additionaly need :
- Python version 2.2.x
- Swig
at least version 1.3.17x (in order to handle C++ member overloading,
shadow classes and static methods)
GNU/Linux walkthrough for the impatient bash user
- cd SOMEWHERE
-
export CVSROOT=:pserver:anonymous@cvs.creatis.insa-lyon.fr:2402/cvs/public
- cvs login (at prompt CVS password
answer with anonymous)
- cvs co gdcm
- [Optional, for test suite]
cvs co gdcmData
- mkdir gdcmInstall
- mkdir gdcmBin
- cd gdcmBin
- ccmake ../gdcm
-
Toggle and adjust the required options and parameters
(see below for more info)
- hit c
(a couple times, until no stars appear, in order configure)
- hit g (generate makefiles)
- hit q (quit ccmake)
- make
- make install
- [Optional] make test
Step by step recompilation
- Retrieve the
sources of gdcm through cvs
and expand them in a source directory that we
shall refer as gdcmSOURCES.
- Create a compile directory (e.g. gdcmBin) that
we shall refer as gdcmBINARY.
- [Optional] if you wish to install in a temporary installation
directory, create it. We shall refer to this directory
as gdcmINSTALL.
- Change working directory to gdcmBINARY.
- Invoke ccmake (from gdcmBINARY) with gdcmSOURCES
as source directory e.g. ccmake ../gdcm on Un*ces or
invoke CMakeSetup on Win32 and setup the source directory
and the compile directory.
Hit c for a first automatic configuration
of your platteform.
- Select the options that best suits your needs. Basically this means
toggling ON or OFF the following parameters
- GGDCM_VTK
if you wish to generate the VTK wrappers.
When automatic configuration fails you should manually set up
the cmake variable VTK_DIR.
- GDCM_WRAP_PYTHON
if you wish to generate the
Python wrappers.
- GDCM_DOXYGEN
if you wish to generate the doxygen documentation,
- Among the other options, you might consider
toggling ON or OFF the following parameters
- CMAKE_INSTALL_PREFIX
should be set to gdcmINSTALL.
- BUILD_EXAMPLES
if you wish to generate the C++ gdcm examples,
- BUILD_TESTING
if you wish to generate gdcm test suite. When doing so you will
need to
- retrieve gdcmData
i.e. the set of Dicom image used in the test suite and
expand them in a directory refered as gdcmDATA.
- setup cmake GDCM_DATA_ROOT to gdcmDATA.
- CMAKE_BUILD_TYPE can be set up to Debug
if you plan to use your native debugger.
- CMAKE_CXX_FLAGS for cautious developpers should be
set to
-g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter
-Wunused-function -Wunused -Wno-system-headers -Wno-deprecated
-Woverloaded-virtual
-
Hit c a couple times until they are no remaining "*"
(star character) preceeding the values of the gdcm variables.
If you get warnings about
CMake forcing CMAKE_CXX_FLAGS (or other compiler variables)
simply ignore them and hit e to resume configuration.
-
Hit g in order to generate the makefiles (on Un*x)
or the workspace and project (on Win32).
-
Hit q to exit from ccmake.
- On Un*x launch make. On Win32 enter the VC++ gdcm.dsw
and lauch a build all.
Installation
This is an optional stage for developpers.
On Un*x proceed with the install stage with make install.
Running the test suite
The impatient can run the full test suite with make test.
For the test suite to be effective, you must have set
BUILD_TESTING to ON when configuring ccmake.
-
- if you run the tests BEFORE installing then
positionate the environment variable GDCM_DICT_PATH
to gdcmSOURCES/Dicts
(e.g. export GDCM_DICT_PATH=$(gdcmSOURCES)/Dicts)
- if you run the tests AFTER installing then
positionate the environment variable GDCM_DICT_PATH
to gdcmINSTALL/share
(e.g. export GDCM_DICT_PATH=$(gdcmINSTALL)/Dicts)
- Assuming your current working directory is gdcmBINARY
the gdcm tests can be run in three different modes:
- Interactive access by number: run
./bin/gdcmTests
and select the number of the test you wish to run.
- Access to a test through it's name : pass the name of the
test as an argument to
./bin/gdcmTests
e.g.
./Test/gdcmTests TestAllEntryVerify.
- Launch the full test suite : (again we assume the
current working directory is gdcmBINARY)
run ctest. This is equivalent to make test.
ctest supports some options (refer to the
CMake documentation
for other options) :
- a verbose mode e.g. ctest -V
- argument filtering with regexp e.g. ctest -R print -V
runs the tests containing "print" in their name and
makes a verbose output.