Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ _build

*.log

*.lock
conda/recipe/meta.yaml
conda/recipe
.vs/
*.key

Expand All @@ -89,3 +92,6 @@ uv.lock
*.bck
*log
*.claude
.pixi/
conda/recipe/meta.yaml
conda/recipe/meta.yaml
67 changes: 67 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
#
# SPDX-License-Identifier: Unlicense

stages:
- build
- test
- deploy

# ============================================================
# GPU-specific images and runner configuration
# ============================================================
Expand Down Expand Up @@ -76,15 +81,38 @@
# Job templates
# ============================================================
.build-and-test:
variables:
CMAKE_BUILD_PARALLEL_LEVEL: "3"
script:
- ./ci/lrz-gitlab/build-and-test.sh

.benchmark:
extends:
- .setup-for-benchmarking
variables:
CMAKE_BUILD_PARALLEL_LEVEL: "3"
script:
- ./ci/lrz-gitlab/benchmark.sh

.build-python-wheel:
variables:
CMAKE_BUILD_PARALLEL_LEVEL: "3"
before_script:
- python3 -m pip install --user --break-system-packages build
script:
- python3 -m build --wheel
- python3 ci/smoke_test_wheel.py
artifacts:
paths:
- dist/*.whl

.pixi-python-package:
image: ghcr.io/prefix-dev/pixi:latest
variables:
CMAKE_BUILD_PARALLEL_LEVEL: "1"
before_script:
- pixi install --locked

# ============================================================
# NeoN - testing jobs
# ============================================================
Expand Down Expand Up @@ -126,3 +154,42 @@ benchmark-neon-intel:
- .gpu-intel
- .rules-neon-benchmarking
- .benchmark

# ============================================================
# NeoN - Python packaging job
# ============================================================
build-python-wheel-nvidia:
extends:
- .gpu-nvidia
- .rules-neon-testing
- .build-python-wheel

build-python-wheel-pixi:
extends:
- .pixi-python-package
stage: build
script:
- pixi run -e build smoke-test
artifacts:
paths:
- dist/*.whl
expire_in: 1 week
rules:
- if: '$CI_COMMIT_TAG'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH'

publish-python-wheel-pypi:
extends:
- .pixi-python-package
stage: deploy
needs:
- job: build-python-wheel-pixi
artifacts: true
id_tokens:
PYPI_ID_TOKEN:
aud: pypi
script:
- pixi run -e release twine upload dist/*
rules:
- if: '$CI_COMMIT_TAG =~ /^v?[0-9]+\.[0-9]+\.[0-9]+$/'
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ We provide a set of unit tests which can be executed via ctest or

cmake --build . --target test

### Pixi Workspace

For reproducible local development environments, NeoN can also be driven via
`pixi.toml`. Pixi is used here as the environment and task runner, while the
actual compilation and wheel creation still go through CMake and
`python -m build`.

Typical commands are:

pixi install # creates pixi.lock
pixi run -e build build # configure + build with -j3
pixi run -e py312 test # run ctest in the Python 3.12 environment
pixi run -e build wheel # build a wheel without build isolation
pixi run -e build smoke-test # install the built wheel in an isolated venv and run test_neon_package.py

The generated `pixi.lock` should be committed so CI uses pinned tooling across
platforms.


## Integration with other CFD Frameworks

Expand Down
43 changes: 43 additions & 0 deletions conda/recipe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Conda recipe for NeoN

This recipe packages the NeoN Python bindings and ships the compiled extension
(`neon/_neon*.so` on Linux/macOS, `neon/_neon*.pyd` on Windows).

## Build locally

```bash
conda build conda/recipe
```

The recipe defaults to `CMAKE_BUILD_PARALLEL_LEVEL=2` to reduce memory pressure.
Override it when needed:

```bash
CMAKE_BUILD_PARALLEL_LEVEL=1 conda build conda/recipe
```

Get the produced package path:

```bash
conda build conda/recipe --output
```

## Upload to anaconda.org

```bash
anaconda login
anaconda upload "$(conda build conda/recipe --output)"
```

## Install and verify

```bash
conda install -c <your-channel> neon
python -c "import neon; import neon._neon; print(neon.__version__)"
```

## Notes

- The package build uses `pip install . --no-build-isolation --no-deps` with `scikit-build-core`.
- Build requirements use Conda compilers to produce relocatable binaries.
- Additional system/compiler requirements may be needed depending on your platform and accelerator setup.
49 changes: 49 additions & 0 deletions conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% set name = "exasim-neon" %}
{% set version = "0.1.0" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
path: ../../

build:
number: 0
script:
- export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-1}
- {{ PYTHON }} -m pip install . -vv --no-build-isolation --no-deps

requirements:
build:
- {{ compiler('cxx') }}
- cmake >=3.22
- ninja
host:
- python
- pip
- scikit-build-core >=0.11.0
- nanobind >=2.9.0
- nlohmann_json
- setuptools
run:
- python
- numpy >=1.19.0

test:
requires:
- pip
imports:
- neon
commands:
- python -c "import neon; print(neon.__version__, neon.__has_serial__)"
- python -c "import neon._neon as ext; print('loaded', ext.__name__)"

about:
home: https://github.com/exasim-project/NeoN
summary: Python bindings for the NeoN CFD framework
license: MIT

extra:
recipe-maintainers:
- exasim-project
Loading
Loading