[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fortran DLLs on mingw32

From: Steve Edwards
Subject: Re: Fortran DLLs on mingw32
Date: Fri, 9 Jan 2009 09:57:50 +0000

On Thu, 8 Jan 2009 19:25:03 +0100
Ralf Wildenhues <address@hidden> wrote:

> Hello Steve,

Hello and thanks for the reply.

> * Steve Edwards wrote on Thu, Jan 08, 2009 at 05:51:27PM CET:
> > This is just a request to find out if anyone out there has tried
> > using libtool to build Fortran DLLs under mingw32?
> First question I'd ask: which gfortran version, and can it (or a newer
> available version) build a shared libgfortran?  That should avoid the
> problems you're having, I hope.

We are currently using the most up to date version available from the
mingw downloads:

4.3.0 (20080305) alpha

which I believe is provided as one of the Technology Demonstrator

We do have gcc-4.3.2 as source but mingw is one platform I have never
tried bootstrapping gcc on (yet...)
> Looking at the FSF GCC tree, it doesn't seem like they're building
> shared libgfortran shared on w32 yet (but I don't know whether
> MinGW/MSYS has modified GCC in this regard).  Guess it's worth asking
> about this (on either, not both) upstream.  A fix could be as easy as
> adding -no-undefined to libgfortran/ and
> AC_LIBTOOL_WIN32_DLL to libgfortran/

I may try a gcc bootstrap myself first though - if I have no success,
I'll try the gfortran list later (as of the two, that is the one I'm

> > The problem was when a Fortran program in the library package
> > tries to link against the created DLL (it was actually a test case
> > wrapper)
> > 
> > It fails with a number of multiple definition errors:
> > 
> > __gfortran_set_options
> > __gfortran_transfer_character
> > __gfortran_st_write_done
> > __gfortran_st_write
> > 
> > 
> > It appears that the DLL creation has pulled in symbols from the
> > libgfortran compiler runtime?
> > 
> > Am I correct in assuming that this is due to the gfortran runtime
> > not being available in DLL form?
> Probably.  A quick workaround would appear to be to use either one of
> '-export-symbols FILE' or '-export-symbols-regex REGEX' with an
> argument suitable of listing only the symbols from your library.
> Untested.

I expect we will wait now until the FSF gcc tree builds DLLs on mingw
by default, but we will give the '-export-symbols-regexp REGEX' option
a try to see how it goes.

For the moment we are building static libraries for program linking and
using a custom rule to build the shared version.

> Hope that helps.

It has been a great help - thanks very much.

Yow! of the hour:
Exceptions always outnumber rules.7

reply via email to

[Prev in Thread] Current Thread [Next in Thread]