Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-parent committed Jul 15, 2024
2 parents 13983de + 079f92e commit 141ff99
Show file tree
Hide file tree
Showing 761 changed files with 7,661 additions and 10,128 deletions.
19 changes: 19 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Checks: >
cert-*,
performance-*,
modernize-*,
misc-include-cleaner,
-readability-identifier-length,
-readability-magic-numbers,
-cppcoreguidelines-avoid-magic-numbers
CheckOptions:
# example of setting a check option
- key: readability-identifier-length.MinLength
value: 3
- key: misc-include-cleaner.IgnoreHeaders
value: >
boost/test/.*;
__chrono/.*;
boost/multiprecision/.*
HeaderFilterRegex: "^.*\/stlab\/.*$"
# WarningsAsErrors: "*"
64 changes: 32 additions & 32 deletions .github/matrix.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"config": [
{
"name": "Linux GCC 13",
"compiler": "gcc",
"version": "13",
"os": "ubuntu-22.04"
},
{
"name": "Linux Clang 15",
"compiler": "clang",
"version": "15",
"os": "ubuntu-22.04"
},
{
"name": "macOS apple-clang 15.1.0",
"compiler": "apple-clang",
"version": "15.1.0",
"os": "macos-13"
},
{
"name": "Windows VS2022",
"compiler": "Visual Studio",
"version": "17",
"os": "windows-2022",
"cmake_toolset": "Visual Studio 17 2022"
},
{
"name": "Linux Webassembly",
"compiler": "emscripten",
"os": "ubuntu-22.04"
}
]
"config": [
{
"name": "Linux GCC 13",
"compiler": "gcc",
"version": "13",
"os": "ubuntu-24.04"
},
{
"name": "Linux Clang 15",
"compiler": "clang",
"version": "15",
"os": "ubuntu-22.04"
},
{
"name": "macOS apple-clang 15.1.0",
"compiler": "apple-clang",
"version": "15.1.0",
"os": "macos-13"
},
{
"name": "Windows VS2022",
"compiler": "Visual Studio",
"version": "17",
"os": "windows-2022",
"cmake_toolset": "Visual Studio 17 2022"
},
{
"name": "Linux Webassembly",
"compiler": "emscripten",
"os": "ubuntu-22.04"
}
]
}
10 changes: 8 additions & 2 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll site to Pages

env:
source: ./docs/

on:
# Runs on pushes targeting the default branch
push:
Expand Down Expand Up @@ -38,7 +41,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@latest
with:
# ruby-version: '3.1' # Not needed with a .ruby-version file
ruby-version: '3.2' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
Expand All @@ -47,7 +50,10 @@ jobs:
- name: Build with Jekyll
# Outputs to the './_site' directory by default
# run: cd ./docs
run: cd ./docs && bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
run: |
cd ./docs
bundle install
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/stlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4.1.6

- name: Generate job matrix
id: set-matrix
# Note: The json in this variable must be a single line for parsing to succeed.
run: echo "::set-output name=matrix::$(cat .github/matrix.json | scripts/flatten_json.py)"
run: echo "matrix=$(cat .github/matrix.json | scripts/flatten_json.py)" >> $GITHUB_OUTPUT

