comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to call fortran subroution?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to call fortran subroution? [message #24704] Mon, 16 April 2001 15:25 Go to previous message
L. Paul Mix is currently offline  L. Paul Mix
Messages: 8
Registered: July 1996
Junior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
web wrote:
<blockquote TYPE=CITE>Thank you very much. I use IDL under windows.
<p>I have generated vecadd.dll from visual fortran. Then I use
<p>result = call_external('f:\fortran\vecadd.dll','f:\fortran\vecadd ',&nbsp;
a,
<br>n_elements(a), x, n_elements(x), b)
<p>to call the dll. The error message is as following:
<p>% CALL_EXTERNAL: Error loading sharable executable.
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
Symbol: f:\fortran\vecadd, File = f:\fortran\vecadd.dll
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
ERROR_PROC_NOT_FOUND
<br>But I have dll file under f:\fortran. How to do then? May be I have
set
<br>wrong parameter.
<br>This is explanation of call_external:
<p>Result = CALL_EXTERNAL(Image, Entry [, P0, ..., PN-1])
<p>Entry:A string containing the name of the symbol in the library which
is the
<br>entry point of the routine to be called.
<p>I donot know how to set entry.
<p>Where can I find The IDL External Development Guide?
<p>Jiali
<p>"Liam Gumley" &lt;Liam.Gumley@ssec.wisc.edu> wrote in message</blockquote>
&lt;Deleted>
<br>For windows with Compaq (Digital) Fortran add the export line to your
wrapper subroutine:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subroutine wvecadd (argc, argv)
<br>cDEC$ ATTRIBUTES DLLEXPORT :: wvecadd
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; integer argc, argv(*)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call vecadd(%val(argv(1)), %val(argv(2)),
%val(argv(3)), %val(argv(4)))
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end
<p>When you call:
<br>junk = call_external('f:\fortran\vecadd.dll', '_WVECADD@8', p1, p2,
p3, p4)
<p>Note the @8 refers to the fact that two pointers are passed to wvecadd
for a total of 8 bytes.&nbsp; The syntax of Call_External makes this suffix
true for all Call_external calls on windows.
<p>Note on HP and Sun unix the entries are 'wvecadd' and 'wvecadd_', respectively.
You will need to branch if you are writing these routines form multiple
platforms.
<p>Good luck.
<br>&nbsp;
<br>&nbsp;
<pre>--&nbsp;
L. Paul Mix
Distinguished Member of the Technical Staff
Electromagnetics and Plasma Physics Analysis

Sandia National Laboratories
MS 1152, P.O. Box 5800
Albuquerque, NM 87185-1152
E-mail: lpmix@sandia.gov
Phone: (505) 845-7493
FAX: (505) 284-6078</pre>
&nbsp;</html>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to read two-bytes variables from a file saved in Mac?
Next Topic: Re: search for linux programs

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:59:31 PDT 2025

Total time taken to generate the page: 0.80326 seconds