Compiling fortran?

Discussion in 'Mac Programming' started by kusurisuri, Sep 26, 2011.

  1. kusurisuri macrumors newbie

    Joined:
    Sep 26, 2011
    #1
    Hello,

    So I am trying to compile the CEA code on my Macbook through the terminal. I have installed Xcode and gfortran, and set my PATH variable correctly.

    The issue that I get when trying to make new library files for the executable files is:

    dyld: Library not loaded: /usr/local/lib/libg2c.0.dylib
    Referenced from: /usr/bin/FCEA2
    Reason: image not found
    Trace/BPT trap

    I cannot find that particular library file in usr/local/lib, so I am wondering what to do exactly.

    Thank you. Please..please help!


    Also, What I have been using as reference is: http://www.stanford.edu/~cantwell/A...EAforIntelMac/Installing_CEA_On_Intel_Mac.pdf
     
  2. parapup macrumors 65816

    parapup

    Joined:
    Oct 31, 2006
    #2
    Looks like the FCEA or whatever program you are trying to run was compiled with older version of the GNU Fortran compiler - g77. From here it seems that 4.x versions of GCC do not need/use the libg2c anymore. Since GCC that ships with recent OS X is 4.x - may be that's why the library is missing.

    I am not sure what you can do - apart from using older OS X installation that runs gcc3.x.
     
  3. kusurisuri thread starter macrumors newbie

    Joined:
    Sep 26, 2011
    #3
    Yeah it is a very old code..

    Do you mean run an older installation of gfortran? Or..or actually an older installation of OS X
     
  4. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
  5. kusurisuri thread starter macrumors newbie

    Joined:
    Sep 26, 2011
    #5
    Yes. That is where I got the gfortran file. (gfortran-snwleo-intel-bin.tar.gz )
     
  6. parapup macrumors 65816

    parapup

    Joined:
    Oct 31, 2006
    #6
    Actually running older OS X install may be a no go because of the hardware. So you might wanna try downloading gcc 3.3 from http://gcc.gnu.org and try to build and install it. Be careful not to overwrite the system GCC installation! (configure --enable-languages=c,c++,objc,fortran --prefix=/usr/local/gcc3 for e.g)

    There is no guarantee this will work though. So good luck!
     

Share This Page