builds:
# installed tools and runners can be found here: https://github.com/actions/runner-images
Expand All @@ -30,12 +30,22 @@ jobs:
name: ${{ matrix.config.name }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4.1.6

- name: Install dependencies // macOS
if: ${{ startsWith(matrix.config.os, 'macos') }}
run: |
brew update
rm '/usr/local/bin/2to3'
rm '/usr/local/bin/2to3-3.12'
rm '/usr/local/bin/idle3'
rm '/usr/local/bin/idle3.12'
rm '/usr/local/bin/pydoc3'
rm '/usr/local/bin/pydoc3.12'
rm '/usr/local/bin/python3'
rm '/usr/local/bin/python3.12'
rm '/usr/local/bin/python3-config'
rm '/usr/local/bin/python3.12-config'
brew install boost
brew install ninja
shell: bash
Expand All @@ -52,7 +62,10 @@ jobs:
if: ${{ startsWith(matrix.config.os, 'windows') }}
run: |
choco install --yes ninja
vcpkg install boost-test:x64-windows boost-multiprecision:x64-windows boost-variant:x64-windows
vcpkg install boost-test:x64-windows boost-multiprecision:x64-windows
# vcpkg install boost:x64-windows
# dotnet add package boost --version 1.85.0
# choco install --yes boost-msvc-14.3
shell: cmd

- name: Install dependencies // Linux Emscripten
Expand Down Expand Up @@ -97,7 +110,7 @@ jobs:
cmake -S $HOME/boost -B ../build-boost -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=23 \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-builtins" \
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/cmake/Platform/Emscripten-STLab.cmake \
-DBOOST_INCLUDE_LIBRARIES="optional;variant;multiprecision;test"
-DBOOST_INCLUDE_LIBRARIES="multiprecision;test"
cmake --build ../build-boost
cmake --install ../build-boost
Expand All @@ -123,7 +136,7 @@ jobs:
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
mkdir ..\build
cmake -S. -B../build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake -S. -B../build -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=20 -DBoost_USE_STATIC_LIBS=TRUE -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build // Unix
if: ${{ startsWith(matrix.config.os, 'ubuntu') || startsWith(matrix.config.os, 'macos') }}
Expand Down
102 changes: 102 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 12,
"patch": 0
},
"configurePresets": [
{
"name": "hyde-build-docs",
"description": "Build documentation",
"hidden": false,
"binaryDir": "${sourceDir}/../build/hyde",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"BUILD_TESTING": "OFF",
"STLAB_MAIN_EXECUTOR": "none",
"STLAB_NO_STD_COROUTINES": "ON",
"STLAB_TASK_SYSTEM": "portable",
"STLAB_THREAD_SYSTEM": "pthread",
"stlab.coverage": "OFF"
}
},
{
"name": "ninja-cpp20-debug-thread-undefined",
"description": "Ninja Debug Build",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/ninja-cpp20-debug-thread-undefined",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_FLAGS": "-fsanitize=thread -fsanitize=undefined",
"CMAKE_LINKER_FLAGS": "-fsanitize=thread -fsanitize=undefined"
}
},
{
"name": "ninja-cpp17-debug",
"description": "Ninja Debug Build",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/ninja-cpp17-debug",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_VERBOSE_MAKEFILE": "ON"
}
},
{
"name": "ninja-cpp20-debug-address",
"description": "Ninja Debug Build",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/ninja-cpp20-debug-address",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_FLAGS": "-fsanitize=address",
"CMAKE_LINKER_FLAGS": "-fsanitize=address",
"CMAKE_VERBOSE_MAKEFILE": "ON"
}
},
{
"name": "clang-tidy-fix",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/clang-tidy-fix",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;--fix"
}
},
{
"name": "clang-tidy-nofix",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/clang-tidy-nofix",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_CLANG_TIDY": "clang-tidy"
}
}
],
"buildPresets": [
{
"name": "clang-tidy-fix",
"configurePreset": "clang-tidy-fix",
"jobs": 1
},
{
"name": "clang-tidy-nofix",
"configurePreset": "clang-tidy-nofix"
}
]
}
33 changes: 15 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ASL libraries will be migrated here in the `stlab` namespace, new libraries will
## Content

### [Concurrency](https://www.stlab.cc/libraries/concurrency/)

This library provides futures and channels, high level abstractions for implementing algorithms that eases the use of multiple CPU cores while minimizing contention. This library solves several problems of the C++11 and C++17 TS futures.

## Documentation
Expand All @@ -26,8 +27,7 @@ Release changelogs are listed in [CHANGES.md](CHANGES.md).

## Requirements

- A standards-compliant C++14, C++17, or C++20 compiler
- **Use with a compiler in C++14-compliant mode** requires Boost.Optional and Boost.Variant >= 1.74.0
- A standards-compliant C++17, C++20, or C++23 compiler
- **Building** the library requires CMake 3.23 or later
- **Testing or developing** the library requires Boost.Test >= 1.74.0

