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

tirwit

macrumors newbie
Original poster
Jan 20, 2010
28
0
Hi!

This is my first month as a mac user and my chief gave me some work of programming stuff for a physics experiment, so I'm probably gonna make a very dumb question... My apologies in advance :)

I need to run a code to simulate a thing in an experience, and that code is written in fortran. I heard that the code can only be run in windows or some linux systems. But I'm loving mac and I don't believe that =P. So my question is: can something written in fortran be run on mac? If not, why? And is there some way to make it possible?

I have xCode 3, btw, if that helps.

The site for both the codes is:
http://www-rsicc.ornl.gov/codes/ccc/ccc7/ccc-756.html
http://www-rsicc.ornl.gov/codes/ccc/ccc7/ccc-713.html
There's some info there but I can't figure out if that means it can't definitely run on a mac.

thanks in advance :D
tirwit
 
There's likely no reason that you could not do this work on OS X.
9.******** COMPUTER SOFTWARE REQUIREMENTS
PENELOPE 2008.1 runs on Pentium personal computers under either Windows XP/Vista/7 or Linux. The code will run on almost any operating system supporting a FORTRAN 77 compiler that is FORTRAN 90 compatible. There are no specific requirements for the PENELOPE kernel. However the time subroutine, which is used in the example programs, must be adapted to the user’s operating system. Included time routines are standard Fortran 90.
A Fortran compiler is required on all computers as the user must supply the main program for his particular problem. Editing the included PENMAIN generally allows users to define their source characteristics without writing a single line of source code. The authors recommend GNU Fortran (gfortran) http://gcc.gnu.org/wiki/GFortranBinaries. Some other compilers which have been used include Compaq Visual Fortran 6.6 and Intel. At RSICC the source code was compiled with Intel Visual Fortran Professional 11.1 under Windows 7. To plot the results, a plotting program is needed. GNUPLOT is recommended http://www.gnuplot.info/. *
In addition to PENELOPE 2008.1 source code, data files and example problems, some graphic tools are included. GVIEW2D, GVIEW3D and GVIEWC are geometry viewers/debuggers that display 2- or 3-dimensional images of the geometry. SHOWER displays showers produced by primary particles of a given kind and energy in a slab. These graphic tools are operable only under MS-Windows 9x/NT/2000/XP/VISTA. Windows executables are included for these viewers, but source codes are not provided.

9. COMPUTER SOFTWARE REQUIREMENTS
Penelope-MPI runs under the AIX operating system on IBM SP workstations and can be run in serial mode on IBM. Fortran 90 and C compilers and MPI are required to build executables for the parallel version. The code was tested at RSICC on an IBM SP3 with mpxlf90 and mpcc compilers.
GVIEW2D, GVIEW3D, and GVIEWC executables from Penelope-2001 are included to display geometry on the computer screen. They run on personal computers under Microsoft Windows 9x, NT or Windows2000 and are simple and effective tools for debugging geometry definition files.

These are the important sections of the documents you linked.

The first mentions gfortran specifically, and there's no reason you shouldn't be able to get gfortran running on OS X. I prefer g95, but I don't know if there's some dependency on a behavior of gfortran over g95.

The second mentions AIX specifically, which might give me pause. I don't know if something about the code is AIX specific, uses AIX-only libraries, etc. I wouldn't give up hope, but if this has been used on other systems and is standard Fortran 90, etc. i would expect this would say so.

Check here for gfortran:
http://gcc.gnu.org/wiki/GFortranBinaries

Mac OS binaries are available for x86 and PPC.

Check here for g95:
http://www.g95.org/downloads.shtml

Mac OS binaries are also available for x86 and PPC.

-Lee
 
Google keywords: mac os fortran

Seriously.

The first page of hits shows compilers, past MacRumors posts on Fortran, and a wealth of other links.
 
Thanks so much for the help guys. I'm new to this so basically I don't understand a thing of this stuff. I'll try to get some info about what's AIX and if it's essential to the code.

Chown: of course I did that. I wouldn't be bothering other people if I didn't tried that first, the thing is that I didn't understood what was written there (like . But I understand that a lot of people ask stuff without even trying to find it in other places and hence , your answer :) But thanks anyway
 
Thanks so much for the help guys. I'm new to this so basically I don't understand a thing of this stuff. I'll try to get some info about what's AIX and if it's essential to the code.

AIX is a version of UNIX by IBM and you would know if you needed it or if you used it as it requires a computer with PowerPC processor (no, not the same PowerPC processor Apple used to use - the more powerful POWER line).
 
I'm following this thread with the same problem, but none of it helps. I'm new to Mac and I'm lost. I've downloaded files and tried to install them. Some I think installed and I can't figure out how to load and compile my program. Now I want to delete the file, AquaTerm, but can't figure out how.

