Skip to content

Instantly share code, notes, and snippets.

@marcinwol
Last active March 8, 2024 14:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save marcinwol/089d4a91f1a1279e33f9 to your computer and use it in GitHub Desktop.
Save marcinwol/089d4a91f1a1279e33f9 to your computer and use it in GitHub Desktop.
Compile dcmtk 3.6.1 on Ubuntu 14.04
# The gist shows how to compile latest development snaphost of DCMTK 3.6.1
# in Ubuntu 14.04. The version of the dcmtk avaliable in ubuntu's repositiries
# is 3.6.0, which is from 2011. The gist also shows how to setup include
#and lib folders so thatwe can use them to write our own C++ programs
# using the develpment version.
# first need to install required packages
sudo apt-get install build-essential cmake libpng12-dev libtiff5-dev libxml2-dev libjpeg8-dev zlib1g-dev libwrap0-dev libssl-dev
# where to install DCMTK
export DCMTK_PREFIX=~/dcmtk361
# download latest development snapshot of the dcmtk. At the time of writing it was dcmtk-3.6.1_20150217.tar.gz
# for latest development versions please go to: http://dicom.offis.de/download/dcmtk/snapshot/
wget http://dicom.offis.de/download/dcmtk/snapshot/dcmtk-3.6.1_20150217.tar.gz
# unpack the archive
tar xzvf dcmtk-3.6.1_20150217.tar.gz
# go into the unpacked archive
cd dcmtk-3.6.1_20150217/
# run cmake to produce make file (alrenative to using ./configure --prefix=$DCMTK_PREFIX)
cmake -DCMAKE_INSTALL_PREFIX=$DCMTK_PREFIX
# compile
make all
# install into prefix folder
make install
# as a result of the above commands the follwoing folders should be created in the $DCMTK_PREFIX
# bin, etc, include, lib, share
# optional to clean the dcmtk-3.6.1_20150217 from the files created
# during compilation.
# make clean
#----- READ BELOW when using ./configure --prefix=$DCMTK_PREFIX instead of cmake ----#
# when ./configure --prefix=$DCMTK_PREFIX is used to configure the dmckt for
# compilation and installation, the execution of the "make install" for
# this development snapshot version wont produce $DCMTK_PREFIX/lib and $DCMTK_PREFIX/include
# directories with header and library files required when wanting to write C++11 that uses
# this snapshot version. Thus, we need to create them ourselfs.
if false; then
# Copy dmcktk library files that were compilied into our $DCMTK_PREFIX/lib folder
mkdir $DCMTK_PREFIX/lib
find . -name "*.a" -exec sh -c 'echo "Copying ${0}"; cp -Rp "${0}" $DCMTK_PREFIX/lib' {} \;
# Now do the same but for header files.
mkdir $DCMTK_PREFIX/include
find . -type d -name "dcmtk" -exec sh -c 'echo "Copying ${0}"; cp -Rp "${0}" $DCMTK_PREFIX/include/' {} \;
fi
@jriesmeier
Copy link

Instead of lines 49 to 55, you should call "make install-lib" or "make install-all" in order to get also the library and header files installed.

The following excerpt is from DCMTK's INSTALL file:

Step 3:
    make install

Step 3 will install the executables and some support files (data dictionary,
configuration and documentation files).  If you also wish to install the
libraries and include files then use "make install-lib".  For the HTML
documentation (see below) use "make install-html" (requires Doxygen to be
installed); "make install-all" installs all of the above.

@Moxtrip69
Copy link

Hi there, we're having some trouble with the DCMTK library, I hope you can give us some advice please, we installed and compiled the toolkit on a Ubuntu VPS, everything is working fine, but we are trying to implement some tools to the frontend of a website, we are making some ajax calls to create an "ECHOSCU" to know if our server is running (ON or OFF) and listening on a determinated port, BUT, we keep getting a DCMDICTPATH error, saying we don't have it defined, my guess that is because we are completely outsite the environment where the env variable is set and used (because we actually have 3 paths on the DCMDICTPATH and all 3 files are loaded to start the server), we read there's a way to compile a build in dictionary so you won't need to get it from a file.

Greetings and thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment