This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |