Skip to content

Commit 3733291

Browse files
authored
v1.3.0 (#99)
1 parent 9be81cf commit 3733291

File tree

159 files changed

+4370
-30334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+4370
-30334
lines changed

.dockerignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
12
## project specific
2-
/src/lib/tentris/tentris_version.hpp
3+
**/tentris_version.hpp
4+
**/build*/**
5+
**/cmake-*/**
6+
tests
37
# log files
4-
tentris_*
8+
tentris.log
59

610
# Created by https://www.toptal.com/developers/gitignore/api/c++,conan,jetbrains+all,cmake
711
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,conan,jetbrains+all,cmake

.github/workflows/push.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 0 additions & 85 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## project specific
2-
/src/lib/tentris/tentris_version.hpp
2+
**/tentris_version.hpp
3+
34
# log files
4-
tentris_*
5+
tentris.log
56

67
# Created by https://www.toptal.com/developers/gitignore/api/c++,conan,jetbrains+all,cmake
78
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,conan,jetbrains+all,cmake

CMakeLists.txt

Lines changed: 12 additions & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -1,194 +1,23 @@
1-
cmake_minimum_required(VERSION 3.13)
1+
cmake_minimum_required(VERSION 3.18)
22
project(tentris
3-
LANGUAGES CXX
4-
VERSION 1.1.3)
5-
set(CMAKE_CXX_STANDARD 20)
6-
7-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/tentris/tentris_version.hpp)
3+
VERSION 1.3.0
4+
DESCRIPTION "tensor-based triplestore")
85

96
include(cmake/boilerplate_init.cmake)
107
boilerplate_init()
11-
include(cmake/conan_cmake.cmake)
12-
install_packages_via_conan("${CMAKE_SOURCE_DIR}/conanfile.txt" "${CONAN_OPTIONS}")
13-
14-
if(DEFINED ${TENTRIS_MARCH})
15-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=${TENTRIS_MARCH}")
16-
endif()
178

18-
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
19-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer -momit-leaf-frame-pointer")
20-
else ()
21-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
9+
option(CONAN_CMAKE "If this should use conan cmake to fetch dependencies" On)
10+
if (IS_TOP_LEVEL AND CONAN_CMAKE)
11+
include(cmake/conan_cmake.cmake)
12+
install_packages_via_conan("${CMAKE_CURRENT_SOURCE_DIR}/conanfile.py" "")
2213
endif ()
2314

24-
if (TENTRIS_STATIC)
25-
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
26-
endif ()
27-
28-
if (TENTRIS_BUILD_WITH_TCMALLOC)
29-
find_library(TCMALLOCMINIMAL tcmalloc_minimal)
30-
if (NOT TCMALLOCMINIMAL)
31-
find_library(TCMALLOCMINIMAL tcmalloc-minimal)
32-
endif()
33-
if (NOT TCMALLOCMINIMAL)
34-
message(FATAL_ERROR "Neither tcmalloc-minimal nor tcmalloc_minimal was found")
35-
endif()
36-
message("tcmalloc minimal ${TCMALLOCMINIMAL}")
37-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TCMALLOCMINIMAL}")
38-
if(TENTRIS_STATIC)
39-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--eh-frame-hdr")
40-
endif()
41-
endif()
42-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -g -O0")
43-
44-
# Lightweight C++ command line option parser https://github.com/jarro2783/cxxopts
45-
include(FetchContent)
46-
FetchContent_Declare(
47-
cxxopts
48-
GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
49-
GIT_TAG v2.2.1
50-
GIT_SHALLOW TRUE
51-
)
52-
set(CXXOPTS_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
53-
set(CXXOPTS_BUILD_TESTS OFF CACHE BOOL "" FORCE)
54-
set(CXXOPTS_ENABLE_INSTALL OFF CACHE BOOL "" FORCE)
55-
set(CXXOPTS_ENABLE_WARNINGS OFF CACHE BOOL "" FORCE)
56-
FetchContent_MakeAvailable(cxxopts)
57-
58-
add_library(csv-parser INTERFACE)
59-
target_include_directories(csv-parser INTERFACE
60-
thirdparty/csv-parser
61-
)
62-
63-
64-
add_library(rapidjson INTERFACE)
65-
target_include_directories(rapidjson INTERFACE
66-
thirdparty/RapidJSON/include
67-
)
68-
69-
find_package(tsl-hopscotch-map REQUIRED)
70-
find_package(fmt REQUIRED)
71-
find_package(hypertrie REQUIRED)
72-
find_package(sparql-parser-base REQUIRED)
73-
find_package(rdf-parser REQUIRED)
74-
if (TENTRIS_STATIC)
75-
SET(Boost_USE_STATIC_LIBS ON)
76-
endif ()
77-
78-
find_package(Boost REQUIRED COMPONENTS system log_setup log thread)
79-
if (TENTRIS_STATIC)
80-
SET(RESTINIO_USE_BOOST_ASIO=static)
81-
endif ()
82-
find_package(restinio REQUIRED)
83-
find_package(string-view-lite REQUIRED)
84-
find_package(optional-lite REQUIRED)
85-
find_package(serd REQUIRED)
86-
87-
# make a library of the code
88-
add_library(tentris INTERFACE)
89-
90-
include(FetchContent)
91-
FetchContent_Declare(
92-
cppitertools
93-
GIT_REPOSITORY https://github.com/ryanhaining/cppitertools.git
94-
GIT_TAG v2.1
95-
GIT_SHALLOW TRUE)
96-
97-
FetchContent_MakeAvailable(cppitertools)
98-
99-
target_link_libraries(tentris
100-
INTERFACE
101-
stdc++fs # for #include <filesystem>
102-
cxxopts
103-
rapidjson
104-
sparql-parser-base::sparql-parser-base
105-
tsl::hopscotch_map
106-
fmt::fmt
107-
hypertrie::hypertrie
108-
rdf-parser::rdf-parser
109-
Boost::Boost
110-
serd::serd
111-
cppitertools::cppitertools
112-
)
113-
114-
target_include_directories(tentris INTERFACE
115-
# todo: move code to include/Dice/tentris
116-
src/lib/
117-
${Boost_INCLUDE_DIRS}
118-
)
119-
120-
# for rt and pthread linkage see:
121-
# * https://stackoverflow.com/questions/58848694/gcc-whole-archive-recipe-for-static-linking-to-pthread-stopped-working-in-rec
122-
# * https://stackoverflow.com/questions/35116327/when-g-static-link-pthread-cause-segmentation-fault-why
123-
if (TENTRIS_STATIC)
124-
set(TENTRIS_STATIC_DEF -static)
125-
set(TENTRIS_PTHREAD_DEF -Wl,--whole-archive -lrt -lpthread -Wl,--no-whole-archive)
126-
else()
127-
set(TENTRIS_PTHREAD_DEF -lpthread)
15+
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CMakeCache.txt)
16+
if (NOT CMAKE_BUILD_TYPE)
17+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
18+
endif ()
12819
endif ()
12920