Instructions for new Mac users are seriously lacking. I was trying to use Dashboard, reading the instructions and pressing the + key on my keyboard. They don't say it's on the screen.

I don't know if I have x code, but I think I don't. I need simple instructions. I need to download and install the program. Then I need to know how to load my source code and run the program.
 
I'm following this thread with the same problem, but none of it helps. I'm new to Mac and I'm lost. I've downloaded files and tried to install them. Some I think installed and I can't figure out how to load and compile my program. Now I want to delete the file, AquaTerm, but can't figure out how.

Instructions for new Mac users are seriously lacking. I was trying to use Dashboard, reading the instructions and pressing the + key on my keyboard. They don't say it's on the screen.

I don't know if I have x code, but I think I don't. I need simple instructions. I need to download and install the program. Then I need to know how to load my source code and run the program.

It sounds like you would do well to get an introductory book on Mac OS X. There are lots out there. Unfortunately I don't have any experience with them so am unable to make a recommendation.
 
Unfortunately, download and install isn't always an option when you want to do something other than surf/watch/listen. Especially with programming tools, because the authors have a higher expectation of their users.

You do want and need XCode. Visit http://developer.apple.com, register for a free ADC account, and download it. This will be the easiest part of this process, as apple did package this up so that, for the most part, download and install works.

As for the fortran compilers... i linked to places that have binaries available. This should simplify things, but might not make them totally problem free. You are lucky you are not needing to compile from source.

Unfortunately there simply aren't that many people developing fortran on OS X. As such, there isn't going to be a lot of guides. Pick which compiler you want to use, and spend some time on the respective site. If you get XCode and one of the compilers downloaded and installed, and compiling using something like:
gfortran -o test test.F95
or
g95 -o test test.F95
doesn't work, gives you an error, etc. you can post it and we can offer advice.

Being a programmer is as much about mastering tools as it is producing code. A chef might not need to be able to build a convection oven, but knowing how to set it to the proper temperature is pretty important. The expectations might be slightly higher, but again when things are by-programmers, for-programmers they may not be inclined to hold your hand.

-Lee
 
You do want and need XCode. Visit http://developer.apple.com, register for a free ADC account, and download it. This will be the easiest part of this process, as apple did package this up so that, for the most part, download and install works.

Then I'm already in trouble. I visit that site and see an ad, not a registration, nor a download. Where do you see x code there? What is Snow Leopard, an upgraded OS that includes x code? How do I find out what my OS is?
 
Then I'm already in trouble. I visit that site and see an ad, not a registration, nor a download. Where do you see x code there? What is Snow Leopard, an upgraded OS that includes x code? How do I find out what my OS is?

You are, indeed, in trouble, as there are no ads on that page. Two clicks gets you to:
http://developer.apple.com/products/membership.html

If you want to get things done programming, you are going to have to root out information and documentation that is much better hidden than that.

Snow Leopard is the "friendly" name for version 10.6 of OS X. You do not need this to run XCode.

Once you have registered for a free ADC account, visit:
http://developer.apple.com/technology/xcode.html

To download XCode.

To find out what version of OS X you are running, click the Apple menu, then choose "About this Mac..." and a dialog will appear stating the version of your OS, amongst other things.

-Lee
 
Hi!

I don't know if it's to late. But, I has the same problem in februaury.

You must download a compiler for fortran maybe GCC, GFORTRAN or G77, this basically have a simplest installation that you can find in the website of this products. I recomend you that install the .tar.gz that is installed from the terminal, is more expensive in time but is more reliable for this purpouse. Maybe you must know if you computer is PPC or MAC-Intel before you download the package.

The .mat that you must generate with (material.exe) you can compile for MAC like (material.out) you introduces ( $ G77 O- material.for -o material.out) and run (./ material.out) in the folder (cd /penelope/work...) like in the cmd terminal for windows.

And concatenate the .mat files ($ cat material1.mat material2.mat... >> materials.mat) In the same folder.

You run the program for example penmain.out ( ./ penmain.out < simulador.in). You have know that the .in and .geo must be properly defined in the same folder.

You must install the gnuplot, that you can download from the website. And then you can plots the results of this program.

I have a problem with the installation of the gview for mac, his name is POV-RAY maybe is for that they mention: exist this problem with some MAC-Intel; So I have to generate the .geo in Windows (gview2d.exe) and then I go to MAC, for run the program with the geometry definition properly (If you find a solution for this problem, I thank you so much that you tell me). In this case the use of software like parallel desktops is so useful.

There is an issue with gnuplot, you must modified the .gnu files, because there is a little diference between commands in the gnuplot for windows and the gnuplot for MAC, but this is so easy with the utilization of the manual of gnuplot for MAC.

I hope, that you can run this program. Is much more efficent in MAC.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.