-
Notifications
You must be signed in to change notification settings - Fork 17
35 investigate migrating to meson [WIP] #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9eaeb1f
99f40a5
6a8812a
ebdedc6
a22dcc5
8ef7617
bf43b5d
3a14fec
4376b55
03c45f2
23b2785
9c88c00
824dabe
f93d5b6
3bfce33
3910a89
7899f3d
6c74533
6ca9887
73b3957
c7e4abf
855f318
8b6c377
985398d
d78ce12
7d39379
62d15af
4b2e703
fe8a195
ac6e9e3
9cbe5b8
554e028
9f24b70
2d9d40b
3df0b23
648b352
014c157
bef6988
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: CMake | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
push: | ||
branches: [ master ] | ||
|
||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install rtools (mingw-w64) (see SciPy workflow for more details) | ||
run: | | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
choco install rtools -y --no-progress --force --version=4.0.0.20220206 | ||
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH | ||
fi | ||
shell: bash | ||
|
||
- name: Install build dependencies from PyPI | ||
run: | | ||
python -m pip install meson cmake ninja | ||
|
||
- name: Configure Meson | ||
# Configure meson to dump all executables in the test directory so Windows would work | ||
run: cd ${{github.workspace}} && meson setup builddir | ||
|
||
- name: Build | ||
# Build your program with the given configuration | ||
run: meson compile -C ${{github.workspace}}/builddir --verbose | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/builddir | ||
# Execute tests defined by meson test configuration. | ||
run: meson test -v |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
[submodule "external/vcpkg"] | ||
path = external/vcpkg | ||
url = https://github.com/microsoft/vcpkg | ||
|
||
[submodule "external/pocketfft"] | ||
path = external/pocketfft | ||
url = https://github.com/hayguen/pocketfft | ||
url = https://github.com/mreineck/pocketfft.git |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,80 @@ | ||
 | ||
 | ||
