Building 0.52 on Mac OS X

Hi, I'm currently trying to get Orthanc up and running on an OS X 10.8 host (currently a 64-bit 2012 Macbook Air for testing).

I've installed most of the dependencies using Homebrew -

brew install openssl dcmtk mongoose boost cmake
brew link openssl

Jsoncpp doesn't seem to be identified by CMake even when present in /usr/local/lib and amending the CMake configuration file, so I'm trying to build a mostly-dynamic build with those caveats using the CMake command

cmake -DSTATIC_BUILD=OFF -DCMAKE_BUILD_TYPE=Debug -DDCMTK_DIR=/usr/local/Cellar/dcmtk/3.6.0/include/dcmtk/ -DUSE_DYNAMIC_JSONCPP=NO -DUSE_DYNAMIC_GOOGLE_TEST=NO ..

Which does work to get all the makefiles built. I've trivially patched the Orthanc source using #elif defined(__APPLE__) for the few platform-specific sections. The compile succeeds but fails linking, apparently due to a failure to find the DCMTK OFLog functions and a couple of iconv symbols (despite having both the system iconv and brew-installed iconv present). I've attached the compiler output.

I'm a bit stuck currently, and can't work out how to complete the compile. I realise the steps above aren't too robust. but was hoping to at least get a proof of concept system running to test the viability of an OS X-based DICOM server.

Does anyone have any bright ideas?

Regards,

Ryan

Linking CXX executable Orthanc.txt (6.27 KB)

Dear Ryan,

Thank you much for your investigations on Mac OS!

Unfortunately, I do not have access to an Apple computer, so I won’t be able to drive you in a precise way. Just a few thoughts:

  • Have you tried to use the “-DSTATIC_BUILD=ON” flag on the CMake step? This will re-compile all the third-party dependencies, including DCMTK.
  • I have encountered similar linking issues with the logging facilities of the standard DCMTK package of Ubuntu, that can be solved by adding the “-DDCMTK_LIBRARIES=wrap;oflog” option to CMake [1].

Anyway, if you manage to make Orthanc compile on Mac OS X, please send us the build instructions so we can patch the code!

Thanks again,
Sébastien-

[1] https://code.google.com/p/orthanc/wiki/FAQ#I_use_the_Linux_distribution_XXX,_how_can_I_build_Orthanc?

Hi Sébastien,

I've just forked the repository and uploaded patches to the build system and a few of the platform-specific source files to allow compilation on OS X. The unit tests pass and I'm able to access the web interface. I've tried to keep the edits as trivial as possible and rely on system/Homebrew shared libraries where possible.

Thanks for your help, the extra oflog flag was what I needed for the linker.

Here are my patches: https://code.google.com/r/ryanwalklin-mac/source/detail?r=3a13772d9af9cbd764b327c3ee9fc2b7306cc5bd

I'll have more of a play with it when I have some time later on in the week.

Regards,

Ryan

Hi Ryan,

I’ve just forked the repository and uploaded patches to the build system and a few of the platform-specific source files to allow compilation on OS X. The unit tests pass and I’m able to access the web interface. I’ve tried to keep the edits as trivial as possible and rely on system/Homebrew shared libraries where possible.

Thanks you much for your contribution! I have just updated the bug tracker and the FAQ.

Cheers,
Sébastien-

Dear Ryan,

FYI, the mainline of Orthanc now properly builds with XCode (and without using Homebrew or MacPorts). You can find the build instructions at the following location:
https://code.google.com/p/orthanc/source/browse/DarwinCompilation.txt

Cheers,
Sébastien-