Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
76 changes: 60 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,94 @@ name: CI
on:
push:
branches:
- "*"
- "!master"
- master
pull_request:
branches:
- master

jobs:
test:
name: Test on node 16 and ${{ matrix.os }}
name: Test node 24 on ${{ matrix.os }} with ${{ matrix.backend }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
include:
- os: ubuntu-latest
backend: mkl
- os: ubuntu-latest
backend: blas
- os: ubuntu-latest
backend: openblas
- os: ubuntu-latest
backend: blis
- os: macOS-latest
backend: accelerate
- os: macOS-latest
backend: openblas
- os: macOS-latest
backend: blis

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js 16
uses: actions/setup-node@v3
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 24
cache: 'npm'

- name: Setup C++ environment on linux
uses: kurocha/setup-cpp@v1
if: runner.os == 'Linux'

- name: Install dependencies on linux
run: sudo apt-get install -yq libblas-dev
- name: Install BLAS dependencies on linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
case "${{ matrix.backend }}" in
mkl)
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor \
| sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
| sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install -yq pkg-config intel-oneapi-mkl-devel
echo "PKG_CONFIG_PATH=/opt/intel/oneapi/mkl/latest/lib/pkgconfig:${PKG_CONFIG_PATH}" >> "$GITHUB_ENV"
;;
blas)
sudo apt-get install -yq pkg-config libblas-dev
;;
openblas)
sudo apt-get install -yq pkg-config libopenblas-dev
;;
blis)
sudo apt-get install -yq pkg-config libblis-dev
;;
*)
echo "Unsupported Linux backend: ${{ matrix.backend }}"
exit 1
;;
esac

- name: Install BLAS dependencies on macOS
if: runner.os == 'macOS' && matrix.backend != 'accelerate'
run: |
brew install pkg-config ${{ matrix.backend }}
echo "PKG_CONFIG_PATH=$(brew --prefix ${{ matrix.backend }})/lib/pkgconfig:${PKG_CONFIG_PATH}" >> "$GITHUB_ENV"

- name: Install package dependencies
run: npm ci
env:
NBLAS_BACKEND: ${{ matrix.backend }}

- name: Build
run: npm run build
env:
NBLAS_BACKEND: ${{ matrix.backend }}

- name: Test
run: npm test

- name: Publish coverage to CodeClimate
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageLocations: ${{github.workspace}}/coverage/lcov.info:lcov
NBLAS_BACKEND: ${{ matrix.backend }}
15 changes: 4 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- run: |
git config --global user.name 'Mateo Gianolio'
git config --global user.email 'mateogianolio@users.noreply.github.com'

- name: Use Node.js 16
uses: actions/setup-node@v3
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 24
cache: 'npm'

- name: Setup C++ environment on linux
Expand All @@ -41,13 +41,6 @@ jobs:
- name: Test
run: npm test

- name: Publish coverage to CodeClimate
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageLocations: ${{github.workspace}}/coverage/lcov.info:lcov

- id: publish
name: Publish package to npm
uses: JS-DevTools/npm-publish@v1
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ coverage
.DS_Store
build
.vscode
dist
routines
lib/routines.h
src/generated*
binding.gyp
__pycache__
*.pyc
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
# nBLAS ![version](https://img.shields.io/npm/v/nblas.svg) ![travis](https://img.shields.io/travis/nperf/nblas.svg) [![maintainability](https://api.codeclimate.com/v1/badges/756aff038b767f2e706e/maintainability)](https://codeclimate.com/github/mateogianolio/nblas/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/756aff038b767f2e706e/test_coverage)](https://codeclimate.com/github/mateogianolio/nblas/test_coverage)
# nBLAS ![version](https://img.shields.io/npm/v/nblas.svg)

[![Greenkeeper badge](https://badges.greenkeeper.io/nperf/nblas.svg)](https://greenkeeper.io/)

Node `>=6.9` C++ bindings for all single- and double-precision CBLAS (Basic Linear Algebra Subprograms) routines.
Node `>=20` C++ bindings for all single- and double-precision CBLAS (Basic Linear Algebra Subprograms) routines.

```bash
$ npm install nblas
$ npm test
```

`npm install` now selects a BLAS backend at build time. The default search order is:

- macOS: `Accelerate`, then `openblas`, `blis`, `blas`
- Linux: `mkl`, `openblas`, `blis`, `blas`

You can override detection when building from source:

```bash
NBLAS_BACKEND=openblas npm install
NBLAS_BLAS_ORDER=openblas,blas npm install
```

Backends other than `Accelerate` are detected via `pkg-config`, so the selected library needs to expose a matching `.pc` file.

`cblas.h` is discovered automatically from the selected backend. If your installation lives in a non-standard location, set `NBLAS_CBLAS_HEADER=/path/to/cblas.h` or pass `--header`.

- **[BLAS Level 1 Routines and Functions](https://software.intel.com/en-us/node/468390)**

- [x] [`?asum (x)`](https://software.intel.com/node/e49cf403-8071-4252-a85f-28964ac3da9e#E49CF403-8071-4252-A85F-28964AC3DA9E)
Expand Down
51 changes: 0 additions & 51 deletions binding.gyp

This file was deleted.

156 changes: 0 additions & 156 deletions dist/index.d.ts

This file was deleted.

Loading
Loading