compat.openblas
#includeOpenBLAS — optimized BLAS, built from source (BLAS-only, no Fortran/LAPACK)
#include <cblas.h>
Curated in .xpkgindex/interfaces.json.
mcpp add compat.openblas@0.3.33
Usage
From this repository's own test project — built and run by CI, not written for the website.
// On Windows the cfg-gated openblas dep + HAVE_OPENBLAS are active: cblas_dgemm
// asserting [19 22; 43 50]. Elsewhere a no-op (openblas is Windows-only).
#ifdef HAVE_OPENBLAS
#include <cblas.h>
int main() {
const double A[4] = {1, 2, 3, 4};
const double B[4] = {5, 6, 7, 8};
double C[4] = {0, 0, 0, 0};
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, 2, 2, 2, 1.0, A, 2, B, 2, 0.0, C, 2);
const double expected[4] = {19, 22, 43, 50};
for (int i = 0; i < 4; ++i) if (C[i] != expected[i]) return 10 + i;
return 0;
}
#else
int main() { return 0; } // openblas is Windows-only; no-op elsewhere
#endif
tests/examples/openblas/tests/dgemm.cpp · project tests/examples/openblas
Build
- targets
openblas (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
include
Sources (1)
mcpp_openblas_anchor.c