Author Topic: Setting up and using the GFortran plugin.  (Read 20830 times)

Offline Henrici

  • Single posting newcomer
  • *
  • Posts: 2
Setting up and using the GFortran plugin.
« on: August 13, 2010, 05:06:18 am »
My goal is to find a free and relatively easy to use Fortran based IDE for Linux.  I am interested in compiling and debugging in a manner similar to setting break points in Visual Studio for C/C++/C#.  I understand Code::Blocks with GFortran seems to be one such solution to this problem.

I am relatively new to Linux and all the assortment of things that can be done with it.  My primary OS is currently Windows 7 (64 bit), and I have managed to successfully install and configure Ubuntu 10.04 (64 bit) inside VirtualBox.  I have installed Mono and Code::Blocks as well.  All appears working ok thus far.

So now I want to configure GFortran for Code::Blocks.  I did find the link [http://wiki.codeblocks.org/index.php?title=Installing_Fortran_Compiler], but I have been unsuccessful in really understanding the steps in the link and getting the Fortran plugin to work.  In fact, I believe the link has several referenced steps that don't apply, and may be leaving out many assumed steps.  I could really use some more help.  Please know my gfortran is installed at /usr/bin, and that is what I used in the steps.

I must be misunderstanding something ... all the configuration I mentioned above I did in roughly a day with very little Linux knowledge ... I can't see why the Fortran plugin for Code::Blocks should pose more of a challenge but it has me stumped.


Offline Henrici

  • Single posting newcomer
  • *
  • Posts: 2
Re: Setting up and using the GFortran plugin.
« Reply #1 on: August 13, 2010, 05:18:20 am »
Here are my steps:

[1]  Code::Blocks > Compiler and debugger settings.
[2]  Click Copy to copy the GNU GCC Compiler settings.
[3]  Type GFortran in the Add new compiler dialog and click Ok.
[4]  Though the link does not even mention the Toolchain and executables tab, that is the only place I could find a compiler installation directory and I specified /usr/bin since that is where GFortran is installed.

I am lost at this point.  The link suggests I should fill the strings for C Compiler, etc... My question is why do I even have that choice there to fill in?  This is a FORTRAN compiler, not a C or C++ compiler so filling in something for that seems totally unrelated.  Never-the-less, I put "GFortran" for EVERY string in the Program Files tab under the Toolchain executables tab.  Is this correct?  Now what?

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Setting up and using the GFortran plugin.
« Reply #2 on: August 13, 2010, 07:49:54 am »
Someone correct me if I'm wrong, but you shouldn't need to add paths on a linux install. Fortran on linux should know how to find whatever libs are required.

Never-the-less, I put "GFortran" for EVERY string in the Program Files tab under the Toolchain executables tab.  Is this correct?  Now what?

Try creating and building a new Fortran project with a simple hello world app. Make sure the Fortran compiler is selected in the project build options.

However, before you do this it is worth your time to try compiling the same app on the command line without Code::Blocks to make sure you have Fortran installed correctly.
« Last Edit: August 13, 2010, 07:52:00 am by dmoore »

Offline gib

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Setting up and using the GFortran plugin.
« Reply #3 on: September 03, 2010, 10:50:18 am »
You certainly don't want "gfortran" in each field.  I'm using MinGW (i.e. Windows), but Linux shouldn't be much different.  I just needed to provide the compilers installation directory (this is the root for the gcc install, in my case, for example, C:\mingw-4.5.1) then CB automatically fills in all the program fields.  These are:
gfortran.exe
gfortran.exe
gfortran.exe
ar.exe
gdb.exe
windres.exe
ming32-make.exe

You should see something similar.