Expand All @@ -38,36 +38,30 @@ for an introduction to this tool.

### Preparation

1. Create a build directory outside this library's source tree. In this guide, we'll use a sibling
1. Create a build directory outside this library's source tree. In this guide, we'll use a sibling
directory called `BUILD`.

2. If you are using the library in C++14-compliant mode or need to run the test suite, be sure you
have the necessary parts of Boost >= 1.74.0 installed. Linux distributions usually make a
suitable version available through standard package managers. On macOS or Linux, you can easilly
install Boost using [Homebrew](https://brew.sh/). To install Boost on Windows, you can use
Boost's [binary installers](https://sourceforge.net/projects/boost/files/boost-binaries/).

3. Install a version of CMake >= 3.23. If you are on Debian or Ubuntu Linux you may need to use
1. Install a version of CMake >= 3.23. If you are on Debian or Ubuntu Linux you may need to use
`snap` to find one that's new enough.

4. If you are using MSVC, you may need to set environment variables appropriately for your target
1. If you are using MSVC, you may need to set environment variables appropriately for your target
architecture by invoking `VCVARSALL.BAT` with an appropriate option.

### Configure

Run CMake in the root directory of this project, setting `../BUILD` as your build directory. The
Run CMake in the root directory of this project, setting `../BUILD` as your build directory. The
basis of your command will be

```
cmake -S . -B ../BUILD -DCMAKE_BUILD_TYPE=# SEE BELOW
```

but there are other options you may need to append in order to be successful. Among them:
but there are other options you may need to append in order to be successful. Among them:

* `-DCMAKE_BUILD_TYPE=`[`Release`|`Debug`] to build the given configuration (required unless you're using visual studio or another multi-config generator).
* `-DCMAKE_CXX_STANDARD=`[`14`|`17`|`20`|`23`] to build with compliance to the given C++ standard.
* `-DBUILD_TESTING=OFF` if you only intend to build, but not test, this library.
* `-DBoost_USE_STATIC_LIBS=TRUE` if you will be testing on Windows.
- `-DCMAKE_BUILD_TYPE=`[`Release`|`Debug`] to build the given configuration (required unless you're using visual studio or another multi-config generator).
- `-DCMAKE_CXX_STANDARD=`[`17`|`20`|`23`] to build with compliance to the given C++ standard.
- `-DBUILD_TESTING=OFF` if you only intend to build, but not test, this library.
- `-DBoost_USE_STATIC_LIBS=TRUE` if you will be testing on Windows.

We also suggest the installation of [Ninja](https://ninja-build.org/) and its use by adding
`-GNinja` to your cmake command line… but ninja is not required.
Expand All @@ -81,7 +75,8 @@ cmake -S . -B ../BUILD -GNinja -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=Releas
If you organize the build directory into subdirectories you can support multiple configurations.

```
cmake -S . -B ../builds/portable -GXcode -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTING=ON -DSTLAB_TASK_SYSTEM=portable
rm -rf ../builds/portable
cmake -S . -B ../builds/portable -GXcode -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTING=ON -DSTLAB_TASK_SYSTEM=portable -DCMAKE_OSX_DEPLOYMENT_TARGET=macosx14.4
```

### Build
Expand All @@ -99,7 +94,9 @@ Running the tests in the `BUILD` directory is as simple as invoking
```
ctest -C Debug
```

or

```
ctest -C Release
```
Expand Down
3 changes: 1 addition & 2 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
.sass-cache/
_site/
build/
stlab/
boost/
boost.tgz
*.bbprojectsettings
*.bbprojectsettings
2 changes: 1 addition & 1 deletion docs/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.2
3.3.1
1 change: 1 addition & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ gem 'jekyll'
gem 'jekyll-redirect-from', group: [:jekyll_plugins]
gem 'jekyll-compose', group: [:jekyll_plugins]
gem "jekyll-remote-theme", group: [:jekyll_plugins]

# don't submit this line to the upstream repo
## Enable this line for local theme development
# gem 'jekyll-theme-adobe-hyde', path: '../../themes'
Loading

0 comments on commit 141ff99

Please sign in to comment.