From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,1981f5c6348c8bb0,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-03-23 07:12:49 PST Path: gmd.de!newsserver.jvnc.net!yale.edu!yale!gumby!newsxfer.itd.umich.edu!gatech!udel!MathWorks.Com!zombie.ncsc.mil!cs.umd.edu!newsfeed.gsfc.nasa.gov!usenet From: kent@kentaurus.dftsrv.gsfc.nasa.gov (James Kent Blackburn) Newsgroups: comp.sys.dec Subject: Help! C FORTRAN on ALPHA/OSF version 1.3 Date: 23 Mar 1994 15:12:49 GMT Organization: NASA Goddard Space Flight Center -- InterNetNews site Distribution: world Message-ID: <2mpm9h$4e9@paperboy.gsfc.nasa.gov> NNTP-Posting-Host: kentaurus.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Keywords: C,FORTRAN,ALPHA,DEC,OSF I have found a problem in having a C main function call a FORTRAN subroutine while using the latest version (1.3) of the OSF operating system on an Alpha workstation. This same code works great on machines using the version 1.2 OSF operating system. Running this very simple test program causes a segmentation fault immediately upon entering the main function! The code and Makefile is shown below. Please send replies via internet email to kent@kentaurus.gsfc.nasa.gov. Thanks... ====================================================================== alpha> cat hjunk.c /* filename: hjunk.c purpose: c - wrapper for fortran junk subroutine author: Kent Blackburn - kent@kentaurus.gsfc.nasa.gov */ #include int main (argc,argv) int argc; char **argv; { void junk_(); junk_(); return(0); } alpha> cat junk.f C Simple fortran subroutine called by C C subroutine junk print*,'hello world' return end alpha> cat Makefile # Makefile for junk program: F77LIBS = -L/usr/lib -ldnet_stub -lUfor -lfor -lFutil -lm -lots -lc CFLAGS = -I./ -g all: junk junk: hjunk.o junk.o $(CC) -o junk $(CFLAGS) hjunk.o junk.o $(F77LIBS) FFLAGS = -c -g junk.o: junk.f $(FC) $(FFLAGS) $<