|
||
# OpenPIV (c++) | ||
# OpenPIV (c++), a fast, open-source particle image velocimetry (PIV) library | ||
|
||
An implementation of a PIV analysis engine in C++ using as few dependencies as possible; | ||
the implementation requires a c++17 compliant compiler. | ||
## An implementation of a PIV analysis engine in C++ using as few dependencies as possible; the implementation requires a c++17 compliant compiler. | ||
|
||
This project is the result of the collaborative effort of numerous researchers in order to provide one of the fastest PIV software on the market while remaining cross-platform and open-source. The software can do the following: | ||
|
||
* Load images with .tif and .pnm extensions | ||
* Save images with .tif and .pnm extensions | ||
* Pre-process and modify images | ||
* Perform digital PIV analysis including subpixel estimation | ||
* and more! | ||
|
||
Additionally, two examples are provided to demonstrate how the library can be used for background subtraction of images and multi-threaded PIV analysis. | ||
|
||
## Build | ||
|
||
There are some external dependencies under external/, so when cloning use: | ||
|
||
```git clone --recursive <path to git repo>``` | ||
|
||
Building uses cmake and vcpkg, and is simplified by using a vcpkg manifest to specify | ||
the dependent packages. Vcpkg has some pre-requisites: | ||
Building uses meson, and is simplified by using meson wrap files to specify the dependent packages. Building has some pre-requisites: | ||
|
||
* a compiler (e.g. `apt install build-essentials`) | ||
* cmake | ||
* git | ||
* cmake (optional) | ||
* python | ||
* (linux) pkg-config (e.g. `apt install pkg-config`) | ||
* curl, zip, unzip, tar (e.g. `apt install curl zip unzip tar`) | ||
* ninja (e.g. `apt install ninja-build`) | ||
* meson (e.g., pip install --user meson) | ||
|
||
Unix users can also use the method used for the Windows build environment as detailed below. | ||
|
||
On Windows, the following can be used: | ||
* install TDM-GCC or any other Windows GNU distribution | ||
* install miniconda or venv and setup virtual environment | ||
* pip install cmake (optional) | ||
* pip install meson | ||
|
||
To build: | ||
* `meson setup builddir` Note, it is good practice to setup --prefix flags so files are not installed on the system. | ||
* `meson compile -C builddir` | ||
|
||
* `cmake -B build -S .` | ||
* `cmake --build build` | ||
Meson provides multiple build types such as debug, debugoptimized, and release. To change the build type, use the --buildtype flag. For example, `meson setup builddir --buildtype debugoptimized`. | ||
|
||
To run tests: | ||
|
||
* `cd build` | ||
* `ctest` | ||
* `meson test -C builddir' | ||
|
||
To change the build type, add `-DCMAKE_BUILD_TYPE` e.g. | ||
`cmake -DCMAKE_BUILD_TYPE=RelWithDebugInfo -B build -S .`. | ||
To get binaries: | ||
* `meson install -C builddir` if the prefix was set or | ||
* `meson install -C buildfir --destdir <some directory>` to install in a specific directory. | ||
|
||
The binaries are located in the build directory: | ||
Sometimes you only want the runtime dynamic libraries and executables. Meson comes with a handy targeted installation using the following command: | ||
* `meson install -C builddir --tags runtime` | ||
|
||
* build | ||
* test -> *_test | ||
Make sure the prefix, or destdir, is set so binaries are not accidentally installed on the system. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would hope for unix-like environment permissions would prevent installation! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be an issue for Unix. However, Windows is where that warning was primarily targeted for. If not set, Meson defaults to C:/ (or whatever letter the current drive is assigned) which could may cause issues and cluttering of the drive. I can be more explicit on that topic if needed. |
||
|
||
The binaries are located the build or installation directory: | ||
|
||
Build directory: | ||
* builddir | ||
* examples | ||
* process | ||
* average_subtract | ||
* openpiv -> libopenpivcore.so | ||
|
||
### Raspberry Pi | ||
Install directory: | ||
* prefix/destdir | ||
* bindir | ||
* libopenpivcore.so | ||
* all other dependent shared libraries | ||
* process (executable) | ||
* average_subtract (executable) | ||
|
||
### Raspberry Pi (using deprecated VCPKG build system) | ||
|
||
Build times are, as expected, much slower than on a modern Intel CPU, but the code | ||
will compile. Some observations: | ||
|
@@ -165,15 +196,18 @@ This is about 230us per interrogation area (7 cores, 3696 interrogation areas, 0 | |
|
||
## Dependencies | ||
|
||
These are captured in `vcpkg.json`: | ||
These are captured in `<dependency>.wrap`: | ||
|
||
* c++17 compiler e.g. clang++-5.0, gcc7 | ||
* [vcpkg](https://github.com/Microsoft/vcpkg) | ||
* catch2: unit test framework | ||
* libtiff: TIFF IO support | ||
* python3 | ||
* [meson](https://mesonbuild.com/index.html) | ||
* benchmark: used to run performance benchmarks | ||
* async++ (optional): implements c++17 parallel algorithms | ||
* catch2: unit test framework | ||
* cxxopts: nice command line parsing | ||
* libtiff: TIFF IO support | ||
* libjpeg-turbo | ||
* liblzma | ||
* zlib | ||
|
||
## Examples | ||
|
||
|
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
avd_sub_exec = executable( | ||
'average_subtract', | ||
'main.cpp', | ||
include_directories: openpiv_include, | ||
dependencies: [ | ||
cxxopts_dep, | ||
fmt_dep, | ||
thread_dep | ||
], | ||
link_with: openpiv_lib, | ||
install: true | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
subdir('average_subtract') | ||
subdir('process') |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
avd_sub_exec = executable( | ||
'process', | ||
'main.cpp', | ||
include_directories: [openpiv_include, pocketfft_include], | ||
dependencies: [ | ||
cxxopts_dep, | ||
fmt_dep, | ||
thread_dep | ||
], | ||
cpp_args: ['-D_USE_MATH_DEFINES'], | ||
link_with: openpiv_lib, | ||
install: true | ||
) |
+2 −2 | README.md | |
+9 −1 | pocketfft_demo.cc | |
+62 −5 | pocketfft_hdronly.h |
Uh oh!
There was an error while loading. Please reload this page.