Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ll-xn!oberon!lipari.usc.edu!jan From: jan@lipari.usc.edu.UUCP Newsgroups: comp.lang.fortran Subject: Interfacing f77 with Common Lisp problems Message-ID: <5285@oberon.USC.EDU> Date: Thu, 19-Nov-87 13:27:45 EST Article-I.D.: oberon.5285 Posted: Thu Nov 19 13:27:45 1987 Date-Received: Sat, 21-Nov-87 18:48:19 EST Sender: nobody@oberon.USC.EDU Reply-To: jan@lipari.usc.edu () Organization: University of Southern California, Los Angeles Lines: 53 Keywords: Help 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 a fortran routine. All it does is create the file (for std. output this is fort.6) and only occasionally writes something into this file. The command "call flush(6)" helps a bit with that. 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 .... foo = i+1 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" to regular output but I have no clue on what to do about that. Any suggestions are greatly appreciated. Jan jan%lipari@oberon.usc.edu arpa: jan%lipari@oberon.usc.edu vdb@usc-cse.csnet (or vdb%usc-cse@csnet-relay.arpa), vdb@usc-cse.usc.edu uucp: ..!{{decvax,ucbvax}!sdcsvax,hplabs,allegra,trwrb}!sdcrdcf!uscvax!vdb