Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rindow/rindow-matlib
The Rindow Matrix library for C
https://github.com/rindow/rindow-matlib
acceleration array clang machine-learning mathematics openmp scientific-computing
Last synced: 11 days ago
JSON representation
The Rindow Matrix library for C
- Host: GitHub
- URL: https://github.com/rindow/rindow-matlib
- Owner: rindow
- License: bsd-3-clause
- Created: 2024-03-17T03:18:19.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-05-12T14:05:28.000Z (9 months ago)
- Last Synced: 2024-11-13T23:10:22.603Z (2 months ago)
- Topics: acceleration, array, clang, machine-learning, mathematics, openmp, scientific-computing
- Language: C++
- Homepage: https://rindow.github.io/mathematics/
- Size: 122 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
The Rindow Matrix library for C
===============================
Rindow Math Matrix is the fundamental package for scientific matrix operation- A powerful N-dimensional array object
- Sophisticated (broadcasting) functions
- A high-speed calculation library written in C.
- Useful linear algebra and random number capabilities
- Parallel calculation with OpenMPYou can call a high-speed calculation library written in C language to speed up matrix calculation processing.
Rindow Matlib includes many matrix operations functions used in machine learning.Please see the documents about rindow mathematics
on [Rindow Mathematics](https://rindow.github.io/mathematics/openblas/mathlibrary.html) web pages.Requirements
============- Windows 10/11 , Linux(Ubuntu 20.04, Debian 12), MacOS or later
How to setup pre-build binaries
===============================### How to setup for Windows
Download the pre-build binary file.
- https://github.com/rindow/rindow-matlib/releases
Unzip the file for Windows and copy rindowmatlib.dll to the directory set in PATH.
```shell
C> PATH %PATH%;C:\path\to\bin
```### How to setup for Linux
Download the pre-build binary file.
- https://github.com/rindow/rindow-matlib/releases
Please install using the apt command.
```shell
$ sudo apt install ./rindow-matlib_X.X.X_amd64.deb
```### Troubleshooting for Linux
Since rindow-matlib currently uses OpenMP, choose the OpenMP version for OpenBLAS as well.Using the pthread version of OpenBLAS can cause conflicts and become unstable and slow.
This issue does not occur on Windows.If you have already installed the pthread version of OpenBLAS,
```shell
$ sudo apt install libopenblas0-openmp liblapacke
$ sudo apt remove libopenblas0-pthread
```But if you can't remove it, you can switch to it using the update-alternatives command.
```shell
$ sudo update-alternatives --config libopenblas.so.0-x86_64-linux-gnu
$ sudo update-alternatives --config liblapack.so.3-x86_64-linux-gnu
```If you really want to use the pthread version of OpenBLAS, please switch to the serial version of rindow-matlib.
There are no operational mode conflicts with OpenBLAS on Windows.
But, If you really want to use the pthread version of OpenBLAS, please switch to the serial version of rindow-matlib.
```shell
$ sudo update-alternatives --config librindowmatlib.so
There are 2 choices for the alternative librindowmatlib.so (providing /usr/lib/librindowmatlib.so).Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/rindowmatlib-openmp/librindowmatlib.so 95 auto mode
1 /usr/lib/rindowmatlib-openmp/librindowmatlib.so 95 manual mode
2 /usr/lib/rindowmatlib-serial/librindowmatlib.so 90 manual modePress to keep the current choice[*], or type selection number: 2
```
Choose the "rindowmatlib-serial".### How to setup for MacOS
Download the pre-build binary file.
- https://github.com/rindow/rindow-matlib/releases
Extract the tar.gz file to the tmp directory and navigate to the directory.
```shell
$ tar -xzf rindow-matlib-X.X.X-Darwin.tar.gz -C /tmp
$ cd /tmp/rindow-matlib-X.X.X-Darwin
```Next, copy the include and lib directories to /usr/local.
```shell
$ sudo cp -r usr/include /usr/local/
$ sudo cp -r usr/lib /usr/local/
$ brew install libomp
```How to build from source code on Windows
========================================
You can also build and use from source code.### Download source code
Download source code from release and unzip
- https://github.com/rindow/rindow-matlib/releases
### Build and Install on Windows
Build with Visual Studio.
```shell
C> cd \path\to\here
C> cmake -S . -B build
C> cmake --build build --config Release
C> cd build
C> ctest -C Release
C> cpack -C Release
C> cd ..\packages
```Unzip the package file from packages directory.
```shell
C> PATH %PATH%;C:\path\to\bin
```How to build from source code on Linux
=======================================
You can also build and use from source code.### Download source code
Download source code from release and extract
- https://github.com/rindow/rindow-matlib/releases
### Build and Install on Linux
Build with cmake.
```shell
$ cd \path\to\here
$ cmake -S . -B build
$ cmake --build build --config Release
$ (cd build; ctest -C Release)
$ (cd build; cpack -C Release)
```Install with apt command.
```shell
$ sudo apt install ./packages/rindow-matlib_X.X.X_amd64.deb
```How to build from source code on MacOS
=======================================You can also build and use from source code.
### Download source code
Download source code from release and extract
- https://github.com/rindow/rindow-matlib/releases
### Build and Install on MacOS
Install openmp library with brew before build with cmake.
```shell
$ brew install libomp
$ cd \path\to\here
$ cmake -S . -B build
$ cmake --build build --config Release
$ (cd build; ctest -C Release)
$ (cd build; cpack -C Release)
```How to use
==========### sample program
```cpp
#include
#include
#include
#includevoid printMatrix(int m, int n, void *matrix)
{
float *v = (float *)matrix;
for(int i=0; i cl /EHsc -I.\path\to\include sample.cpp \path\to\lib\rindowmatlib.lib
```### Build the sample program on Linux.
```shell
$ g++ sample.cpp -lrindowmatlib -lm
```### Build the sample program on MacOS.
```shell
$ c++ sample.cpp -lrindowmatlib -lm
```