DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Mon, 2018-09-24, 12:31

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed, 2016-02-17, 15:38 
Offline

Joined: Tue, 2005-07-12, 13:50
Posts: 71
Location: Erlangen, Germany
Hi,

I am using the dcmtk-3.6.1_20150924 snapshot on Ubuntu Linux. I am using other libraries as well which are not affected by the problem I am going to describe. All dcmtk shared libraries are affected, I am just using dcmdata here in my description to keep it short.

After
Code:
sudo make install


If find the following files in /usr/local/bin:

Code:
libdcmdata.so -> libdcmdata.so.7
libdcmdata.so.3.6.1
libdcmdata.so.7 -> libdcmdata.so.3.6.1


Regardless to which of these files I instruct gcc to link my application, it always links to libdcmdata.so.7.
Even if I remove all softlinks and link to /usr/lib/libdcmdata.so.3.6.1 explicitly, ldd tells me, that I am still linking to libdcmdata.so.7 and to my surprise by nothing but liniking to libdcmdata.so.3.6.1 this link seems to be implicitly re-created in the file system. I tried to find the clue in the CMake configuration options, but I cannot find anything suspicious.

I suspect this is not a bug but a feature - probably realted to the fact that different snapshots of 3.6.1 can exist. My goal is to ship the dcmtk libraries with my application without having to create softlinks in the installation proccess. Can someone give me an advice please?

Thank you

Markus


Top
 Profile  
 
PostPosted: Thu, 2016-02-18, 10:51 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Mon, 2014-03-03, 09:51
Posts: 258
Location: Oldenburg, Germany
Hi Markus,

as far as I know each shared object under linux has its filename and the so called soname. The soname is given when the shared object is created by the linker. CMake seems to use the filename as a base and simply appends the API version counter to it. This seems reasonable, as the API version counter is meant to be incremented whenever the binary interface of the object changes (if we do that whenever this happens is another story), so any version of DCMTK that "implements" API version 7 should be binary compatible to one and another and therefore linking to <filename>.<API_VERSION> should be okay, no matter what actual library version this may then refer to.

So in short: the name is hardwired into the internals of the shared object and will not change no matter how the file is named on the disk. The file will need to be compiled with different parameters for changing it to something else.

I found this for more information about the topic: http://tldp.org/HOWTO/Program-Library-H ... aries.html

Best regards
Jan


Top
 Profile  
 
PostPosted: Thu, 2016-02-18, 15:31 
Offline

Joined: Tue, 2005-07-12, 13:50
Posts: 71
Location: Erlangen, Germany
Thank you for your response, Jan!


Top
 Profile  
 
PostPosted: Thu, 2016-02-25, 13:07 
Offline

Joined: Tue, 2005-07-12, 13:50
Posts: 71
Location: Erlangen, Germany
Just a brief follow-up question: Is there a particular reason why the major version in the SONAME (.7) is different from the dcmtk version (.3.6.1). This seems to be somehow unusual, all other libraries that I have come accross so far have a SONAME which is a substring of the full version.


Top
 Profile  
 
PostPosted: Thu, 2016-02-25, 13:36 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1975
Location: Oldenburg, Germany
The following excerpt is from "dcmtk/CMake/dcmtkPrepare.cmake":

Code:
# Basic version information
# (Starting with version 3.5.5, an odd number at the last position indicates
#  a development snapshot and an even number indicates an official release.)
SET(DCMTK_MAJOR_VERSION 3)
SET(DCMTK_MINOR_VERSION 6)
SET(DCMTK_BUILD_VERSION 1)
# The ABI is not guaranteed to be stable between different snapshots/releases,
# so this particular version number is increased for each snapshot or release.
SET(DCMTK_ABI_VERSION 8)

Does the second comment answer your question?


Top
 Profile  
 
PostPosted: Tue, 2016-03-01, 11:14 
Offline

Joined: Tue, 2005-07-12, 13:50
Posts: 71
Location: Erlangen, Germany
It does, thank you. I wonder which policy is applied to other libraries which keep the prefix of the version and the ABI version in sync, but that is a different story.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group