Re: linkimage an unix [message #13128] |
Wed, 21 October 1998 00:00 |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
Wolfgang Weber - Fahr wrote:
>
> Hi everybody,
>
> I'm trying to port a rather big IDL program from PC-Version (Windows NT)
> to DEC Unix. The Problem is, that the Program uses a Smoothing Routine
> that's written in C/Fortran and load's it via LINKIMAGE. It was working
> on a Windows NT machine but somehow I can't make linkimage load the code
> under unix.
> That's what I did:
> The Programm consists of a C-Wrapper which calls the main Fortran
> Programm which again uses a C-Sort routine (and some Library c-Functions
> like sqrt). I Compiled all parts of the Program and linked them together
> (with a dummy main programm to make 'make' work). Then I used 'ar' to
> create a library file which seems to hold all necessary funktions.
> If I call this file from linkimage with 'linkimage, func-name,
> filename,1,func-name' I get the message : 'dlopen: cannot load
> filename'.
Hardly surprising. What you have actually created is an executable image
and
stored it in an archive library. What linkimage requires is a Dynamic
Shared
Object. IDL uses dlopen to load this DSO.
>
> Has anybody got a clue how to do these things right??
Yes.
>
> Thanks in advance,
>
> Wolfgang Weber - Fahr
First you need to compile the source to create the object files.
Use the appropriate C or F77 compiler.
Then link the code, preferably using the F77 compiler, but alternatively
using the C compiler to create a DSO (for Digital UNIX you have to
specify
the -shared option to create a DSO) and give it a name which ends in
.so.
It's not essential to have the name end in .so but it is a convention
for
DSOs.
If you use the C compiler to link the code you may well have to tell
it to link to the F77 library (the F77 compiler should do this itself).
This is usually done with the -lF77 but not always, you need to find
out what it is on your system.
Now you have your DSO which you can load into IDL with linkimage.
--
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
|
|
|