title: The MinGW gfortran compiler is not able to compile a simple test program
body: <p>Following <a href="https://stackoverflow.com/q/60586977/4999991">this post</a>, I'm trying to compile <a href="https://github.com/ElmerCSC/elmerfem" rel="nofollow noreferrer">Elmer FEM</a> on Windows using the MinGW compilers. However when running the </p>
  
  <pre><code>cmake -DCMAKE_C_COMPILER=C:\\MinGW\\bin\\gcc.exe -DCMAKE_CXX_COMPILER=C:\\MinGW\\bin\\g++.exe -DCMAKE_Fortran_COMPILER=C:\\MinGW\\bin\\gfortran.exe ..
  </code></pre>
  
  <p>command in the <code>build</code> folder I get the error:</p>
  
  <pre><code>-- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.18363.
  -- The Fortran compiler identification is unknown
  -- Check for working Fortran compiler: C:\MinGW\bin\gfortran.exe
  -- Check for working Fortran compiler: C:\MinGW\bin\gfortran.exe  -- broken
  CMake Error at C:/Program Files/CMake/share/cmake-3.16/Modules/CMakeTestFortranCompiler.cmake:45 (message):
    The Fortran compiler
  
      "C:\MinGW\bin\gfortran.exe"
  
    is not able to compile a simple test program.
  
    It fails with the following output:
  
      Change Dir: C:/Users/foobar/Desktop/elmer/elmerfem/build/CMakeFiles/CMakeTmp
  
      Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTC_8d573 &amp;&amp;
      Microsoft Visual Studio 2017 Version 15.0.28010.2050.
      Copyright (C) Microsoft Corp. All rights reserved.
  
      Some errors occurred during migration. For more information, see the migration report:
      C:\Users\foobar\Desktop\elmer\elmerfem\build\CMakeFiles\CMakeTmp\UpgradeLog.htm
  
      Invalid project
  </code></pre>
  
  <p>from <a href="https://stackoverflow.com/a/53635241/4999991">here</a> I tried adding the </p>
  
  <pre><code>set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
  </code></pre>
  
  <p>to the <code>CmakeLists.txt</code> file, running the <code>cmd</code> as admin from <a href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/207460115/comments/207678629" rel="nofollow noreferrer">here</a>, and from <a href="https://stackoverflow.com/a/59361133/4999991">here</a> tried uninstalling (from Chocolatey) and re-installing MinGW from the original website with no avail. I would appreciate it if you could help me know what is the problem and how I can solve it.</p>
  
  <p><strong>P.S.</strong> To solve the above issue one shoudl use the command:</p>
  
  <pre><code>cmake -DCMAKE_C_COMPILER=C:/MinGW/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/MinGW/bin/g++.exe -DCMAKE_Fortran_COMPILER=C:/MinGW/bin/gfortran.exe -DCMAKE_MAKE_PROGRAM=C:/MinGW/bin/mingw32-make.exe .. -G "MinGW Makefiles"
  </code></pre>
  
  <p>But then there is the missing BLAS issue. I'm trying to solve. this using MSYS2</p>