diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ae9bf11..b762a69b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,15 @@ cmake_minimum_required(VERSION 3.13) project(tentris LANGUAGES CXX - VERSION 1.1.2) + VERSION 1.1.3) set(CMAKE_CXX_STANDARD 20) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/tentris/tentris_version.hpp) -include(${CMAKE_BINARY_DIR}/conan_paths.cmake) - -if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) - if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) - endif () -endif () +include(cmake/boilerplate_init.cmake) +boilerplate_init() +include(cmake/conan_cmake.cmake) +install_packages_via_conan("${CMAKE_SOURCE_DIR}/conanfile.txt" "${CONAN_OPTIONS}") if(DEFINED ${TENTRIS_MARCH}) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=${TENTRIS_MARCH}") @@ -85,6 +82,7 @@ endif () find_package(restinio REQUIRED) find_package(string-view-lite REQUIRED) find_package(optional-lite REQUIRED) +find_package(serd REQUIRED) # make a library of the code add_library(tentris INTERFACE) @@ -109,7 +107,7 @@ target_link_libraries(tentris hypertrie::hypertrie rdf-parser::rdf-parser Boost::Boost - serd-0 + serd::serd cppitertools::cppitertools ) diff --git a/Dockerfile b/Dockerfile index c3bb87fc..da26be8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,18 +23,8 @@ RUN export LDFLAGS="${CMAKE_EXE_LINKER_FLAGS}" && ./configure \ make install WORKDIR / -# we need serd as static library. Not available from ubuntu repos -RUN ln -s /usr/bin/python3 /usr/bin/python -RUN git clone --quiet --branch v0.30.2 https://gitlab.com/drobilla/serd.git -WORKDIR serd -RUN git submodule update --quiet --init --recursive && \ - ./waf configure --static && \ - ./waf install -RUN rm /usr/bin/python -WORKDIR / - # install and configure conan -RUN pip3 install conan && \ +RUN pip3 install "conan<2" && \ conan user && \ conan profile new --detect default && \ conan profile update settings.compiler.libcxx=libstdc++11 default && \ @@ -50,6 +40,7 @@ RUN conan remote add dice-group https://conan.dice-research.org/artifactory/api/ # build and cache dependencies via conan WORKDIR /conan_cache COPY conanfile.txt conanfile.txt +RUN ln -s /usr/bin/clang-14 /usr/bin/clang # required by meson for building serd RUN conan install . --build=missing --profile default > conan_build.log # import project files diff --git a/README.MD b/README.MD index 094ea039..257ffa7e 100644 --- a/README.MD +++ b/README.MD @@ -1,5 +1,3 @@ -[![Website](https://img.shields.io/website?up_message=tentris&url=https%3A%2F%2Ftentris.dice-research.org%2F)](https://tentris.dice-research.org/) [![Build Status](https://travis-ci.com/dice-group/tentris.svg)](https://travis-ci.com/dice-group/tentris) [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/dicegroup/tentris_server)](https://hub.docker.com/repository/docker/dicegroup/tentris_server) ![GitHub](https://img.shields.io/github/license/dice-group/tentris) - # Tᴇɴᴛʀɪs: A Tensor-based Triple Store

Tᴇɴᴛʀɪs Logo

@@ -22,6 +20,24 @@ https://tentris.dice-research.org/iswc2020/ } ``` +and + +> Alexander Bigerl, Lixi Conrads, Charlotte Behning, Muhammad Saleem and Axel-Cyrille Ngonga Ngomo (2022) Hashing the Hypertrie: Space- and Time-Efficient Indexing for SPARQL in Tensors. In: The Semantic Web – ISWC 2022 Hashing the Hypertrie: Space- and Time-Efficient Indexing for SPARQL in Tensors + +https://tentris.dice-research.org/iswc2022/ + +``` +@InProceedings{bigerl2022hashing-the-hypertrie, + author = {Bigerl, Alexander and Conrads, Lixi and Behning, Charlotte and Sherif, Mohamed Ahmed and Saleem, Muhammad and Ngonga Ngomo, Axel-Cyrille}, + booktitle = {The Semantic Web -- ISWC 2022}, + publisher = {Springer International Publishing}, + title = { {H}ashing the {H}ypertrie: {S}pace- and {T}ime-{E}fficient {I}ndexing for {SPARQL} in {T}ensors}, + url = {https://papers.dice-research.org/2022/ISWC_Hashing_the_Hypertrie/iswc2022_hashing_the_hypertrie_public.pdf}, + year = 2022 +} + +``` + ## Key Features @@ -152,15 +168,20 @@ To build Tᴇɴᴛʀɪs yourself, you need some experience with building C++ pro ### Build Tools Tᴇɴᴛʀɪs is known to build successfully on Ubuntu 20.04 and newer. -Building was tested with GCC 10 and clang 10. +Building was tested with clang 14 and libstdc++-11-dev (gcc's standard library). The following packages are required to build Tᴇɴᴛʀɪs: ``` -sudo apt install build-essential uuid-dev g++-10 git openjdk-8-jdk python3-pip python3-setuptools python3-wheel +sudo apt install make cmake uuid-dev git openjdk-11-jdk python3-pip python3-setuptools python3-wheel libstdc++-11-dev clang-14 g++-11 pkg-config lld autoconf libtoolmake cmake uuid-dev git openjdk-11-jdk python3-pip python3-setuptools python3-wheel libstdc++-11-dev clang-14 g++-11 pkg-config lld autoconf libtool ``` -Additionally, a recent version of conan is required: +and set the compilers to be used in your current shell: +```bash +export CXX="clang++-14" +export CC="clang-14" ``` -pip3 install --user conan +Additionally, a conan v1.x is required: +``` +pip3 install --user "conan<2" ``` ### Dependencies @@ -168,15 +189,6 @@ Most required dependencies are installed via conan. Therefore, Add the respectiv ```shell script conan remote add dice-group https://conan.dice-research.org/artifactory/api/conan/tentris ``` -Additionally, a statically linked version of the [Serd](https://drobilla.net/software/serd) library is required. As the packages in the deb/rpm repositories include only a dynamic library, we need to compile it manually: -```shell script -git clone --branch v0.30.2 https://gitlab.com/drobilla/serd.git -cd serd -git submodule update --init --recursive -./waf configure --static -sudo ./waf install -cd - -``` ### Pull & Build After you installed all dependencies, you are ready to build Tᴇɴᴛʀɪs. Make sure you are connected to the internet as Tᴇɴᴛʀɪs downloads things at several points throughout the build processes. diff --git a/cmake/boilerplate_init.cmake b/cmake/boilerplate_init.cmake new file mode 100644 index 00000000..675e2811 --- /dev/null +++ b/cmake/boilerplate_init.cmake @@ -0,0 +1,27 @@ +macro(boilerplate_init) + ## enforce standard compliance + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + + ## C++ compiler flags + if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + else () + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0") + endif () + + ## C++ language visibility configuration + if (NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET AND + NOT DEFINED CMAKE_VISIBILITY_INLINES_HIDDEN) + set(CMAKE_CXX_VISIBILITY_PRESET default) + set(CMAKE_VISIBILITY_INLINES_HIDDEN NO) + endif () + + # conan requires cmake build type to be specified and it is generally a good idea + if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CMakeCache.txt) + if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) + endif () + endif () +endmacro() diff --git a/cmake/conan_cmake.cmake b/cmake/conan_cmake.cmake new file mode 100644 index 00000000..1cd79894 --- /dev/null +++ b/cmake/conan_cmake.cmake @@ -0,0 +1,27 @@ +macro(install_packages_via_conan conanfile conan_options) + + list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) + list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) + + + if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") + message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") + file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake" + "${CMAKE_BINARY_DIR}/conan.cmake" + TLS_VERIFY ON) + endif () + + include(${CMAKE_BINARY_DIR}/conan.cmake) + + conan_cmake_autodetect(settings) + conan_check(VERSION 1 DETECT_QUIET) + if (CONAN_CMD) + conan_cmake_install(PATH_OR_REFERENCE ${conanfile} + BUILD missing + SETTINGS ${settings} + OPTIONS "${conan_options}" + ENV_HOST "CC=${CMAKE_C_COMPILER};CXX=${CMAKE_CXX_COMPILER}") + else () + message(WARNING "No conan executable was found. Dependency retrieval via conan is disabled. System dependencies will be used if available.") + endif () +endmacro() \ No newline at end of file diff --git a/conanfile.txt b/conanfile.txt index e0f538a8..f7e4ac3e 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,10 +1,11 @@ [requires] -boost/1.75.0 +boost/1.82.0 fmt/7.1.3 restinio/0.6.12 hypertrie/0.6.1@dice-group/stable rdf-parser/0.13.0@dice-group/stable sparql-parser-base/0.2.2@dice-group/stable +serd/0.30.16 [options] restinio:asio=boost @@ -17,3 +18,5 @@ sparql-parser-base:sparql_version=1.0 [generators] cmake_find_package cmake_paths +CMakeDeps +CMakeToolchain \ No newline at end of file diff --git a/src/lib/tentris/store/RDF/SerdParser.hpp b/src/lib/tentris/store/RDF/SerdParser.hpp index d84c09e1..2aa49e6d 100644 --- a/src/lib/tentris/store/RDF/SerdParser.hpp +++ b/src/lib/tentris/store/RDF/SerdParser.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/lib/tentris/store/TripleStore.hpp b/src/lib/tentris/store/TripleStore.hpp index 8023b936..b4b7523b 100644 --- a/src/lib/tentris/store/TripleStore.hpp +++ b/src/lib/tentris/store/TripleStore.hpp @@ -14,7 +14,6 @@ #include "tentris/store/RDF/TermStore.hpp" #include "tentris/store/RDF/SerdParser.hpp" -#include "tentris/store/SPARQL/ParsedSPARQL.hpp" #include "tentris/util/LogHelper.hpp" #include "tentris/tensor/BoolHypertrie.hpp"