Sparse and dense linear algebra, differential equations, statistics, and continuum mechanics in Rust.

Compiles for wasm32-unknown-unknown and wasm32-wasip1
- Introduction
- WebAssembly
- Installation
- 🌟 Examples
- (lab) Numerical integration (quadrature)
- (lab) Solution of PDEs using spectral collocation
- (lab) Matrix visualization
- (lab) Singular value decomposition
- (lab) Cholesky factorization
- (lab) Solution of a (dense) linear system
- (lab) Reading table-formatted data files
- (lab) Line search for optimization
- (nonlin) Numerical continuation of a B-spline curve
- (sparse) Solution of a sparse linear system
- (sparse) Solution of a complex sparse linear system
- (ode) Solution of the Brusselator ODE
- (ode) Solution of the Brusselator PDE
- (pde) Spectral collocation in 2D with transfinite mapping
- (stat) Generate the Frechet distribution
- (tensor) Allocate second-order tensors
- Roadmap
- For developers
- About the name
Russell (Rust Scientific Library) helps develop high-performance computations involving linear algebra, sparse linear systems, numerical mathematics (continuation), differential equations, statistics, and continuum mechanics using the Rust programming language. While applications built with Russell mainly focus on computational mechanics, its foundation in fundamental mathematics and numerics makes it useful for other disciplines as well.
This project aims to deliver efficient, reliable, and easy-to-maintain code. To support this, Russell includes unit and integration tests, with test coverage required to be over 95%. For better code maintenance, Russell avoids overly complex Rust constructions. However, it still makes use of Rust features such as generics, traits, enums, options, and results. Another goal of Russell is to provide examples of all computations in the documentation to assist users and developers.
This project is split into the following crates:
-
russell_lab — Core mathematical and linear algebra laboratory:
- Data structures: NumVector, NumMatrix (column-major layout for direct BLAS/LAPACK interoperability), and stack-allocated SmallVector/SmallMatrix.
- Linear Algebra: BLAS 1/2/3 and LAPACK routines (dense solves, SVD, Cholesky, symmetric and general eigenvalues/eigenvectors for real and complex numbers).
- Numerics & Special Functions: Bessel, modified Bessel, Beta, Gamma, Erf, Elliptic integrals, Chebyshev/Legendre polynomials, Lagrange interpolation, B-splines, quadrature, Brent's root-finding, Newton solver, cubic solver, and numerical derivatives/Jacobians.
- Backends: pure-Rust BLAS/LAPACK from the
algebra_linearcrate by default; OpenBLAS (open_blas) or Intel oneAPI MKL (intel_mkl) as opt-in accelerators.
-
russell_tensor — Tensor calculus and continuum mechanics:
- Tensor types: Tensor1 (3D vectors), Tensor2 (2nd-order), Tensor3 (3rd-order), Tensor4 (4th-order).
- Kelvin-Mandel representation: Maps tensors to vector/matrix spaces preserving Euclidean norms.
- Operations & Calculus: Dot/ddot contractions, dyadic products, polar decompositions, principal/deviatoric/octahedral invariants, Lode invariant, first and second derivatives of invariants and tensor functions, linear elasticity / Hooke's law.
-
russell_sparse — Sparse matrix structures and solvers:
- Formats: CooMatrix, CscMatrix, CsrMatrix (both real f64 and Complex64).
- Direct Solvers: pure-Rust Direct (
Genie::Direct, always available), UMFPACK (SuiteSparse), and MUMPS (mumps). - Iterative Solvers: preconditioned CG, BiCGStab, and restarted GMRES with algebraic multigrid (pure Rust, always available).
- Utilities: Matrix Market I/O, vismatrix exporter, numerical Jacobian assembly, linear system verification.
-
russell_ode — ODE and Index-1 DAE solvers:
- Explicit Runge-Kutta (DoPri5, DoPri8, Forward Euler) with stiffness detection and dense output.
- Implicit solvers: Backward Euler and Radau5 (supports mass matrices, DAEs, and concurrent real/complex linear solves).
-
russell_pde — Partial differential equation tools:
- 1D/2D Finite Difference Methods (FDM) and Spectral Collocation (SPC) on Chebyshev/Legendre-Lobatto nodes.
- Transfinite mappings for deformed/curved domains.
- Essential boundary conditions via System Partitioning (SPS) or Lagrange Multipliers (LMM).
-
russell_nonlin — Continuation methods for parameterized nonlinear systems
$G(u, \lambda) = 0$ :- Predictor-corrector continuation: Natural continuation and Pseudo-arclength continuation (handling folds/limit points).
-
russell_stat — Engineering statistics and extreme value distributions
- Frechet, Gumbel, Lognormal, Normal, Uniform, quantiles, IQR, ASCII histogram generation.
Below is a summary of internal dependencies:
| Crate | Key dependencies |
|---|---|
russell_lab |
num-complex, serde |
russell_sparse |
russell_lab |
russell_stat |
russell_lab, rand |
russell_tensor |
russell_lab, serde |
russell_pde |
russell_lab, russell_sparse |
russell_ode |
russell_lab, russell_sparse, russell_pde |
russell_nonlin |
russell_lab, russell_sparse, russell_stat |
russell_lab
├── russell_stat
├── russell_tensor
├── russell_sparse
│ ├── russell_pde
│ │ └── russell_ode
│ └── russell_nonlin
The following crates are not part of russell but are associated with it and recommended:
- plotpy Plotting tools using Python3/Matplotlib as an engine (for quality graphics)
- tritet Triangle and tetrahedron mesh generators (with Triangle and Tetgen)
- gemlab Geometry, meshes, and numerical integration for finite element analyses
- benchmark-russell Performance benchmarks for this project
This project can use SuiteSparse (or MUMPS) for the solution of large (sparse) linear systems of equations. Dense linear algebra comes from russell_lab's own Rust implementation, and OpenBLAS or Intel MKL may be selected as accelerators.
The default build needs no external library. russell_lab ships pure-Rust BLAS/LAPACK kernels and russell_sparse has the Direct solver (pure Rust), so cargo build works on every platform, WebAssembly included. The external libraries are optional, and each one is selected by a Cargo feature:
| Feature | What it adds | Linux | macOS | Windows MSVC | Windows GNU |
|---|---|---|---|---|---|
open_blas |
OpenBLAS for the dense kernels | ✓ | ✓ | — | ✓ |
intel_mkl |
Intel oneAPI MKL for the dense kernels | ✓ | — | — | — |
umfpack |
UMFPACK (SuiteSparse), sparse direct solver | ✓ | ✓ | ✓ (vcpkg) | ✓ (MSYS2) |
mumps |
MUMPS, sparse direct solver | ✓ | ✓ | — | ✓ (MSYS2) |
open_blasandintel_mklfill the same slot;intel_mkltakes precedence when both are enabled.umfpackandmumpsare independent of each other and of the kernels above, and any combination is valid — including none of them.- MUMPS is never taken from a package manager. The distributions rarely ship the sequential build this project uses, so it is compiled locally and found through
RUSSELL_LOCAL_PREFIX; see the per-OS options below. - On Windows the two Rust toolchains have different sources: MSVC takes UMFPACK from vcpkg, and only the GNU toolchain under MSYS2 can link MUMPS. See windows.md.
An accelerator is worth it for large problems but is never required: the native kernels reach about half of OpenBLAS's throughput per core, and dense solves are further behind because dgetrf is not blocked yet. The russell_lab README has the measured table.
The following table summarizes which features each crate forwards:
open_blas |
intel_mkl |
umfpack |
mumps |
|
|---|---|---|---|---|
russell_lab |
✓ | ✓ | ||
russell_nonlin |
✓ | ✓ | ✓ | ✓ |
russell_ode |
✓ | ✓ | ✓ | ✓ |
russell_pde |
✓ | ✓ | ✓ | ✓ |
russell_sparse |
✓ | ✓ | ✓ | ✓ |
russell_stat |
✓ | ✓ | ||
russell_tensor |
✓ | ✓ |
Below is an example of how to enable the intel_mkl, umfpack and mumps features with the russell_sparse crate in the Cargo.toml file:
[dependencies]
russell_lab = { version = "*", features = ["intel_mkl"] }
russell_sparse = { version = "*", features = ["intel_mkl", "umfpack", "mumps"] }Replace "*" with the desired version. Note that russell_sparse (and all other crates in this project) require russell_lab as a dependency.
The workspace builds for both WebAssembly targets with the default features, i.e. with the Direct solver (pure Rust) and no external libraries:
cargo check --workspace --target wasm32-unknown-unknown
cargo check --workspace --target wasm32-wasip1The browser target has no filesystem: the Matrix Market readers/writers and the JSON statistics helpers compile, but they return errors when called. WASI exposes the filesystem when the runtime preopens a directory. Timers work in both: wasm32-unknown-unknown uses web-time (performance.now()), while WASI uses the standard library clock. Enabling umfpack or mumps is only possible on native targets.
Every option below is optional: the default build needs no external library, and the Cargo.toml snippet under each option lists the features that make the build actually use the libraries installed by it. Without those features, the libraries are present but unused, and the build keeps the Rust kernels and the Direct solver (pure Rust).
RUSSELL_LOCAL_PREFIX is the single variable that locates locally compiled solvers. With umfpack it is optional: when set to a directory containing the UMFPACK layout below, that installation is used; otherwise the build falls back to the system library. With mumps it is required. The layout is fixed:
$RUSSELL_LOCAL_PREFIX/include/umfpack $RUSSELL_LOCAL_PREFIX/lib/umfpack
$RUSSELL_LOCAL_PREFIX/include/mumps $RUSSELL_LOCAL_PREFIX/lib/mumps
The compilation scripts below install into exactly that layout: the Linux scripts use /usr/local, the macOS script takes the prefix as its argument, and the Windows MUMPS script installs into the MSYS2 root (see windows.md). Two SuiteSparse builds share the libumfpack.so.6 soname, so the directory of the selected one must also be reachable by the dynamic loader at run time (ldconfig on a system prefix, or LD_LIBRARY_PATH); the binaries built inside this workspace carry a run path instead. A prefix that is set but does not contain UMFPACK produces a warning and the system fallback; a missing MUMPS installation stops the build with the expected paths.
Using Intel MKL with russell_lab and OpenBLAS with russell_sparse is possible but not advantageous, since MKL is slightly faster than OpenBLAS (see this article). If MKL is already installed, Option 3 below compiles both SuiteSparse and MUMPS against it; there is no fourth option mixing the two.
Run the following command to install OpenBLAS and SuiteSparse:
pacman -Syu rust blas-openblas suitesparseSet Cargo.toml as follows, so that the installed libraries are used:
[dependencies]
russell_lab = { version = "*", features = ["open_blas"] }
russell_sparse = { version = "*", features = ["open_blas", "umfpack"] }open_blas selects the packaged OpenBLAS and umfpack the packaged SuiteSparse. Drop umfpack if you only want the dense accelerator, or both features for the default Rust kernels and the Direct solver (pure Rust).
Run the following commands to compile and install SuiteSparse and MUMPS with OpenBLAS (use these scripts at your own risk; carefully check the scripts before running them):
export RUSSELL_LOCAL_PREFIX=/usr/local # where both scripts install
bash zscripts/arch-compile-mumps.bash
bash zscripts/arch-compile-suitesparse.bash Set Cargo.toml as follows:
russell_sparse = { version = "*", features = ["open_blas", "umfpack", "mumps"] }Run the following commands to compile and install SuiteSparse and MUMPS with Intel MKL (use these scripts at your own risk; carefully check the scripts before running them):
bash zscripts/arch-install-intel-toolkit.bash
export RUSSELL_LOCAL_PREFIX=/usr/local # where both scripts install
bash zscripts/arch-compile-mumps.bash 1
bash zscripts/arch-compile-suitesparse.bash 1Set Cargo.toml as follows:
russell_sparse = { version = "*", features = ["intel_mkl", "umfpack", "mumps"] }Run the following command to install OpenBLAS and SuiteSparse:
sudo apt-get install -y --no-install-recommends \
liblapacke-dev \
libopenblas-dev \
libsuitesparse-devSet Cargo.toml as follows, so that the installed libraries are used:
[dependencies]
russell_lab = { version = "*", features = ["open_blas"] }
russell_sparse = { version = "*", features = ["open_blas", "umfpack"] }open_blas selects the packaged OpenBLAS and umfpack the packaged SuiteSparse. Drop umfpack if you only want the dense accelerator, or both features for the default Rust kernels and the Direct solver (pure Rust).
Run the following commands to compile and install SuiteSparse and MUMPS with OpenBLAS (use these scripts at your own risk; carefully check the scripts before running them):
export RUSSELL_LOCAL_PREFIX=/usr/local # where both scripts install
bash zscripts/debian-compile-mumps.bash
bash zscripts/debian-compile-suitesparse.bash Set Cargo.toml as follows:
russell_sparse = { version = "*", features = ["open_blas", "umfpack", "mumps"] }Run the following commands to compile and install SuiteSparse and MUMPS with Intel MKL (use these scripts at your own risk; carefully check the scripts before running them):
bash zscripts/debian-install-intel-toolkit.bash
export RUSSELL_LOCAL_PREFIX=/usr/local # where both scripts install
bash zscripts/debian-compile-mumps.bash 1
bash zscripts/debian-compile-suitesparse.bash 1Set Cargo.toml as follows:
russell_sparse = { version = "*", features = ["intel_mkl", "umfpack", "mumps"] }dnf update -y
dnf install epel-release -y
crb enable
dnf install -y \
lapack-devel \
openblas-devel \
suitesparse-develSet Cargo.toml as follows, so that the installed libraries are used:
[dependencies]
russell_lab = { version = "*", features = ["open_blas"] }
russell_sparse = { version = "*", features = ["open_blas", "umfpack"] }The locally compiled options (2 and 3) are not provided for Rocky Linux.
First, install Homebrew.
brew install lapack openblas suite-sparseSet Cargo.toml as follows, so that the installed libraries are used:
[dependencies]
russell_lab = { version = "*", features = ["open_blas"] }
russell_sparse = { version = "*", features = ["open_blas", "umfpack"] }Intel MKL is not available for macOS (Intel discontinued it for that platform), so open_blas is the accelerator to use there.
MUMPS is not packaged for macOS in the sequential form this project uses, so it is compiled from source with Homebrew's gfortran against Apple's Accelerate framework (use the script at your own risk; carefully check it before running it):
brew install gcc # provides gfortran
export RUSSELL_LOCAL_PREFIX="$HOME/local"
bash zscripts/macos-compile-mumps.bash "$RUSSELL_LOCAL_PREFIX"Set Cargo.toml as follows; UMFPACK still comes from Homebrew, as in Option 1:
russell_sparse = { version = "*", features = ["open_blas", "umfpack", "mumps"] }The script installs into $RUSSELL_LOCAL_PREFIX/include/mumps and lib/mumps, and rewrites the dylibs' install names to @rpath, which the run path emitted by russell_sparse resolves. Test binaries of crates that only depend on russell_sparse do not get that run path, so export DYLD_LIBRARY_PATH="$RUSSELL_LOCAL_PREFIX/lib/mumps" when testing the whole workspace.
Two toolchains work on Windows, and the features differ between them:
- MSVC, the default Rust toolchain there. The Direct solver (pure Rust) needs nothing installed; add UMFPACK with vcpkg (
vcpkg install suitesparse-umfpack[core]:x64-windows, withVCPKG_ROOTset) and enableumfpack. MUMPS,open_blasandintel_mklare not available with this toolchain. - MSYS2 with the GNU toolchain, which provides OpenBLAS, SuiteSparse and the MinGW/gfortran build of MUMPS. It supports
open_blas,umfpackandmumps; it is the only way to use MUMPS on Windows.
See windows.md for step-by-step instructions for both.
By default, OpenBLAS will use all available threads, including Hyper-Threads that may worsen the performance. Thus, it is recommended to set the following environment variable:
export OPENBLAS_NUM_THREADS=<real-core-number>Substitute <real-core-number> with the correct value from your system.
Furthermore, if working on a multi-threaded application where the solver should not be multi-threaded on its own (e.g., running parallel calculations in an optimization tool), you may set:
export OPENBLAS_NUM_THREADS=1This variable only affects builds that link OpenBLAS (open_blas). The Rust kernels, Intel MKL, and the sparse solvers do not read it; mumps_num_threads, in LinSolParams, controls the MUMPS thread count.
See also:
- russell_lab/examples
- russell_nonlin/examples
- russell_ode/examples
- russell_pde/examples
- russell_sparse/examples
- russell_stat/examples
- russell_tensor/examples
The code below determines the perimeter P of an ellipse of length 2 and width 1:
2π
⌠ ____________________
P = │ \╱ ¼ sin²(θ) + cos²(θ) dθ
⌡
0
See the code: algo_quadrature_integrate_1d.rs
This example illustrates the solution of a 1D PDE using the spectral collocation method. It employs the InterpLagrange struct.
d²u du x
——— - 4 —— + 4 u = e + C
dx² dx
-4 e
C = ——————
1 + e²
x ∈ [-1, 1]
Boundary conditions:
u(-1) = 0 and u(1) = 0
Reference solution:
x sinh(1) 2x C
u(x) = e - ——————— e + —
sinh(2) 4
See the code: algo_lorene_1d_pde_spectral_collocation.rs
Results:
We can use the fantastic tool named vismatrix to visualize the pattern of non-zero values of a matrix. With vismatrix, we can click on each circle and investigate the numeric values as well.
The function mat_write_vismatrix writes the input data file for vismatrix.
See the code: matrix_visualization.rs
After generating the "dot-smat" file, run the following command:
vismatrix /tmp/russell_lab/matrix_visualization.smatOutput:
See the code: matrix_singular_value_decomposition.rs
See the code: matrix_cholesky_4x4.rs
See the code: matvec_solve_linear_system.rs
The goal is to read the following file (clay-data.txt):
# Fujinomori clay test results
sr ea er # header
1.00000 -6.00000 0.10000
2.00000 7.00000 0.20000
3.00000 8.00000 0.20000 # << look at this line
# comments plus new lines are OK
4.00000 9.00000 0.40000
5.00000 10.00000 0.50000
# bye
Each column (sr, ea, er) is accessible via the get method of the [HashMap].
See the code: base_read_table.rs
Alternatively, we can use the simpler read_data function:
See the code: base_read_data.rs
Line search is used in gradient-based optimization methods to find an appropriate step size.
See the code: algo_line_search.rs
This example traces a B-spline curve defined by G(u, λ) = 0 using the Pseudo-arclength continuation method.
The nonlinear problem is defined as follows:
G(u, λ) = u - C(λ)
where C(λ) is a point on a 2D B-spline curve parametrized by λ ∈ [0,1].
See the code: arclength_bspline.rs
The plot looks like this:
See the code: doc_umfpack_quickstart_coo.rs
See the code: doc_complex_umfpack_tiny.rs
The system is:
y0' = 1 - 4 y0 + y0² y1
y1' = 3 y0 - y0² y1
with y0(x=0) = 3/2 and y1(x=0) = 3
Solving with DoPri8 -- 8(5,3):
See the code: brusselator_ode_dopri8.rs
A plot of the (dense) solution is shown below:
This example solves the Brusselator PDE described in (Hairer E, Wanner G (2002) Solving Ordinary Differential Equations II Stiff and Differential-Algebraic Problems. Second Revised Edition. Corrected 2nd printing 2002. Springer Series in Computational Mathematics, 614p).
See the code: brusselator_pde_radau5_2nd.rs.
The results are shown below for the U field:
And below for the V field:
See the code: brusselator_pde_2nd_comparison.rs compares russell results with Mathematica results.
The figure below shows the russell (black dashed lines) and Mathematica (red solid lines) results for the U field:
The figure below shows the russell (black dashed lines) and Mathematica (red solid lines) results for the V field:
Example: Solving a 2D Poisson equation on a rotated square domain
This example employs spectral collocation with transfinite mapping to solve the Poisson equation:
-k · ∇²u = f on a unit square rotated by angle α
u = g on the boundary (Dirichlet conditions)
The analytical solution used for verification is:
u(x,y) = sin(π·x·cos(α) + π·y·sin(α)) · exp(π·y·cos(α) - π·x·sin(α))
The domain is mapped from the reference square (r,s) ∈ [-1,1]×[-1,1] to the physical rotated square via transfinite interpolation.
See the code: doc_example_spc_map.rs
The plot looks like this:
See the code: distribution_frechet.rs
Sample output:
min = 0.11845731988882305
max = 26248.036672205748
mean = 12.268212841918867
std_dev = 312.7131690782321
[ 0,0.5) | 1370 🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦
[0.5, 1) | 2313 🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦
[ 1,1.5) | 1451 🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦
[1.5, 2) | 971 🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦
[ 2,2.5) | 659 🟦🟦🟦🟦🟦🟦🟦🟦
[2.5, 3) | 460 🟦🟦🟦🟦🟦
[ 3,3.5) | 345 🟦🟦🟦🟦
[3.5, 4) | 244 🟦🟦🟦
[ 4,4.5) | 216 🟦🟦
[4.5, 5) | 184 🟦🟦
[ 5,5.5) | 133 🟦
[5.5, 6) | 130 🟦
[ 6,6.5) | 115 🟦
[6.5, 7) | 108 🟦
[ 7,7.5) | 70
[7.5, 8) | 75
[ 8,8.5) | 57
[8.5, 9) | 48
[ 9,9.5) | 59
sum = 9008
See the code: allocating_second_order_tensors.rs
- Improve
russell_lab- Implement more integration tests for linear algebra
- Implement more examples
- Implement more performance benchmarks
- Wrap more BLAS/LAPACK functions
- Implement dggev, zggev, zheev, and zgeev
- Wrap Intel MKL (alternative to OpenBLAS)
- Add more complex number functions
- Add fundamental functions to
russell_lab- Implement the Bessel functions
- Implement the modified Bessel functions
- Implement the elliptical integral functions
- Implement Beta, Gamma and Erf functions (and associated)
- Implement orthogonal polynomial functions
- Implement some numerical methods in
russell_lab- Implement Brent's solver
- Implement a solver for the cubic equation
- Implement numerical derivation
- Implement numerical Jacobian function
- Implement line search
- Implement Newton's method for nonlinear systems
- Implement numerical quadrature
- Implement multidimensional data interpolation
- Add interpolation and polynomials to
russell_lab- Implement Chebyshev polynomials
- Implement Chebyshev interpolation
- Implement Orthogonal polynomials
- Implement Lagrange interpolation
- Implement Legendre polynomials
- Implement Fourier interpolation
- Improve
russell_sparse- Implement support for complex numbers
- Implement the Compressed Sparse Column format (CSC)
- Implement the Compressed Sparse Row format (CSR)
- Improve the C-interface to UMFPACK and MUMPS
- Write the conversion from COO to CSC in Rust
- Improve
russell_ode- Implement explicit Runge-Kutta solvers
- Implement Radau5 for DAEs
- Implement extrapolation methods
- Implement multi-step methods
- Implement general linear methods
- Implement
russell_pde- Implement 1D and 2D spectral collocation methods
- Implement 1D and 2D finite difference methods
- Implement
russell_nonlin- Implement natural continuation for nonlinear systems
- Implement pseudo-arclength continuation for nonlinear systems
- Study better methods for step size control in continuation methods
- Improve
russell_stat- Add probability distribution functions
- Implement drawing of ASCII histograms
- Implement FORM (first-order reliability method)
- Add more examples
- Improve
russell_tensor- Implement functions to calculate invariants
- Implement first and second-order derivatives of invariants
- Implement some high-order derivatives
- Implement standard continuum mechanics tensors
- General improvements
- Compile on Linux (Arch, Debian/Ubuntu, Rocky)
- Compile on macOS
- Compile on Windows
- Study the compilation of MUMPS on Windows
- Write scripts to compile on Windows
This section summarizes the build.rs files, which compile and link the non-Rust C dependencies at build time.
The code adopts the convention that double lower-case letters denote a single capital letter, matching the symbols used in the documentation and the mathematical formulas:
aa⇔Abb⇔Bpp⇔Pii⇔Ijj⇔J
For example, the scalar coefficients A, B, and C in the second-derivative formulas of the invariants are coded as aa, bb, and cc.
With neither accelerator feature enabled, russell_lab/build.rs compiles no C code: the kernels come from algebra_linear. When open_blas or intel_mkl is enabled, it compiles a single C shim (c_code/interface_blas.c) that wraps BLAS/LAPACK and selects one of two paths:
intel_mkl— builds against Intel oneAPI MKL: resolvesMKL_VERSION(env var, defaultlatest), adds/opt/intel/oneapi/mkl/{version}to the include path, definesUSE_INTEL_MKL, and linksmkl_intel_lp64,mkl_intel_thread,mkl_core,pthread,m,dl,iomp5.open_blas(used only whenintel_mklis off) — split by OS:- Windows: locates headers/libraries via the
MSYS2_PREFIXenvironment variable. - Other OS: probes
pkg-config(probe_blas_lapack), tryingopenblasfirst and then thecblas+lapackpair (Nix). Before trusting a probe, it verifies the headers (cblas.h,lapack.h) actually exist — this avoids the RHEL/Rocky case wherelapack.pcexists but ships nolapack.h. It falls back to hardcoded Homebrew/system paths (filtered viaexisting_dirsto drop non-existent directories) and links theopenblasandlapackshared libraries.
- Windows: locates headers/libraries via the
Build-dependencies: cc, pkg-config.
russell_sparse/build.rs compiles the C shims for the sparse solvers. UMFPACK is optional and off by default (umfpack); MUMPS joins it when mumps is enabled. The features select which solvers are present, and the build selects the UMFPACK source:
-
umfpackon: a local install under$RUSSELL_LOCAL_PREFIX/include/umfpackand.../lib/umfpackis used whenRUSSELL_LOCAL_PREFIXis set and contains it, with nopkg-configlookup in that case; otherwise the build falls back to the package-manager library (pkg-config, trying bothUMFPACKandumfpackspellings, then the built-in directory list). If neither answers, the build stops naming the package to install. A prefix that is set but incomplete prints a warning and falls back. -
umfpackoff: no UMFPACK shims are compiled and nothing is linked; the Direct solver (pure Rust) remains available. -
mumpson: MUMPS from$RUSSELL_LOCAL_PREFIX/include/mumpsand.../lib/mumps, independently of UMFPACK, shared on Unix and static on Windows (dmumps_cpmech,zmumps_cpmech,mumps_common_cpmech,mpiseq_cpmech,pord_cpmech,metis,gfortran,gomp). A missing prefix fails the build naming the exact path it expected. -
RUSSELL_LOCAL_PREFIXis trimmed of trailing separators. - The selected UMFPACK is recorded with
cargo:rustc-env, soget_library_versions()reports whether it is thesystemor thelocalone, or that it was not compiled in.
Build-dependencies: cc, pkg-config.
The library is named after Bertrand Russell (1872–1970), a distinguished British philosopher, logician, mathematician, and pacifist. Among his many influential works is Principia Mathematica (1910–1913), co-authored with Alfred North Whitehead—an ambitious attempt to derive mathematics from logic and widely regarded as one of the twentieth century's most important contributions to mathematical logic. The book cover shown features Introduction to Mathematical Philosophy, in which Russell explains the principal ideas of Principia Mathematica in a more accessible, less technical manner.
The photo of the stamp corresponds to India's commemorative postage stamp issued on 16 October 1972 for the birth centenary of Bertrand Russell, as part of the "Centenary Series" introduced that year by the Indian Posts and Telegraphs Department to mark the centenaries falling during the year (issue note). Four personalities were honored on that date — the Telugu poet Vemana (300th birth anniversary), T. Prakasam and Bhai Vir Singh (birth centenaries), and Russell (₹1.45) — and all four stamps were released together on a single first day cover (list of Indian stamps of 1972). India's reason for including a British philosopher was political as much as intellectual: Russell became chairman of the India League in Britain in 1932, presiding over its meetings and heading it during the delegation it sent to India that autumn, and he wrote the introduction to the delegation's report, The Condition of India (1932) (South Asian Britain). The department's own issue note puts it plainly: "Temperamentally sympathetic to the Indian struggle for liberty, Russell became Chairman of the Indian League formed in Britain to help the Indians and their claim for self-government." The stamp reproduces a photograph supplied with the courtesy of M/s Keystone Press Agency Ltd., London, and was designed and printed by photogravure at the India Security Press, Nasik Road, in a print run of three million (42 stamps per issue sheet, perforation 13½ × 14) (technical data). The portrait is accompanied by the dates 1872–1970 and the legend बर्ट्रेंड रसल / भारत INDIA. The author of this Rust project is a proud owner of the stamp featured in the photo.




