New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

PLEASE HELP A gfortran NEWBIE...


Post Reply New Thread Subscribe

 
Thread Tools
CobraMan

 
Member Since: May 28, 2012
Posts: 3
CobraMan is on a distinguished road

CobraMan is offline
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:
PROGRAM HIWORLD
WRITE(UNIT=*, FMT=*) 'Hello World'
END

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

WHAT AM I DOING WRONG?
QUOTE Thanks
cwa107

 
cwa107's Avatar
 
Member Since: Dec 20, 2006
Location: Middletown, Pennsylvania
Posts: 26,483
cwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond repute
Mac Specs: 15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 SSD

cwa107 is offline
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!
QUOTE Thanks
CobraMan

 
Member Since: May 28, 2012
Posts: 3
CobraMan is on a distinguished road

CobraMan is offline
And thank you for the assistance. My first post on the forum, so I do appreciate it.
QUOTE Thanks
CobraMan

 
Member Since: May 28, 2012
Posts: 3
CobraMan is on a distinguished road

CobraMan is offline
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
QUOTE Thanks

Post Reply New Thread Subscribe


« Create Automator Service to make MD5 Checksum of External Hard Drive | get the currently active finder window using objc »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
gfortran and g77 on lion smriti OS X - Development and Darwin 2 04-23-2012 08:23 PM
gfortran compiler error Robin.Lashof OS X - Development and Darwin 1 03-23-2011 03:18 PM
I cannot properly install gcc and gfortran gcordoba OS X - Development and Darwin 3 02-18-2010 04:28 PM
Newbie with a 17" iMac Fahrvergnugen OS X - Operating System 3 01-07-2004 02:03 AM

All times are GMT -4. The time now is 07:31 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?