Boost logo

Ublas :

From: Georg Baum (Georg.Baum_at_[hidden])
Date: 2007-07-27 12:40:49

Am Freitag 27 Juli 2007 18:27 schrieb wedekind:

> What I've achieved so far is to compile lapack using MinGW.

I did exactly the same.

> Unfortunately
> MinGW's fortran compiler g77 suffixes symbols with underscores. But the
> C++ linker (from M$ Visual C++) expects the same symbols without these
> underscores.

The cause is not the linker, but the headers in the bindings that declare
the fortran functions.

> I have then compiled lapack (using g77) with
> -fno-second-underscore or -fno-underscoring to no avail! My sample
> application now successfully links but according to the "Dependency
> Walker" tool from Visual Studio it does not depend on the lapack-dll and
> crashes with a memory read exception on startup :( I guess the not
> recommended underscoring-options have done more harm than good.

Getting the dll stuff right is tricky, because AFAIK gcc and MSVC create
dlls a bit differently. I simply used a static lib.

> So my question is (after trying it nearly whole 2 days on myself
> including extensive web-search): Is there a recommended way to build
> lapack so that it can be used with the boost::numeric::bindings::lapack?

It can be done the other way round: You can apply the patch I sent in to the bindings.
Then you can use g77 compiled fortran stuff from MSVC if you add the define

I did not know about the -f options, I guess they should also work instead
of the patch if you use a static lib.