Author Topic: Set up code blocks for fortran77  (Read 14788 times)

Offline Triscas

  • Single posting newcomer
  • *
  • Posts: 8
Set up code blocks for fortran77
« on: November 12, 2012, 02:42:43 pm »
Hello, this is my first experience trying to set up the code blocks and I'm a bit lost. I have windows XP and I try to install the next software:
-MinGW (tdm gcc 4.7.1.2)
-Codeblocs fortran v1.0 win

I'm following this "how to do" but I don't understand the step 3 http://wiki.codeblocks.org/index.php?title=Installing_Fortran_Compiler
Some one could explain the details?

Thanks in advance.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Set up code blocks for fortran77
« Reply #1 on: November 12, 2012, 03:22:38 pm »
Some one could explain the details?
If you don't have in mind to use Fortran with C::B, skip this step. Otherwise checkout the Fortran Project plugin by "darmar" (search the forums).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Triscas

  • Single posting newcomer
  • *
  • Posts: 8
Re: Set up code blocks for fortran77
« Reply #2 on: November 12, 2012, 03:42:10 pm »
Some one could explain the details?
If you don't have in mind to use Fortran with C::B, skip this step. Otherwise checkout the Fortran Project plugin by "darmar" (search the forums).

I want to use it just with fortran77. I'll check the darmar plugin.

Edit: I had already checked this plugin, it's what i'm trying to setp up. My problem with step 3 is how to configure the path. The error toolchain path is not set up correctly is reported to me in codeblocks.
« Last Edit: November 12, 2012, 03:54:58 pm by Triscas »

Offline Triscas

  • Single posting newcomer
  • *
  • Posts: 8
Re: Set up code blocks for fortran77
« Reply #3 on: November 12, 2012, 03:55:46 pm »
By the way, to compile fortran 77 gfortran is compatible?

zabzonk

  • Guest
Re: Set up code blocks for fortran77
« Reply #4 on: November 12, 2012, 04:58:51 pm »
gfortran apparently does not  support fortran77, at least via the -std option. See http://gcc.gnu.org/wiki/GFortranG77
« Last Edit: November 12, 2012, 05:01:59 pm by Neil Butterworth »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Set up code blocks for fortran77
« Reply #5 on: November 12, 2012, 05:37:49 pm »
My problem with step 3 is how to configure the path. The error toolchain path is not set up correctly is reported to me in codeblocks.
Don't be too strict on these rules. Each GCC compiler package might have different names for the executables. So please check:
- Do you actually have the Fortran compiler package installed? -> Its not shipped with each GCC by default!
- What are the names of the required executables for your compiler distro?
- Enter these accordingly into the toolchain setup.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Triscas

  • Single posting newcomer
  • *
  • Posts: 8
Re: Set up code blocks for fortran77
« Reply #6 on: November 12, 2012, 07:19:23 pm »
Following this "how to do" http://wiki.codeblocks.org/index.php?title=Installing_Fortran_Compiler:

+To attach the GNU Fortran 77 Compiler (G77) the following steps are required:

    * Make a copy of the GNU GCC compiler as follows:
   .
   .
   .
Done


      * Setup the compiler as follows:

1.) The path etc. should be as of the GCC Compiler. If this has been setup correctly, no changes are required. Otherwise refer to the setup of the GNU GCC compiler.

2.) Change under the "Programs" tab: "C compiler" = "g77.exe", "Linker for dynamic libs": "g77.exe" When I've changed the path to c:\MinGW32\compiler I got that and I didn't change it--> "C compiler" = "mingw32-gcc.exe", "Linker for dynamic libs": "mingw32-gcc.exe" (actually is also in the c++ compiler option.

3.) If you mix Fortran with C programs then add "-lg2c" in the "Linker" tab (and "-lstdc++" if you have mixed Fortran/C and C++ projects) under "Other linker options". --> Not mixing, then I skip this step

    * Important: Make sure the path environment is setup to really point a path that contains the Fortran compiler suite. C::B with MinGW does NOT include the Fortran compiler. You may download the compiler under MinGW webpage. "gcc-g77-3.4.2-20040916-1.tar.gz" is the name of the package I expect you want. --> I don't know exactly what should I do with this.

+Adding new Fortran file type

Done

+Setting up Fortran projects

To work with Fortran files, do the following: Add a (new) file to the project, saved as "your_fortran_file.f". Verify it's recognised as "Fortran Sources" file type. If not verify you have done the steps above correctly. To enable compiling the project which includes Fortran files follow these steps:

    * Right click on the project, select "Build options" and make sure you have selected the "GNU G77 compiler" (see steps above).
    * Right click on the "your_fortran_file.f" file and select "Properties".

1.) Enable "Compile file" and "Link file".

2.) Under the "Advanced" tab enter "CC" as compiler variable
It says can't find compiler executable in my configurated path


I really need some help. Thanks for the answers.
« Last Edit: November 12, 2012, 07:22:38 pm by Triscas »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Set up code blocks for fortran77
« Reply #7 on: November 12, 2012, 08:39:21 pm »
Al-right, once again to summarise:

- I told you in my previous post and you read about it in the WiKi, that C::B does not ship with a Fortran compiler. Full stop.
- C::B tells you it cannot find the compiler executable "g77.exe" - that's the error you see.

So once again what you need to do now:
- Choose a Fortran compiler of your choice that is compatible to the GCC compiler framework you are using
- Install the Fortran compiler
- Verify that:
- What are the names of the required executables for your compiler distro?
- Enter these accordingly into the toolchain setup.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