Author Topic: GNU Fortran compiler not found  (Read 4555 times)

Offline timetobakethedonuts

  • Single posting newcomer
  • *
  • Posts: 3
GNU Fortran compiler not found
« on: October 03, 2021, 09:03:13 pm »
I am new to Code::Blocks.  I did a full install of codeblocks-20.03mingw-setup.exe on my Windows 10 computer, and selected the GNU Fortran Compiler.  I have a C:\Program Files\CodeBlocks\MinGW directory from the install, but in toolchain executables, when I do autodetect after filling in this directory name it tells me the executable can not be found in the directory.

I am lost and this is pretty complicated to a newcomer.  I spent 45 minutes searching the internet unsuccessfully for how to download just the GNU Fortran compiler, thinking I could add it to this directory.  I was not confident that I found a stand alone compiler - some looked like other IDEs.

Can someone please assist?  The installer I used is advertised to include the Fortran compiler.  Thank you in advance.

*edit* I realize this a very basic problem, but tried a couple of ways of researching it and came up empty.  The nature of open source in this case is making it hard to find out even what the name of the compiler executable is that should be in the folder above.  Also, why it isn't there, and how to go about adding one.
« Last Edit: October 04, 2021, 01:44:45 am by timetobakethedonuts »

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: GNU Fortran compiler not found
« Reply #1 on: October 04, 2021, 01:48:24 am »
Try the following page for Fortran support and ask in the fortran forum via the link on the page:
    https://cbfortran.sourceforge.io/

Offline timetobakethedonuts

  • Single posting newcomer
  • *
  • Posts: 3
Re: GNU Fortran compiler not found
« Reply #2 on: October 04, 2021, 02:44:17 am »
Try the following page for Fortran support and ask in the fortran forum via the link on the page:
    https://cbfortran.sourceforge.io/
OK, thank you.  I had no idea there may be as better place to ask.  I assume Fortran is not widely used - at least not as widely as when I learned F77 back in the day.  I appreciate the tip.  Sourceforge was where a landed while looking for a Fortran compiler, but it looked like it may be its own IDE - but it appeared the version I downloaded should come with the Fortran compiler.  Hopefully there is an easy answer.

I see now that apparently the file it is looking for is mingw32-gfortran.exe.  It is confusing, because in the toolchain executables window, there are boxes for C and C++ compiler and they both have mingw32-gfortran.exe in them.  Also, I reinstalled, and I noticed that MinGW compiler suite installation element states that additional downloads are needed.  So maybe by design an additional download is needed for the F compiler.
« Last Edit: October 04, 2021, 03:10:29 am by timetobakethedonuts »

Offline gd_on

  • Lives here!
  • ****
  • Posts: 796
Re: GNU Fortran compiler not found
« Reply #3 on: October 04, 2021, 12:49:05 pm »
if you have installed codeblocks-20.03mingw-setup.exe, gfortran is included in the distribution (located in MinGW\bin same place as gcc, g++ ....)
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline timetobakethedonuts

  • Single posting newcomer
  • *
  • Posts: 3
Re: GNU Fortran compiler not found
« Reply #4 on: October 04, 2021, 03:22:11 pm »
if you have installed codeblocks-20.03mingw-setup.exe, gfortran is included in the distribution (located in MinGW\bin same place as gcc, g++ ....)
I did find gfortran.exe in the bin directory.  This is not intuitive to me - I thought it was looking for mingw32-gfortran.exe, but the fact these are in boxes labelled C and C++ it isn't clear they are for FORTRAN at all.  I changed the entries in the C and C++ boxes from "mingw32-gfortran.exe" to "gfortran.exe" and hit autodetect - that still gave an error.  But sure enough, now I have the compiler!  Thank you for replying.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 796
Re: GNU Fortran compiler not found
« Reply #5 on: October 04, 2021, 03:33:33 pm »
have a look in the wiki, or in the user manual.
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).