Fortran and Mac

Discussion in 'Mac Programming' started by tirwit, Jan 20, 2010.

  1. tirwit macrumors newbie

    Joined:
    Jan 20, 2010
    #1
    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
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #3
    There's likely no reason that you could not do this work on OS X.
    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
     
  3. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    Google keywords: mac os fortran

    Seriously.

    The first page of hits shows compilers, past MacRumors posts on Fortran, and a wealth of other links.
     
  4. tirwit thread starter macrumors newbie

    Joined:
    Jan 20, 2010
    #5
    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
     
  5. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #6
    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).
     
  6. lloydjay macrumors newbie

    Joined:
    Feb 5, 2010
    #7
    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.
     
  7. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #8
    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.
     
  8. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #9
    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
     
  9. lloydjay macrumors newbie

    Joined:
    Feb 5, 2010
    #10
    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?
     
  10. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #11
    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
     
  11. lloydjay macrumors newbie

    Joined:
    Feb 5, 2010
    #12
    Access Denied

    I set up the account. I have 10.6.1
     
  12. Cavidal macrumors newbie

    Joined:
    May 13, 2010
    #13
    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.
     

Share This Page