# agrim-p777/conda-package-genn architecture

> Architecture diagram of the GitHub repository agrim-p777/conda-package-genn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/agrim-p777/conda-package-genn
- Repository: https://github.com/agrim-p777/conda-package-genn

## Overview

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`](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cpu/meta.yaml) (CPU meta), [`pygenn-cuda/meta.yaml`](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cuda/meta.yaml) (CUDA meta), [`pygenn-cuda`](https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-cuda) (CUDA package), [`pygenn-cpu`](https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-cpu) (CPU package)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Docs"]
  node_readme["README<br/>docs<br/>[README.md]"]
  node_assets["Assets<br/>docs"]
end

subgraph group_recipes["Core recipes"]
  node_cpu_root["CPU package<br/>recipe family"]
  node_cuda_root["CUDA package<br/>recipe family"]
  node_cpu_meta["CPU meta<br/>conda recipe<br/>[meta.yaml]"]
  node_cpu_cfg["CPU config<br/>variant config"]
  node_cuda_meta["CUDA meta<br/>conda recipe<br/>[meta.yaml]"]
  node_cuda_cfg["CUDA config<br/>variant config"]
  node_cuda_postlink["Post-link<br/>install hook<br/>[post-link.sh]"]
end

subgraph group_variants["Platform variants"]
  node_linux_cpu["Linux CPU<br/>platform recipe"]
  node_linux_cuda117["Linux CUDA 11.7<br/>platform recipe"]
  node_linux_cuda12x["Linux CUDA 12.x<br/>platform recipe"]
  node_linux_cuda124["Linux CUDA 12.4<br/>platform recipe"]
  node_win_cpu["Windows CPU<br/>platform recipe"]
  node_win_cuda_nmake["Win CUDA NMake<br/>platform recipe"]
  node_win_cuda124["Win CUDA 12.4<br/>platform recipe"]
  node_mac_cpu1["macOS CPU A<br/>platform recipe"]
  node_mac_cpu2["macOS CPU B<br/>platform recipe"]
  node_mac_winlinux["Win/Linux CPU<br/>platform recipe"]
end

subgraph group_forge["Conda-Forge"]
  node_forge_cpu["Forge CPU<br/>forge recipe"]
  node_forge_cuda["Forge CUDA<br/>forge recipe"]
end

subgraph group_checks["Validation"]
  node_smoketest_cpu["CPU smoke<br/>smoke test"]
  node_smoketest_cuda["CUDA smoke<br/>smoke test"]
  node_root_smoketest["Smoke suite<br/>smoke tests<br/>[test.py]"]
end

node_readme -->|"describes"| node_cpu_root
node_readme -->|"describes"| node_cuda_root
node_assets -.->|"supports"| node_readme
node_cpu_root -->|"centers on"| node_cpu_meta
node_cpu_root -->|"variants by"| node_cpu_cfg
node_cuda_root -->|"centers on"| node_cuda_meta
node_cuda_root -->|"variants by"| node_cuda_cfg
node_cuda_root -->|"installs"| node_cuda_postlink
node_cpu_meta -.->|"specializes"| node_linux_cpu
node_cpu_meta -.->|"specializes"| node_win_cpu
node_cpu_meta -.->|"specializes"| node_mac_cpu1
node_cpu_meta -.->|"specializes"| node_mac_cpu2
node_cpu_meta -.->|"specializes"| node_mac_winlinux
node_cuda_meta -.->|"specializes"| node_linux_cuda117
node_cuda_meta -.->|"specializes"| node_linux_cuda12x
node_cuda_meta -.->|"specializes"| node_linux_cuda124
node_cuda_meta -.->|"specializes"| node_win_cuda_nmake
node_cuda_meta -.->|"specializes"| node_win_cuda124
node_forge_cpu -.->|"mirrors"| node_cpu_root
node_forge_cuda -.->|"mirrors"| node_cuda_root
node_cpu_root -->|"validated by"| node_smoketest_cpu
node_cuda_root -->|"validated by"| node_smoketest_cuda
node_smoketest_cpu -.->|"feeds"| node_root_smoketest
node_smoketest_cuda -.->|"feeds"| node_root_smoketest
node_cuda_postlink -.->|"supports"| node_smoketest_cuda

click node_readme "https://github.com/agrim-p777/conda-package-genn/blob/main/README.md"
click node_assets "https://github.com/agrim-p777/conda-package-genn/tree/main/assets"
click node_cpu_root "https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-cpu"
click node_cuda_root "https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-cuda"
click node_cpu_meta "https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cpu/meta.yaml"
click node_cpu_cfg "https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cpu/conda_build_config.yaml"
click node_cuda_meta "https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cuda/meta.yaml"
click node_cuda_cfg "https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cuda/conda_build_config.yaml"
click node_cuda_postlink "https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cuda/post-link.sh"
click node_forge_cpu "https://github.com/agrim-p777/conda-package-genn/tree/main/Conda_Forge/pygenn-cpu"
click node_forge_cuda "https://github.com/agrim-p777/conda-package-genn/tree/main/Conda_Forge/pygenn-cuda"
click node_linux_cpu "https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-linux-cpu"
click node_linux_cuda117 "https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-linux-cuda11.7"
click node_linux_cuda12x "https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-linux-cuda12.x"
click node_linux_cuda124 "https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-linux-cuda12.4"
click node_win_cpu "https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-win-cpu"
click node_win_cuda_nmake "https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-win-cuda (nmake)"
click node_win_cuda124 "https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-win-cuda12.4"
click node_mac_cpu1 "https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-cpu (mac01)"
click node_mac_cpu2 "https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-cpu (mac02)"
click node_mac_winlinux "https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-cpu (winlinux)"
click node_smoketest_cpu "https://github.com/agrim-p777/conda-package-genn/blob/main/Conda_Forge/pygenn-cpu/tests/run_pygenn_cpu_smoketest.py"
click node_smoketest_cuda "https://github.com/agrim-p777/conda-package-genn/blob/main/Conda_Forge/pygenn-cuda/tests/run_pygenn_cuda_smoketest.py"
click node_root_smoketest "https://github.com/agrim-p777/conda-package-genn/blob/main/tests/test.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_assets toneBlue
class node_cpu_root,node_cuda_root,node_cpu_meta,node_cpu_cfg,node_cuda_meta,node_cuda_cfg,node_cuda_postlink toneAmber
class node_linux_cpu,node_linux_cuda117,node_linux_cuda12x,node_linux_cuda124,node_win_cpu,node_win_cuda_nmake,node_win_cuda124,node_mac_cpu1,node_mac_cpu2,node_mac_winlinux toneMint
class node_forge_cpu,node_forge_cuda toneRose
class node_smoketest_cpu,node_smoketest_cuda,node_root_smoketest toneIndigo
```

