• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
gfortran in a static library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gfortran in a static library


  • Subject: gfortran in a static library
  • From: John Weeks <email@hidden>
  • Date: Tue, 6 Jun 2006 13:42:04 -0700

I posted this problem on the Fortran list, because originally I thought it
was a gfortran problem. But I'm beginning to think its a gcc or XCode
problem...



I'm using gfortran to build some Fortran code to be used in our C/C++
application. To do this, I compile the Fortran code using gfortran, and put
the resulting object files into a static library using libtool.

This requires that the main application link against libgfortran.a.

It would be nice if I could distribute a single library file to my
non-fortran-aware colleagues.

To attack this, I included libgfortran.a in the inputs to libtool, and
removed libgfortran.a from the libraries that the application links against.

It almost worked, except that there is a single undefined symbol:
___floatundidf.

Why would including libgfortran in my static library result in an undefined
symbol, where including libgfortran in the libraries for the main
application does not?

Is there a solution?

Is there a better way to approach the whole problem?



Since I wrote all that, using nm I have discovered that libgcc_s.1.dylib
that ships with gfortran contains the needed definition. Can I link with
that? If I do, then I will have to distribute libgcc_s.1.dylib with the
eventual application, since its a dylib, right? Can I extract the needed
code from the dylib to include in my static library? Can I build my static
library in a way that excludes the code that needs floatundidf?


XCode: 2.2 (so far)
GNU Fortran 95 (GCC) 4.2.0 20060315 (experimental)
It needs to target OS X 10.3.9.

Thank you, and apologies for a long and rambling bunch of questions.

Regards,
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax   (503) 620-6754
email   email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: (no subject)
  • Next by Date: templates & function menu; was: code completion
  • Previous by thread: Re:
  • Next by thread: Xcode 2.3 broke CPlusTest?
  • Index(es):
    • Date
    • Thread