A minimal FFI binding for LAPACK (http://www.netlib.org/lapack/) in Pharo.
For the documentation, please refer to the pharo-ai wiki page: https://github.com/pharo-ai/wiki/blob/master/wiki/LinearAlgebra/Lapack.md
For creating another binding to another method (or routine, because the library is written in Fortran), you only need to create a subclass of LapackAlgorithm
. You can check LapackDgelsd
as an example.
Note: We only tested this for MacOS. But it should work on Windows and Linux too. A prerequisite is to have already intalled the library on your OS. For making it work on Linux and Windows, is only needed to override the methods unixLibraryName
and win32LibraryName
to return the path in which the library is installed on your system. Check LapackLibrary>>#macLibraryName
To install Lapack
, go to the Playground (Ctrl+OW) on your Pharo image and execute the following Metacello script (select it and press Do-it button or Ctrl+D):
Metacello new
baseline: 'Lapack';
repository: 'github://pharo-ai/lapack/src';
load.
If you want to add a dependency on Lapack
to your project, include the following lines into your baseline method:
spec
baseline: 'Lapack'
with: [ spec repository: 'github://pharo-ai/lapack/src' ].
If you are new to baselines and Metacello, check out the Baselines tutorial on Pharo Wiki.