-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into imp/205-custom-template-index-pattern
- Loading branch information
Showing
68 changed files
with
668 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[tool.black] | ||
line-length = 100 | ||
target-version = ['py38'] | ||
target-version = ['py310'] | ||
skip-string-normalization = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ dist/ | |
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
./lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
format: | ||
@find ./lib/include ./lib/src ./nanobind/include ./nanobind/src \ | ||
-iname "*.hpp" -o \ | ||
-iname "*.cpp" -o \ | ||
-iname "*.hh" -o \ | ||
-iname "*.cc" -o \ | ||
-iname "*.h" -o \ | ||
-iname "*.c" \ | ||
| xargs clang-format -verbose -style=file -i | ||
|
||
packer-images: | ||
@./scripts/build_glibc_packer_docker_image.sh | ||
@./scripts/build_musl_packer_docker_image.sh | ||
|
||
packs: packer-images | ||
@./scripts/run_glibc_packer.sh | ||
@./scripts/run_musl_packer.sh | ||
|
||
install: | ||
@./scripts/build_glibc_packer_docker_image.sh | ||
@./scripts/run_glibc_packer.sh | ||
@pip install ./nanobind/dist/hyperon_das_atomdb_cpp*manylinux*.whl --force-reinstall --no-cache-dir | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ wheel>=0.37.1 | |
nanobind>=2.1.0 | ||
scikit-build-core>=0.10 | ||
auditwheel>=6.1.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# See https://github.com/pypa/manylinux for more information | ||
FROM quay.io/pypa/manylinux_2_28_x86_64 | ||
|
||
RUN dnf install -y rpm-build | ||
|
||
CMD ["bash", "-x", "./scripts/_build_glibc_packs.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# See https://github.com/pypa/manylinux for more information | ||
FROM quay.io/pypa/musllinux_1_2_x86_64 | ||
|
||
CMD ["bash", "-x", "./scripts/_build_musl_packs.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/ | ||
dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
cmake_minimum_required(VERSION 3.15...3.30) | ||
|
||
if(DEFINED CMAKE_PROJECT_VERSION AND NOT "${CMAKE_PROJECT_VERSION}" STREQUAL "") | ||
set(LIB_VERSION ${CMAKE_PROJECT_VERSION}) | ||
else() | ||
message(FATAL_ERROR "CMAKE_PROJECT_VERSION is not defined or is empty") | ||
endif() | ||
|
||
if(NOT DEFINED TARGET_TYPE OR "${TARGET_TYPE}" STREQUAL "") | ||
message(FATAL_ERROR "TARGET_TYPE is not defined or is empty") | ||
endif() | ||
|
||
set(namespace "atomdb") | ||
project( | ||
"hyperon_das_atomdb_cpp" | ||
VERSION ${LIB_VERSION} | ||
DESCRIPTION "Atom Space DB for Hyperon DAS" | ||
) | ||
|
||
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-dev") | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Ofast") | ||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
|
||
add_library(${PROJECT_NAME} STATIC) | ||
|
||
# Detect the installed mbedtls static library and import it into hyperon_das_atomdb_cpp | ||
if(EXISTS /usr/local/lib/libmbedcrypto.a) | ||
set(LIBMBCRYPTO_PATH /usr/local/lib/libmbedcrypto.a) | ||
elseif(EXISTS /usr/local/lib64/libmbedcrypto.a) | ||
set(LIBMBCRYPTO_PATH /usr/local/lib64/libmbedcrypto.a) | ||
else() | ||
message(FATAL_ERROR "libmbedcrypto.a not found in /usr/local/lib or /usr/local/lib64") | ||
endif() | ||
|
||
# This step is required to embed the `mbedtls` library into the `hyperon_das_atomdb_cpp` static | ||
# library. This is done to avoid the need to install the `mbedtls` library on the target system. | ||
# Teoretically, it would be possible to do the same with just `CMAKE_CXX_ARCHIVE_CREATE`, but it | ||
# does not work as expected due to some limitations related to the number of files that can be | ||
# passed as objects. | ||
set(MBCRYPTO_SYMBOLS_PATH ${CMAKE_BINARY_DIR}/mbedcrypto_symbols) | ||
make_directory(${MBCRYPTO_SYMBOLS_PATH}) | ||
execute_process(COMMAND ar x ${LIBMBCRYPTO_PATH} --output=${MBCRYPTO_SYMBOLS_PATH}) | ||
file(GLOB mbedcrypto_symbols ${MBCRYPTO_SYMBOLS_PATH}/*.o) | ||
set(CREATE_STATIC_LIB_SCRIPT ${PROJECT_SOURCE_DIR}/scripts/_create_static_library.sh) | ||
set(CMAKE_CXX_CREATE_STATIC_LIBRARY | ||
"${CREATE_STATIC_LIB_SCRIPT} <TARGET> <OBJECTS> ${MBCRYPTO_SYMBOLS_PATH}/*o") | ||
|
||
file(GLOB_RECURSE sources | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/*.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) | ||
file(GLOB_RECURSE headers | ||
${CMAKE_CURRENT_SOURCE_DIR}/include/*.h | ||
${CMAKE_CURRENT_SOURCE_DIR}/include/*.hh | ||
${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) | ||
|
||
target_sources(${PROJECT_NAME} PRIVATE ${sources} ${headers}) | ||
|
||
target_include_directories(${PROJECT_NAME} | ||
PRIVATE | ||
# where the library itself will look for its internal headers | ||
${CMAKE_CURRENT_SOURCE_DIR}/src | ||
PUBLIC | ||
# where top-level project will look for the library's public headers | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
# where external projects will look for the library's public headers | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
|
||
# without it public headers won't get installed | ||
set(public_headers ${headers}) | ||
|
||
target_compile_options(${PROJECT_NAME} PRIVATE -Werror) | ||
|
||
# where to find our CMake modules | ||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") | ||
include(Installing) | ||
include(Packing) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
|
||
check_required_components(@PROJECT_NAME@) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2024 SingularityNET | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# for CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_INCLUDEDIR and others | ||
include(GNUInstallDirs) | ||
|
||
# note that ${public_headers} should be in quotes | ||
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${public_headers}") | ||
|
||
set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "d") | ||
|
||
# install the target and create export-set | ||
install( | ||
TARGETS ${PROJECT_NAME} | ||
EXPORT "${PROJECT_NAME}-targets" | ||
COMPONENT ${PROJECT_NAME} # must be here, not any line lower | ||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} # include/hyperon_das_atomdb_cpp | ||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} # include | ||
) | ||
|
||
set(CMAKE_INSTALL_DESTINATION "cmake/${PROJECT_NAME}") | ||
|
||
# generate and install export file | ||
install( | ||
EXPORT "${PROJECT_NAME}-targets" | ||
FILE "${PROJECT_NAME}-targets.cmake" | ||
NAMESPACE ${namespace}:: | ||
DESTINATION ${CMAKE_INSTALL_DESTINATION} | ||
COMPONENT ${PROJECT_NAME} | ||
) | ||
|
||
include(CMakePackageConfigHelpers) | ||
|
||
# generate the version file for the config file | ||
write_basic_package_version_file( | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" | ||
COMPATIBILITY AnyNewerVersion | ||
) | ||
# create config file | ||
configure_package_config_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" | ||
INSTALL_DESTINATION ${CMAKE_INSTALL_DESTINATION} | ||
) | ||
# install config files | ||
install( | ||
FILES | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" | ||
DESTINATION ${CMAKE_INSTALL_DESTINATION} | ||
COMPONENT ${PROJECT_NAME} | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME} CACHE STRING "hyperon_das_atomdb_cpp") | ||
set( | ||
CPACK_PACKAGE_DESCRIPTION_SUMMARY "Atom Space DB for Hyperon DAS" | ||
CACHE STRING "Atom Space DB for Hyperon DAS is a C++ library for managing Atom databases." | ||
) | ||
set(CPACK_PACKAGE_VENDOR "SingularityNET") | ||
|
||
set(CPACK_VERBATIM_VARIABLES YES) | ||
|
||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) | ||
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/dist") | ||
set(CPACK_STRIP_FILES YES) | ||
|
||
set( | ||
CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS | ||
OWNER_READ OWNER_WRITE OWNER_EXECUTE | ||
GROUP_READ GROUP_EXECUTE | ||
WORLD_READ WORLD_EXECUTE | ||
) | ||
|
||
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") | ||
|
||
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | ||
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) | ||
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) | ||
|
||
set(CPACK_PACKAGE_CONTACT "[email protected]") | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andre Senna <${CPACK_PACKAGE_CONTACT}>") | ||
|
||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") | ||
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") | ||
|
||
set(CPACK_PACKAGE_ARCHITECTURE "amd64") | ||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CPACK_PACKAGE_ARCHITECTURE}) | ||
set(CPACK_PACKAGE_VERSION | ||
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") | ||
set(CPACK_PACKAGE_FILE_NAME | ||
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_ARCHITECTURE}-${TARGET_TYPE}") | ||
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) | ||
set(CPACK_DEB_COMPONENT_INSTALL YES) | ||
|
||
include(CPack) | ||
|
2 changes: 1 addition & 1 deletion
2
hyperon_das_atomdb_cpp/src/constants.h → cpp/lib/include/constants.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.