Re: caling f90 [message #55699] |
Wed, 05 September 2007 06:22 |
woopik
Messages: 18 Registered: September 2007
|
Junior Member |
|
|
i forgot
when i verify nm biblio.so | grep "for"
these function for_open and for_write_seq_lis
stil have the U status mean undefined
but it works :)
|
|
|
Re: caling f90 [message #55700 is a reply to message #55699] |
Wed, 05 September 2007 06:13  |
woopik
Messages: 18 Registered: September 2007
|
Junior Member |
|
|
so ...
i heve copy all libraries from intel lib catalogue to my project
catalogue
because i was unable specify the directory with ld -L......... -
llibcore (doesn't matter now)
i make an .so with ld -shared libifcore.so.5 libifcoremt.so and my
objects
and now it works :)
thanks
|
|
|
|
Re: caling f90 [message #55709 is a reply to message #55707] |
Tue, 04 September 2007 11:40  |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
The path environment may be different for spawn. my guess is that if you use
spawn, your code accesses the intel sharable (.so) libraries, which it
cannot find otherwise. Try linking with libifcore.a, libimf.a, and libirc.a.
Also for whatever reasons I don't remember anymore, I use the
switches -static -static-libcxa with the intel compiler.
Haje
<woopik@interia.pl> wrote in message
news:1188929267.027643.53410@d55g2000hsg.googlegroups.com...
> but when i spawn a program there is no problem with these
> libraries
>
|
|
|
|
Re: caling f90 [message #55711 is a reply to message #55710] |
Tue, 04 September 2007 10:29  |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
Hi,
The missing functions are contained in the Intel Fortran libraries. I
usually link the static these libraries to avoid these issues.
Haje
<woopik@interia.pl> wrote in message
news:1188919137.972574.312690@g4g2000hsf.googlegroups.com...
> hi
>
> i try run fortran 90 function via call_external an C wrapper
> but i have errors ONLY when i try tu use standard functions like open
> or write(*,*)
> S = CALL_EXTERNAL('biblio.so','dlhipo', ra,ile)
>
> when i use open
> [*****@****] [test] >/usr/local/rsi/idl/bin/bin.linux.x86_64/idlde:
> symbol lookup error: ./biblio.so:
> undefined symbol: for_open
>
> when i use write
> [*****@****] [test] >/usr/local/rsi/idl/bin/bin.linux.x86_64/idlde:
> symbo
> l lookup error: ./biblio.so: undefined symbol: for_write_seq_lis
>
> when i make call_external to a function without open or write
> all works !!!
> when i make SPAWN a program with open / write
> all works good !
>
> there are examples
> my function DLH.f90
> SUBROUTINE DLH(Ra,counter)
> ! lf is defined in module types as integer, parameter ::
> lf=kind(1.d0)
> use types
> implicit none
> real(lf), intent(in) :: Ra
> integer, intent(out) :: counter
> write(*,*)
> write(*,*) "-> Utilisation de l'application dlhip."
> counter=2
> END SUBROUTINE DLH
>
> my wrapper xtemp.c
> #include <stdio.h>
> void dlhipo(int argc, void *argv[])
> {
> extern void dlh_(); /* FORTRAN routine */
> int *n;
> float *f;
> f = (float *) argv[0]; /*Ra*/
> n = (int *) argv[1]; /*counter*/
> dlh_(f, n);
> }
>
> my compile options
> gcc -c -fPIC -shared xtemp.c for C wrapper
> ifort -check bounds -c -mp1 -O3 -fPIC DLH.f90
> ld -shared xtemp.o DLH.o -o biblio.so
>
> my program when i use SPAWN
> spawn,['../test/a.out'],/NOSHELL
>
> program example
> use types
> implicit none
> real(lf):: Ra
> integer :: counter
> write(*,*)
> write(*,*) "-> Utilisation de l'application dlh."
> open(22,file='./local.txt')
> close(22)
> Ra=2
> counter=2
> end
>
>
> someone know why i have theses errors ?
> thx
>
|
|
|