Advice on linking D programs to fortran77 blas/lapack
Bill Baxter
dnewsgroup at billbaxter.com
Thu May 22 13:05:17 PDT 2008
Michael Gratton wrote:
> Hello,
>
> I'm trying to link a D program to the BLAS and LAPACK libraries (numerical linear algebra packages usually written in FORTRAN77).
>
> I've written an extern (C) {} block much like I would in C/C++ to provide "headers" for the functions I want to call, and then tried to build the program by
>
> dmd test.d /usr/lib/libblas.a /usr/lib/liblapack.a
>
> This nearly works, but LAPACK complains that several _gfortran symbols are undefined, such as:
>
> (.text+0x83): undefined reference to `_gfortran_compare_string'
> (.text+0x341): undefined reference to `_gfortran_copy_string'
> (.text+0x69): undefined reference to `_gfortran_st_write'
>
> ...and so on. Has anyone else had luck with this kind of linking? Am I missing a library that gcc magically includes when linking C and F77? Am I just flat trying to link wrong with the dmd command?
>
> Thanks!
> --mg
I have the BLAS/LAPACK wrappers I use up as part of this:
http://www.dsource.org/projects/multiarray
May require some tweaking to use with Intel's BLAS/LAPACK. I use ATLAS.
--bb
More information about the Digitalmars-d
mailing list