Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
predictable_parallel_patterns
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0744bc50
authored
Mar 18, 2019
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add thread sanitizer cmake flags.
parent
13441527
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
2 deletions
+42
-2
CMakeLists.txt
+1
-0
README.md
+30
-2
cmake/SetupThreadSanitizer.cmake
+11
-0
No files found.
CMakeLists.txt
View file @
0744bc50
...
...
@@ -13,6 +13,7 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
include
(
cmake/DisabelInSource.cmake
)
include
(
cmake/SetupOptimizationLevel.cmake
)
include
(
cmake/SetupThreadingSupport.cmake
)
include
(
cmake/SetupThreadSanitizer.cmake
)
# make our internal cmake script collection avaliable in the build process.
list
(
APPEND CMAKE_PREFIX_PATH
"
${
PROJECT_SOURCE_DIR
}
/cmake"
)
...
...
README.md
View file @
0744bc50
...
...
@@ -8,4 +8,32 @@ the recommended IDE is either a simple text editor or [CLion](https://www.jetbra
We divide the project into subtargets to separate for the library
itself, testing and example code. The library itself can be found in
`lib/pls`
, testing related code is in
`test`
, example and playground
apps are in
`app`
.
\ No newline at end of file
apps are in
`app`
.
### Buiding
To build the project first create a folder for the build
(typically as a subfolder to the project) using
`mkdir cmake-build-debug`
.
Change to the new folder
`cd cmake-build-debug`
and init the cmake
project using
`cmake ../ -DCMAKE_BUILD_TYPE=DEBUG`
. For realease builds
do the same only with build type
`RELEASE`
. Other build time settings
can also be passed at this setup step.
After this is done you can use normal
`make`
commands like
`make`
to build everything
`make <target>`
to build a target
or
`make install`
to install the library globally.
### Testing
Testing is done using
[
Catch2
](
https://github.com/catchorg/Catch2/
)
in the test subfolder. Tests are build into a target called
`tests`
and can be executed simply by building this executabe and running it.
### Data Race Detection
As this project contains a lot concurrent code we use
[
Thread Sanitizer
](
https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
)
in our CI process and optional in other builds. To setup CMake builds
with sanitizer enabled add the cmake option
`-DTHREAD_SANITIZER=ON`
.
Please regularly test with thread sanitizer enabled and make sure to not
keep the repository in a state where the sanitizer reports errors.
\ No newline at end of file
cmake/SetupThreadSanitizer.cmake
0 → 100644
View file @
0744bc50
# Optionally compile with thread sanitizer enabled to find concurrency bugs
# https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
# Add optional sanitizer, off by default
option
(
THREAD_SANITIZER
"Add thread sanitizer"
OFF
)
if
(
THREAD_SANITIZER
)
add_compile_options
(
-fsanitize=thread -g
)
add_link_options
(
-fsanitize=thread
)
endif
()
message
(
"-- Thread Sanitizer:
${
THREAD_SANITIZER
}
"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment