{"id":18509196,"url":"https://github.com/rindow/rindow-matlib-ffi","last_synced_at":"2026-02-21T21:07:51.269Z","repository":{"id":228272783,"uuid":"773553700","full_name":"rindow/rindow-matlib-ffi","owner":"rindow","description":"The Interface of The Rindow Matlib on FFI","archived":false,"fork":false,"pushed_at":"2025-04-13T12:26:27.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T16:02:43.891Z","etag":null,"topics":["acceleration","array","machine-learning","mathematics","php","php8","scientific-computing"],"latest_commit_sha":null,"homepage":"https://rindow.github.io/mathematics/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rindow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-18T00:29:35.000Z","updated_at":"2025-04-13T12:20:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"7beeb9f4-3601-4b42-b723-6a6c4bae3285","html_url":"https://github.com/rindow/rindow-matlib-ffi","commit_stats":null,"previous_names":["rindow/rindow-matlib-ffi"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rindow/rindow-matlib-ffi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rindow%2Frindow-matlib-ffi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rindow%2Frindow-matlib-ffi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rindow%2Frindow-matlib-ffi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rindow%2Frindow-matlib-ffi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rindow","download_url":"https://codeload.github.com/rindow/rindow-matlib-ffi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rindow%2Frindow-matlib-ffi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29694197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T18:18:25.093Z","status":"ssl_error","status_checked_at":"2026-02-21T18:18:22.435Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acceleration","array","machine-learning","mathematics","php","php8","scientific-computing"],"created_at":"2024-11-06T15:16:45.509Z","updated_at":"2026-02-21T21:07:51.238Z","avatar_url":"https://github.com/rindow.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"The Interface of The Rindow Matlib on FFI\n==========================================\n\nStatus:\n[![Build Status](https://github.com/rindow/rindow-matlib-ffi/workflows/tests/badge.svg)](https://github.com/rindow/rindow-matlib-ffi/actions)\n[![Downloads](https://img.shields.io/packagist/dt/rindow/rindow-matlib-ffi)](https://packagist.org/packages/rindow/rindow-matlib-ffi)\n[![Latest Stable Version](https://img.shields.io/packagist/v/rindow/rindow-matlib-ffi)](https://packagist.org/packages/rindow/rindow-matlib-ffi)\n[![License](https://img.shields.io/packagist/l/rindow/rindow-matlib-ffi)](https://packagist.org/packages/rindow/rindow-matlib-ffi)\n\n\"The interface of rindow matlib on ffi\".\n\nPlease see the documents about rindow mathematics on [Rindow Mathematics](https://rindow.github.io/mathematics/openblas/mathlibrary.html) web pages.\n\nYou can call a high-speed calculation library written in C language to speed up matrix calculation processing.\nRindow Matlib includes many matrix operations functions used in machine learning.\n\nRequirements\n============\n\n- PHP 8.1 or PHP8.2 or PHP8.3 or PHP8.4\n- Rindow Matlib C Library 1.1 or later\n- Windows 10/11, Linux, macOS\n\n\nHow to setup\n============\n\n### How to setup for Windows\nDownload the pre-build binary file.\n\n- https://github.com/rindow/rindow-matlib/releases\n\nUnzip the file for Windows and copy rindowmatlib.dll to the directory set in PATH.\n\nThe standard DLLs in the Bin directory is the thread version. Subdirectories contain OpenMP and Serial versions.\n\n```shell\nC\u003e copy rindowmatlib.dll C:\\php\nC\u003e PATH %PATH%;C:\\php\n```\n\nSet it up using composer.\n\n```shell\nC\u003e mkdir \\your\\app\\dir\nC\u003e cd \\your\\app\\dir\nC\u003e composer require rindow/rindow-matlib-ffi\n```\n\n### How to setup for Linux\nDownload the pre-build binary file.\n\n- https://github.com/rindow/rindow-matlib/releases\n\nPlease install using the apt command. \n```shell\n$ sudo apt install ./rindow-matlib_X.X.X_amd64.deb\n```\n\nSet it up using composer.\n\n```shell\n$ mkdir \\your\\app\\dir\n$ cd \\your\\app\\dir\n$ composer require rindow/rindow-matlib-ffi\n```\n\n### How to setup for macOS\nDownload the pre-build binary file.\n\n- https://github.com/rindow/rindow-matlib/releases\n\nExtract the tar.gz file to the tmp directory and navigate to the directory.\n\n```shell\n$ tar -xzf rindow-matlib-X.X.X-Darwin-XXX.tar.gz -C /tmp\n$ cd /tmp/rindow-matlib-X.X.X-Darwin-XXX\n```\n\nThe standard dylib in the Lib directory is the thread version. Subdirectories contain OpenMP and Serial versions.\n\nNext, copy the include and lib directories to /usr/local.\n\n```shell\n$ sudo cp -r usr/include /usr/local/\n$ sudo cp -r usr/lib /usr/local/\n```\nIf you want to use OpenMP mode please type `brew install libomp`\n\nSet it up using composer.\n\n```shell\n$ mkdir \\your\\app\\dir\n$ cd \\your\\app\\dir\n$ composer require rindow/rindow-matlib-ffi\n```\n\n### Troubleshooting for Linux\nSince rindow-matlib currently uses ptheads, so you should choose the pthread version for OpenBLAS as well.\nIn version 1.0 of Rindow-matlib we recommended the OpenMP version, but now we have changed our policy and are recommending the pthread version.\n\nUsing the OpenMP version of OpenBLAS can cause conflicts and become unstable and slow.\nThis issue does not occur on Windows.\n\nIf you have already installed the OpenMP version of OpenBLAS, you can delete it and install pthread version.\n```shell\n$ sudo apt install libopenblas0-pthread liblapacke\n$ sudo apt remove libopenblas0-openmp\n```\n\nBut if you can't remove it, you can switch to it using the update-alternatives command.\n\n```shell\n$ sudo update-alternatives --config libopenblas.so.0-x86_64-linux-gnu\n$ sudo update-alternatives --config liblapack.so.3-x86_64-linux-gnu\n```\n\nIf you really want to use the OpenMP version of OpenBLAS, please switch to the OpenMP version of rindow-matlib.\n\n```shell\n$ sudo update-alternatives --config librindowmatlib.so\nThere are 1 choices for the alternative librindowmatlib.so (providing /usr/lib/librindowmatlib.so).\n\n  Selection    Path                                             Priority   Status\n------------------------------------------------------------\n* 0            /usr/lib/rindowmatlib-thread/librindowmatlib.so   95        auto mode\n  1            /usr/lib/rindowmatlib-openmp/librindowmatlib.so   95        manual mode\n  2            /usr/lib/rindowmatlib-serial/librindowmatlib.so   90        manual mode\n  3            /usr/lib/rindowmatlib-thread/librindowmatlib.so   100       manual mode\n\nPress \u003center\u003e to keep the current choice[*], or type selection number: 1\n```\nChoose the \"rindowmatlib-openmp\".\n\n\n\nHow to use\n==========\n\n```shell\n$ composer require rindow/rindow-matlib-ffi\n$ composer require rindow/rindow-math-buffer-ffi\n```\n\n```php\n\u003c?php\ninclude __DIR__.'/vendor/autoload.php';\n\nuse Interop\\Polite\\Math\\Matrix\\NDArray;\nuse Rindow\\Matlib\\FFI\\MatlibFactory;\nuse Rindow\\Math\\Buffer\\FFI\\BufferFactory;\n\n$factory = new MatlibFactory();\n$math = $factory-\u003eMath();\n$hostBufferFactory = new BufferFactory();\n$NWITEMS = 64;\n\n$x = $hostBufferFactory-\u003eBuffer(\n    $NWITEMS,NDArray::float32\n);\n\nfor($i=0;$i\u003c$NWITEMS;$i++) {\n    $x[$i] = $i;\n}\n$n = count($x);\n$offsetX = 0;\n$incX = 1;\n\n$sum = $math-\u003esum($n,$x,$offsetX,$incX);\n\nvar_dump($sum);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frindow%2Frindow-matlib-ffi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frindow%2Frindow-matlib-ffi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frindow%2Frindow-matlib-ffi/lists"}