{"id":18509198,"url":"https://github.com/rindow/rindow-clblast","last_synced_at":"2025-04-09T03:32:23.307Z","repository":{"id":53698354,"uuid":"323523573","full_name":"rindow/rindow-clblast","owner":"rindow","description":"CLBlast PHP binding - BLAS library with OpenCL on PHP","archived":false,"fork":false,"pushed_at":"2024-04-29T07:59:08.000Z","size":113,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T23:12:10.333Z","etag":null,"topics":["blas","clblast","gpgpu","gpu","machine-learning","mathematics","opencl","php","php-extension","php8"],"latest_commit_sha":null,"homepage":"https://rindow.github.io/mathematics/","language":"C","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}},"created_at":"2020-12-22T04:48:50.000Z","updated_at":"2024-07-17T15:09:13.000Z","dependencies_parsed_at":"2024-04-29T08:53:15.163Z","dependency_job_id":"8a9c1110-7831-4b8f-85b1-cdf97b6ca64b","html_url":"https://github.com/rindow/rindow-clblast","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rindow%2Frindow-clblast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rindow%2Frindow-clblast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rindow%2Frindow-clblast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rindow%2Frindow-clblast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rindow","download_url":"https://codeload.github.com/rindow/rindow-clblast/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247973945,"owners_count":21026738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["blas","clblast","gpgpu","gpu","machine-learning","mathematics","opencl","php","php-extension","php8"],"created_at":"2024-11-06T15:16:46.191Z","updated_at":"2025-04-09T03:32:22.973Z","avatar_url":"https://github.com/rindow.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"IMPORTANT\n=========\nDevelopment of this program has ended.\nPlease migrate to the program below instead.\n\n- https://github.com/rindow/rindow-clblast-ffi\n\nWe stopped using PHP extensions because it was too difficult to prepare binary files for each PHP version and Linux version.\n\n\nRindow CLBlast PHP extension\n============================\nCLBlast binding for PHP.\n\nCLBlast is BLAS library on OpenCL. [Click here for details](https://github.com/CNugteren/CLBlast).\n\nRindow-CLBlast allows you to harness the power of your GPU with Rindow-Neural-Network-Library. Take full advantage of your machine and feel free to use machine learning on your cheap laptop.\n\nRequirements\n============\n\n- PHP7.2 or PHP7.3 or PHP7.4 or PHP8.0 or PHP8.1 or PHP8.2 or PHP8.3\n- interop-phpobjects/polite-math 1.0.4 or later\n- LinearBuffer implements for interop-phpobjects (rindow_openblas etc.)\n- rindow_opencl PHP extension 0.1.4\n- OpenCL 1.1/1.2 drivers/libraries.\n- Windows 10 or Linux (Ubuntu 20.04, Debian 12) or later\n\nAMD GPU/APU drivers for windows are including OpenCL drivers.\nIntel Integrated GPU for windows are including OpenCL drivers.\n\n\nRecommend environment\n=====================\n\n- PHP8.1 or PHP8.2 or PHP8.3\n- OpenBLAS [sources](https://github.com/OpenMathLib/OpenBLAS), [binaries](https://github.com/OpenMathLib/OpenBLAS/releases)\n- LinearBuffer implements - rindow-openblas 0.4.0 or later. [sources](https://github.com/rindow/rindow-openblas), [binaries](https://github.com/rindow_openblas-binaries)\n- OpenCL binding for PHP - rindow-opencl 0.2.0. [sources](https://github.com/rindow/rindow-opencl), [binaries](https://github.com/rindow-opencl/releases)\n- BLAS libray for OpenCL implements - rindow-clblast 0.2.0. [sources](https://github.com/rindow/rindow-clblast), [binaries](https://github.com/rindow-clblast/releases)\n- Matrix PHP library - rindow-math-matrix 2.0.0 or later. [sources](https://github.com/rindow/rindow-math-matrix)\n- Driver Pack - rindow-math-matrix-matlibext 1.0.0 or later. [sources](https://github.com/rindow/rindow-math-matrix-matlibext)\n- Machine learning library on PHP - rindow-neuralnetworks [sources](https://github.com/rindow/rindow-neuralnetworks)\n\nHow to build from source code on Linux\n========================================\nYou can also build and use from source code.\n\n### Install OpenCL ICD and Tool\n```shell\n$ sudo apt install clinfo\n```\n\n### Install Hardware-dependent OpenCL library.\nFor example, in the case of Ubuntu standard AMD driver, install as follows\n\n```shell\n$ sudo apt install mesa-opencl-icd\n$ sudo mkdir -p /usr/local/usr/lib\n$ sudo ln -s /usr/lib/clc /usr/local/usr/lib/clc\n```\n\nIn addition, there are the following drivers.\n\n- mesa-opencl-icd\n- beignet-opencl-icd\n- intel-opencl-icd\n- nvidia-opencl-icd-xxx\n- pocl-opencl-icd\n\n### Check OpenCL status\nHow to check the installation status\n\n```shell\n$ clinfo\nNumber of platforms                               1\n  Platform Name                                   Clover\n  Platform Vendor                                 Mesa\n  Platform Version                                OpenCL 1.1 Mesa 21.2.6\n  Platform Profile                                FULL_PROFILE\n  Platform Extensions                             cl_khr_icd\n  Platform Extensions function suffix             MESA\n....\n...\n..\n.\n```\n\n### Install build tools and libray\nInstall gcc development environment and opencl library. Then install the php development environment according to the target php version.\n\n```shell\n$ sudo apt install build-essential autoconf automake libtool bison re2c\n$ sudo apt install pkg-config\n$ sudo apt install phpX.X-dev (ex. php8.1-dev)\n$ sudo apt install ocl-icd-opencl-dev\n$ sudo apt install ./rindow-openblas-phpX.X_X.X.X_amd64.deb\n$ sudo apt install ./rindow-opencl-phpX.X_X.X.X_amd64.deb\n```\n\n### Build\nRun the target php version of phpize and build.\n\n```shell\n$ git clone https://github.com/rindow/rindow-opencl\n$ git clone https://github.com/rindow/rindow-clblast\n$ cd rindow-clblast\n```\n\nIf you use Ubuntu 22.04 or Debian 12, You can install libclblast from distribution package.\n```shell\n$ sudo apt install libclblast-dev\n```\nIf you use Ubuntu 20.04 or Debian 11, You have to download github.com and make a deb file, and then install.\n```shell\n$ sh ./clblast-packdeb.sh\n$ sudo apt install ./clblast_X.X.X_amd64.deb\n```\n\nNext, Setup the environment and build.\n```shell\n$ composer update\n$ phpizeX.X (ex. phpize8.1)\n$ mv build/Makefile.global build/Makefile.global.orig\n$ sed -f Makefile.global.patch \u003c build/Makefile.global.orig \u003e build/Makefile.global\n$ ./configure --enable-rindow_clblast --with-rindow_opencl=../rindow-opencl --with-php-config=php-configX.X (ex. php-config8.1)\n$ make clean\n$ make\n$ make test\n```\n\n### Install from built directory\n\n```shell\n$ sudo make install\nor\n$ sh ./packaging.sh X.X (ex. sh ./packaging.sh 8.1)\n$ suto apt install ./rindow-clblast-phpX.X_X.X.X_amd64.deb (ex. ./rindow-clblast-php8.1_...)\n```\nAdd the \"extension=rindow_clblast\" entry to php.ini\n\n\nHow to build from source code on Windows\n========================================\n\n### Install VC15 or VS16\nDeveloping PHP extensions from php7.2 to php7.4 requires VC15 instead of the latest VC.\n\n- Install Microsoft Visual Studio 2019 or later installer\n- Run Installer with vs2017 build tools option.\n\nDeveloping PHP extensions from php8.0/8.1/8.2 requires VS16. You can use Visual Studio 2019.\n\n### php sdk and devel-pack binaries for windows\n\n- You must know that PHP 7.2,7.3 and 7.4 needs environment for the MSVC version vc15 (that means Visual Studio 2017). php-sdk releases 2.1.9 supports vc15.\n- Download https://github.com/microsoft/php-sdk-binary-tools/releases/tag/php-sdk-2.1.9\n- If you want to build for PHP 8.0, you needs environment for the MSVC version vs16 (that means Visual Studio 2019). php-sdk releases 2.2.0 supports vs16.\n- Download https://github.com/microsoft/php-sdk-binary-tools/releases/tag/php-sdk-2.2.0\n- Extract to c:\\php-sdk\n- Download target OpenCL headers from https://github.com/KhronosGroup/OpenCL-Headers\n- Extract to /path/to/OpenCL/include\n- Download target CLBlast sdk for Windows-x64 binary from https://github.com/CNugteren/CLBlast/releases\n- Extract to /path/to/OpenCL/include\n- Download target Rindow-OpenCL headers from https://github.com/rindow/rindow-opencl\n- Extract to /path/to/Rindow-OpenCL\n\nFor execution\n- Download Rindow-OpenBLAS binaries from https://github.com/rindow/rindow-openblas/releases\n- Download OpenBLAS binaries from https://github.com/xianyi/OpenBLAS/releases\n- Extract and install to php extension and some directory\n\n### Install and setup rindow_opencl and CLBlast\n\nIn order to execute rindow_clblast, you need CLBlast and the rindow_opencl.\n\nPlease install rindow_opencl and CLBlast to execute.\nSee https://github.com/rindow/rindow-opencl/ for more information.\nAnd then download binaries of CLBlast for windows from https://github.com/CNugteren/CLBlast/releases and extract and set path to DLLs.\n\n```shell\nC:\\tmp\u003ecopy rindow_opencl.dll /path/to/php-installation-path/ext\nC:\\tmp\u003eecho extension=rindow_opencl.dll \u003e\u003e /path/to/php-installation-path/php.ini\nC:\\tmp\u003ePATH %PATH%;/path/to/OpenBLAS-directory/bin;/path/to/CLBlast-1.x.x-Windows-x64/bin\n```\n\n### Download OpenCL-SDK\n\n- Download OpenCL SDK form https://github.com/KhronosGroup/OpenCL-SDK/releases\n- extract and copy to opencl development directory\n\n\n### Install and setup rindow_openblas for test\n\nIn order to execute rindow_opencl, you need a buffer object that implements the LinearBuffer interface. Please install rindow_openblas to run the tests.\nSee https://github.com/rindow/rindow-openblas/ for more information.\n\n```shell\nC:\\tmp\u003ecopy rindow_openblas.dll /path/to/php-installation-path/ext\nC:\\tmp\u003eecho extension=rindow_openblas \u003e\u003e /path/to/php-installation-path/php.ini\nC:\\tmp\u003ePATH %PATH%;/path/to/OpenBLAS/bin\n```\n\n### start php-sdk for target PHP version\n\nOpen Visual Studio Command Prompt for VS for the target PHP version(see stepbystepbuild.)\nNote that you must explicitly specify the version of vc15 for which php.exe was built.\nThe -vcvars_ver=14.16 means vc15.\n\n```shell\nC:\\visual\\studio\\path\u003evcvars64 -vcvars_ver=14.16\nor\nC:\\visual\\studio\\path\u003evcvars64\n\nC:\\tmp\u003ecd c:\\php-sdk\nC:\\php-sdk\u003ephpsdk-vxxx-x64.bat\n```\n\n### Build\n\n```shell\n$ PATH %PATH%;/path/to/OpenBLAS/bin;/path/to/CLBlast-devel-directory/lib\n$ cd /path/to/here\n$ composer update\n$ /path/to/php-devel-pack-x.x.x-Win32-Vxxx-x64/phpize.bat\n$ configure --enable-rindow_clblast --with-prefix=/path/to/php-installation-path --with-opencl=/path/to/OpenCL-SDK-directory --with-clblast=/path/to/CLBlast-devel-directory --with-rindow_opencl=/path/to/Rindow-OpenCL-sources-directory\n$ nmake clean\n$ nmake\n$ nmake test\n```\n\n### Install from built directory\n\n- Copy the php extension binary(.dll) to the php/ext directory from here/arch/Releases_TS/php_rindow_clblast.dll\n- Add the \"extension=php_rindow_clblast\" entry to php.ini\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frindow%2Frindow-clblast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frindow%2Frindow-clblast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frindow%2Frindow-clblast/lists"}