https://github.com/ngsolve/ngsolve-addon-template
An Minimal NGSolve Addon with Python Bindings
https://github.com/ngsolve/ngsolve-addon-template
Last synced: 4 months ago
JSON representation
An Minimal NGSolve Addon with Python Bindings
- Host: GitHub
- URL: https://github.com/ngsolve/ngsolve-addon-template
- Owner: NGSolve
- License: unlicense
- Created: 2024-03-28T11:26:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-04T13:20:43.000Z (about 1 year ago)
- Last Synced: 2025-06-04T20:34:17.522Z (about 1 year ago)
- Language: CMake
- Size: 42 KB
- Stars: 3
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# An minimal NGSolve addon with Python bindings
## using the project template
To create your own NGSolve addon project you perfrom the following steps:
1. git-fork this project
2. fill the project with your C++ and Python files
3. adapt CMakeList.txt (addon_name, C++ and Python files)
4. adapt file pyproject.toml, section [project]
5. adapt `src/__init__.py` file
6. adapt `README.md` for installation instructions for your addon-project
## installing the addon project
Quick install: install the addon package directly with pip from git:
python -m pip install git+https://github.com/NGSolve/ngsolve-addon-template.git
**Alternative** needed for self-compiled NGSolve
python -m pip install scikit-build-core pybind11_stubgen toml
python -m pip install --no-build-isolation git+https://github.com/NGSolve/ngsolve-addon-template.git
test it:
python -m ngsolve_addon_template.demos.exploremesh
Step-by-step installation:
simple step-by-step installation using pip:
git clone https://github.com/NGSolve/ngsolve-addon-template.git
cd ngsolve-addon-template
python -m pip install --no-build-isolation .
alternative step-by-step installation using `cmake`:
git clone https://github.com/NGSolve/ngsolve-addon-template.git
cd ngsolve-addon-template
mkdir build
cd build
cmake ..
make -j4 install
## Troubleshooting
### Problem
Error in gihub actions when building Linux package:
```
ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
```
### Solution
Update `pyproject.toml` by adding the following line to the `[tool.cibuildwheel]` section:
```toml
[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux_2_28"
```
Some more NGSolve addons you can find here:
* https://github.com/TUWien-ASC/NGS-myfe (including vs-code instructions)