Laclib implements basic linear algebra functions, wrapping OpenBLAS or Intel MKL. It also wraps MUMPS or Intel Direct Sparse Solver (DSS, e.g., PARDISO) for the solution of large linear systems with sparse matrices.
The following code shows how to solve a linear system with a (large) sparse matrix:
auto coo = read_matrix_market("my-matrix.mtx");
auto options = MumpsOptions::make_new(is_symmetric(coo->layout));
auto solver = SolverMumps::make_new(options);
auto rhs = vector<double>(coo->n, 1.0);
auto x = vector<double>(coo->n, 0.0);
solver->analyze_and_factorize(coo);
solver->solve(x, rhs);
See ex_solver_mumps.cpp for a complete code.
After installation (explained below), you may clone https://github.com/cpmech/use-laclib to bootstrap a project using laclib
.
The docker image is convenient with Visual Code remote development tools (but containerized; "not really remote").
./build-docker-image.bash
First, follow the procedures from https://github.com/cpmech/script-install-mumps
Then, execute
./install-deps.bash
./install.bash
which will compile and install the header files in /usr/local/include/laclib
and the library files in /usr/local/lib/laclib
.
├── benchmarks # tests for computational performance
├── data # auxiliary data for unit tests
├── examples # examples of usage
├── src # this is the "main library"
│ ├── analysis # analysis, stats, and reporting
│ ├── check # functions for unit/integration tests
│ ├── linalg # basic linear algebra functions
│ ├── sparse # sparse matrix and solvers tools
│ └── util # some utilities for file/string manipulations
└── zscripts # auxiliary "internal" bash scripts
We suggest looking at the sparse directory first.
From: https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-download.html
Select Linux → APT Package Manager
and follow the instructions, or use the script below:
bash ./zscripts/install-intel-mkl-linux.bash
Select Windows → Online Installer
and follow the instructions.