How agrim-p777/conda-package-genn works
1. What this repository is
This repo is not the GeNN source code itself; it is the packaging and release architecture for distributing PyGeNN as Conda packages. The goal is to turn a source-built C++/CUDA scientific library into installable binaries for end users.
2. Two primary product lines
The architecture splits into two top-level package families:
- pygenn-cpu: CPU-only build, no CUDA dependency
- pygenn-cuda: GPU-enabled build, depends on CUDA toolchain/runtime packages
This is the main product boundary in the repo.
3. Conda recipe as the central build unit
Each package family is built from a Conda recipe centered on:
- meta.yaml for package metadata, dependency pins, outputs, and build commands
- conda_build_config.yaml for variant selection and version pinning
The recipes are the authoritative architecture layer; everything else supports them.
4. Build configuration is platform- and version-aware
The tree contains multiple recipe variants for Linux, Windows, and macOS, plus CUDA version splits such as CUDA 11.7 and CUDA 12.x / 12.4.
That indicates the repo is organized around a matrix of build targets, not a single universal build script.
5. CPU vs CUDA have different dependency boundaries
The CPU package is a simpler runtime distribution of the Python bindings plus the compiled GeNN backend libraries.
The CUDA package adds the full GPU compilation/runtime boundary: modular CUDA Conda packages, CUDA path handling, and post-install guidance.
This is the key architectural distinction between the two deliverables.
6. Post-install behavior is part of the package design
The CUDA recipe includes post-link.sh and post-link.bat, which means installation is not purely file copy based.
The package also needs to communicate runtime environment setup, especially CUDA_PATH, so install-time hooks are used as part of the user-facing architecture.
7. Platform-specific build adaptations
The presence of separate folders like pygenn-cpu (mac01), pygenn-cpu (mac02), pygenn-win-cpu, pygenn-win-cuda (nmake), and Linux-specific recipe dirs shows the project had to encode OS-specific build mechanics:
- macOS dynamic library handling
- Windows build-system differences, including NMake/MSBuild
- Linux recipes with simpler native toolchain assumptions
These are not just alternate configs; they represent distinct packaging solutions per platform.
8. Runtime artifact handling is important
The README highlights fixes for macOS .dylib packaging and Windows CUDA path resolution, which means the package boundary includes:
- compiled shared libraries
- Python extension/modules
- platform loader behavior
The repo therefore bridges Python packaging and native binary distribution.
9. Tests are smoke tests, not application tests
The tests/ directories contain smoke tests for both CPU and CUDA packages:
- run_pygenn_cpu_smoketest.py
- run_pygenn_cuda_smoketest.py
- test.py
These likely validate that the installed package can be imported and that the backend loads correctly in a Conda environment. The tests are aimed at packaging integrity rather than model correctness.
10. Conda-Forge publication pipeline is explicit
The Conda_Forge/ directory mirrors the package families, indicating a separate layout for Conda-Forge submission and CI-ready recipes.
This repo supports the path from local packaging work to staged/official Conda-Forge recipes, so the architecture includes a recipe authoring layer and a distribution layer.
11. Documentation and assets are supporting, not operational
README.md and the assets/ directory are documentation/branding support. They explain the packaging rationale, but they are not part of the build or runtime path.
12. Overall data flow
The high-level flow is:
GeNN source build inputs and platform toolchains → Conda recipe selection (meta.yaml + conda_build_config.yaml) → platform/CUDA-specific build → packaged Python bindings and native libraries → post-link environment guidance → smoke tests in Conda environments.
That is the architectural story this repo encodes.
Main entry points: pygenn-cpu/meta.yaml CPU meta · pygenn-cuda/meta.yaml CUDA meta · pygenn-cuda CUDA package · pygenn-cpu CPU package
Components 24
Docs
Narrative and visual support files.
Core recipes
Primary conda packaging definitions for the CPU and CUDA product lines.
- CPU package · Top-level CPU-only packaging path for PyGeNN.
pygenn-cpu - CUDA package · Top-level GPU-enabled packaging path for PyGeNN.
pygenn-cuda - CPU meta · Authoritative CPU package metadata, dependencies, and build commands.
pygenn-cpu/meta.yaml - CPU config · CPU build variant and version pin selection.
pygenn-cpu/conda_build_config.yaml - CUDA meta · Authoritative CUDA package metadata, dependencies, and build commands.
pygenn-cuda/meta.yaml - CUDA config · CUDA build variant and version pin selection.
pygenn-cuda/conda_build_config.yaml - Post-link · Install-time hooks for CUDA environment setup on Unix and Windows.
pygenn-cuda/post-link.sh
Platform variants
OS- and CUDA-specific recipe branches and build adaptations.
- Linux CPU · Linux-specific CPU packaging branch.
pygenn-linux-cpu - Linux CUDA 11.7 · Linux CUDA packaging branch pinned to CUDA 11.7.
pygenn-linux-cuda11.7 - Linux CUDA 12.x · Linux CUDA packaging branch for the CUDA 12 family.
pygenn-linux-cuda12.x - Linux CUDA 12.4 · Linux CUDA packaging branch pinned to CUDA 12.4.
pygenn-linux-cuda12.4 - Windows CPU · Windows-specific CPU packaging branch.
pygenn-win-cpu - Win CUDA NMake · Windows CUDA packaging branch using NMake-oriented build mechanics.
pygenn-win-cuda (nmake) - Win CUDA 12.4 · Windows CUDA packaging branch pinned to CUDA 12.4.
pygenn-win-cuda12.4 - macOS CPU A · macOS CPU packaging branch for one recipe variant.
pygenn-cpu (mac01) - macOS CPU B · macOS CPU packaging branch with helper build scripts and loader handling.
pygenn-cpu (mac02) - Win/Linux CPU · Shared CPU packaging branch for Windows and Linux.
pygenn-cpu (winlinux)
Conda-Forge
Recipe layout for Conda-Forge publication and CI.
- Forge CPU · Conda-Forge aligned CPU recipe layout.
Conda_Forge/pygenn-cpu - Forge CUDA · Conda-Forge aligned CUDA recipe layout.
Conda_Forge/pygenn-cuda
Validation
Smoke tests that verify installed package behavior.
- CPU smoke · Installed-package smoke test for the CPU build.
Conda_Forge/pygenn-cpu/tests/run_pygenn_cpu_smoketest.py - CUDA smoke · Installed-package smoke test for the CUDA build.
Conda_Forge/pygenn-cuda/tests/run_pygenn_cuda_smoketest.py - Smoke suite · Repository-level smoke testing entry point.
tests/test.py
Connections 25
- README → CPU package: describes · Documents the CPU packaging line.
- README → CUDA package: describes · Documents the CUDA packaging line.
- Assets → README: supports · Branding and illustrative support for the docs.
- CPU package → CPU meta: centers on · The CPU package is defined by its recipe metadata.
- CPU package → CPU config: variants by · CPU build matrix is selected through conda-build configuration.
- CUDA package → CUDA meta: centers on · The CUDA package is defined by its recipe metadata.
- CUDA package → CUDA config: variants by · CUDA build matrix is selected through conda-build configuration.
- CUDA package → Post-link: installs · CUDA packaging includes install-time environment setup.
- CPU meta → Linux CPU: specializes · Linux-specific CPU packaging branch.
- CPU meta → Windows CPU: specializes · Windows-specific CPU packaging branch.
- CPU meta → macOS CPU A: specializes · macOS CPU packaging branch.
- CPU meta → macOS CPU B: specializes · Alternate macOS CPU packaging branch.
- CPU meta → Win/Linux CPU: specializes · Shared Windows/Linux CPU branch.
- CUDA meta → Linux CUDA 11.7: specializes · Linux CUDA 11.7 branch.
- CUDA meta → Linux CUDA 12.x: specializes · Linux CUDA 12.x branch.
- CUDA meta → Linux CUDA 12.4: specializes · Linux CUDA 12.4 branch.
- CUDA meta → Win CUDA NMake: specializes · Windows CUDA branch using NMake build mechanics.
- CUDA meta → Win CUDA 12.4: specializes · Windows CUDA 12.4 branch.
- Forge CPU → CPU package: mirrors · Conda-Forge recipe layout mirrors the CPU package family.
- Forge CUDA → CUDA package: mirrors · Conda-Forge recipe layout mirrors the CUDA package family.
- CPU package → CPU smoke: validated by · CPU packaging is checked with an installed-environment smoke test.
- CUDA package → CUDA smoke: validated by · CUDA packaging is checked with an installed-environment smoke test.
- CPU smoke → Smoke suite: feeds · Repository-level test entry point includes the CPU smoke check.
- CUDA smoke → Smoke suite: feeds · Repository-level test entry point includes the CUDA smoke check.
- Post-link → CUDA smoke: supports · Install-time setup enables the CUDA smoke test to load correctly.