DICOM example running problem

I met the problem when trying to run the DICOM example under the file examples/extended/medical/DICOM

I installed DCMTK with version 3.6.7 in the path /home/gn4/dcmtk-3.6.7-install
Then define the enviromental variable DCMTK_BASE_DIR to point to the directory where I have installed it. i.e, add this line to the GNUmakefile in DICOM/
DCMTK_BASE_DIR = /home/gn4/dcmtk-3.6.7-install

Then add to the enviromental variable LD_LIBRARY_PATH the path ${DCMTK_BASE_DIR}/lib (i.e. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${DCMTK_BASE_DIR}/lib )

by $echo LD_LIBARAY_PATH I can see the path in it.

echo $LD_LIBRARY_PATH
/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/home/gn4/geant4-v11.0.3-install/lib:/home/root/root-6.26.08/buildroot/home/root/root-6.26.08-install/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/home/gn4/geant4-v11.0.3-install/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/home/gn4/geant4-v11.0.3-install/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/home/gn4/geant4-v11.0.3-install/lib:/home/gn4/dcmtk-3.6.7-install/lib:/home/gn4/dcmtk-3.6.7-install/lib

Then to set the enviromental variable DICOM_USE_DCMTK to 1.
In GNUmakefile, I uncommented the line
#DICOM_USE_DCMTK := true

  • Compile it with ‘make’/‘gmake’

  • A standard Geant4 example CMakeLists.txt is provided

  • Configure via cmake with
    cmake -DGeant4_DIR=/home/gn4/geant4-v11.0.3-install/lib/Geant4-11.0.3 -DDCMTK_DIR=/home/gn4/dcmtk-3.6.7-install /home/gn4/geant4-v11.0.3-install/share/Geant4-11.0.3/examples/extended/medical/DICOM

then make

But when I make I get this error info.

root@lab2:/home/gn4/geant4-v11.0.3-install/share/Geant4-11.0.3/examples/extended/medical/DICOM# make
Entering dicomReader …
make[1]: Nothing to be done for ‘obj’.
make: *** No rule to make target ‘/home/gn4/geant4.10.04.p03-install/include/Geant4/globals.hh’, needed by ‘/root/geant4_workdir/tmp/Linux-g++/DICOM/DicomRegularDetectorConstruction.o’. Stop.

Does anyone know how to solve it?

By thy way when I run the cmake file it has no problem.

cmake -DGeant4_DIR=/home/gn4/geant4-v11.0.3-install/lib/Geant4-11.0.3 -DDCMTK_DIR=/home/gn4/dcmtk-3.6.7-install /home/gn4/geant4-v11.0.3-install/share/Geant4-11.0.3/examples/extended/medical/DICOM
– DICOM: Using DCMTK
– Trying to find DCMTK expecting DCMTKConfig.cmake
– Trying to find DCMTK expecting DCMTKConfig.cmake - ok
– Trying to find DCMTK expecting DCMTKConfig.cmake
– Trying to find DCMTK expecting DCMTKConfig.cmake - ok
– DICOM settings:

  • DICOM_USE_DCMTK: ON
  • DICOM_USE_HEAD: OFF
    – Configuring done
    – Generating done
    – Build files have been written to: /home/gn4/geant4-v11.0.3-install/share/Geant4-11.0.3/examples/extended/medical/DICOM

As the GNUmakefile system relies heavily on the environment for configuration, something has gone wrong here, as it’s trying to pick up Geant4 from /home/gn4/geant4.10.04.p03-install/, i.e a very old version.

I’d suggest only trying to use the CMake system for building applications as it’s far less prone to issues like this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.