Cannot build the osmis S3 plugin

121 views
Skip to first unread message

athome withagroovebox

unread,
Jan 19, 2021, 11:46:21 PM1/19/21
to Orthanc Users
Hey all,

Having a really difficult time building the osmis s3 plugin.  I'm on a Mac running Catalina.  I've tried both commands mentioned in the docs, and neither work.

First command : 
cmake -DCMAKE_TOOLCHAIN_FILE=/usr/local/Cellar/vcpkg/2020.11-1/libexec/scripts/buildsystems/vcpkg.cmake -DUSE_SYSTEM_GOOGLE_TEST=OFF ../../orthanc-object-storage/Aws

Result :
CMake Error at /Users/myname/aws/builds/aws-sdk-cpp/build/aws/orthanc/OrthancFramework/Resources/CMake/DownloadPackage.cmake:100 (message):
  CMake is not allowed to download from Internet.  Please set the
  ALLOW_DOWNLOADS option to ON

This didn't make a ton of sense, because I looked at orthanc-object-storage/Aws/CMakeLists.txt and see "set(ALLOW_DOWNLOADS ON)" right there on line 15.

Second command :
cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_VCPKG_PACKAGES=OFF -DUSE_SYSTEM_GOOGLE_TEST=OFF ../../orthanc-object-storage/Aws

Result :
CMake Error at /Users/myname/aws/builds/aws-sdk-cpp/build/aws/orthanc/OrthancFramework/Resources/CMake/JsonCppConfiguration.cmake:67 (message):
  Please install the libjsoncpp-dev package

I looked around and couldn't find a way to install the libjsoncpp-dev package on a Mac.  You can install the libjsoncpp package just fine using brew, but not libjsoncpp-dev.

Can anybody out there please help me?  I'm not a C++ programmer, so sadly I don't really understand any of this.

--Jeremy

Sébastien Jodogne

unread,
Jan 20, 2021, 1:25:41 AM1/20/21
to Orthanc Users
Hello,

The S3 plugin is not compatible with macOS yet.

Please use Docker for Mac instead:

Sébastien-

athome withagroovebox

unread,
Jan 20, 2021, 1:55:35 PM1/20/21
to Orthanc Users
Thank you for helping me with this.  Does the docker image contain the S3 plugin?  If not, then I still need to build the plugin from source, correct?

I just tried to build the plugin inside a Debian Buster docker container, and I got the same error :

-- Found PythonInterp: /usr/local/bin/python (found version "3.8.3")
CMake Error at /root/aws/builds/aws-sdk-cpp/builds/aws/orthanc/OrthancFramework/Resources/CMake/DownloadPackage.cmake:100 (message):
  CMake is not allowed to download from Internet.  Please set the
  ALLOW_DOWNLOADS option to ON
Call Stack (most recent call first):
  /root/aws/builds/aws-sdk-cpp/builds/aws/orthanc/OrthancFramework/Resources/CMake/DownloadPackage.cmake:136 (DownloadFile)
  /root/aws/builds/aws-sdk-cpp/builds/aws/orthanc/OrthancFramework/Resources/CMake/GoogleTestConfiguration.cmake:55 (DownloadPackage)
  /root/aws/builds/aws-sdk-cpp/builds/aws/orthanc/OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake:465 (include)
  CMakeLists.txt:28 (include)


-- Configuring incomplete, errors occurred!
See also "/root/aws/builds/aws-sdk-cpp/builds/aws/CMakeFiles/CMakeOutput.log".

Sébastien Jodogne

unread,
Jan 21, 2021, 1:35:48 AM1/21/21
to Orthanc Users
Indeed, for reasons explained by Osimis at the following location, you'll have to recompile the S3 plugin by yourself by deriving from the "osimis/orthanc" Docker image:
https://book.orthanc-server.com/plugins/object-storage.html#pre-compiled-binaries

Regarding your issue, this is not really a C++ question: Just add "-DALLOW_DOWNLOADS=ON" as an additional command-line argument when invoking CMake.

Sébastien-

athome withagroovebox

unread,
Jan 21, 2021, 8:37:10 PM1/21/21
to Orthanc Users
Thank you again for all the help!  I tried to follow the directions in the page you sent me, but couldn't get it to work.  cmake kept telling me to install a library (like libjsoncpp-dev or zlib1g-dev), and then I'd use apt-get to install the library, and then I'd run cmake again, but cmake would tell me it still couldn't find the library.  Anyway, I finally got it to compile with this line, which I found in a previous forum post :
cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_VCPKG_PACKAGES=OFF -DUSE_SYSTEM_GOOGLE_TEST=OFF -DSTANDALONE_BUILD=ON -DSTATIC_BUILD=ON -DALLOW_DOWNLOADS=ON ../../orthanc-object-storage/Aws

That seemed to work!  I wound up with an orthanc folder containing the subfolders OrthancFramework and OrthancServer.  My question is : what do I do now?  I've been using the jodogne/orthanc-python docker image, because I need the python plugin and the postgresql plugin.  How do I make a Docker container that has Orthanc, as well as the postgresql, python, and S3 plugins?  If I make a Dockerfile and use jodogne/orthanc-python as my base, is there a way I can copy in the compiled S3 plugin?

Thanks again for helping me to get started with Orthanc!

--Jeremy

Sébastien Jodogne

unread,
Jun 23, 2021, 3:32:14 AM6/23/21
to Orthanc Users
For your interest, the AWS S3 plugin for Orthanc now compiles very easily on Ubuntu 18.04 (including fully static linking against the AWS C++ SDK), thanks to the following changeset:

Here is the corresponding call to CMake:

$ cmake ../orthanc-object-storage/Aws -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_GOOGLE_TEST=OFF -DUSE_VCPKG_PACKAGES=OFF
$ make

This should ease your process of deriving a Docker image from "jodogne/orthanc-python" that integrates a build environment for the AWS S3 plugin (just install the "build-essential" and "cmake" packages, then use the command above).

Regards,
Sébastien-
Reply all
Reply to author
Forward
0 new messages