eth-cscs / sarus

OCI-compatible engine to deploy Linux containers on HPC environments.
https://sarus.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
127 stars 10 forks source link

unable to build #21

Closed torehl closed 2 years ago

torehl commented 3 years ago

Hi,

Any ideas why this fails? OS: Ubuntu 18.04.5LTS.

$ sudo apt search rapidjson Sorting... Done Full Text Search... Done rapidjson-dev/bionic,now 1.1.0+dfsg2-3 all [installed] fast JSON parser/generator for C++ with SAX/DOM style API

. . [ 2%] Building CXX object src/common/CMakeFiles/common_library.dir/Utility.o cd /home/torel/workspace/Sarus/sarus-1.3.2/build-x86_64/src/common && /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_NO_CXX11_SCOPED_ENUMS -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_RANDOM_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DCPPREST_FORCE_HTTP_CLIENT_ASIO -DCPPREST_FORCE_HTTP_LISTENER_ASIO -DCPPREST_NO_SSL_LEAK_SUPPRESS -I/home/torel/workspace/Sarus/sarus-1.3.2/src -isystem /cm/shared/apps/boost/gcc/1.71.0/include -MD -MT src/common/CMakeFiles/common_library.dir/Utility.o -MF CMakeFiles/common_library.dir/Utility.o.d -o CMakeFiles/common_library.dir/Utility.o -c /home/torel/workspace/Sarus/sarus-1.3.2/src/common/Utility.cpp /home/torel/workspace/Sarus/sarus-1.3.2/src/common/Utility.cpp: In function ‘rapidjson::SchemaDocument sarus::common::readJSONSchema(const boost::filesystem::path&)’: /home/torel/workspace/Sarus/sarus-1.3.2/src/common/Utility.cpp:970:94: error: no matching function for call to ‘rapidjson::GenericSchemaDocument > >::GenericSchemaDocument()’ return rapidjson::SchemaDocument{ schemaJSON, nullptr, rapidjson::SizeType(0), &provider }; ^ In file included from /home/torel/workspace/Sarus/sarus-1.3.2/src/common/Utility.hpp:26:0, from /home/torel/workspace/Sarus/sarus-1.3.2/src/common/Utility.cpp:11: /usr/include/rapidjson/schema.h:1405:5: note: candidate: rapidjson::GenericSchemaDocument::GenericSchemaDocument(const rapidjson::GenericSchemaDocument&) [with ValueT = rapidjson::GenericValue >; Allocator = rapidjson::CrtAllocator] GenericSchemaDocument(const GenericSchemaDocument&); ^~~~~~~~~~~~~~~~~~~~~ /usr/include/rapidjson/schema.h:1405:5: note: candidate expects 1 argument, 4 provided /usr/include/rapidjson/schema.h:1378:5: note: candidate: rapidjson::GenericSchemaDocument::GenericSchemaDocument(rapidjson::GenericSchemaDocument&&) [with ValueT = rapidjson::GenericValue >; Allocator = rapidjson::CrtAllocator] GenericSchemaDocument(GenericSchemaDocument&& rhs) RAPIDJSON_NOEXCEPT : ^~~~~~~~~~~~~~~~~~~~~ /usr/include/rapidjson/schema.h:1378:5: note: candidate expects 1 argument, 4 provided /usr/include/rapidjson/schema.h:1341:14: note: candidate: rapidjson::GenericSchemaDocument::GenericSchemaDocument(const ValueType&, rapidjson::GenericSchemaDocument::IRemoteSchemaDocumentProviderType*, Allocator*) [with ValueT = rapidjson::GenericValue >; Allocator = rapidjson::CrtAllocator; rapidjson::GenericSchemaDocument::ValueType = rapidjson::GenericValue >; rapidjson::GenericSchemaDocument::IRemoteSchemaDocumentProviderType = rapidjson::IGenericRemoteSchemaDocumentProvider > > >] explicit GenericSchemaDocument(const ValueType& document, IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0) : ^~~~~~~~~~~~~~~~~~~~~ /usr/include/rapidjson/schema.h:1341:14: note: candidate expects 3 arguments, 4 provided /home/torel/workspace/Sarus/sarus-1.3.2/src/common/Utility.cpp: In function ‘rapidjson::Document sarus::common::readAndValidateJSON(const boost::filesystem::path&, const boost::filesystem::path&)’: /home/torel/workspace/Sarus/sarus-1.3.2/src/common/Utility.cpp:1007:24: error: ‘class rapidjson::SchemaValidatingReader<0, rapidjson::BasicIStreamWrapper >, rapidjson::UTF8<> >’ has no member named ‘GetError’ reader.GetError().Accept(w); ^~~~~~~~ src/common/CMakeFiles/common_library.dir/build.make:246: recipe for target 'src/common/CMakeFiles/common_library.dir/Utility.o' failed make[2]: *** [src/common/CMakeFiles/common_library.dir/Utility.o] Error 1 make[2]: Leaving directory '/global/D1/homes/torel/workspace/Sarus/sarus-1.3.2/build-x86_64' CMakeFiles/Makefile2:657: recipe for target 'src/common/CMakeFiles/common_library.dir/all' failed make[1]: *** [src/common/CMakeFiles/common_library.dir/all] Error 2 make[1]: Leaving directory '/global/D1/homes/torel/workspace/Sarus/sarus-1.3.2/build-x86_64' Makefile:148: recipe for target 'all' failed make: *** [all] Error 2
Madeeks commented 3 years ago

Hello @torehl, I think the problem comes from trying to build Sarus with RapidJSON 1.1.0 provided by the package manager. Unfortunately RapidJSON has not had tagged releases for a while, with the last one dating back to 2016 (see here), which is quite earlier than when Sarus started development. As indicated in the Sarus documentation, we recommend to use RapidJSON from the commit https://github.com/Tencent/rapidjson/commit/663f076, which is the one used regularly in the build and test pipelines. For example, you can install it as follows:

cd /tmp 
mkdir -p rapidjson && cd rapidjson
wget -O rapidjson-master.tar.gz https://github.com/Tencent/rapidjson/archive/663f076c7b44ce96526d1acfda3fa46971c8af31.tar.gz
tar xvzf rapidjson-master.tar.gz
cd rapidjson-663f076c7b44ce96526d1acfda3fa46971c8af31
sudo mkdir -p /usr/local/include/rapidjson && sudo cp -r include/rapidjson/* /usr/local/include/rapidjson

I was able to also build Sarus in a Ubuntu 18.04 environment with the very latest commit from RapidJSON (https://github.com/Tencent/rapidjson/commit/b557259f8813bed2d79e83bd2f92eb673579a82c), if you prefer a more recent commit.

Should you choose a RapidJSON installation location which is not in the default CMake search paths, you could pass the location manually to CMake through the CMAKE_PREFIX_PATH variable, e.g.:

cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain_files/gcc.cmake \
      -DCMAKE_INSTALL_PREFIX=/opt/sarus/default \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_PREFIX_PATH="<rapidjson install dir>" \
      ..
taliaga commented 2 years ago

Closing due to inactivity. If further help is needed, feel free to reopen or create a new issue if unrelated.