Installation
Prerequisites
SPIRES requires:
- C compiler: GCC 9+ or Clang 12+
- OpenBLAS: High-performance BLAS implementation
- LAPACKE: C interface to LAPACK
- OpenMP: For parallel reservoir operations (optional but recommended)
Install Dependencies
macOS (Homebrew)
brew install openblas lapack libompUbuntu / Debian
sudo apt install libopenblas-dev liblapacke-dev libomp-devFedora / RHEL
sudo dnf install openblas-devel lapack-devel libomp-develClone and Build
git clone https://github.com/txmastin/spires.git
cd spires
makeThe build produces libspires.a (static library) and libspires.so (shared library) in the build/ directory.
Link Against SPIRES
Add the following to your compiler invocation:
gcc -o my_program my_program.c \
-I/path/to/spires/include \
-L/path/to/spires/build \
-lspires -lopenblas -llapacke -lm -fopenmpVerify Installation
#include <spires.h>
#include <stdio.h>
int main(void) {
spires_reservoir_config cfg = {
.num_neurons = 100,
.num_inputs = 1,
.num_outputs = 1,
.spectral_radius = 0.9,
.neuron_type = SPIRES_NEURON_LIF_DISCRETE,
.connectivity_type = SPIRES_CONN_RANDOM,
};
spires_reservoir *r = NULL;
spires_status s = spires_reservoir_create(&cfg, &r);
if (s == SPIRES_OK) {
printf("SPIRES is working!\n");
spires_reservoir_destroy(r);
}
return 0;
}Next: Quickstart →
Last updated on