You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Maho NAKATA <ma...@apache.org> on 2013/01/02 00:38:43 UTC

Boost, LAPACK and fortran

Hi all and Pedro,

In 2012/12/30 I recieved an e-mail from Pedro (sorry 
if you want to keep this activity secret) that he want to use
uBLAS http://www.boost.org/doc/libs/1_48_0/libs/numeric/ublas/doc/index.htm
for matrix-matrxi, matrix-vector manipulations. For the first step, it is a
very very good idea.

Here, I'm wondering whether we can include FORTRAN in a build requirement.

uBLAS and BLAS [http://www.netlib.org/blas/] 
are independent implementation but BLAS is the original and well tested.
and LAPACK [http://www.netlib.org/lapack/] which is based on BLAS, and can do much more things
like least square fitting, singular value decomposition, solving linear equations
and solving eigenvalue problems (and whatever you think will be found in LAPACK).
Moreover web hit of LAPACK page is 111,192,369! [http://www.netlib.org/master_counts2.html#lapack]

We can also use OpenBLAS to speed up BLAS part and some parts of LAPACK. BLAS is usually slow in their
reference implementation (10-100 times slower for dgemm in particular), and
optimized BLAS like ATLAS, Intel MKL, GotoBLAS2, OpenBLAS are much faster.
OpenBLAS is a derivative of GotoBLAS2. Unfortunately GotoBLAS2 is discontinued, but
OpenBLAS is actively maintained and ported to many processors.

Unfortunately or forutnately, BLAS and LAPACK are written in FORTRAN, (and LAPACK > 3.1 requires
FORTRAN90).

All are distributed under BSD style license except for Intel MKL, so we can include without
violation of Apache license.

Note that I'm a maintiner of BLAS, LAPACK in FreeBSD,
http://www.freebsd.org/cgi/cvsweb.cgi/ports/math/lapack/Makefile
and I'm a (only) principal developer of multiple precision version of BLAS and LAPACK
called MPACK.
http://mplapack.sourceforge.net/

So - depending on BLAS, LAPACK and OpenBLAS in the future
are very good idea, and provides far better functionality and performance without 
license issues. One problem is that we will require build dependency as FORTRAN!

What do you think?

Best,
-- Nakata Maho
http://nakatamaho.riken.jp/ http://blog.goo.ne.jp/nakatamaho/ 
http://nakatamaho.riken.jp/maho.pgp.txt http://ja.openoffice.org/


Re: Boost, LAPACK and fortran

Posted by Pedro Giffuni <pf...@apache.org>.
Hi Maho;


----- Messaggio originale -----
> Da: Maho NAKATA 

> 
> Hi all and Pedro,
> 
> In 2012/12/30 I recieved an e-mail from Pedro (sorry 
> if you want to keep this activity secret) that he want to use
> uBLAS http://www.boost.org/doc/libs/1_48_0/libs/numeric/ublas/doc/index.htm
> for matrix-matrxi, matrix-vector manipulations. For the first step, it is a
> very very good idea.
> 

It wasn't meant to be a secret but I was taking some time to digest the idea of
using Boost in general.

> Here, I'm wondering whether we can include FORTRAN in a build requirement.
> 

The idea of using Fortran is rather inconvenient due to the Windows port.
We currently use MSVC 2008: Microsoft stopped distributing Fortran compilers
ages ago and using gfortran as an extra dependency makes things too complex.

I think we could use Boost's ublas for the Matrix operations and that should be
sufficient for the very basic matrix support Calc provides.

I am not very good with how Matrices work on C++ though, so I don't have
plans to work on it.

> 
> So - depending on BLAS, LAPACK and OpenBLAS in the future
> are very good idea, and provides far better functionality and performance 
> without 
> license issues. One problem is that we will require build dependency as FORTRAN!
>

We can use FORTRAN for extensions and maybe optional scaddins though.
There are some really cool scientific packages in FORTRAN like MUMPS:
http://graal.ens-lyon.fr/MUMPS/


Cheers,

Pedro.