Re: Fortran + IDL [message #26453 is a reply to message #26371] |
Fri, 24 August 2001 03:53   |
fskhk
Messages: 5 Registered: August 2001
|
Junior Member |
|
|
Craig Markwardt <craigmnet@cow.physics.wisc.edu> wrote in message news:<onelq6a3c7.fsf@cow.physics.wisc.edu>...
> fskhk@puknet.puk.ac.za (Helena Kruger) writes:
>> I am working in Fortran (with a complicated program) and IDL. Up to
>> now I put the output of the fortran data in a text file, go to IDL,
>> read the text file in IDL and draw the graphs. For every small change
>> in fortran I have to go in and out the fortran program and IDL
>> program. Will it be easier and better to use ActiveX or Callable IDL
>> under Windows? How and where can I learn to make the linkage?
>
> Stein Vidar's response spawned a thought. Why aren't you using SPAWN?
> One point of any programming language is to proceduralize mundane
> tasks so you don't have to keep doing the tasks yourself.
>
> You could start with something like this:
>
> pro dofortran, array
> ;; Call fortran program
> spawn, 'runfortran', output
>
> ;; Determine number of elements in array - assume it's a 3xN array
> n = n_elements(output)
> array = fltarr(3,n)
>
> for i = 0L, n-1 do begin
> v0 = [0., 0., 0.]
> reads, output(i), v0
> array(*,i) = v0
> endfor
>
> return
> end
>
> Obviously you will have to customize for your program name and the
> number of variables, etc.
>
> Craig
I got an example of Callable IDL from internet, using the fortran
program align2.f, a c-wrapper, written by Doug Loucks of RSI, in 1998
and the IDL program, called align.pro. I used these programs and
tried to link them, but am still struggling. I use the following
versions of software: Visual C++ 5.0, IDL 5.2.1 and Visual Fortran
Professional Edition 5.0A, working under WINDOWS.
I can compile the fortran program and the c-wrapper (Callable.c) with
no problems.
I get the following error messages:
--------------------Configuration: callable - Win32
Debug--------------------
Linking...
LINK : warning LNK4098: defaultlib "libc.lib" conflicts with use of
other libs; use /NODEFAULTLIB:library
callable.obj : error LNK2001: unresolved external symbol
_IDL_Win32Init
callable.obj : error LNK2001: unresolved external symbol
_IDL_ExecuteStr
callable.obj : error LNK2001: unresolved external symbol
_IDL_ImportNamedArray
callable.obj : error LNK2001: unresolved external symbol _IDL_Cleanup
align2.obj : error LNK2001: unresolved external symbol
_IDL_WIN32INIT@4
align2.obj : error LNK2001: unresolved external symbol
_IDL_IMPORTNAMEDARRAY@32
align2.obj : error LNK2001: unresolved external symbol
_IDL_EXECUTESTR@8
align2.obj : error LNK2001: unresolved external symbol _IDL_CLEANUP@4
Debug/callable.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.
Is the reason that it look for the IDL32.LIB file because of the
different versions of software used or maybe the path? How can I
bypass this linking problem?
Helena
|
|
|