Author Topic: Fortran compilers  (Read 427 times)

Offline sospel

  • Multiple posting newcomer
  • *
  • Posts: 10
Fortran compilers
« on: January 31, 2019, 05:55:41 pm »

Hello  :)

Wishing to complete a big program of astronomical calculations written several years ago in FORTRAN 90, I thought of using the " CODE-BLOCKS " environment  to benefit from its numerous advantages: IDE, forums, compilers, etc. etc....

So, I have  downloaded yesterday the version 17.12 and I installed it with no problem  on my  HP/WINDOWS  computer.

To test first of all a simple example using the FORTRAN, I noticed with pleasure that the panel " Global Compiler Settings " allows to select among numerous options that of the choice of a Fortran compiler  :

- GNU Fortran Compiler
- G95 Fortran Compiler
- PGI Fortran Compiler

I began by choosing GNU ==> the BUILD and RUN ran with no problem 
But it is not the same with the two other compilers , because by clicking on "OK" for their choice, I have a message: " couldn't find compile executable in your configured search for the G95 (or PGI) fortran compile "

Now, by downloading the version 17.12, I had understood that all the compilers were in downloaded package...

Where from a first question : how to make if I wish to use G95?

And, at the same time if possible:what is the most successful (speed, accuracy of the calculations) three?

Thank you in advance for any answer!
Cordially
SosPel

PS : I hope my topic is on the right place  ;)

Offline gd_on

  • Regular
  • ***
  • Posts: 443
Re: Fortran compilers
« Reply #1 on: January 31, 2019, 06:30:12 pm »
Version 17.12 is effectively provided with a fortran compiler, but :
1) only a gnu compiler is given. For g95, pgi, you'll have to find them elsewhere and install by yourself;
2) the gnu gfortran provided with C::B 17.12 is the last TDM version 5.1. It's OK for the hello program, but it's bugged for more complex programs : particularly when you try to open a file to read data, it crashes. Many posts describe this problem in this forum and some possible workarounds. It has been corrected in official 5.2 versions, but unfortunately TDM versions are now abandonned;
3) you can also install 8.1 version from MinGW 64 Gnu project (version 64 bits, seh, posix for example). It's normally OK. I think it's the version used to generate the last nightly builds of CodeBlocks, and will be probably distributed with the next official version (but I have no idea when ...)
Windows 10 or 7, svn C::B (last version or almost!), WxWidgets 2.8.12, Compilers TDM 4.9.2 32 bits (gcc and gfortran installed in C:\MinGW32). Tests with C::B 64 bits and WxWidgets 2.8.12 or 3.1.2 (64 bits) compiled by TDM 4.9.2 or Std 8.1 in C:\MinGW64

Offline sospel

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Fortran compilers
« Reply #2 on: February 01, 2019, 09:57:35 am »

@gd_on

Thanks  for your answer !

According to your advice, I have just downloaded MinGW 64 Gnu project.
But I do not know how to use this compiler in CodeBlocs : (
have you  a link towards a document which would tell me what I have to make ?

Thank you in advance!
Cordially
SosPel

Offline gd_on

  • Regular
  • ***
  • Posts: 443
Re: Fortran compilers
« Reply #3 on: February 01, 2019, 11:24:29 am »
In the wiki, general guidelines : http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler
a little bit outdated, but correct : http://forums.codeblocks.org/index.php/topic,13090.msg89007.html#msg89007
and many information by searching in the forum with, for example, those keys : gfortran install
You can also in setting/compilers, duplicate an existing compiler (gcc for example, gnu fortran), rename it, and adjusting the path and names of executables.
Other informations in the user manual : http://www.codeblocks.org/user-manual
or
http://wiki.codeblocks.org/index.php/MinGW_installation
or
https://medium.com/@yzhong.cs/code-blocks-compile-64-bit-under-windows-with-mingw-w64-79101f5bbc02
...



« Last Edit: February 01, 2019, 12:27:04 pm by gd_on »
Windows 10 or 7, svn C::B (last version or almost!), WxWidgets 2.8.12, Compilers TDM 4.9.2 32 bits (gcc and gfortran installed in C:\MinGW32). Tests with C::B 64 bits and WxWidgets 2.8.12 or 3.1.2 (64 bits) compiled by TDM 4.9.2 or Std 8.1 in C:\MinGW64

Offline sospel

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Fortran compilers
« Reply #4 on: February 02, 2019, 03:06:57 pm »
 
@gd_on
   
Hello !
thanks for the many tips to install a FORTRAN compiler:).

Based on your advice in previous post:

" 3) you can also install 8.1 version from MinGW 64 Gnu project (version 64 bits, seh, posix for example). It's normally OK "

I choose to install this version of MINGW64.   I will then anticipate the next version of CODEBLOCKS!!

So here I am ready to program in Fortran with a good FORTRAN compiler in CB!

Cordially   :)
Sospel