Building Orthanc 1.3.0 on Fedora with DCMTK 3.6.2 - slight issue: invalid conversion

Hello all,

I’m very excited to test out the newest release of Orthanc.

I’ve successfully compiled Orthanc 1.2.0 on Fedora Server 25.

I tried to compile Orthanc 1.3.0 but came accross the following issue while compiling it:

`

In file included from /home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/libsrc/syncprims.cc:27:0:
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h: In constructor ‘dcmtk::log4cplus::thread::Mutex::Mutex(dcmtk::log4cplus::thread::Mutex::Type)’:
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h:66:59: error: invalid conversion from ‘int’ to ‘dcmtk::log4cplus::thread::MutexImplBase*’ [-fpermissive]
: mtx (DCMTK_LOG4CPLUS_THREADED (new impl::Mutex (t)) + 0)
^~~
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h: In constructor ‘dcmtk::log4cplus::thread::Semaphore::Semaphore(unsigned int, unsigned int)’:
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h:109:74: error: invalid conversion from ‘int’ to ‘dcmtk::log4cplus::thread::SemaphoreImplBase*’ [-fpermissive]
: sem (DCMTK_LOG4CPLUS_THREADED (new impl::Semaphore (max, initial)) + 0)
^~~
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h: In constructor ‘dcmtk::log4cplus::thread::FairMutex::FairMutex()’:
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h:151:59: error: invalid conversion from ‘int’ to ‘dcmtk::log4cplus::thread::FairMutexImplBase*’ [-fpermissive]
: mtx (DCMTK_LOG4CPLUS_THREADED (new impl::FairMutex) + 0)
^~~
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h: In constructor ‘dcmtk::log4cplus::thread::ManualResetEvent::ManualResetEvent(bool)’:
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h:193:71: error: invalid conversion from ‘int’ to ‘dcmtk::log4cplus::thread::ManualResetEventImplBase*’ [-fpermissive]
: ev (DCMTK_LOG4CPLUS_THREADED (new impl::ManualResetEvent (sig)) + 0)
^~~
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h: In constructor ‘dcmtk::log4cplus::thread::SharedMutex::SharedMutex()’:
/home/user/OrthancBuild-1.3.0/dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h:255:60: error: invalid conversion from ‘int’ to ‘dcmtk::log4cplus::thread::SharedMutexImplBase*’ [-fpermissive]
: sm (DCMTK_LOG4CPLUS_THREADED (new impl::SharedMutex) + 0)
^~~
CMakeFiles/ServerLibrary.dir/build.make:9950: recipe for target ‘CMakeFiles/ServerLibrary.dir/dcmtk-3.6.2/oflog/libsrc/syncprims.cc.o’ failed
make[2]: *** [CMakeFiles/ServerLibrary.dir/dcmtk-3.6.2/oflog/libsrc/syncprims.cc.o] Error 1
CMakeFiles/Makefile2:105: recipe for target ‘CMakeFiles/ServerLibrary.dir/all’ failed
make[1]: *** [CMakeFiles/ServerLibrary.dir/all] Error 2
Makefile:129: recipe for target ‘all’ failed
make: *** [all] Error 2

`

Again, Orthanc 1.2.0 compiled without any issue.

I tried with the following cmake that worked with Orthanc 1.2.0:

`
cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ~/Orthanc-1.3.0

`

And then with this one:

`
cmake -DALLOW_DOWNLOADS=ON -DUSE_SYSTEM_JSONCPP=OFF -DUSE_SYSTEM_MONGOOSE=OFF -DUSE_SYSTEM_PUGIXML=OFF -DUSE_SYSTEM_SQLITE=OFF -DUSE_SYSTEM_BOOST=OFF -DUSE_SYSTEM_DCMTK=OFF -DUSE_SYSTEM_GOOGLE_TEST=OFF -DUSE_SYSTEM_LIBJPEG=OFF ~/Orthanc-1.3.0

`

It seems to be coming from DCMTK directly. All of the Fedora Server packages are up to date. Should we direct this error to the DCMTK team?

Thanks in advance for your help and insights!

Best,

Sylvain

Dear Sylvain,

This is clearly an issue within DCMTK 3.6.2. I’m not myself sure of what the “+ 0” is meant for.

I kindly invite you to report it to the DCMTK team:
http://forum.dcmtk.org/viewforum.php?f=1

Please warn me when a patch is available, I will happily integrate it in Orthanc.

In the meantime, you can add the “-DUSE_DCMTK_360=ON” when invoking cmake, in order to fallback to DCMTK 3.6.0.

Regards,
Sébastien-

Thank you Sebastien.

I’ve just posted the question on their forum: http://forum.dcmtk.org/viewtopic.php?f=3&t=4584

Let’s see how this goes :).

Thank you for your help!

Best,

Sylvain

Just a quick update:

I removed the ‘+ 0’ instruction in
`
dcmtk-3.6.2/oflog/include/dcmtk/oflog/thread/syncpub.h

`

  • wherever the system highlighted an error.

Compilation works now. We’re still discussing other details in the DCMTK forum thread, such as whether multi threading was disabled (which I don’t know the answer to), but I do have a fully compiled program now.

Need to test whether it works!

Thanks,

Sylvain

Hello Sebastien,

Just a quick update from the DCMTK forum thread. Does the DCMTK configuration come from your side?

Apparently, DCMTK should be configured with multi threading ON, but this line is missing from the configuration file ./config/include/dcmtk/config/osconfig.h

From what I understand, the option should be OPTION(DCMTK_WITH_THREADS “Configure DCMTK with support for multi-threading.” ON)

I don’t know whether this is relevant, and there’s more info on the DCMKT forum thread. Just relaying the info :).

Thanks,

Sylvain

Dear Sylvain,

Thanks for digging into this issue!

The culprit was indeed the undefined “DCMTK_WITH_THREADS” option.

The fix is now part of the mainline, and will be part of forthcoming 1.3.1 maintenance release:
https://bitbucket.org/sjodogne/orthanc/commits/c33ff8a7ffa94900017f323ab26192267fd3ff4e

Regards,
Sébastien-