Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

carrollp

macrumors newbie
Original poster
Dec 27, 2007
1
0
I have built a FORTRAN program on Mac OSX using GNU gcc and f77. Works fine, but when I try to run it on another OSX Mac, I get an error:

dyld: Library not loaded: /usr/local/lib/libg2c.0.dylib

Can't I build a program that is runnable on other OSX Mac's that doesn't have the compiler installed?
 
The problem is that all OS X systems come with the C runtime shared libraries installed by default, while they don't include the Fortran 77 runtimes by default. The Fortran libraries get installed when you install the compiler. If you want to distribute the program to a user who might not have the Fortran library you're using, then you need to statically link the runtime into your program. Try adding "-static-libgfortran" to your compiler directives.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.