Skip to content

Commit

Permalink
Update build system (#990)
Browse files Browse the repository at this point in the history
- bump sme_deps to 2024.05.15
- cibuildwheel -> 2.18
- CLI11 -> v2.4.2
- nanobind -> latest master
- update README for CI and tests
- add workaround for mingw gcc-14 c++20 issue (https://gitlab.kitware.com/cmake/cmake/-/issues/25974)
  • Loading branch information
lkeegan committed May 15, 2024
1 parent 59fcfea commit 4e13be3
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 30 deletions.
30 changes: 11 additions & 19 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,22 @@ the CI builds - see [ci/README](../ci/README.md) for more details.

### Linux local build

Clone the repo including sub-modules:
Clone the repo including submodules:

```
git clone --recursive https://github.com/spatial-model-editor/spatial-model-editor.git
cd spatial-model-editor
```

Download the latest static libs and copy them to `/opt/smelibs`:
(If you already cloned without `--recursive` you can run `git submodule update --init --recursive`)

Run the getdeps script to download the latest static libs and copy them to `/opt/smelibs`:

```
sudo ./ext/getdeps.sh
```

Make sure you have the necessary libraries installed, for example on Ubuntu:
Make sure you have the system libraries required by Qt6 installed, for example on Ubuntu:

```
sudo apt-get install \
Expand All @@ -33,17 +35,6 @@ sudo apt-get install \
libxfixes-dev \
libxi-dev \
libxrender-dev \
libxcb1-dev \
libxcb-glx0-dev \
libxcb-keysyms1-dev \
libxcb-image0-dev \
libxcb-shm0-dev \
libxcb-icccm4-dev \
libxcb-sync-dev \
libxcb-xfixes0-dev \
libxcb-shape0-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libfreetype-dev \
Expand All @@ -56,20 +47,21 @@ Build using CMake, e.g.
```
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/opt/smelibs;/opt/smelibs/lib/cmake" -DSME_EXTRA_EXE_LIBS="-ltirpc"
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/opt/smelibs;/opt/smelibs/lib/cmake"
ninja
```
Depending on how your system differs from the CI server where these static libs were compiled, you may not need `-DSME_EXTRA_EXE_LIBS="-ltirpc"`, or you may need to add something else.

Now you can run the tests, see [test/README.md](https://github.com/spatial-model-editor/spatial-model-editor/blob/main/test/README.md) for more information:

```
make test
ninja test
```

The python bindings can also be independently built & installed using pip, where any required CMake arguments can be supplied
via the `CMAKE_ARGS` env var, separated by spaces:

```
CMAKE_ARGS="-DCMAKE_PREFIX_PATH='/opt/smelibs;/opt/smelibs/lib/cmake' -DSME_BUILD_CORE=ON" pip install -v .
CMAKE_ARGS="-DCMAKE_PREFIX_PATH='/opt/smelibs;/opt/smelibs/lib/cmake'" pip install -v .
pytest sme
```

Expand Down Expand Up @@ -131,4 +123,4 @@ pytest sme

- [clang-format](https://clang.llvm.org/docs/ClangFormat.html)

- a CI job also runs these checks, and will automatically add a commit with any required fixes
- pre-commit.ci will automatically add a commit to a PR with any required fixes
2 changes: 1 addition & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
steps:
- uses: spatial-model-editor/setup-ci@2024.04.23
with:
sme_deps: '2024.04.24'
sme_deps: '2024.05.15'
- uses: actions/checkout@v4
with:
submodules: 'recursive'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run:
shell: ${{ matrix.platform.shell }}
env:
CIBUILDWHEEL_VERSION: "2.17.0"
CIBUILDWHEEL_VERSION: "2.18"
CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/spatial-model-editor/manylinux_x86_64:2024.04.24"
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
Expand All @@ -43,7 +43,7 @@ jobs:
steps:
- uses: spatial-model-editor/setup-ci@2024.04.23
with:
sme_deps: '2024.04.24'
sme_deps: '2024.05.15'
- uses: actions/checkout@v4
with:
submodules: 'recursive'
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
hooks:
- id: nbstripout
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.4
rev: v18.1.5
hooks:
- id: clang-format
types_or: [c++, c, cuda]
Expand All @@ -31,7 +31,7 @@ repos:
hooks:
- id: shell-fmt-go
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.2
rev: 0.28.3
hooks:
- id: check-github-workflows
- id: check-readthedocs
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ project(
DESCRIPTION "Spatial Model Editor"
LANGUAGES C CXX)

# workaround for mingw gcc-14 c++20 issue:
# https://gitlab.kitware.com/cmake/cmake/-/issues/25974
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)

# workaround for CGAL using deprecated exec_program
if(POLICY CMP0153)
cmake_policy(
Expand Down
2 changes: 1 addition & 1 deletion ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@

- <https://github.com/spatial-model-editor/sme_manylinux_x86_64>

- To use a new tag, update `CIBW_MANYLINUX_X86_64_IMAGE` in [.github/workflows/wheels.yml](https://github.com/spatial-model-editor/spatial-model-editor/blob/main/.github/workflows/wheels.yml#L30-L31)
- To use a new tag, update `CIBW_MANYLINUX_X86_64_IMAGE` in [.github/workflows/release.yml](https://github.com/spatial-model-editor/spatial-model-editor/blob/main/.github/workflows/release.yml#L34)
2 changes: 1 addition & 1 deletion ext/CLI11
Submodule CLI11 updated 198 files
6 changes: 3 additions & 3 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Or to list (without running) all tests that are tagged `[simulate]` and not tagg

See the Catch2 [command-line documentation](https://github.com/catchorg/Catch2/blob/master/docs/command-line.md#top) for more options.

Note: currently the GUI tests are only tested on linux,
and the mouse and keyboard should not be used while the tests are running
,as this can interfere with the simulated mouse and keyboard events generated by the test.
Note: currently the GUI tests are only tested in CI on linux,
and the mouse and keyboard should not be used while the tests are running,
as this can interfere with the simulated mouse and keyboard events generated by the test.

Any tests that are tagged `[gui]` will not run in parallel with any other tests with this tag.
Any tests that are tagged `[expensive]` are not ran in the debug/coverage CI builds.
Expand Down

0 comments on commit 4e13be3

Please sign in to comment.