Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran - Cygwin, gfortran and emacs!

  1. Aug 31, 2008 #1

    I am in need of assistance, not with code, but with simply setting Fortran up in XP.

    I am under the impression that I need cygwin, gfortran/g95 and emacs. I installed Cygwin, and downloaded some file tree (gfortran-4.4-Cygwin-i686.tar). But I do not know where to get the 'emacs' that I need!

    Please help if you can, it should be obvious that I dont know anything about this!
  2. jcsd
  3. Sep 1, 2008 #2


    User Avatar
    Science Advisor
    Homework Helper

    You don't NEED emacs - it's just an editor (heresy I know)
    You can use any editor - emacs does have a lot of features and configurability
    you can get binariers from http://ftp.gnu.org/gnu/emacs/windows/ (look for .zip)

    I use notepad++, it has syntax highlighting for most languages
  4. Sep 1, 2008 #3
    Thx. I choose 'emacs-22.2-bin-i386.zip ', now Im not sure how to install it or what to do with it. I didnt think it would be this hard to get it going on my machine!:rofl::cry:

    So, what I have now is Cygwin installed... which Im not exactally sure what it does. It lets me run some linix like things, but it is not an emulator... I also have the emac zip file and some gfortran zip file.

    So Im guessing I need to somehow get the emac going as the editor, and point it to the gfortran file tree for the compiler?
  5. Sep 1, 2008 #4


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

  6. Sep 1, 2008 #5
    I never heard of it before.

    I installed codeblocks, but am still stuck... It says I need to link it to gfortran.exe under the program tab, but I see no program tab nor do I have gfotran.exe. When I download gfortran I get an archive containing a file tree, not a .exe file.
  7. Sep 1, 2008 #6


    User Avatar
    Science Advisor
    Homework Helper

    When you download gfortran - assuming you download the binaries there is probably a directory called bin, the gfortran.exe will be in there.
    The windows binaries are available from http://gcc.gnu.org/wiki/GFortranBinaries

    If you run it from the commandline, you will have to put the bin directory on your path, or tell the ide where to find it.
  8. Sep 2, 2008 #7


    User Avatar
    Science Advisor

    When you install Cygwin, it comes "stock" barebones. If it downloaded/installed in just a minute or so, then you have nothing in it.

    Go back through, and in the installation options there is a part where there are a ton of things that are optionally included. If you click the very top cross mark it will install everything. Do note that this take a minute for the computer to update everything.

    Then the download/install will take more on the order of an hour or two IIRC. Then you should have emacs/VIM ready to use. I 'believe' it may come with g95 at that point, although you may need to install separately. Do note that when you download g95 (if you choose to use that one), there are different downloads for linux/windows/CYGWIN so choose appropriately.

    I personally prefer VIM because that's what I was tought on, but any text editor will work for you. I do prefer VIM though because you are basically working in the shell, so you can save, exit the file, then do any shell work you need, including quick compilation/code execution, etc.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook