Installing Fortran on Mac: A Step-by-Step Guide

In summary: Xcode%203.2.6&platform=mac&product=Developer%20ToolsThanks for the other advices.Yes, that's right. There's a version of Xcode on the installation DVDs, which is probably all you need.If you want the latest, you can register as a developer here:Once registered as a Mac developer, you can log into the the Mac dev center here:The download link for Xcode 3.2.6 is right on the first page. It's a 4+ GB...
  • #1
Casco
82
1
Well I am taking a Numerical Analysis course, and I just bought a MacBook Pro. My problem is that I just barely can handle Mac's software, I need to install fortran and I don't have any idea of how to do it, also I need a program similar to Origin on windows for my mac, for the data analysis. Any tutorial or help for installing Fortran on Mac would be very helpful.

Thanks
 
Physics news on Phys.org
  • #3
vela said:
You might find this page helpful.

http://hpc.sourceforge.net/#fortran
I don't understand very well this step:

Most of these packages have been compiled/tested on OS X 10.6, 10.7 and XCode Tools 3.x, 4.x. Feel free to contact me with questions or problems! Note: Mac OS X 10.6 does not include /usr/local/bin in its default PATH. Therefore, assuming you're using the default bash shell, please type (or include in /etc/profile) export PATH=/usr/local/bin:$PATH before using any of these tools.

Could you explain it to me ?

New at Mac.

Thanks
 
Last edited:
  • #4
You need to get Xcode from Apple. It's the development system from Apple. I'll assume since you just bought the MacBook Pro, you're running 10.7 on it. If so, you can get Xcode 4.1.1 from the Mac App Store. It's a free download. You actually won't use Xcode itself. You want the tools to get gcc and other tools needed for compiling programs in a Unix environment.

If you're running 10.6, you need to get Xcode 3, which you can get from Apple's developer site. You'll have to register as a developer, which you can do for free, to get to the download page. Sometimes, it's hard to find the page, so if you have to go this route and run into trouble, ask here, and I can probably find the page for you relatively quickly.

---

PATH is an environment variable which tells the system which directories to look for programs in when you type a command in at the command line, just like with DOS. By default, the system sets PATH to something like /usr/bin:/bin:/usr/sbin:/sbin. So when you type a command, it first looks for the command in /usr/bin. If it's not there, it checks /bin, and so on.

When you install most open-source software, it doesn't put them into any of these system directories to avoid breaking the operating system. Instead, there's a local structure set up, which resides in /usr/local. To get programs stored in there to run, you need to add /usr/local/bin and /usr/local to PATH. You typically do this by adding the appropriate line in the file .bash_profile, which gets executed every time you start up the shell.

---

Mac OS X is based on Unix, so you're going to want to learn how to get around a Unix system. You're facing a bit of a learning curve, but this stuff is pretty useful to know. Once you know it, you'll be able to use other Unix and Unix-like systems, like Linux.

---

Some other resources you might find useful are the Fink and Macports projects. While a lot of open source software will just compile on OS X if you just follow the instructions for Unix, it's not uncommon to run into little bugs here and there. Fink and Macports offers collections of ported software where all these kinks were fixed by someone else. Also, you'll often find if you want to install some software that it depends on a bunch of other stuff, so you have to go track that stuff down and compile it first. Macports and Fink take care of all that for you.
 
  • #5
vela said:
If you're running 10.6, you need to get Xcode 3, which you can get from Apple's developer site. You'll have to register as a developer, which you can do for free, to get to the download page. Sometimes, it's hard to find the page, so if you have to go this route and run into trouble, ask here, and I can probably find the page for you relatively quickly.

I am running 10.6 but I think that software is on a installation disc that comes with the MacBook Pro when you buy it, Is it right? Because I have two discs. Could it be an option??. If I am wrong about that, Can you give a page so I can download the software?. Because I couldn't find it.

Thanks for the other advices.
 
  • #6
  • #7
vela said:
Yes, that's right. There's a version of Xcode on the installation DVDs, which is probably all you need.

If you want the latest, you can register as a developer here:

http://developer.apple.com/programs/register/

Once registered as a Mac developer, you can log into the the Mac dev center here:

https://developer.apple.com/devcenter/mac/index.action

The download link for Xcode 3.2.6 is right on the first page. It's a 4+ GB download.


Ok, thanks for your information, it has been very valuable cause all the pages that I found the past days were not so instructive as I would liked. I will run the DVD and see what happens.

Thank you.

Oh I forgot, I am also new on PF, if there is any way to give you points or something like that just let me know and I will do it.
 
  • #8
You're welcome. No point system here. :smile:
 

1. How do I download Fortran for Mac?

To install Fortran on Mac, you can either download the latest version from the official website or use a package manager such as Homebrew.

2. Do I need to have Xcode installed on my Mac to use Fortran?

Yes, Xcode is required to compile and run Fortran code on Mac. You can download Xcode from the Mac App Store or the Apple Developer website.

3. Can I install multiple versions of Fortran on my Mac?

Yes, you can install multiple versions of Fortran on your Mac using a package manager like Homebrew. However, it is recommended to only have one version active at a time to avoid conflicts.

4. How do I check if Fortran is properly installed on my Mac?

To check if Fortran is installed on your Mac, you can open the Terminal and type gfortran -v. This will display the version and other information about your Fortran installation.

5. Can I uninstall Fortran from my Mac?

Yes, you can uninstall Fortran from your Mac by using the same method you used to install it. For example, if you used Homebrew to install Fortran, you can use brew uninstall gcc to remove it.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Computing and Technology
Replies
24
Views
2K
  • Programming and Computer Science
Replies
1
Views
535
  • Engineering and Comp Sci Homework Help
Replies
8
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Computing and Technology
Replies
11
Views
2K
  • Computing and Technology
Replies
31
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
900
  • Engineering and Comp Sci Homework Help
Replies
3
Views
6K
  • Computing and Technology
Replies
2
Views
1K
Back
Top