From 1fa3ad521c365a3c26ad6f922366858bf43917d3 Mon Sep 17 00:00:00 2001 From: frog Date: Wed, 2 Jul 2003 13:21:36 +0000 Subject: [PATCH] * setup.py is again effective on un*x (takes into account the addon of the jpeg library) * Doc/DoxyDevelInstal.txt added (developper's raw documentation) * Doc/Doxy* updated (includes above enhancements) * INSTALL now points to web documentation --- Frog --- ChangeLog | 7 +++++ Doc/DoxyDevelInstal.txt | 57 ++++++++++++++++++++++++++++++++++++++++ Doc/DoxyInstallation.txt | 17 ++++++++---- Doc/DoxyMainPage.txt | 1 + Doc/DoxyfileDeveloppers | 3 ++- INSTALL | 46 +++++++++++--------------------- setup.py | 27 ++++++++++++++----- 7 files changed, 116 insertions(+), 42 deletions(-) create mode 100644 Doc/DoxyDevelInstal.txt diff --git a/ChangeLog b/ChangeLog index e9a71ba2..5c0a2a28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-07-02 Eric Boix + * setup.py is again effective on un*x (takes into account the + addon of the jpeg library) + * Doc/DoxyDevelInstal.txt added (developper's raw documentation) + * Doc/Doxy* updated (includes above enhancements) + * INSTALL now points to web documentation + 2003-07-01 Eric Boix * src/gdcmHeader.h doesn't make unnecessary reference to gdcmUtil.h anymore. diff --git a/Doc/DoxyDevelInstal.txt b/Doc/DoxyDevelInstal.txt new file mode 100644 index 00000000..126c9d19 --- /dev/null +++ b/Doc/DoxyDevelInstal.txt @@ -0,0 +1,57 @@ +/** + * \page DoxyDevelInstal Developpers workspace + * There is no further requirements than the ones of \ref DoxyInstallation. + * But the developpers generally have further needs than the library user + * like : + * - in place debugging (in place as opposed to fully + * installed, i.e. when working in the cvs hierarchy or in the hierarchy + * build from gdcm source tar ball). + * - tests of features + * - test suite usage (typically after code modifications and prior to + * commit). + * . + * In the following we shall assume that gdcm is allready compiled- + * BUT not installed- in a directory named GDCM_HOME. + * + * \section DoxyDevelInstalCPlusPlus Working with C++ + * The kernel library uses the environnement variable + * GDCM_DICT_PATH as a path to the location of the default + * Dicom dictionary. Hence if you which to work/debug a code based + * on gdcm, you first need to positionate this variable. When omitting + * this you should get the following message: + * gdcmDict::gdcmDict: can't open dictionary /usr/local/share/gdcm/dicomV3.dic + * + * Suppose you want to launch some C++ demo/test program, that + * gets compiled with the kernel, e.g. PrintHeader. One can do + * - cd GDCM_HOME + * - export GDCM_DICT_PATH=`pwd`/Dicts + * - cd Test + * - ./PrintHeader + * . + * \section DoxyDevelInstalPython Working with Python + * - cd GDCM_HOME + * - ./autogen.sh --enable-python + * - make + * - export PYTHONPATH=`pwd` + * - cd gdcmPython + * - ln -s .libs/pygdcm.so _gdcm.so (this is because automake + * doesn't allow the building of libraries whose name starts with an + * underscore. Since we need the wrapper library to be named _gdcm + * [because swig automaticatily uses this name when building the + * shadow classes], automake generates pygdcm.so and at install stage + * stage renames it to _gdcm.so). + * - You can then use gdcmPython for manual test/demos + * -# cd GDCM_HOME/gdcmPython/demo + * -# python PrintHeader.py + * . + * - You can also run the gdcm test suite, which is written in Python: + * -# first you need to install the Dicom data files used by the + * test suite. The cvs access point is + * :pserver:anonymous@cvs.creatis.insa-lyon.fr:2402/cvs/public + * and the name of the module is gdcmData. + * Checkout this module in GDCM_HOME directory + * -# cd GDCM_HOME/gdcmPython/ + * -# python testSuite.py + * . + * . + */ diff --git a/Doc/DoxyInstallation.txt b/Doc/DoxyInstallation.txt index 3ba3baca..c1c107fc 100644 --- a/Doc/DoxyInstallation.txt +++ b/Doc/DoxyInstallation.txt @@ -24,18 +24,25 @@ * . * . * - * \section DoxyInstallLinux Linux + * \section DoxyInstallLinux Un*x * \subsection DoxyInstallLinuxCvs Starting from cvs sources. - * - Retrieve the sources through cvs + * - Retrieve the + + sources through cvs, * - cd gdcm * - ./autogen.sh --help in order to select your preferences * - ./autogen.sh to launch the usual automake/autoconf * process e.g. * -# ./autogen.sh --prefix=/where/ever/you/want - * to configure the script to force installation in a specified - * place. + * to configure the script to force installation in a specified + * place. * -# ./autogen.sh --enable-python to generate the - * python wrappers. + * python wrappers (a.k.a. gdcmPython) + * -# ./autogen.sh --enable-vtk to generate the + * vtk clases that shallow wrap gdcm, + * -# ./autogen.sh --enable-doxygen to generate the + * doxygen + * based documentation * . * - make (or make 'CFLAGS=-g...) * - make instal diff --git a/Doc/DoxyMainPage.txt b/Doc/DoxyMainPage.txt index 096b8118..3e11aba2 100644 --- a/Doc/DoxyMainPage.txt +++ b/Doc/DoxyMainPage.txt @@ -4,6 +4,7 @@ * - \ref DoxyIntroduction * - \ref DoxyInstallation * - \ref DoxyPythonComplete + * - \ref DoxyDevelInstal * - Namespace List * - Class Hierarchy * - Alphabetical List diff --git a/Doc/DoxyfileDeveloppers b/Doc/DoxyfileDeveloppers index 7f960e04..ff736cb4 100644 --- a/Doc/DoxyfileDeveloppers +++ b/Doc/DoxyfileDeveloppers @@ -302,7 +302,8 @@ WARN_LOGFILE = # with spaces. INPUT = ../src DoxyPython.txt DoxyMainPage.txt \ - DoxyInstallation.txt DoxyPython.txt DoxyIntroduction.txt + DoxyInstallation.txt DoxyDevelInstal.txt \ + DoxyPython.txt DoxyIntroduction.txt # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp diff --git a/INSTALL b/INSTALL index ecae1fa7..123306df 100644 --- a/INSTALL +++ b/INSTALL @@ -1,31 +1,17 @@ -* For compiling the library and C++ test programs: - -./autogen.sh -./configure (optional if just after autogen.sh) -make -make instal - -You can use the --prefix option of the configure script to force installation -in some place (default is /usr/local/DCMlib): - -./configure --prefix=/where/ever/you/want - - -* For testing in C++: -./Test/test ../Data/CR-MONO1-10-chest.dcm (or any other file in there) - - -* For testing in Python: -cd python/gdcmPython -make (requires SWIG Version 1.3.16u i.e. the contemporary devel version) -python testSuite.py (test suite written in unittest, you should use python2) - - -* For manual test in python: -cd python/demo -python test.py ../../Data/CR-MONO1-10-chest.dcm (or any other file) - - ------------------------------------------------------------------------------ -Documentation can be found in the Doc sub-directory. Please refer to +################################################### +For the impatient: + * cvs -d:pserver:anonymous@cvs.creatis.insa-lyon.fr:2402/cvs/public login + answer anonymous + * cvs -d:pserver:anonymous@cvs.creatis.insa-lyon.fr:2402/cvs/public co gdcm + * cd gdcm + * ./autogen.sh (--enable-python --enable-vtk --enable-doc) + * make + * make instal + +################################################### +The full documentation for installation is available at + http://www.creatis.insa-lyon.fr/Public/Gdcm/html.developper/DoxyInstallation.html + +################################################### +The documentation can also be found in the Doc sub-directory. Please refer to README file within Doc. diff --git a/setup.py b/setup.py index 7697a86d..3d7040f0 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,7 @@ from WrapVTK import * ThisModule='gdcmPython' gdcmPythonSrcDir=ThisModule gdcmSrcDir ="src" +gdcmJpeg8SrcDir =os.path.join('src', 'jpeg', 'libijg8') gdcmvtkSrcDir ="vtk" gdcmDictsDir ="Dicts" gdcmTestDir ="Test" @@ -36,25 +37,39 @@ else: targetDir=os.path.join(targetDir, ThisModule) -# For the Swig compilation +### Sources section: determination of sources for the extensions: +# Sources 1a/ The kernel of gdcm itself (which wrapped with Swig) +# defines the first extension Sources = [] Sources.extend(glob.glob(os.path.join(gdcmSrcDir,"*.cxx"))) -#Sources.extend(glob.glob(os.path.join(gdcmSrcDir,"*.h"))) Sources.append(os.path.join(gdcmPythonSrcDir,"gdcm.i")) +# Sources 1b/ The kernel of gdcm depends on a jpeg library whose sources are +# contained in subdir gdcmJpeg8SrcDir. But within this subdir +# some of the C files should not be compiled (refer to +# gdcmJpeg8SrcDir/Makefile.am) ! +Jpeg8Sources = glob.glob(os.path.join(gdcmJpeg8SrcDir,"j*.c")) +Jpeg8SourcesToRemove = ['jmemansi.c', 'jmemname.c', 'jmemdos.c', 'jmemmac.c'] +for Remove in Jpeg8SourcesToRemove: + ### Because setup.py is a multiple pass process we need to trap + ### the case were the files were allready wed out on a previous pass. + try: + Jpeg8Sources.remove(os.path.join(gdcmJpeg8SrcDir, Remove)) + except ValueError: + continue +Sources.extend(Jpeg8Sources) -# For the VTK compilation +# Sources 2/ The second extension contains the VTK classes (which we wrap +# with the vtk wrappers): VTK_INCLUDE_DIR=os.path.join(VTK_PATH,"include","vtk") VTK_LIB_DIR=os.path.join(VTK_PATH,"lib","vtk") - vtkSources = [] vtkSources.extend(glob.glob(os.path.join(gdcmvtkSrcDir,"vtk*.cxx"))) vtkSources.extend(glob.glob(os.path.join(gdcmSrcDir,"*.cxx"))) -#vtkSources.extend(glob.glob(os.path.join(gdcmvtkSrcDir,"vtk*.h"))) - vtkLibraries=["vtkCommon","vtkCommonPython", "vtkIO","vtkIOPython", "vtkFiltering","vtkFilteringPython"] +##### setup(name=ThisModule, version="0.2", description="...", -- 2.45.0