Skip to main content

soillib

soillib is a library and toolbox for numerical geomorphology simulation on the GPU

Written in in C++23 + CUDA and exposed to Python3 through nanobind

Maintained by erosiv. Based on concepts developed by and maintained by Nicholas McDonald.

Tested on Windows and Linux.

Terrain Generated with Soillib

Description

soillib is a unified C++23 library for numerical geomorphology simulation, with a Python3 layer built on top. The library is designed with a high degree of compatiblity with Python in mind.

soillib provides modularized and unified concepts for many aspects of geomorphological simulations, from high-performance indexing structures to unified particle physics and unified data import and export interfaces, including native GeoTIFF support.

soillib is fully statically typed in C++, while allowing for dynamic types in the python interface. It achieves this through a selector pattern, which generates statically typed code for all permitted types (constrained by concepts), while choosing these paths dynamically. This leads to deep inlining and full static performance benefits.

This allows for creating complex geomorphological simulations through elegant modular concepts in Python. All examples are implemented in Python, but are equally reproducible in C++.

soillib is interoperable with popular Python packages like numpy and pytorch, making it easy to integrate into new or existing projects quickly.

soillib is inspired by a number of predecessor systems and the difficulty of maintaining them all at the same time as concepts evolve. This allows for the maintenance of a single library, and re-implementing these programs on top of this library easily.

Features / Highlights

  • GPU First Kernelized Erosion Models
  • A Library of Kernelized Operations for Numerical Geomorphology
  • Fully Statically Typed C++23 Library with Concepts
  • Dynamically Typed Python Module
  • Interoperability with Numpy / PyTorch
  • Unified image import / export, including floating-point .tiff data and native GeoTIFF support.

Why C++23?

Concepts and type constraints are extremely convenient for defining complex operations which can be implemented for certain map and cell types, without becoming too specific.

Additionally, the introduction of "deducing this" in C++23 as well as the convenient std::format and std::print are features that reduce design complexity of the library.

Installation

Dependencies

  • GLM
  • LibTIFF
  • CUDA Toolkit
  • CMake
  • Python3
  • Scikit (pip)

Installing

Install through pypi.org using pip:

pip install soillib

Building

Build from source and install from this repository using pip:

git submodule update --init --recursive
pip install .

Re-building for development:

pip install --no-build-isolation -ve .

Build directly using CMake:

git submodule update --init --recursive
cmake -S . -B build
cmake --build build

Build Wheel Distributable:

pip wheel .

Metadata

Release files for soillib 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for soillib 1.1.2
File Interpreter ABI Platform
soillib-1.1.2-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details

Release files / soillib-1.1.2-cp312-abi3-win_amd64.whl

Download URL soillib-1.1.2-cp312-abi3-win_amd64.whl
Size 30.5 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
40e78bcd759e3656c333ae70de9856b0dcc28fef04b329bdf1111bba106e76e4
BLAKE2b-256 checksum
How to use checksums
81aa8d942d84fa2ad9a68149da7945ed92b30c1c00c066e740942b32463b2e31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.1.2 This release

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page