Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
88c57b4
made lib compare
Gitubrr Apr 21, 2026
f6c9ff1
added more comparison points
Gitubrr Apr 25, 2026
7419e16
added list of dependences
Gitubrr Apr 28, 2026
21279b0
CI -> +
Gitubrr Apr 29, 2026
e2a2ad1
Just formatting changes to README
Gitubrr Apr 29, 2026
2ed3b03
added config params info
Gitubrr May 4, 2026
fc33885
added config structure
Gitubrr May 4, 2026
d680949
formatting only
Gitubrr May 4, 2026
de27aa7
added performance parameter
Gitubrr May 4, 2026
e0c9b47
formatting only
Gitubrr May 4, 2026
0b8ca49
formatting
Gitubrr May 5, 2026
b880e9e
added 2 libs, removed 'Пакетные менеджеры'
Gitubrr May 5, 2026
e0c730b
added SPLA usage scenarios
Gitubrr May 11, 2026
b5b7580
making defolt scenario
Gitubrr May 19, 2026
af09acd
added 1 question about errors
Gitubrr May 19, 2026
627b027
added new scenaries
Gitubrr Jun 1, 2026
c1b7f2d
added manual
Gitubrr Jul 9, 2026
8c9ddff
Fixed the incorrect format name in 1 example in CONFIGURATION FALE se…
Gitubrr Jul 10, 2026
c90f185
add parsers
Gitubrr Jul 26, 2026
82028eb
fixed formatting errors
Gitubrr Jul 26, 2026
464aaa0
changed cli parser, file parser, made validate
Gitubrr Jul 28, 2026
f8cea29
changed init
Gitubrr Jul 28, 2026
0af1432
made apply() and started changing cl_accelerator.cpp,.hpp + added num…
Gitubrr Jul 29, 2026
73045f1
removed apply(), changed init() -> init(conf)
Gitubrr Jul 29, 2026
a28e55e
for formatter only
Gitubrr Jul 29, 2026
8e333d8
add configuration mechanism
Gitubrr Aug 31, 2026
c9b84f3
made UserManual and UserGuide
Gitubrr Sep 8, 2026
3e87443
unnecessary changes
Gitubrr Sep 8, 2026
aa11385
fixed
Gitubrr Sep 20, 2026
60ecdff
for formatter and ubuntu build
Gitubrr Sep 20, 2026
53fb6c4
changed make file
Gitubrr Sep 20, 2026
5aa6e52
changed deps in make file
Gitubrr Sep 20, 2026
54b10b1
! grep -qE \[ FAILED \]
Gitubrr Sep 20, 2026
24dcab7
CL_TARGET_OPENCL_VERSION=300
Gitubrr Sep 20, 2026
2291458
made verbosity
Gitubrr Sep 22, 2026
3082114
added MIT license back
Gitubrr Sep 23, 2026
0b14b37
add MIT license to cl_configure
Gitubrr Sep 23, 2026
48613f8
made new user guide
Gitubrr Sep 24, 2026
ac5f337
chanjed config structure
Gitubrr Sep 25, 2026
60f09aa
added new params to cnfig
Gitubrr Sep 27, 2026
7586978
fixed build err
Gitubrr Sep 27, 2026
ec9897a
CL_TARGET_OPENCL_VERSION=300 -> 120 back
Gitubrr Sep 27, 2026
788e7b4
fixed CL_HPP_MINIMUM_OPENCL_VERSION
Gitubrr Sep 28, 2026
b895cd9
for deps
Gitubrr Sep 28, 2026
3e7f817
for formatter
Gitubrr Sep 28, 2026
17ec47a
removed base from UserGuide
Gitubrr Oct 3, 2026
73a39f6
removed "configs" and "current_config"
Gitubrr Oct 6, 2026
103f80e
added about how to run with user conf
Gitubrr Oct 7, 2026
4f9309f
fixed ci scenar
Gitubrr Oct 7, 2026
e6a8c45
Запуск с -> Запуск ci с
Gitubrr Oct 7, 2026
0dc7fba
added new configuration func
Gitubrr Oct 13, 2026
ae1209d
removed comment
Gitubrr Oct 13, 2026
2b2448e
fix for windows
Gitubrr Oct 13, 2026
66f1a3a
deleted and renamed files
Gitubrr Oct 13, 2026
14c6bf1
cl_config_status.hpp -> config_status.hpp
Gitubrr Oct 13, 2026
e31094b
chanjed ci back
Gitubrr Oct 13, 2026
0a82109
chanjed lang to english
Gitubrr Oct 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 73 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(spla LANGUAGES CXX)

