Skip to content

SmallapackPrerequisites

Nicolas Cellier edited this page Jul 29, 2016 · 4 revisions

Introduction

Smallapack is an interface to the LAPACK/BLAS libraries. Therefore, these libraries are a pre-requisite.

Details

Various Smalltalk dialects can call some external procedures via these two main mechanisms:

  • by augmenting the Smalltalk virtual machine with user defined primitives
  • by dynamically linking a library containing the procedure and using Foreign Function Interface (FFI)

Smallapack has been developed with the second technology because it is thought to be more agile (easier and faster to develop and extend), and also because the feature is available on various Smalltalk dialects without too much differences.

The drawback is that BLAS and LAPACK must be available as a Dynamic Link Library (Windows .DLL, Mac .dylib) or shared library (linux .so). The libraries are build as static by default, but http://www.netlib.org/lapack contains instructions for creating a dynamic version. For windows, I explain how I compiled these libraries see SmallapackCompilingWindowsDLL.

Netlib provides a default implementation of the BLAS library. But this default implementation is not specifically optimized for you hardware. It is better to obtain an optimized BLAS, either from a vendor, or from the ATLAS project (See http://math-atlas.sourceforge.net/ ). Once more, it will be necessary to obtain or build a DLL.

Note that Mac OSX provides an optimized BLAS/LAPACK in the veclib framework, and this should be installed along with XCode.

Linux distributions generally have a precompiled netlib lapack package, for example you might want to test

sudo apt-get install liblapack-dev

about xerbla

Blas executes the function xerbla when it detects an error in function parameters.

The default implementation for xerbla is to stop the program, which is not suitable for Smalltalk read/eval/print style.

One possibility is to override the default version by modifying BLAS source code if you compile BLAS from source, and this is the only option you’ll have on Dolphin.

On Squeak/Pharo/Visualworks, Smallapack will try to load a replacement library (xerbla.dll or libxerbla.so or libxerbla.dylib) containing an alternative xerbla function which avoid modifying BLAS. It is known to work at least on linux and MacOSX, but untested in Windows.

This is a pre-requisite for Smallapack that you need to build before testing Smallapack.

An example of implementation for the function can be found in the sources (see xerbla), as well as example Xcode for compiling on Mac OSX.

Clone this wiki locally