Compile dcmtk

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
mribeiro
Posts: 6
Joined: Fri, 2023-09-01, 08:25

Compile dcmtk

#1 Post by mribeiro »

Hello, I'm new to dcmtk, my initial goal is to compile all the tools in my environment below, could anyone help me out? I confess that I'm not very good at C++ but I'm determined to tackle it.

Ubuntu 22.04
gcc 11.4.0
emacs editor

All I did so far was to download dcmtk from the link below:
https://dicom.offis.de/download/dcmtk/d ... 64.tar.bz2

Thank you very much and I'm sorry if this subject already exists here, but I searched and didn't find anything that could help me.

mribeiro

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

Re: Compile dcmtk

#2 Post by Marco Eichelberg »

It's actually fairly simple. First of all, download the right package from https://dcmtk.org/en/dcmtk/dcmtk-software-development/. You have apparently downloaded a package with pre-compiled executables, and not the DCMTK source code. Unpack the package (tar xzf dcmtk-3.6.7.tar.gz) and carefully read the installation instructions in dcmtk-3.6.7/INSTALL. These should explain everything you need to know.

In brief, the simplest way to compile DCMTK is:

Code: Select all

mkdir dcmtk-bin
cd dcmtk-bin
cmake ../dcmtk-3.6.7
make

mribeiro
Posts: 6
Joined: Fri, 2023-09-01, 08:25

Re: Compile dcmtk

#3 Post by mribeiro »

Hello Marco Eichelberg,

Thanks for the answer, I'm studying C++ in depth, I hope one day to contribute to everyone.

Follow the steps described in INSTALL:

mkdir dcmtk-3.6.7-build
cd dcmtk-3.6.7-build
cmake ../dcmtk-3.6.7
make -j8
make DESTDIR=../dcmtk-3.6.7-install install

But at the beginning of the compilation it displays warnings that it did not find the external libraries (libiconv, libpng, etc.), I downloaded these libs and extracted them according to the structure below:

/home/mribeiro/
dcmtk-3.6.7
dcmtk-3.6.7-install
icu
libiconv-1.16
libpng-1.6.37
libxml2-v2.9.13
openjpeg-2.4.0
tiff-4.3.0
zlib-1.2.12

At the same level as the source code folder.

In the documentation I didn't find the correct path for these libs, where am I going wrong?

Thanks.
Marcelo

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

Re: Compile dcmtk

#4 Post by Marco Eichelberg »

I presume that you are working on Linux. The DCMTK build scripts on Linux expect pre-compiled developer versions of the external libraries to be available before CMake is run. For all of these libraries, official development packages exist on most Linux distributions, e.g. on Debian/Ubuntu, you just have to run "apt-get install libpng-dev" to install the developer version of libpng. DCMTK will then find, and use this library.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest