Skip to content

Commit

Permalink
Fix/build (#94)
Browse files Browse the repository at this point in the history
* include serd 0.30.16 dependency via conan

* update how CMake handles conan

* update boost to work with recent clang versions

* reflect changes on Dockerfile

* update README.MD
  • Loading branch information
bigerl authored Aug 29, 2023
1 parent 627bb8f commit bc33b03
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 36 deletions.
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ 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}")
Expand Down Expand Up @@ -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)
Expand All @@ -109,7 +107,7 @@ target_link_libraries(tentris
hypertrie::hypertrie
rdf-parser::rdf-parser
Boost::Boost
serd-0
serd::serd
cppitertools::cppitertools
)

Expand Down
13 changes: 2 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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
Expand Down
42 changes: 27 additions & 15 deletions README.MD
Original file line number Diff line number Diff line change
@@ -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

<p><img src = "https://tentris.dice-research.org/iswc2020/assets/img/Tentris_logo.svg" alt = "Tᴇɴᴛʀɪs Logo" width = "30%" align = "center"></p>
Expand All @@ -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
}
```

</details>

## Key Features
Expand Down Expand Up @@ -152,31 +168,27 @@ 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
Most required dependencies are installed via conan. Therefore, Add the respective remotes:
```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.
Expand Down
27 changes: 27 additions & 0 deletions cmake/boilerplate_init.cmake
Original file line number Diff line number Diff line change
@@ -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()
27 changes: 27 additions & 0 deletions cmake/conan_cmake.cmake
Original file line number Diff line number Diff line change
@@ -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()
5 changes: 4 additions & 1 deletion conanfile.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,3 +18,5 @@ sparql-parser-base:sparql_version=1.0
[generators]
cmake_find_package
cmake_paths
CMakeDeps
CMakeToolchain
2 changes: 1 addition & 1 deletion src/lib/tentris/store/RDF/SerdParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <Dice/RDF/Term.hpp>
#include <Dice/hash/DiceHash.hpp>
#include <boost/lockfree/spsc_queue.hpp>
#include <serd-0/serd/serd.h>
#include <serd/serd.h>
#include <boost/algorithm/string.hpp>
#include <tsl/hopscotch_map.h>
#include <atomic>
Expand Down

0 comments on commit bc33b03

Please sign in to comment.