######################################################################
## Package version
## python/VERSION.md is the single source of truth for the version:
## python/setup.py reads it for the PyPI package and the C++ library
## gets it as the SPLA_VERSION compile definition.

file(READ "${CMAKE_CURRENT_LIST_DIR}/python/VERSION.md" SPLA_VERSION_RAW)
string(STRIP "${SPLA_VERSION_RAW}" SPLA_VERSION)
message(STATUS "SPLA package version: ${SPLA_VERSION}")

######################################################################
## public options

option(SPLA_BUILD_TESTS "Build test folder with modules tests" YES)
option(SPLA_BUILD_EXAMPLES "Build library example applications with algorithms" YES)
option(SPLA_BUILD_TOOLS "Build command line tools (spla)" YES)
option(SPLA_BUILD_OPENCL "Build library with opencl backend" YES)

######################################################################
Expand Down Expand Up @@ -178,18 +189,40 @@ endfunction()
add_subdirectory(deps/robin_hood)
add_subdirectory(deps/svector)

message(STATUS "Add CLI11 as CLI/ENV parser")
include(FetchContent)

FetchContent_Declare(CLI11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
GIT_TAG v2.4.2
)
FetchContent_MakeAvailable(CLI11)

message(STATUS "Add nlohmann/json as JSON parser")
FetchContent_Declare(nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.11.3
)
FetchContent_MakeAvailable(nlohmann_json)

if (SPLA_BUILD_OPENCL)
if (SPLA_TARGET_MACOSX)
message(STATUS "Add standard Apple OpenCL package")
find_package(OpenCL REQUIRED)
message(STATUS "Use Apple OpenCL framework for linking, headers from deps")
find_library(OPENCL_FRAMEWORK OpenCL REQUIRED)

add_library(OpenCLHeaders INTERFACE)
add_library(OpenCL::Headers ALIAS OpenCLHeaders)
target_include_directories(OpenCLHeaders INTERFACE ${OpenCL_INCLUDE_DIRS})
target_include_directories(OpenCLHeaders INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/deps/opencl-headers)

add_library(HeadersCpp INTERFACE)
add_library(OpenCL::HeadersCpp ALIAS HeadersCpp)
target_include_directories(HeadersCpp INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/deps/opencl-headers-hpp/include)
target_link_libraries(HeadersCpp INTERFACE OpenCL::Headers)

