Cannot build the osmis S3 plugin

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

Hello,

The S3 plugin is not compatible with macOS yet.

Please use Docker for Mac instead:
https://docs.docker.com/docker-for-mac/install/

https://book.orthanc-server.com/users/docker-osimis.html

Sébastien-

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”)
Downloading http://orthanc.osimis.io/ThirdPartyDownloads/gtest-1.8.1.tar.gz
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”.

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-

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

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:
https://hg.orthanc-server.com/orthanc-object-storage/rev/b922ae86bbe1

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-