{"id":13800554,"url":"https://github.com/ekrich/sblas","last_synced_at":"2025-06-15T04:05:19.398Z","repository":{"id":40297746,"uuid":"97343209","full_name":"ekrich/sblas","owner":"ekrich","description":"Scala Native BLAS (Basic Linear Algebra Subprograms) supporting Linux and macOS","archived":false,"fork":false,"pushed_at":"2025-06-06T18:49:20.000Z","size":287,"stargazers_count":35,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-06T19:44:58.990Z","etag":null,"topics":["blas","linear-algebra","linux","macos","math","scala","scala-native"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ekrich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-07-15T21:27:18.000Z","updated_at":"2025-06-06T18:49:22.000Z","dependencies_parsed_at":"2023-02-16T03:16:07.808Z","dependency_job_id":"38cc2feb-709d-4759-b92e-111e961736ef","html_url":"https://github.com/ekrich/sblas","commit_stats":{"total_commits":210,"total_committers":2,"mean_commits":105.0,"dds":"0.44285714285714284","last_synced_commit":"3bfe101808ae0c38e42943111c31fa3ac4732222"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ekrich/sblas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekrich%2Fsblas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekrich%2Fsblas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekrich%2Fsblas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekrich%2Fsblas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ekrich","download_url":"https://codeload.github.com/ekrich/sblas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekrich%2Fsblas/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259919352,"owners_count":22932069,"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","linear-algebra","linux","macos","math","scala","scala-native"],"created_at":"2024-08-04T00:01:13.698Z","updated_at":"2025-06-15T04:05:19.382Z","avatar_url":"https://github.com/ekrich.png","language":"Scala","funding_links":[],"categories":["Bindings"],"sub_categories":[],"readme":"# sblas - Scala Native BLAS\n\n![CI](https://github.com/ekrich/sblas/workflows/CI/badge.svg)\n\nThis library implements BLAS (Basic Linear Algebra Subprograms) in the form\nof CBLAS for the Scala Native platform. Scala Native is a unique platform that\nmarries the high level language of Scala but compiles to native code with a\nlightweight managed runtime which includes a state of the art garbage collector.\nThe combination allows for great programming and the ability to use high\nperformance C language libraries like CBLAS.\n\nScala Native uses the Scala compiler to produce\n[NIR](https://scala-native.readthedocs.io/en/latest/contrib/nir.html)\n(Native Intermediate Representation) that is optimized and then\nconverted to [LLVM IR](http://llvm.org/). Finally LLVM code is optimized\nand compiled by [Clang](http://clang.llvm.org/) to produce a native executable.\n\n## New for Scala Native 0.5.0+\n\nA higher level API has been started but only for one function `dnrm2`. This API\nallows the developer to pass Scala `Array`s, which are Garbage Collection (GC)\nmanaged, directly to a function to be read or for a result. If the input to the\nfunction is a matrix then the `Array` is in row major order like it would be\nin C. Each row in the matrix is read from the array before the next row.\n\nThis API results in a zero overhead call to the CBLAS API because no data is\ncopied. It should perform as fast as C after the arrays are initialized. For those\nwanting to know; this uses an experimental API that allows the caller to get a\npointer to the first element in the array (after the array object header). The\ndata is housed in the array so the API can just work on the raw data in the array.\n\n## Getting started\n[![Maven Central](https://img.shields.io/maven-central/v/org.ekrich/sblas_native0.5_3.svg)](https://maven-badges.herokuapp.com/maven-central/org.ekrich/sblas_native0.5_3)\n\nIf you are already familiar with Scala Native you can jump right in by adding the following dependency in your `sbt` build file.\n\n```scala\nlibraryDependencies += \"org.ekrich\" %%% \"sblas\" % \"x.y.z\"\n```\n\nTo use in `sbt`, replace `x.y.z` with the version from Maven Central badge above.\nAll available versions can be seen at the [Maven Repository](https://mvnrepository.com/artifact/org.ekrich/sblas).\n\nOtherwise follow the [Getting Started](https://scala-native.readthedocs.io/en/latest/user/setup.html)\ninstructions for Scala Native if you are not already setup.\n\nAdditional libraries that need to be installed on you system are as follows:\n\n* Linux/Ubuntu you need to install [ATLAS](http://math-atlas.sourceforge.net/) for CBLAS\nsupport.\n\n```\n$ sudo apt-get install libatlas-base-dev\n```\n\n* macOS has CBLAS pre-installed as part of the [Accelerate Framework](https://developer.apple.com/documentation/accelerate).\n\n* Other OSes need to have `libcblas` available on the system.\n\n## Scala Build Versions\n\n| Scala Version          | Native (0.4.0)        | Native (0.4.3+) | Native (0.5.0+) |\n| ---------------------- | :-------------------: | :-------------: | :--------------: |\n| 2.11.x                 |          ✅           |        ✅       |                   |\n| 2.12.x                 |          ✅           |        ✅       |         ✅        |\n| 2.13.x                 |          ✅           |        ✅       |         ✅        |\n| 3.x.x                  |                       |        ✅       |         ✅        |\n\nUse version sblas `0.3.0` for Scala Native `0.4.0`.\nUse version sblas `0.4.0` for Scala Native `0.4.3+` with Scala 3 support.\nUse version sblas `0.5.0` for Scala Native `0.4.10+`.\nUse version sblas `0.6.0` for Scala Native `0.5.0-RC2`.\nUse version sblas `0.7.x` for Scala Native `0.5.0+`.\n\n\n## Usage and Help\n[![scaladoc](https://www.javadoc.io/badge/org.ekrich/sblas_native0.5_3.svg?label=scaladoc)](https://www.javadoc.io/doc/org.ekrich/sblas_native0.5_3)\n[![Join chat https://gitter.im/ekrich/sblas](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ekrich/sblas?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nReference the link above for Scaladoc. The documentation is a little sparse but hopefully will improve with time.\n\nAfter `sbt` is installed and any other Scala Native prerequisites are met you can use the following Gitter G8 template instructions to get a fully functional Scala Native application with a couple of BLAS examples in the body of the main program.\n\n```\n$ sbt new ekrich/sblas.g8\n$ cd \u003cdirectory entered after the prompt\u003e\n$ sbt run\n```\n\nIn addition, look at the [sblas unit tests](https://github.com/ekrich/sblas/blob/main/sblas/src/test/scala/org/ekrich/blas/unsafe/BlasTest.scala) for other examples of usage.\n\n## Using scalafmt\n\nIf you are using scalafmt and you would like to wrap arrays in your code such as the\nfollowing:\n\n```scala\nval A = Array(\n  0.11f, 0.12f, 0.13f,\n  0.21f, 0.22f, 0.23f)\n```\nAdd `newlines.source = keep` to your `.scalafmt.conf` file. This will keep your rows and\ncolumns from wrapping.\n\n## BLAS References and External Documentation\n\nSome useful links are as follows which are also in the LICENSE.md file as some of the Scaladoc was sourced from these references:\n\nWikipedia Website:\n- https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms\n\nNetlib Website:\n- http://www.netlib.org/blas/#_documentation\n- http://www.netlib.org/blas/#_blas_routines\n- http://www.netlib.org/lapack/lapack-3.1.1/html/\n\nApple Website:\n- https://developer.apple.com/documentation/accelerate/blas?language=objc\n\nIntel Website:\n- https://software.intel.com/en-us/mkl-developer-reference-c-blas-routines\n- https://software.intel.com/en-us/mkl-developer-reference-c-naming-conventions-for-blas-routines\n\nIBM Website:\n- https://www.ibm.com/support/knowledgecenter/en/SSFHY8_6.1/reference/am5gr_apa.html\n\n## Versions\n\nRelease [0.7.0](https://github.com/ekrich/sblas/releases/tag/v0.7.0) - (2024-04-11)\u003cbr/\u003e\nRelease [0.6.0](https://github.com/ekrich/sblas/releases/tag/v0.6.0) - (2024-02-29)\u003cbr/\u003e\nRelease [0.5.0](https://github.com/ekrich/sblas/releases/tag/v0.5.0) - (2023-01-29)\u003cbr/\u003e\nRelease [0.4.0](https://github.com/ekrich/sblas/releases/tag/v0.4.0) - (2022-02-01)\u003cbr/\u003e\nRelease [0.3.0](https://github.com/ekrich/sblas/releases/tag/v0.3.0) - (2021-03-20)\u003cbr/\u003e\nRelease [0.2.0](https://github.com/ekrich/sblas/releases/tag/v0.2.0) - (2019-12-05)\u003cbr/\u003e\nRelease [0.1.1](https://github.com/ekrich/sblas/releases/tag/v0.1.1) - (2019-05-01)\u003cbr/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekrich%2Fsblas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekrich%2Fsblas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekrich%2Fsblas/lists"}