[19020] in s-news-athena
Re: [S] dll.load() with mingw32/gcc-g77
daemon@ATHENA.MIT.EDU (Prof Brian D Ripley)
Tue Aug 24 03:51:51 1999
Date: Tue, 24 Aug 1999 08:40:16 +0100 (BST)
From: Prof Brian D Ripley <ripley@stats.ox.ac.uk>
To: Ignatius Reilly <ar_menio@yahoo.com>
Cc: s-news@wubios.wustl.edu
In-Reply-To: <19990823223223.12768.rocketmail@web119.yahoomail.com>
Message-Id: <Pine.GSO.4.05.9908240833260.4037-100000@auk.stats>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Mon, 23 Aug 1999, Ignatius Reilly wrote:
> Thanks to Prof. Brian D. Ripley for his comments and suggestions. I
> followed them and got my libraries to work.
>
> A couple of comments.
>
> --- Prof Brian D Ripley <ripley@stats.ox.ac.uk> wrote:
> [...]
> > I think your solutions export no symbols, unless --export-all-symbols
> > can be abbreviated. You don't need an export lib for your own .o.
>
> Actually the problem seems to have been that I didn't use the argument
> "symbols" in dll.load(). The objects were in fact in the .dll file,
> because the following line loaded the object from my old .dll file.
Yes, --export-all-symbols _can_ be abbreviated, although my docs do not
say so. However, relying on things like that is not a good idea.
> > dll.load("[path]/mys.dll", call="cdecl", symbols="mystuff_")
>
> I was somewhat puzzled by Prof. Ripley's suggestion to use .C() to run
> my (originally) Fortran code. .C() worked perfectly. I guess this is
> due to the fact that internally "g77 = f2c + gcc"? In any case, I've
> tried to use .Fortran() and it worked as well. Maybe my simple code
> will run with both functions but a more sophisticated one will need
> .C()?
If you use .Fortran("mystuff") it looks for symbol "MYSTUFF" (it says when
it reports an error). If you use .C("mystuff") it looks for "mystuff". To
my surprise, .Fortran("mystuff_") works, as it looks for "MYSTUFF_", and
that is _not_ an exported symbol. It would be interesting to know
exactly what is incorrect here (is the mapping to uppercase not done,
or is the symbol matching case-insensitive: in which case watch out).
The idea of .Fortran is that it will map "mystuff"/"MYSTUFF" appropriately.
It does for Watcom Fortran conventions, but not for g77 conventions.
Using .C is as easy, and much better understood!
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news