From: Jan Vandenbrande
Subject: Interfacing f77 & Lisp: HowTo?
Date: 
Message-ID: <4934@oberon.USC.EDU>
Can someone out there help me with the foreign function
interface of Common Lisp running on a Sun 3/260?

The problem is as follows:

I am trying to call a fortran77 function from lisp.
So far all works fine except, except that I don't
seem to be able to write anything to output, or to
a file for that matter, from that fortran routine.
All it does is create the file (for std. output this
is fort.6) but never writes anything into this file.

To load the fortran function and libraries I do the following
in Lisp:

(define-fortran-function foo (S i)  :result-type :integer)
(load-foreign-files '("foo.o") '("-lU77" "-lF77" "-lI77" "-lc"))

where foo.o is the f77 -c foo.f of something like:

	Integer function foo(S,I)
	Integer i
	character*10 s
	print*, "WhyDoesN'T ThisPRINT", i
	....
C	More irrelevant stuff
	....
	return
	end

I tried all kinds of things (formatted output, creating new files, 
etc), but nothing has worked so far. When foo is linked with a regular
fortran program, it works just fine.

Anyone have an idea? My impression is that somehow some print buffer 
doesn't get "flushed" but I have no clue on how to do that.

Jan

Send mail directly to :
··········@oberon.usc.edu
  arpa: ··········@oberon.usc.edu
	···@usc-cse.csnet (or ···········@csnet-relay.arpa), ···@usc-cse.usc.edu
  uucp:  ..!{{decvax,ucbvax}!sdcsvax,hplabs,allegra,trwrb}!sdcrdcf!uscvax!vdb