add_library(OpenCL INTERFACE)
target_include_directories(OpenCL INTERFACE ${OpenCL_INCLUDE_DIRS})
target_link_libraries(OpenCL INTERFACE ${OpenCL_LIBRARIES})
target_link_libraries(OpenCL INTERFACE ${OPENCL_FRAMEWORK})
else ()
message(STATUS "Add Khronos OpenCL C API header files")
add_subdirectory(deps/opencl-headers)
Expand All @@ -199,14 +232,13 @@ if (SPLA_BUILD_OPENCL)
set(OPENCL_ICD_LOADER_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(OPENCL_ICD_LOADER_BUILD_TESTING OFF CACHE BOOL "" FORCE)
add_subdirectory(deps/opencl-icd-loader)
endif ()


message(STATUS "Add Khronos OpenCL HPP bindings")
add_library(HeadersCpp INTERFACE)
add_library(OpenCL::HeadersCpp ALIAS HeadersCpp)
target_include_directories(HeadersCpp INTERFACE deps/opencl-headers-hpp/include)
target_link_libraries(HeadersCpp INTERFACE OpenCL::Headers)
message(STATUS "Add Khronos OpenCL HPP bindings")
add_library(HeadersCpp INTERFACE)
add_library(OpenCL::HeadersCpp ALIAS HeadersCpp)
target_include_directories(HeadersCpp INTERFACE deps/opencl-headers-hpp/include)
target_link_libraries(HeadersCpp INTERFACE OpenCL::Headers)
endif ()
endif ()

if (SPLA_BUILD_EXAMPLES)
Expand Down Expand Up @@ -297,6 +329,9 @@ add_library(spla SHARED
include/spla/vector.hpp
src/core/accelerator.hpp
src/core/common.hpp
src/core/config_status.hpp
src/core/configure.cpp
src/core/configure.hpp
src/core/dispatcher.cpp
src/core/dispatcher.hpp
src/core/logger.cpp
Expand Down Expand Up @@ -368,21 +403,35 @@ target_include_directories(spla PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src)

set_target_properties(spla PROPERTIES OUTPUT_NAME "spla_${SPLA_ARCH}")
target_compile_definitions(spla PRIVATE SPLA_EXPORTS)
target_compile_definitions(spla PRIVATE SPLA_VERSION="${SPLA_VERSION}")

target_link_libraries(spla PRIVATE robin_hood)
target_link_libraries(spla PRIVATE svector)
target_link_libraries(spla PRIVATE CLI11::CLI11)
target_link_libraries(spla PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(spla PRIVATE ${CMAKE_DL_LIBS})

if (SPLA_BUILD_OPENCL)
target_link_libraries(spla PUBLIC OpenCL)
target_link_libraries(spla PUBLIC OpenCL::HeadersCpp)
target_compile_definitions(spla PUBLIC CL_TARGET_OPENCL_VERSION=120)
target_compile_definitions(spla PUBLIC
CL_TARGET_OPENCL_VERSION=120
CL_HPP_TARGET_OPENCL_VERSION=120
CL_HPP_MINIMUM_OPENCL_VERSION=120)
list(APPEND SPLA_DEFINES SPLA_BUILD_OPENCL)
endif ()

spla_target_compile_definitions(spla)
spla_target_compile_options(spla)
spla_target_link_options(spla)

set(SPLA_CONF_SRC "${CMAKE_CURRENT_LIST_DIR}/python/pyspla/spla_conf.json")
set(SPLA_CONF_DST "${CMAKE_BINARY_DIR}/spla_conf.json")
add_custom_command(TARGET spla POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
"${SPLA_CONF_SRC}" "${SPLA_CONF_DST}"
COMMENT "Copying shipped configuration file spla_conf.json next to the library")

######################################################################
## Add examples directory

Expand All @@ -404,6 +453,17 @@ if (SPLA_BUILD_EXAMPLES)
spla_example_application(convert)
endif ()

######################################################################
## Add command line tools

if (SPLA_BUILD_TOOLS)
message(STATUS "Add command line tools to build")

add_executable(spla_cli tools/soft_check.cpp)
target_link_libraries(spla_cli PRIVATE spla)
set_target_properties(spla_cli PROPERTIES OUTPUT_NAME spla)
endif ()

######################################################################
## Add unit-tests directory

Expand Down
2 changes: 2 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def main():
parser.add_argument("--build-type", default="Release", help="type of build: `Debug`, `Release` or `RelWithDebInfo`")
parser.add_argument("--tests", default="YES", help="build tests")
parser.add_argument("--examples", default="YES", help="build example applications")
parser.add_argument("--tools", default="YES", help="build command line tools")
parser.add_argument("--opencl", default="YES", help="build opencl acceleration backend")
parser.add_argument("--target", default="all", help="which target to build")
parser.add_argument("--nt", default="4", help="number of os threads for build")
Expand All @@ -44,6 +45,7 @@ def main():

build_config_args = ["cmake", ".", "-B", args.build_dir, "-G", "Ninja", f"-DCMAKE_BUILD_TYPE={args.build_type}",
f"-DSPLA_BUILD_TESTS={args.tests}", f"-DSPLA_BUILD_EXAMPLES={args.examples}",
f"-DSPLA_BUILD_TOOLS={args.tools}",
f"-DSPLA_BUILD_OPENCL={args.opencl}"]

if args.arch:
Expand Down
121 changes: 121 additions & 0 deletions docs/LibsCompare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Comparison of libraries for creating a configuration mechanism
All information is taken from the repositories of the corresponding projects. Access date: 21.04.26.

## Comparison criteria

| Criterion | Metric | Units |
|:---|:---|:---|
| **Dependencies** | presence | +/- |
| **Sources** | CLI (argv) / env / files | +/-, formats |
| **C++ standard** | minimum version | C++xx |
| **Supports standard hierarchy** | Linux/Windows/MacOS | +/- |
| **Distribution** | header-only / static / dynamic | - |
| **OS** | Linux / Windows / macOS | +/-, compilers |
| **Activity** | average number of commits | commits/month (last month) |
| **Issues** | open, closed/open | n, ratio |
| **Community** | GitHub Stars | n |
| **Passes CI** | CI | +/- |

> ? - not specified in the README.


## Comparison of command line parsers (CLI)

| Criterion | CLI11 | cxxopts |
|:---|:---:|:---:|
| Dependencies | - | - |
| **Sources** | | |
|  CLI (argv) | + | + |
|  env | + | - |
|  Files | - | - |
| C++ standard | ≥ C++11 | ≥ C++11 |
| **Supports standard hierarchy** | | |
|  Linux | + | + |
|  Windows | + | + |
|  MacOS | + | + |
| Distribution | header-only | header-only
| **OS** | | |
|  Linux | + (GCC 4.8+, Clang 3.5+) | + (GCC ≥ 4.9, Clang ≥ 3.1) |
|  Windows | + (MSVC ≥ 2015) | + (MSVC ≥ 2015) |
|  macOS | + (AppleClang 7+) | + (Clang ≥ 3.1 with libc++) |
| **Community** | | |
|  Activity (commits/month) | 4 | 1 |
|  Total issues | 506 | 307 |
|  Issues closed/open | 9 | 6 |
|  Stars | 4.3k | 4.7k |
| Passes CI | + | + | + |


## File parsers

| Criterion | nlohmann/json | yaml-cpp | toml++ | toml11 | config-cxx | taocpp/config
|:---|:---:|:---:|:---:|:---:|:---:|:---:|
| Dependencies | - | - | - | - | - | - |
| **Sources** |
|  CLI (argv) | - | - | - | - | - | - |
|  env | - | - | - | - | + | + |
|  Files | JSON | YAML | TOML | TOML | JSON, YAML, XML | JSON, JAXN |
| C++ standard | ≥ C++11 | ≥ C++11 | ≥ C++17 | ≥ C++11 | ≥ C++20 | ≥ C++17 |
| **Supports standard hierarchy** |
|  Linux | + | + | + | + | + | + |
|  Windows | + | + | + | + | + | + |
|  MacOS | + | + | + | + | + | + |
| Distribution | header-only | static/dynamic¹ | header-only/static/dynamic¹ | header-only/static/dynamic¹ | header-only | header-only |
| **OS** | | |
|  Linux | + (GCC 4.8–14.2, Clang 3.4–21.0) | + (GCC, Clang) | + (Clang 8+, GCC 8+) | + (GCC, Clang) | + (GCC 13+, Clang 16+) | +
|  Windows | + (MSVC 2015–2022) | + (MSVC) | + (MSVC VS2019+) | + (MSVC, MinGW) | + (MSVC 143+ (VS 2022)) | +
|  macOS | + (AppleClang 9.1–16.0) | + (Xcode, AppleClang) | + (AppleClang) | + (AppleClang) | + (AppleClang 16+) | +
| **Community** | | |
|  Activity (commits/month) | 2 | 9 | 2 | 4 | 2 | 13 |
|  Total issues | 3271 | 905 | 193 | 194 | 24 | 5 |
|  Issues closed/open | 68 | 3 | 8 | 5 | 0 open | 0 open |
|  Stars | 49.4k | 15k | 2k | 1.3k | 31 | 194 |
| Passes CI | + | + | + | - | + | ? |

> ¹ Optional.

## Comparison of universal tools

| Criterion | Boost.Program_options
|:---|:---:|
| Dependencies | +¹ |
| **Sources** | | |
|  CLI (argv) | + | + |
|  env | + | + |
|  Files | INI |
| C++ standard | ≥ C++3 |
| **Supports standard hierarchy** | | |
|  Linux | + |
|  Windows | + |
|  MacOS | + |
| Distribution | static/dynamic² |
| **OS** | | |
|  Linux | + (GCC 5+, Clang 3.6+) |
|  Windows | + (MSVC 2015 (vc140)+) |
|  macOS | + (AppleClang) |
| **Community** | | |
|  Activity (commits/month) | 12 |
|  Total issues | 400 |
|  Issues closed/open | 1 |
|  Stars | 9.4k |
| Passes CI | + | + |

> ¹ Dependency list:
> 1. Boost.Any
> 2. Boost.Bind
> 3. Boost.Config
> 4. Boost.Core
> 5. Boost.Detail
> 6. Boost.Function
> 7. Boost.Iterator
> 8. Boost.Lexical Cast
> 9. Boost.Smart Ptr
> 10. Boost.ThrowException
> 11. Boost.Tokenizer
> 12. Boost.Type Traits

> ² Optional.


### Conclusion:
Based on the comparison results, the best choice is likely to use `CLI11` and `nlohmann/json`, since, unlike `Boost.program_options`, they require no dependencies and are header-only.
Loading
Loading