home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / c / 13413 < prev    next >
Encoding:
Internet Message Format  |  1992-09-09  |  2.3 KB

  1. Xref: sparky comp.lang.c:13413 comp.lang.fortran:3501
  2. Path: sparky!uunet!sun-barr!olivea!hal.com!darkstar.UCSC.EDU!gross
  3. From: gross@maxwell.ucsc.edu (Mike Gross)
  4. Newsgroups: comp.lang.c,comp.lang.fortran
  5. Subject: mixing C/Fortran and shared libraries
  6. Message-ID: <18m1jcINN9qs@darkstar.UCSC.EDU>
  7. Date: 9 Sep 92 23:33:00 GMT
  8. Organization: University of California, Santa Cruz
  9. Lines: 42
  10. NNTP-Posting-Host: maxwell.ucsc.edu
  11.  
  12. Hello, netters!
  13.    I've been having a rather nasty problem trying to integrate a Fortran
  14. object library into a C program. The compilers and linker seem quite happy
  15. with the code and my makefiles, but when I run the program, I get the 
  16. following error message from ld.so:
  17.  
  18. ld.so: call to undefined procedure __fp_convert_double_to_int from 0xf757311c
  19.  
  20. I looked in libm.a (both Fortran and C versions) and this routine was
  21. present in both of them. What seems to be happening is that at compile time,
  22. the loader thinks it doesn't need this particular routine, so it doesn't link
  23. it in. But somewhere along the line at runtime, the dynamic loader realizes
  24. this is a mistake and tries to get it. The problem: there is no libm.so.*.
  25.  
  26. I tried to find out what this routine was for. The obvious answer is that
  27. it's a typecast of some sort. I tried writing a Fortran routine that 
  28. calculated pi in double precision and cast it to an integer*4. This made
  29. no difference. I even tried calling the routine directly, and this didn't
  30. help. 
  31.  
  32. I'm at the end of my rope now, since my C program is getting rather large,
  33. and I don't have source code to the Fortran library (it's Mongo 1987 for
  34. those familiar with it). Does anyone out there have any idea what's going
  35. on?
  36.  
  37. If it matters, I'm using GNU cc, version 2.2.2 on a Sparc IPC running
  38. SunOS 4.1.1. The Fortran compiler is Sun's second ("SC1.0") supposedly
  39. fixed f77. There is, of course, the possibility that the library was 
  40. compiled under an older f77 (since I didn't compile it myself).
  41.  
  42. Any help would be tremendously appreciated.
  43.  
  44. Michael Gross                       Until Oct. 15:
  45. 312 Natural Sciences II             c/o Keith Jahoda
  46. Univ of California                  NASA/Goddard Space Flight Center
  47. Santa Cruz, CA 95064                Code 666
  48. (408) 459-4588                      Greenbelt, MD 20771
  49. gross@maxwell.ucsc.edu              gross@ros1.gsfc.nasaa.gov
  50.  
  51.  
  52.  
  53.  
  54.