[18917] in s-news-athena
[S] RE: Fortran/C Compilers and S-PLUS
daemon@ATHENA.MIT.EDU (Clark Sims)
Wed Aug 11 12:05:11 1999
To: "S Mail Server" <s-news@wubios.wustl.edu>
Date: Wed, 11 Aug 1999 08:53:26 -0700
From: " Clark Sims " <clarksimssplus@my-deja.com>
Message-Id: <KDPBEMMHNLLOAAAA@my-deja.com>
Mime-Version: 1.0
Cc:
Reply-To:
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Andrew Bruce wrote:
It is true that the dyn.load function works only with the Watcom compilers.
However, there is another option on Windows/NT for dynamically interfacing C
or Fortran code with S-PLUS for Windows/NT. If you create a DLL, you can
load the DLL using the S-PLUS function dll.load. This capability has been
in S-PLUS for Windows since Version 3.3. Since S-PLUS Version 4.0, such
DLL's have been able to call internal S-PLUS functions. (In Version 3.3,
only code compiled with the Watcom compilers and loaded with dyn.load or the
LOAD utility could call internal functions. In S-PLUS 4.0 and above, that
advantage no longer exists.)
Clark Sims replies:
Here is a code fragement that is simular to many code
fragments that I have tested:
declspec(dllimport) void *S_alloc( long num, long size);
declspec(dllexport) void any_func( double **x, long *len)
{
* len = 1;
*x = (double*)S_alloc( 1, sizeof(double));
}
When I call this function from 486 systems running
Win 95 it works fine. It does not work when I run it
on Pentiums 2 running NT. I spent a great deal of time
trying to figure out what was going on, and the only
conlusion I could reach is that the DLL calls to sqpe.dll are somehow different than most DLL calls,
and that these calls do not work with the newer hardware, and newer software.
I am getting the impression that Mathsoft is not aware
of this problem. I have documented it as well as I can,
I have called technical support, I have written technical support, I don't know what more I can do
to make Mathsoft aware that the dll functions, in
sqpe.dll do not work as documented.
Rather than wait for Mathsoft to fix the problem,
I have fixed it myself. The patch is at:
http://home.t-online.de/home/howlingmad/watcom.html
In the patch I also fixed the problem with Fortran
String Descriptors, and I created a C++ style,
output stream object for printing to S+.
--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.
-----------------------------------------------------------------------
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