Fortran - Cygwin, gfortran and emacs

In summary, you need to install Cygwin (it may come with g95), and then download and install emacs and gfortran.
  • #1
DieCommie
157
0
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 don't know anything about this!
 
Technology news on Phys.org
  • #2
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
 
  • #3
Thx. I choose 'emacs-22.2-bin-i386.zip ', now I am 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 I am not exactally sure what it does. It let's 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 I am guessing I need to somehow get the emac going as the editor, and point it to the gfortran file tree for the compiler?
 
  • #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.
 
  • #6
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.
 
  • #7
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.
 

1. What is Fortran and why is it used?

Fortran is a high-level programming language commonly used in scientific and engineering fields for numerical calculations. It is well-suited for handling complex mathematical operations and is often used for creating simulations and mathematical models.

2. What is Cygwin and how does it relate to Fortran?

Cygwin is a software tool that provides a Unix-like environment on Windows operating systems. It allows for the use of Unix commands, such as gfortran, which is a free Fortran compiler. Cygwin is often used as a platform for working with Fortran on Windows.

3. What is gfortran and how is it different from other Fortran compilers?

Gfortran is a free and open-source Fortran compiler that is part of the GNU Compiler Collection (GCC). It is widely used and supports the latest Fortran standards. Unlike other Fortran compilers, gfortran does not require a license and can be used on multiple platforms.

4. Can I use an integrated development environment (IDE) for Fortran on Cygwin?

Yes, you can use an IDE such as Emacs for Fortran programming on Cygwin. Emacs is a popular text editor that supports syntax highlighting and debugging features for Fortran. It can be easily installed and configured on Cygwin for a more user-friendly coding experience.

5. Is Fortran still relevant in modern scientific computing?

Yes, Fortran is still widely used in scientific computing and remains a popular choice for numerical calculations. It has a long history and a large library of numerical routines, making it a reliable and efficient option for scientific programming. Additionally, new versions of Fortran continue to be developed and updated to meet the demands of modern computing.

Similar threads

  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
2
Views
6K
  • Programming and Computer Science
Replies
17
Views
4K
  • Programming and Computer Science
Replies
1
Views
5K
  • Programming and Computer Science
Replies
6
Views
2K
  • Programming and Computer Science
Replies
1
Views
2K
  • Programming and Computer Science
Replies
2
Views
17K
  • Programming and Computer Science
Replies
1
Views
1K
Back
Top