[Pharo-project] Numerical packages

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue May 31 23:49:59 CEST 2011

2011/5/31 Eliot Miranda <eliot.miranda at gmail.com>:
> Hi Nicolas,
> On Tue, May 31, 2011 at 1:22 PM, Nicolas Cellier
> <nicolas.cellier.aka.nice at gmail.com> wrote:
>> I can tell you about Smallapack as author.
>> First advantage: using a state of the art robust library
>> LAPACK + BLAS is the core of Matlab/Octave/Scilab/R/etc...
>> It is robust in terms of API stability, numerical stability, and
>> number of bugs (try finding known ones).
>> Second advantage: combine advantages of
>> - a fast and efficient number crunching library for low level primitives
>> - and our favourite IDE for higher level code (interpreter debugger
>> browser etc...)
>> That's the exact strategy developped by Matlab.
>> As a bonus, Smalltalk interpreter is faster than Matlab, and don't ask
>> me about Matlab language design (non) choices ;)
>> To reach Matlab core preformances, you need an optimized version of
>> BLAS (ATLAS for example).
>> I imagine versions of these libraries could exploit multi-core
>> parallelism (but I did not check status of
>> http://www.netlib.org/scalapack/).
>> Good news, I have a working Smallapack in both Dolphin and VW.
>> Unfortunately, the main drawback is that Squeak/Pharo is not in that list.
>> First, Smallapack may crash the image in Squeak/Pharo...
>> I've not found the reasons, but suspect some FFI problems.
>> Maybe I should try using a plugin rather than FFI. That seems doable
>> since low level FFI code is generated automatically from Lapack
>> comments. It's just a matter of changing code generator to generate
>> slang rather than FFI...
> How easy is this to test?  What does one have to install?  Is it all freely
> available?  I'd like to find time to test this in the ReentrantFFIPlugin.
>  Seems like a good test case.

- is MIT
- has a few tests

For compiling 16+ args, there is a Compiler mcz in the repository (a
few versions back trunk, so a merge might be necessary).
This is useless if you can upgrade to 31 args.

See the wiki tab for load order.
At my last attempts, MC failed to initialize correctly; if a debugger
opens on a nil class var, then try redoing some initialize...

I may help this week end (thursday thru saturday).


>> Second drawback is that loading Smallapack in a Squeak/Pharo image
>> requires some pre-requisite.
>> This is because LAPACK has the bad property of having functions with
>> more than 16 arguments.
>> Squeak/Pharo Compiler cannot handle methods with that many arguments.
>> I have a Compiler hack ready for handling this case.
> That's easy to fix.  The bytecode set supports up to 31 args.  e just need
> to push fixes to the compiler front-end right?
>> I have not automated the process because I'm not so sure that
>> Gofer/Metacello are good for installing such hack (Compiler overrides
>> may seem evil).
>> But I can help any good will.
>> So, if you're after an off-the-shelf library working out of the box,
>> Smallapack is not OK.
>> However, if above goals fit yours, and you're willing to help, I'll be
>> happy to revive the project and inject a few hours into it.
>> Nicolas
> best,
> Eliot
>> 2011/5/31 Ignacio Vivona <altobarba at gmail.com>:
>> > Hi all! I'm currently planning on doing some work related to resolving
>> > partial differential equations (shallow water) in pharo. I'm seeing a
>> > couple
>> > of project for dealing with vectors, matrices and some other math
>> > things.
>> > http://www.squeaksource.com/DHBNumerical.html
>> > http://www.squeaksource.com/MatrixPlugin.html
>> > http://www.squeaksource.com/Numerics.html
>> > http://www.squeaksource.com/Smallapack.html
>> > Has anyone any experience working with these?
>> > Also I'm looking at Mathmorphs (does it work in
>> > pharo?) http://mate.dm.uba.ar/~caniglia/mathMorphs.html and
>> > DrGEO http://community.ofset.org/index.php/DrGeo for doing the graphical
>> > interaction.
>> > If someone knows of some other project related please guide me.
>> > Thanks in advance,
>> > Ignacio Vivona

More information about the Pharo-project mailing list