Results 1 to 4 of 4
  1. #1

    Member Since
    May 28, 2012
    PLEASE HELP A gfortran NEWBIE...
    I'm running a late 2011 13" MacBook Pro with a 2.7 GHz Intel Core i7 processor and OS-X 10.7.4

    Today I downloaded XCode via the Mac App Store and successfully installed it with a default install and no error messages.

    I also downloaded and successfully executed the gfortran apple installer (version 4.6.2) for OX Lion (10.7) - installer released 2011-10-20 from the GCC website.

    I then went into my user directory via the Terminal, and found there was no ".bash_profile" file. So I created one with a single line (followed by a carriage return). The single line is:
    "export PATH=/usr/local/binPATH"

    I restarted my computer at this point.

    I then created a simple fortran text file (named hiworld.f77 and saved as text), that reads:
    WRITE(UNIT=*, FMT=*) 'Hello World'

    When I try to compile the code (from within the directory the hiworld.f77 source code is in) with the following statement from the Terminal,

    gfortran hiworld.f77 -o hiworld

    I receive the following error message from the Terminal:

    "collect2: cannot find 'ld'

    I get the same error message if I attempt to compile with the following command:

    /usr/local/bin/gfortran hiworld.f77 -o hiworld


  2. #2

    cwa107's Avatar
    Member Since
    Dec 20, 2006
    Lake Mary, Florida
    15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 SSD
    I've moved your post to a more proper forum; please be sure to check the forum descriptions to find the best place to post.

    By posting in the right forum you help people not only find your question faster, but it helps others looking for the same information in the future.

    Thanks for understanding!
    Liquid and computers don't mix. It might seem simple, but we see an incredible amount of people post here about spills. Keep drinks and other liquids away from your expensive electronics!

  3. #3

    Member Since
    May 28, 2012
    And thank you for the assistance. My first post on the forum, so I do appreciate it.

  4. #4

    Member Since
    May 28, 2012
    Further Developments
    Based on some related posts here, I went back and installed the XCode Command Line tools via the Downloads tab on the XCode Preferences Window.

    Now, when I type in gfortran hiworld.f77 -o hiworld,

    I get the following...

    ld: warning: ignoring file hiworld.f77, file was built for unsupported file format which is not the architecture being linked (x86_64)
    Undefined symbols for architecture x86_64:
    "_main", referenced from:
    start in crt1.10.5.o
    ld: symbol(s) not found for architecture x86_64
    collect2: ld returned 1 exit status

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. gfortran and g77 on lion
    By smriti in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 04-23-2012, 09:23 PM
  2. How to install gfortran on OSX 10.7 (Lion)
    By drongobot in forum OS X - Development and Darwin
    Replies: 3
    Last Post: 10-30-2011, 03:05 PM
  3. gfortran compiler error
    By Robin.Lashof in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 03-23-2011, 04:18 PM
  4. I cannot properly install gcc and gfortran
    By gcordoba in forum OS X - Development and Darwin
    Replies: 3
    Last Post: 02-18-2010, 05:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts