Re: Calling Fortran 90 from IDL/LINUX/ pgi/ifort [message #43562] |
Fri, 22 April 2005 07:26 |
Randall Skelton
Messages: 31 Registered: October 2004
|
Member |
|
|
Hi Axel,
Writing c code that passes strings back and forth between fortran can
be difficult even without IDL in the mix. While it has become more
standardized, each compiler works these things a little differently
which is why you won't find many examples in the RSI manual. If you
haven't already done so, I'd experiment with just passing strings
between c and fortran with your chosen compilers. I've not used the
portland group compilers but there are generic notes on doing this for
the sun compilers that generally work for gnu, intel and irix
compilers. See:
http://docs.sun.com/source/817-0929/11_cfort.html
If you can convince yourself that you can do this, then it should just
be a matter of copying the IDL string to a local C char array that has
been correctly sized and then passing it appropriately to your fortran
routines.
Cheers,
Randall
|
|
|
Re: Calling Fortran 90 from IDL/LINUX/ pgi/ifort [message #43564 is a reply to message #43562] |
Fri, 22 April 2005 05:10  |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
In order to clear out loaded .so, you need to use .full_session_reset or
short .f.
"catwithhat" <axel@apl.washington.edu> wrote in message
news:1114132155.276487.294180@z14g2000cwz.googlegroups.com.. .
> I have Fortran 90 application I need to run from IDL under Redhat Linux
> (x86). I have looked at the examples for call_external but apparently
> neither the direct case nor the C-Wrapper case are implemented for
> Linux.
>
> Question:
> -Can anyone send me an example (Makefile). I have either pgif90
> or ifort (Intel) compilers available for (x86)
> -I have gotten the simple simple_c2f.c to almost work but the
> the strings don't get passed properly.
>
> pgicc -fPIC -c example_c2f.c
> pgif90 -fPIC -shared example_c2f.o example_c2f1.f -o \
> example_c2f.so
>
> This works except for the string variable which doesn't get
> passed into the C-program correctly
>
> -Also I noticed that when I recompile a new *.so libary, I need
> to exit IDL and reenter to make it read the new one.
> I tried .reset but that has no effect either.
>
> Thanks much
> Axel
>
|
|
|