Quantcast Fortran - Cygwin, gfortran and emacs! Text - Physics Forums Library

PDA

View Full Version : Fortran - Cygwin, gfortran and emacs!


DieCommie
Aug31-08, 11:08 PM
Hello,

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!

mgb_phys
Sep1-08, 01:20 AM
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

DieCommie
Sep1-08, 02:35 AM
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?

vanesch
Sep1-08, 04:07 AM
Why don't you go for code::blocks ?

http://www.codeblocks.org/

and
http://wiki.codeblocks.org/index.php?title=Installing_Fortran_Compiler
?

DieCommie
Sep1-08, 09:57 AM
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.

mgb_phys
Sep1-08, 10:44 AM
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.

minger
Sep2-08, 11:33 AM
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.