-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sam Partee
committed
Aug 31, 2020
0 parents
commit eb584cf
Showing
88 changed files
with
16,178 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[paths] | ||
source = | ||
src | ||
*/site-packages | ||
|
||
[run] | ||
branch = true | ||
source = | ||
silc | ||
tests | ||
parallel = true | ||
|
||
[report] | ||
show_missing = true | ||
precision = 2 | ||
omit = *migrations* |
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,9 @@ | ||
# see https://editorconfig.org/ | ||
root = true | ||
|
||
[*] | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 |
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,74 @@ | ||
*.py[cod] | ||
__pycache__ | ||
|
||
# third party libs | ||
third-party/ | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
.eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
wheelhouse | ||
develop-eggs | ||
.installed.cfg | ||
lib | ||
lib64 | ||
venv*/ | ||
pyvenv*/ | ||
pip-wheel-metadata/ | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
.coverage.* | ||
.pytest_cache/ | ||
nosetests.xml | ||
coverage.xml | ||
htmlcov | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Mr Developer | ||
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
.idea | ||
*.iml | ||
*.komodoproject | ||
|
||
# Complexity | ||
output/*.html | ||
output/*/index.html | ||
|
||
# Sphinx | ||
docs/_build | ||
|
||
.DS_Store | ||
*~ | ||
.*.sw[po] | ||
.build | ||
.ve | ||
.env | ||
.cache | ||
.pytest | ||
.benchmarks | ||
.bootstrap | ||
.appveyor.token | ||
*.bak | ||
|
||
# Mypy Cache | ||
.mypy_cache/ |
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,10 @@ | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
version: 2 | ||
sphinx: | ||
configuration: docs/conf.py | ||
formats: all | ||
python: | ||
install: | ||
- requirements: docs/requirements.txt | ||
- method: pip | ||
path: . |
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 @@ | ||
{ | ||
"cmake.configureOnOpen": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
Authors | ||
======= | ||
|
||
* HPE HPC & AI - hpe.com |
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 @@ | ||
|
||
Changelog | ||
========= | ||
|
||
0.1.0 (2020-08-25) | ||
------------------ |
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,121 @@ | ||
SET(CMAKE_CXX_STANDARD 17) | ||
cmake_minimum_required(VERSION 3.1) | ||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) | ||
project (silc) | ||
|
||
set(PROJECT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) | ||
set(CPP_ROOT_FOLDER_NAME silc) | ||
include_directories(${PROJECT_INCLUDE_DIR}) | ||
|
||
|
||
# Dependencies | ||
# ============ | ||
find_package(xtl REQUIRED) | ||
find_package(xtensor REQUIRED) | ||
|
||
# # Build | ||
# # ===== | ||
|
||
|
||
SET(INTERFACE_LIB_NAME silc) | ||
|
||
file(GLOB_RECURSE ${PROJECT_NAME}_HEADERS ${PROJECT_INCLUDE_DIR}/*.hpp) | ||
|
||
add_library(${INTERFACE_LIB_NAME} INTERFACE) | ||
|
||
message(STATUS "INSTALL_INTERFACE: ${CMAKE_INSTALL_INCLUDEDIR}") | ||
target_include_directories(${INTERFACE_LIB_NAME} INTERFACE | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) | ||
|
||
|
||
|
||
target_link_libraries(${INTERFACE_LIB_NAME} | ||
INTERFACE xtensor) | ||
|
||
|
||
# Python | ||
# ============ | ||
OPTION(BUILD_PYTHON "${PROJECT_NAME} python binding" ON) | ||
if(BUILD_PYTHON) | ||
add_subdirectory(python) | ||
endif() | ||
|
||
|
||
|
||
# Tests | ||
########### | ||
|
||
OPTION(BUILD_TESTS "${PROJECT_NAME} test suite" ON) | ||
# OPTION(DOWNLOAD_DOCTEST "build doctest from downloaded sources" ON) | ||
|
||
# if(DOWNLOAD_DOCTEST) | ||
# set(BUILD_TESTS ON) | ||
# endif() | ||
|
||
if(BUILD_TESTS) | ||
add_subdirectory(test) | ||
endif() | ||
|
||
|
||
|
||
# Installation | ||
# ============ | ||
|
||
include(GNUInstallDirs) | ||
include(CMakePackageConfigHelpers) | ||
|
||
|
||
set(${PROJECT_NAME}_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE | ||
STRING "install path for ${PROJECT_NAME}Config.cmake") | ||
|
||
|
||
message(STATUS "DEST ${${PROJECT_NAME}_CMAKECONFIG_INSTALL_DIR}" ) | ||
|
||
|
||
install(TARGETS ${INTERFACE_LIB_NAME} | ||
EXPORT ${INTERFACE_LIB_NAME}-targets) | ||
|
||
install(EXPORT ${INTERFACE_LIB_NAME}-targets | ||
FILE ${INTERFACE_LIB_NAME}Targets.cmake | ||
#NAMESPACE ${PROJECT_NAME}:: | ||
DESTINATION lib/cmake/${PROJECT_NAME} | ||
) | ||
|
||
|
||
install(DIRECTORY ${PROJECT_INCLUDE_DIR}/${CPP_ROOT_FOLDER_NAME} | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
||
|
||
|
||
|
||
configure_package_config_file(${PROJECT_NAME}Config.cmake.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" | ||
INSTALL_DESTINATION ${${PROJECT_NAME}_CMAKECONFIG_INSTALL_DIR}) | ||
|
||
|
||
# ${PROJECT_NAME} is header-only and does not depend on the architecture. | ||
# Remove CMAKE_SIZEOF_VOID_P from ${PROJECT_NAME}ConfigVersion.cmake so that an ${PROJECT_NAME}Config.cmake | ||
# generated for a 64 bit target can be used for 32 bit targets and vice versa. | ||
set(_${PROJECT_NAME}_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}) | ||
unset(CMAKE_SIZEOF_VOID_P) | ||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake | ||
VERSION ${${PROJECT_NAME}_VERSION} | ||
COMPATIBILITY AnyNewerVersion) | ||
set(CMAKE_SIZEOF_VOID_P ${_${PROJECT_NAME}_CMAKE_SIZEOF_VOID_P}) | ||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake | ||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake | ||
DESTINATION ${${PROJECT_NAME}_CMAKECONFIG_INSTALL_DIR}) | ||
|
||
install(EXPORT ${PROJECT_NAME}-targets | ||
FILE ${PROJECT_NAME}Targets.cmake | ||
DESTINATION ${${PROJECT_NAME}_CMAKECONFIG_INSTALL_DIR}) | ||
|
||
configure_file(${PROJECT_NAME}.pc.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" | ||
@ONLY) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/") | ||
|
||
|
||
|
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,18 @@ | ||
graft docs | ||
graft src | ||
graft tests | ||
|
||
|
||
include .coveragerc | ||
include .cookiecutterrc | ||
include .editorconfig | ||
|
||
include AUTHORS.rst | ||
include CHANGELOG.rst | ||
include CONTRIBUTING.rst | ||
include LICENSE | ||
include README.rst | ||
|
||
include tox.ini .travis.yml .appveyor.yml .readthedocs.yml | ||
|
||
global-exclude *.py[cod] __pycache__/* *.so *.dylib |
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 @@ | ||
======== | ||
Overview | ||
======== | ||
|
||
SmartSim Infrastructure Library Clients |
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 @@ | ||
#!/bin/sh | ||
|
||
if [[ ! -d "./third-party" ]]; then | ||
mkdir third-party | ||
fi | ||
cd third-party | ||
|
||
# Install Hiredis | ||
if ls ./hiredis/install/lib/libhiredis* 1>/dev/null 2>&1; then | ||
echo "Hiredis has already been downloaded and installed" | ||
export HIREDIS_INSTALL_PATH="$(pwd)/hiredis/install" | ||
export LD_LIBRARY_PATH="$HIREDIS_INSTALL_PATH/lib":$LD_LIBRARY_PATH | ||
else | ||
if [[ ! -d "./hiredis" ]]; then | ||
git clone https://github.com/redis/hiredis.git hiredis --branch master --depth=1 | ||
echo "Hiredis downloaded" | ||
fi | ||
cd hiredis | ||
make PREFIX="$(pwd)/install" | ||
make PREFIX="$(pwd)/install" install | ||
cd ../ | ||
export HIREDIS_INSTALL_PATH="$(pwd)/hiredis/install" | ||
export LD_LIBRARY_PATH="$HIREDIS_INSTALL_PATH/lib":$LD_LIBRARY_PATH | ||
echo "Finished installing Hiredis" | ||
fi | ||
|
||
#Install Redis-plus-plus | ||
if ls ./redis-plus-plus/install/lib/libredis++* 1>/dev/null 2>&1; then | ||
echo "Redis-plus-plus has already been downloaded and installed" | ||
export REDISPP_INSTALL_PATH="$(pwd)/redis-plus-plus/install" | ||
export LD_LIBRARY_PATH="$REDISPP_INSTALL_PATH/lib":$LD_LIBRARY_PATH | ||
else | ||
if [[ ! -d "./redis-plus-plus" ]]; then | ||
git clone https://github.com/sewenew/redis-plus-plus.git redis-plus-plus --branch master --depth=1 | ||
echo "Redis-plus-plus downloaded" | ||
fi | ||
cd redis-plus-plus | ||
ex -s -c '2i|SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)' -c x CMakeLists.txt | ||
mkdir compile | ||
cd compile | ||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="${HIREDIS_INSTALL_PATH}" -DCMAKE_INSTALL_PREFIX="$(pwd)/../install" .. | ||
make -j 2 | ||
make install | ||
cd ../../ | ||
export REDISPP_INSTALL_PATH="$(pwd)/redis-plus-plus/install" | ||
export LD_LIBRARY_PATH="$REDISPP_INSTALL_PATH/lib":$LD_LIBRARY_PATH | ||
echo "Finished installing Redis-plus-plus" | ||
fi | ||
|
||
cd ../ |
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,10 @@ | ||
find_path(DOCTEST_INCLUDE_DIR doctest.h) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(DOCTEST DEFAULT_MSG DOCTEST_INCLUDE_DIR) | ||
|
||
if(DOCTEST_FOUND) | ||
set(DOCTEST_INCLUDE_DIRS ${DOCTEST_INCLUDE_DIR}) | ||
endif(DOCTEST_FOUND) | ||
|
||
mark_as_advanced( DOCTEST_INCLUDE_DIR) |
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,52 @@ | ||
# Find the Python NumPy package | ||
# PYTHON_NUMPY_INCLUDE_DIR | ||
# NUMPY_FOUND | ||
# will be set by this script | ||
|
||
|
||
find_package(pybind11 REQUIRED) | ||
include_directories(${pybind11_INCLUDE_DIRS}) | ||
|
||
|
||
if(NUMPY_FIND_QUIETLY) | ||
find_package(PythonInterp) | ||
else() | ||
find_package(PythonInterp QUIET) | ||
set(_numpy_out 1) | ||
endif() | ||
|
||
if (PYTHON_EXECUTABLE) | ||
# write a python script that finds the numpy path | ||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/FindNumpyPath.py | ||
"from __future__ import print_function\n" | ||
"try: import numpy; print(numpy.get_include())\nexcept:pass\n") | ||
|
||
# execute the find script | ||
exec_program("${PYTHON_EXECUTABLE}" ${CMAKE_CURRENT_BINARY_DIR} | ||
ARGS "FindNumpyPath.py" | ||
OUTPUT_VARIABLE NUMPY_PATH) | ||
elseif(_numpy_out) | ||
message(STATUS "Python executable not found.") | ||
endif(PYTHON_EXECUTABLE) | ||
|
||
|
||
|
||
|
||
|
||
|
||
find_path(PYTHON_NUMPY_INCLUDE_DIR numpy/arrayobject.h | ||
"${NUMPY_PATH}" | ||
"${PYTHON_INCLUDE_PATH}" | ||
/usr/include/python2.7/ | ||
/usr/include/python2.6/ | ||
/usr/include/python2.5/ | ||
/usr/include/python2.4/) | ||
|
||
#message(STATUS "the numpy path is: ${NUMPY_PATH}") | ||
|
||
if(PYTHON_NUMPY_INCLUDE_DIR) | ||
set(PYTHON_NUMPY_FOUND 1 CACHE INTERNAL "Python numpy found") | ||
endif(PYTHON_NUMPY_INCLUDE_DIR) | ||
|
||
#include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( NUMPY DEFAULT_MSG PYTHON_NUMPY_INCLUDE_DIR) |
Oops, something went wrong.