Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!yahoo From: yahoo@unix.cis.pitt.edu (Kenneth L Moore) Newsgroups: comp.lang.c Subject: Re: USING FORTRAN/IMSL LIB. FROM C Message-ID: <22392@unix.cis.pitt.edu> Date: 17 Feb 90 20:40:26 GMT References: <1990Feb16.172952.24266@utzoo.uucp> Reply-To: yahoo@unix.cis.pitt.edu (Kenneth L Moore) Organization: Univ. of Pittsburgh, Comp & Info Services Lines: 27 In article <1990Feb16.172952.24266@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In article majmudar@amalthea.rutgers.edu (Keyur Majmudar) writes: =>=>I am trying to call an IMSL subroutine (qdags) [in FORTRAN] from a C =>You need to look in your Fortran manual to find out the details of linking =>Fortran to C on your particular system. =>Also, parameter-passing conventions are often different. You =>usually can't just call Fortran subroutines as if they were C functions. I'll add an amen to that. When I was writing my master's thesis I had to call FORTRAN functions from a C program because of complex number manipulation (on our machine the FORTRAN intrinsic complex number arithmetic was much faster than using C routines). I had to read our system's manuals to be successful. I could not just call FORTRAN functions as if they were written in C. Especially if they had character strings, which require a string length in FORTRAN passes. I also had to set special loader flags to get it to work. However, after the initial effort, the result was flawless. So don't be discouraged. It only took me two days to get it working. (and I'm not all that swift!) -- I don't yell and I don't tell and I'm grateful as hell: Benny Hill