13021

131-
# main executable targets
132-
add_executable(tentris_server src/exec/TentrisServer.cpp src/exec/config/ServerConfig.hpp src/exec/config/TerminalConfig.hpp)
133-
134-
target_link_libraries(tentris_server
135-
PRIVATE
136-
${TENTRIS_STATIC_DEF}
137-
${TENTRIS_PTHREAD_DEF}
138-
tentris
139-
restinio::restinio
140-
nonstd::string-view-lite
141-
nonstd::optional-lite
142-
nonstd::variant-lite
143-
)
144-
145-
set_target_properties(tentris_server PROPERTIES LINK_FLAGS_RELEASE -s)
146-
147-
add_dependencies(tentris_server tentris)
148-
149-
add_executable(tentris_terminal src/exec/TentrisTerminal.cpp src/exec/config/ServerConfig.hpp src/exec/config/TerminalConfig.hpp)
150-
target_link_libraries(tentris_terminal
151-
${TENTRIS_STATIC_DEF}
152-
${TENTRIS_PTHREAD_DEF}
153-
tentris
154-
)
155-
156-
set_target_properties(tentris_terminal PROPERTIES LINK_FLAGS_RELEASE -s)
157-
158-
add_dependencies(tentris_terminal tentris)
159-
160-
add_executable(rdf2ids src/exec/tools/RDF2IDs.cpp)
161-
target_link_libraries(rdf2ids
162-
${TENTRIS_STATIC_DEF}
163-
${TENTRIS_PTHREAD_DEF}
164-
tentris
165-
)
166-
167-
set_target_properties(rdf2ids PROPERTIES LINK_FLAGS_RELEASE -s)
16822

169-
add_dependencies(rdf2ids tentris)
170-
171-
172-
add_executable(ids2hypertrie src/exec/tools/IDs2Hypertrie.cpp)
173-
target_link_libraries(ids2hypertrie
174-
${TENTRIS_STATIC_DEF}
175-
${TENTRIS_PTHREAD_DEF}
176-
tentris
177-
csv-parser
178-
)
179-
180-
add_dependencies(ids2hypertrie tentris)
181-
182-
if (CMAKE_BUILD_TYPE MATCHES "Release")
183-
set_property(TARGET tentris_server PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
184-
set_property(TARGET tentris_terminal PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
185-
186-
set_property(TARGET ids2hypertrie PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
187-
set_property(TARGET rdf2ids PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
188-
endif ()
189-
190-
option(TENTRIS_BUILD_TESTS "build tests alongside the project" OFF)
191-
if (TENTRIS_BUILD_TESTS)
192-
enable_testing() # enable this to enable testing
193-
add_subdirectory(tests)
194-
endif ()
23+
add_subdirectory(libs)

0 commit comments

Comments
 (0)