<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Bernd Schubert wrote:</tt>
<blockquote cite="mid:200806251632.40647.bernd-schubert@gmx.de"
type="cite">
<pre wrap=""><tt>On Wednesday 25 June 2008, Alan W. Irwin wrote:
</tt></pre>
<blockquote type="cite">
<pre wrap=""><tt>I think that assumption needs lots of qualifiers. Did your run-time
actually give correct numerical results when linking from a C main
programme to f77blas.lib? Interfacing C/C++ and Fortran is a tricky
business. There is a project called cfortran that tries to do it for all
the different Unix variants, but it is pretty complicated because of
various naming conventions on each brand of Unix. Because of those
complications, systems often have both C and Fortran versions of BLAS
installed. For example, it appears your system has cblas.lib which is the
library I think you want to link to from C/C++ code.
</tt></pre>
</blockquote>
<pre wrap=""><!----><tt>
No, it is really no problem to link fortran libraries and to call their
functions. It is onkly a bit nasty sometimes to write the proto types of the
blas/lapack functions, since nobody seems to have created a complete set of
these, afaik. For real number crunching one also uses the intel/amd or goto
libraries and there is always only one library of these, for both C and
Fortran (afaik, these optimized libraries are also not written in fortran
anymore, they just have this stupid interface to be compatible with fortran.
The other issue with fortran libraries is to figure out, how these have been
compiled (additional underscores, etc).
On the other hand, cblas even has a slightly different interface than nativ
blas, so without changing the existing code it is not suitable for linking.
</tt></pre>
</blockquote>
<tt>From my experience a huge problem is the way in which
the libs are compiled (this refers to the underscore issue mentioned by
Bernd). This is currently not taken care of at all. In Boost's numeric
bindings this is taken care of by a special macro called FORTRAN_ID. It
is not straight forward to find out how the code has been compiled, but
it could be done by trial and error. If e.g. the linking in my example
from the previous mail fails it may be due to two reasons, either the
libs are missing or they have been compiled including a leading
underscore. Well, maybe even more flavors exist.<br>
<br>
Regarding the compatibility, I tried out and verified quite a few of
the functions offered via CBLAS and LAPACK mainly via
<a class="moz-txt-link-freetext" href="http://boost-sandbox.cvs.sourceforge.net/boost-sandbox/boost-sandbox/boost/numeric/bindings/">http://boost-sandbox.cvs.sourceforge.net/boost-sandbox/boost-sandbox/boost/numeric/bindings/</a>
. Unfortunately I did not build the libraries I am currently working
with myself so I can not give detailed information about how they were
built but my unit tests yielded correct results. <br>
<br>