{"id":43308411,"url":"https://github.com/RubixML/Tensor","last_synced_at":"2026-02-12T21:00:34.802Z","repository":{"id":33086860,"uuid":"151361731","full_name":"RubixML/Tensor","owner":"RubixML","description":"A library and extension that provides objects for scientific computing in PHP.","archived":false,"fork":false,"pushed_at":"2025-04-01T02:37:27.000Z","size":2086,"stargazers_count":269,"open_issues_count":9,"forks_count":32,"subscribers_count":10,"default_branch":"master","last_synced_at":"2026-01-26T23:29:06.747Z","etag":null,"topics":["arithmetic","engineering","lapack","linear-algebra","machine-learning","math","matrix","matrix-decompositions","matrix-factorizations","matrix-multiplication","multithreaded","php","php-extension","rubix","scientific-computing","statistics","tensor","tensor-extension","tensor-php","vector"],"latest_commit_sha":null,"homepage":"https://rubixml.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubixML.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":["andrewdalpino"]}},"created_at":"2018-10-03T04:43:19.000Z","updated_at":"2026-01-07T02:09:09.000Z","dependencies_parsed_at":"2024-03-15T20:46:49.252Z","dependency_job_id":"af251e62-31ce-4688-8dff-7c1828c554f4","html_url":"https://github.com/RubixML/Tensor","commit_stats":{"total_commits":300,"total_committers":6,"mean_commits":50.0,"dds":0.07999999999999996,"last_synced_commit":"178da34285ece166b822a9d75a3d1f48c03fcfc9"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/RubixML/Tensor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixML%2FTensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixML%2FTensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixML%2FTensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixML%2FTensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubixML","download_url":"https://codeload.github.com/RubixML/Tensor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixML%2FTensor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29381022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T20:34:40.886Z","status":"ssl_error","status_checked_at":"2026-02-12T20:23:00.490Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["arithmetic","engineering","lapack","linear-algebra","machine-learning","math","matrix","matrix-decompositions","matrix-factorizations","matrix-multiplication","multithreaded","php","php-extension","rubix","scientific-computing","statistics","tensor","tensor-extension","tensor-php","vector"],"created_at":"2026-02-01T21:00:22.048Z","updated_at":"2026-02-12T21:00:34.795Z","avatar_url":"https://github.com/RubixML.png","language":"PHP","readme":"# Tensor: Scientific Computing for PHP\n\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/rubix/tensor.svg?style=flat\u0026colorB=8892BF)](https://www.php.net/) [![Latest Stable Version](https://img.shields.io/packagist/v/rubix/tensor.svg?style=flat\u0026colorB=orange)](https://packagist.org/packages/rubix/tensor) [![Code Checks](https://github.com/RubixML/Tensor/actions/workflows/ci.yml/badge.svg)](https://github.com/RubixML/Tensor/actions/workflows/ci.yml) [![Extension Build](https://github.com/RubixML/Tensor/actions/workflows/ci-ext.yml/badge.svg)](https://github.com/RubixML/Tensor/actions/workflows/ci-ext.yml) [![Downloads from Packagist](https://img.shields.io/packagist/dt/rubix/tensor.svg?style=flat\u0026colorB=red)](https://packagist.org/packages/rubix/tensor) [![GitHub](https://img.shields.io/github/license/RubixML/Tensor)](https://github.com/RubixML/Tensor/blob/master/LICENSE.md)\n\nA library and extension that provides objects for scientific computing in [PHP](https://php.net).\n## Installation\nFollow the instructions below to install either Tensor PHP or the Tensor extension.\n\n### Tensor PHP\nInstall Tensor PHP into your project with [Composer](https://getcomposer.org/):\n```sh\n$ composer require rubix/tensor\n```\n\n### Tensor Extension\nInstall the Tensor extension via [PECL](https://pecl.php.net/package/Tensor):\n```sh\n$ pecl install tensor\n```\nCompiling on MacOS :\nTo avoid some errors on Mac devices using homebrew, don't forget to add environment variables:\n```sh\nexport LDFLAGS=\"-L$(brew --prefix openblas)/lib -L$(brew --prefix pcre2)/lib -L$(brew --prefix gcc)/lib/gcc/current\"\nexport CPPFLAGS=\"-I$(brew --prefix openblas)/include -I$(brew --prefix pcre2)/include -I$(brew --prefix gcc)/include\"\nexport PKG_CONFIG_PATH=\"$(brew --prefix openblas)/lib/pkgconfig:$(brew --prefix pcre2)/lib/pkgconfig:$(brew --prefix gcc)/lib/pkgconfig\"\nexport PATH=\"$(brew --prefix gcc)/bin:$PATH\"\nexport FC=$(brew --prefix gcc)/bin/gfortran\n```\n\n\u003e **Note:** If both the library and extension are installed, the extension will take precedence.\n\n## Requirements\n- [PHP](https://php.net) 8.0 or above\n\n### Optional To Compile Extension\n- A C compiler such as [GCC](https://gcc.gnu.org/), [Clang](https://clang.llvm.org/), or [Visual C++](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)\n- A Fortran compiler such as [GFortran](https://gcc.gnu.org/wiki/GFortran)\n- The PHP development package (source code and tooling)\n- [OpenBLAS](https://www.openblas.net/) development package\n- [LAPACKE](https://www.netlib.org/lapack/lapacke.html) C interface to [LAPACK](http://www.netlib.org/lapack/)\n- [re2c](https://re2c.org/) 0.13.6 or later\n- [GNU make](https://www.gnu.org/software/make/) 3.81 or later\n- [autoconf](https://www.gnu.org/software/autoconf/autoconf.html) 2.31 or later\n- [automake](https://www.gnu.org/software/automake/) 1.14 or later\n- Ubuntu build-essentials\n\n## Manually Compiling the Extension\nClone the repository locally using [Git](https://git-scm.com/):\n```sh\n$ git clone https://github.com/RubixML/Tensor\n```\n\nMake sure you have all the necessary build tools installed such as a C compiler and make tools. For example, on an Ubuntu linux system you can enter the following on the command line to install the necessary dependencies.\n\n```sh\n$ sudo apt-get install make gcc gfortran php-dev libopenblas-dev liblapacke-dev re2c build-essential\n```\n\nThen, change into the `ext` directory from the project root and run the following commands from the terminal. See [this guide](https://www.php.net/manual/en/install.pecl.phpize.php) for more information on compiling PHP extensions with PHPize.\n\n```sh\n$ cd ./ext\n$ phpize\n$ ./configure\n$ make\n$ sudo make install\n```\n\nFinally, add the following line to your `php.ini` configuration to install the extension.\n```\nextension=tensor.so\n```\n\nTo confirm that the extension is loaded in PHP, you can run the following command.\n\n```sh\nphp -m | grep tensor\n```\n\n## Performance Comparison\n\n![Tensor Performance MNIST](https://raw.githubusercontent.com/RubixML/Tensor/master/docs/images/tensor-performance-mnist.png)\n\n![Tensor Performance Benchmarks](https://raw.githubusercontent.com/RubixML/Tensor/master/docs/images/tensor-performance-benchmarks.png)\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\nThe code is licensed [MIT](LICENSE) and the documentation is licensed [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/).\n","funding_links":["https://github.com/sponsors/andrewdalpino"],"categories":["Math, Statistics \u0026 Linear Algebra"],"sub_categories":["Recommended core stack"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRubixML%2FTensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRubixML%2FTensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRubixML%2FTensor/lists"}