Author Topic: fortran codeblocks  (Read 557 times)

Offline dimitris

  • Single posting newcomer
  • *
  • Posts: 4
fortran codeblocks
« on: February 03, 2017, 05:37:00 pm »
I am new here and I don't know if it is the propper place for asking this type of questions.
I use Code::Blocks as IDE for C++. Everything works fine.
But I can' t figure out what is the relevant procedure for creating a Fortran program.
I have downloaded this version of Code:Blocks codeblocks-16.01mingw-setup.exe
Should I download CBFotran?
When I ask the program to create a Fortran application the following minimal file is created
Code: [Select]
A fortran95 program for G95
! By WQY
program main
  implicit none
  integer re_i
  write(*,*) "Hello World!"
  re_i = system("pause")
end

But the program cannot compile it.
Should I download indepentantly a compiler?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5777
    • My Best Post
Re: fortran codeblocks
« Reply #1 on: February 03, 2017, 06:35:25 pm »
Code::Blocks is just an IDE; so, yes, you need to download an Compiler!

Note: The CB Installer with mingw in it's filename does have an C++/C Compiler; no idea if it has a FORTRAN compiler.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dimitris

  • Single posting newcomer
  • *
  • Posts: 4
Re: fortran codeblocks
« Reply #2 on: February 03, 2017, 06:44:15 pm »
Thanks a lot for your the quick reponse.
How I can detect if there is already a compiler?
If there is not and supposing I have downloaded one like gfortran how can I guide Code:Blocks to detect the compiler?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5777
    • My Best Post
Re: fortran codeblocks
« Reply #3 on: February 03, 2017, 06:48:02 pm »
Under the CB Installation folder there is a mingw folder look at the exe files in [the bin sub-folder]; does one have fortran in its name or not.

Tim S.
« Last Edit: February 03, 2017, 06:50:02 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5777
    • My Best Post
Re: fortran codeblocks
« Reply #4 on: February 03, 2017, 06:57:55 pm »
Just looked at the CB Downloads; I would guess the only one with an FORTRAN compiler is the one with fortran in its filename.
https://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01mingw_fortran-setup.exe/download

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dimitris

  • Single posting newcomer
  • *
  • Posts: 4
Re: fortran codeblocks
« Reply #5 on: February 03, 2017, 08:33:25 pm »
Thank you very much for the useful replies.
I hope that I will not face a problem.

Offline dimitris

  • Single posting newcomer
  • *
  • Posts: 4
Re: fortran codeblocks
« Reply #6 on: February 03, 2017, 09:58:48 pm »
No, there is not a Fortran Compiler in
...\CodeBlocks\MinGW\bin
I guess I have to install one there.
In fact I followed the procedure described here
https://doc-14-7o-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/gl5vs6g6j5s5liu79nkbqjgnqhfblntt/1486152000000/02552863230247067214/*/1n5a91xiRR-LDm1xFC0MgCWn3QJ8sYHX0bz1GZ7cZo_BuYOxNYESpQfoIz8N9
Everything works fine.

Offline Kousha

  • Single posting newcomer
  • *
  • Posts: 1
Re: fortran codeblocks
« Reply #7 on: March 12, 2017, 12:59:43 pm »
Read the instructions in this link:
http://gdurl.com/s20W

Then, download the file at this address and install it:
http://users.humboldt.edu/finneyb/gfortran-windows-20140629.exe

I hope this helps
Kousha