## Components

### Docs

Narrative and visual support files.

- [README](https://github.com/agrim-p777/conda-package-genn/blob/main/README.md): docs · Explains the packaging goals, platform splits, and release story. · `README.md`
- [Assets](https://github.com/agrim-p777/conda-package-genn/tree/main/assets): docs · Supporting visual and branding files. · `assets`

### Core recipes

Primary conda packaging definitions for the CPU and CUDA product lines.

- [CPU package](https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-cpu): recipe family · Top-level CPU-only packaging path for PyGeNN. · `pygenn-cpu`
- [CUDA package](https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-cuda): recipe family · Top-level GPU-enabled packaging path for PyGeNN. · `pygenn-cuda`
- [CPU meta](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cpu/meta.yaml): conda recipe · Authoritative CPU package metadata, dependencies, and build commands. · `pygenn-cpu/meta.yaml`
- [CPU config](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cpu/conda_build_config.yaml): variant config · CPU build variant and version pin selection. · `pygenn-cpu/conda_build_config.yaml`
- [CUDA meta](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cuda/meta.yaml): conda recipe · Authoritative CUDA package metadata, dependencies, and build commands. · `pygenn-cuda/meta.yaml`
- [CUDA config](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cuda/conda_build_config.yaml): variant config · CUDA build variant and version pin selection. · `pygenn-cuda/conda_build_config.yaml`
- [Post-link](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-cuda/post-link.sh): install hook · 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](https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-linux-cpu): platform recipe · Linux-specific CPU packaging branch. · `pygenn-linux-cpu`
- [Linux CUDA 11.7](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-linux-cuda11.7): platform recipe · Linux CUDA packaging branch pinned to CUDA 11.7. · `pygenn-linux-cuda11.7`
- [Linux CUDA 12.x](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-linux-cuda12.x): platform recipe · Linux CUDA packaging branch for the CUDA 12 family. · `pygenn-linux-cuda12.x`
- [Linux CUDA 12.4](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-linux-cuda12.4): platform recipe · Linux CUDA packaging branch pinned to CUDA 12.4. · `pygenn-linux-cuda12.4`
- [Windows CPU](https://github.com/agrim-p777/conda-package-genn/tree/main/pygenn-win-cpu): platform recipe · Windows-specific CPU packaging branch. · `pygenn-win-cpu`
- [Win CUDA NMake](https://github.com/agrim-p777/conda-package-genn/tree/HEAD/pygenn-win-cuda%20(nmake)): platform recipe · Windows CUDA packaging branch using NMake-oriented build mechanics. · `pygenn-win-cuda (nmake)`
- [Win CUDA 12.4](https://github.com/agrim-p777/conda-package-genn/blob/main/pygenn-win-cuda12.4): platform recipe · Windows CUDA packaging branch pinned to CUDA 12.4. · `pygenn-win-cuda12.4`
- [macOS CPU A](https://github.com/agrim-p777/conda-package-genn/tree/HEAD/pygenn-cpu%20(mac01)): platform recipe · macOS CPU packaging branch for one recipe variant. · `pygenn-cpu (mac01)`
- [macOS CPU B](https://github.com/agrim-p777/conda-package-genn/tree/HEAD/pygenn-cpu%20(mac02)): platform recipe · macOS CPU packaging branch with helper build scripts and loader handling. · `pygenn-cpu (mac02)`
- [Win/Linux CPU](https://github.com/agrim-p777/conda-package-genn/tree/HEAD/pygenn-cpu%20(winlinux)): platform recipe · Shared CPU packaging branch for Windows and Linux. · `pygenn-cpu (winlinux)`

### Conda-Forge

Recipe layout for Conda-Forge publication and CI.

- [Forge CPU](https://github.com/agrim-p777/conda-package-genn/tree/main/Conda_Forge/pygenn-cpu): forge recipe · Conda-Forge aligned CPU recipe layout. · `Conda_Forge/pygenn-cpu`
- [Forge CUDA](https://github.com/agrim-p777/conda-package-genn/tree/main/Conda_Forge/pygenn-cuda): forge recipe · Conda-Forge aligned CUDA recipe layout. · `Conda_Forge/pygenn-cuda`

### Validation

Smoke tests that verify installed package behavior.

- [CPU smoke](https://github.com/agrim-p777/conda-package-genn/blob/main/Conda_Forge/pygenn-cpu/tests/run_pygenn_cpu_smoketest.py): smoke test · Installed-package smoke test for the CPU build. · `Conda_Forge/pygenn-cpu/tests/run_pygenn_cpu_smoketest.py`
- [CUDA smoke](https://github.com/agrim-p777/conda-package-genn/blob/main/Conda_Forge/pygenn-cuda/tests/run_pygenn_cuda_smoketest.py): smoke test · Installed-package smoke test for the CUDA build. · `Conda_Forge/pygenn-cuda/tests/run_pygenn_cuda_smoketest.py`
- [Smoke suite](https://github.com/agrim-p777/conda-package-genn/blob/main/tests/test.py): smoke tests · Repository-level smoke testing entry point. · `tests/test.py`

## Connections

- 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.
