[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

!HELP! foreign function interface to Fortran



Hi:

I am trying to use the foreign function interface 
to access a Fortran subroutine. However, the interface
is complicated by the fact my machine (Sun 4) doesn't have
one system library used by the Fortran subroutine.
So the steps I am taking are:

[1] I went to another machine (Sun 4) which has the system library
and do:

	f77 -c test.f
	ld -Bstatic -r test.f -lnag (where nag is the needed library)

then I tranferred the binary object file "test.o," linked to nag library,
to my own machine. I tested the transferred subroutine "test.o" by 
linking to the main program  "main.f" via "f77 main.f test.o".
The entire Fortran program works fine.

[2] Then I go into CL (Allegro CL 3.1.beta.22 [Sun4]) and do the following:

    <cl> (use-package :ff)
    <cl> (require :foreign)
    <cl> (load "test.o" :system-libraries '("F77" "I77")
                        :unreferenced-lib-names '("_f_init"))
                        ; Foreign loading /home/radon1/users/hodges/klin/research/workstation_software/NAG/test/test.o with system libraries F77 I77.
    Undefined:
    _ieee_retrospective_
    __fp_convert_double_to_int
    _ir_fp_class_
    _fp_class
    Warning: Foreign load failed

    NIL 

[3] What puzzles me is all the undefined symbols can be found in
libF77.a and libI77.a in the default lib directories. I don't
know where I have done wrong????

I appreciate your help in advance. Thanks.
KK