cgo/jalla

whats the status of this project? :)

Closed this issue · 12 comments

it doesn't seem to be easy to build on unix but not linux systems. thoughts?

(context: one way or another, I want to help make sure theres a working bsd3 lin alg toolchain for haskell in the ecosystem by the end of the summe r)

cgo commented

Hi,
the status is that is worked for me so far but I haven't been doing anything on it for a while.
I have only built it on linux, what do you mean by "not easy"? Any specific problems? Do you mean building lapacke or jalla?

Cheers,
Christian

cgo commented

... Can you and would you be interested in contributing to jalla?

Hey Christian,

the problem is that I can't get lapacke built on OS X.

as for interest in contributing to Jalla, Yes, in the sense that I want to fix the lack of proprietary/ BSD3 friendly lin alg/ numerical computation tools for haskell on hackage.

so actually if you look at my https://github.com/cartazio/hs-linear-algebra repo, I fixed up the the old BLAS lib that was on hackage. Also, chatting with Alberto to factor out the Non GSL specific pieces of HMatrix lin alg so it can be BSD licensed (and maybe combine the duplicated works?!)

also, on macs, the native lapack & blas libs are the favored things to use. (Hmatrix gets this right)

so the most accurate answer is yes/no :)

I'm able and inclined, but I think none of the current libs are quite right for supporting Dense and Spare Lin alg thats high level and performant :)

and i'm trying to get the ball rolling on fixing that.

cgo commented

Hmm .. where is the problem with building lapacke? Is it something compiler-related?
Unfortunately I don't have an Apple PC and I am not planning to get one, so I can't really try it out ...

I would also be happy to see a widely usable implementation of sparse linear algebra methods for Haskell;
my time does not allow for doing something like that (I'm doing everything Haskell related in my spare time).
But if you find something or make something yourself, give me a shout :)

Also do you have any ideas/suggestions what you would add first in jalla, or what you would change?

Having hmatrix (or large parts of it) as a bsd3 library would certainly be a very good thing to promote
the use of Haskell for numerical tasks (I think).

well, on the mac the libs to be used for blas etc should be the built-in ones.
I have no clue where the problem is, i can't even get pip to install scons.

for mac,
http://developer.apple.com/library/mac/#documentation/Accelerate/Reference/AccelerateFWRef/_index.html

(its probably worth looking at how Hmatrix does its blas/lapack bindings for different architectures, it handles both linux and mac well)

yes, not asking you or anyone else to do so. (email / skype / gchat me out of band and I can elaborate more on that)

well, if i get can the non gsl bits of hmatrix bsd3'd, it may make sense to focus the dev work on hmatrix (for the lapack and blas cases)

i'm actually on a slow motion rampage to kill R & Matlab with a haskell based platform.

cgo commented

Lapacke is really just a C interface. It uses BLAS and LAPACK, and it's part of LAPACK since version 3.4.
So if you build lapacke, it should be using your native BLAS/LAPACK (correct me if you observe anything that
would prove me wrong!). So you could also use e.g. ATLAS generated libraries, or any other implementation.

You don't necessarily need scons for building, I just found scons to be much (much much) more convenient to use
than makefiles. Lapacke comes with very small Makefiles (make.inc), which you can edit to fit your system.
My scons file filters out a few sources which apparently rely on lapack >= 3.4 as well as XBLAS, which I don't use.

Have you tried installing scons simply from the sources, from http://scons.org?

I haven't looked at the low level bindings in hmatrix, but I might actually do that :) I have generated mine for the largest part with a home-made little program. Writing the bindings is pretty straight forward, just very very tedious work when you do it
for the lot.

Good luck with replacing matlab, I'm ready to join you ;)

i686-apple-darwin11-llvm-gcc-4.2: ../../../lapack-3.2.1/lapack.a: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: ../../../lapack-3.2.1/blas.a: No such file or directory
make[2]: *** [xcbdsqr_1] Error 1
rm cbdsqr_1.o
make[1]: *** [all] Error 2

is the problem...

shoot me an email sometime and i can tell you more about about the rampage i'm up to. i'll actually be hiring starting early/mid fall if i get things over the ground.

cgo commented

Ah .. you're probably using the unchanged make.inc for lapack 3.2.1.
These files are meant to be used from within the LAPACK source distribution.

There will be a line in that file looking like

LIBS = ../../../lapack-3.2.1/lapack.a ../../../lapack-3.2.1/blas.a -lm

You need to change make.inc to match your system. Where are your blas/cblas and lapack libraries?
Does Darwin/BSD have locate? If yes try "locate lapack.a". If you only have shared libraries,
you will need to link to those instead of the static archives.

I think it's better to use scons for building, as it also delivers a shared library (which enables you to use jalla from ghci).
It would probably also need some adjustment as to the naming of the blas/lapack libraries under macos.
If you get it to work, it would be great if you could commit your changes!
I'm also willing to help, but that will be limited to guesses because I don't have macos...

Getting scons to work on macos should be possible, there's even a page about using scons on macos: http://scons.org/wiki/MacOSX

In case you don't know it already, it's worth learning :)

I'll send you an email soon too ..
Cheers
Christian