Skip to content

Commit f87bc09

Browse files
committed
Merge branch 'master' into tstenner/outlet_sync
2 parents ed35fda + e6c8b6c commit f87bc09

File tree

359 files changed

+4977
-34228
lines changed

Some content is hidden

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

359 files changed

+4977
-34228
lines changed

.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Checks: |
1212
-readability-isolate-declaration,
1313
-readability-function-cognitive-complexity,
1414
bugprone-*,
15-
concurrency-*
15+
-bugprone-easily-swappable-parameters,
16+
concurrency-*,
1617
portability-*
1718
...

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ insert_final_newline = true
66
charset = utf-8
77
indent_style = tab
88

9+
[*.yaml]
10+
indent_style = space
11+
indent_size = 2
12+

.github/workflows/cppcmake.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: C/C++ CI
33
on:
44
push:
55
branches: ['*']
6-
tags:
7-
paths_ignore: ['docs/**', '.travis.yml']
6+
tags: ['*']
7+
paths:
8+
- '**'
9+
- '!docs/**'
10+
- '!.github/**'
11+
- '.github/workflows/cppcmake.yml'
812
pull_request:
913
release:
1014
types: ['created']
@@ -30,8 +34,8 @@ jobs:
3034
config:
3135
- {name: "ubuntu-20.04", os: "ubuntu-20.04", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF"}
3236
- {name: "ubuntu-18.04", os: "ubuntu-latest", docker: "ubuntu:18.04" }
33-
- {name: "windows-x64", os: "windows-latest", cmake_extra: "-T v140,host=x86"}
34-
- {name: "windows-32", os: "windows-latest", cmake_extra: "-T v140,host=x86 -A Win32"}
37+
- {name: "windows-x64", os: "windows-2019", cmake_extra: "-T v140,host=x86"}
38+
- {name: "windows-32", os: "windows-2019", cmake_extra: "-T v140,host=x86 -A Win32"}
3539
- {name: "macOS-latest", os: "macOS-latest"}
3640

3741
# runs all steps in the container configured in config.docker or as subprocesses when empty
@@ -60,7 +64,8 @@ jobs:
6064
-DCPACK_PACKAGE_DIRECTORY=${PWD}/package \
6165
-Dlslgitrevision=${{ github.sha }} \
6266
-Dlslgitbranch=${{ github.ref }} \
63-
${{ matrix.config.cmake_extra }}
67+
${{ matrix.config.cmake_extra }} \
68+
${{ github.event.inputs.cmakeextra }}
6469
echo ${PWD}
6570
- name: make
6671
run: cmake --build build --target install --config Release -j
@@ -82,6 +87,7 @@ jobs:
8287
dpkg -I package/liblsl*.deb
8388
fi
8489
cmake -E remove_directory package/_CPack_Packages
90+
cp testing/lslcfgs/default.cfg .
8591
- name: upload install dir
8692
uses: actions/upload-artifact@master
8793
with:

.github/workflows/mingw_static.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ name: MinGW Windows static test
33
on:
44
push:
55
branches: ['*']
6-
tags:
7-
paths_ignore: ['docs/**', '.travis.yml']
6+
paths:
7+
- '**'
8+
- '!docs/**'
9+
- '!.github/**'
10+
- '.github/workflows/mingw_static.yml'
811
pull_request:
912

1013
jobs:
1114
build:
1215
name: MinGW batteries-included
13-
runs-on: windows-latest
16+
runs-on: windows-2019
1417

1518
defaults:
1619
run:

.github/workflows/sanitize.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Clang Sanitizer
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
cmakeextra:
7+
description: "Extra CMake options"
8+
required: false
9+
default: ""
10+
sanitizer:
11+
description: 'Sanitizer to run'
12+
required: true
13+
default: 'address'
14+
options: ['address', 'thread', 'memory', 'undefined']
15+
type: choice
16+
17+
defaults:
18+
run:
19+
shell: bash
20+
21+
jobs:
22+
build:
23+
name: "${{ github.event.inputs.sanitizer }}"
24+
runs-on: 'ubuntu-latest'
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Install build toolchain
29+
run: |
30+
wget https://apt.llvm.org/llvm-snapshot.gpg.key
31+
echo "deb [signed-by=$PWD/llvm-snapshot.gpg.key] http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main" | sudo tee /etc/apt/sources.list.d/llvm.list
32+
sudo apt update
33+
sudo apt install -y libpugixml-dev clang-13 gdb
34+
- name: Configure CMake
35+
run: |
36+
# linking a C++ library to a C program fails with ubsan enabled; disable lslver for this run
37+
sed -i -e'/lslver/d' CMakeLists.txt
38+
cmake --version
39+
cmake -S . -B build \
40+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
41+
-DCMAKE_C_COMPILER=clang-13 \
42+
-DCMAKE_{CXX_COMPILER,LINKER}=clang++-13 \
43+
-DCMAKE_{C,CXX,EXE_LINKER,SHARED_LINKER}_FLAGS="-fsanitize=${{ github.event.inputs.sanitizer }}" \
44+
-DLSL_COMFY_DEFAULTS=ON \
45+
-DLSL_UNITTESTS=ON \
46+
-DLSL_BENCHMARKS=ON \
47+
-DLSL_BUILD_EXAMPLES=OFF \
48+
-DLSL_BUNDLED_PUGIXML=OFF \
49+
-DLSL_SLIMARCHIVE=ON \
50+
-DLSL_OPTIMIZATIONS=ON \
51+
-Dlslgitrevision=${{ github.sha }} \
52+
-Dlslgitbranch=${{ github.ref }} \
53+
${{ github.event.inputs.cmakeextra }}
54+
echo ${PWD}
55+
56+
- name: make
57+
run: cmake --build build --config RelWithDebInfo -j
58+
59+
- name: run unit tests
60+
run: |
61+
# alias gdbwrap="gdb --batch -ex 'run --order rand --wait-for-keypress never --durations yes' -ex 'thread apply all bt' -return-child-result"
62+
gdb --batch -ex 'run --order rand --wait-for-keypress never --durations yes' -ex 'thread apply all bt' -return-child-result build/testing/lsl_test_internal
63+
gdb --batch -ex 'run --order rand --wait-for-keypress never --durations yes' -ex 'thread apply all bt' -return-child-result build/testing/lsl_test_exported
64+
timeout-minutes: 15

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/build*/
2+
/install/
3+
/package/
24
/CMakeLists.txt.user
35
/CMakeLists.json
46
/CMakeSettings.json

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Changes for liblsl 1.16
2+
3+
* add: optional, minimal header-only replacement for Boost.Serialization (Tristan Stenner)
4+
* add: extensible `lsl_create_inlet_ex()` for high-precision buffer lengths (Chadwick Boulay)
5+
* change: replace Boost.Uuid, Boost.Random and Boost.Thread with built-in functions (Tristan Stenner)
6+
* change: replace Boost.Asio with upstream Asio (Tristan Stenner)
7+
* change: update bundled Boost to 1.78 (Tristan Stenner)
8+
* change: allow building against system Boost again (@chausner)
9+
* change: speed up resolving a fixed number of streams (Tristan Stenner)
10+
* change: reduce Asio operation overhead (Tristan Stenner)
11+
* change: IPv6 is enabled by default on macOS (Tristan Stenner)
12+
* change: share io contexts for IPv4+IPv6 services (Tristan Stenner)
13+
* **change**: send resolve requests from all local network interfaces (Tristan Stenner)
14+
* fix: fix a minor memory leak when closing streams (Tristan Stenner)
15+
116
# Changes for liblsl 1.15.2
217

318
* fix: bump artifact / soname version

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required (VERSION 3.12)
22
project (liblsl
3-
VERSION 1.15.2
3+
VERSION 1.16.0
44
LANGUAGES C CXX
55
DESCRIPTION "Labstreaminglayer C/C++ library"
66
HOMEPAGE_URL "https://github.com/sccn/liblsl"

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ The most up-to-date instructions are in the
2020
Precompiled packages are uploaded
2121

2222
- to the [Release page](https://github.com/sccn/liblsl/releases)
23-
- the [Anaconda cloud](https://anaconda.org/conda-force/liblsl), install with `conda install -c conda-forge liblsl`
23+
- the [Anaconda cloud](https://anaconda.org/conda-forge/liblsl), install with `conda install -c conda-forge liblsl`
2424

25-
To compile the library yourself from source please follow the [online documentation](https://labstreaminglayer.readthedocs.io/dev/lib_dev.html).
25+
liblsl is also available via the following package managers:
26+
27+
- [vcpkg](https://vcpkg.io)
28+
- [Conan](https://conan.io/center/liblsl)
29+
30+
To compile the library yourself from source,
31+
please follow the [online documentation](https://labstreaminglayer.readthedocs.io/dev/lib_dev.html).
2632

2733
For single board computers running linux, you can also try
2834
`standalone_compilation_linux.sh`.

examples/SendDataInChunks.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ struct fake_device {
2525
*/
2626
std::size_t n_channels;
2727
double srate;
28-
int64_t pattern_samples;
29-
int64_t head;
28+
std::size_t pattern_samples;
29+
std::size_t head;
3030
std::vector<int16_t> pattern;
3131
std::chrono::steady_clock::time_point last_time;
3232

3333
fake_device(const int16_t n_channels, const float srate)
3434
: n_channels(n_channels), srate(srate), head(0) {
35-
pattern_samples = (int64_t)(srate - 0.5) + 1; // truncate OK.
35+
pattern_samples = (std::size_t)(srate - 0.5) + 1; // truncate OK.
3636

3737
// Pre-allocate entire test pattern. The data _could_ be generated on the fly
3838
// for a much smaller memory hit, but we also use this example application
@@ -47,8 +47,9 @@ struct fake_device {
4747
// sin(2*pi*f*t), where f cycles from 1 Hz to Nyquist: srate / 2
4848
double f = (chan_ix + 1) % (int)(srate / 2);
4949
pattern.emplace_back(
50-
offset_0 + chan_ix * offset_step +
51-
magnitude * static_cast<int16_t>(sin(2 * M_PI * f * sample_ix / srate)));
50+
static_cast<int16_t>(
51+
offset_0 + chan_ix * offset_step +
52+
magnitude * sin(2 * M_PI * f * sample_ix / srate)));
5253
}
5354
}
5455
last_time = std::chrono::steady_clock::now();
@@ -70,8 +71,8 @@ struct fake_device {
7071
auto now = std::chrono::steady_clock::now();
7172
auto elapsed_nano =
7273
std::chrono::duration_cast<std::chrono::nanoseconds>(now - last_time).count();
73-
int64_t elapsed_samples = std::size_t(elapsed_nano * srate * 1e-9); // truncate OK.
74-
elapsed_samples = std::min(elapsed_samples, (int64_t)(buffer.size() / n_channels));
74+
std::size_t elapsed_samples = std::size_t(elapsed_nano * srate * 1e-9); // truncate OK.
75+
elapsed_samples = std::min(elapsed_samples, (std::size_t)(buffer.size() / n_channels));
7576
if (nodata) {
7677
// The fastest but no patterns.
7778
// memset(&buffer[0], 23, buffer.size() * sizeof buffer[0]);
@@ -126,7 +127,7 @@ int main(int argc, char **argv) {
126127
chn.append_child_value("unit", "microvolts");
127128
chn.append_child_value("type", type);
128129
}
129-
int32_t buf_samples = max_buffered * samplingrate;
130+
int32_t buf_samples = (int32_t)(max_buffered * samplingrate);
130131
auto flags = static_cast<lsl_transport_options_t>(
131132
(do_sync ? transp_sync_blocking : transp_default) | transp_bufsize_samples);
132133
lsl::stream_outlet outlet(info, chunk_samples, buf_samples, flags);

0 commit comments

Comments
 (0)