Thanks @ivanpribec for clarifying this issue. I need the inverse explicitly, indeed.
Already tried to link the code to the linear algebra library by: C:\sandbox>gfortran FEM.f90 -o FEM.exe -L/C:/sandbox -lapack
where this is the directory I have placed the lapack.f and blas.f files, but this returns: c:/mingw/bin/…/lib/gcc/mingw32/6.3.0/…/…/…/…/mingw32/bin/ld.exe: cannot find -lapack collect2.exe: error: ld returned 1 exit status
so, something must be missing from the command, right?
Not exactly. Unfortunately my Windows PC is down, so I cannot guide you through the process. But you can try to follow the instructions at http://icl.cs.utk.edu/lapack-for-windows/lapack/ Seeing that you use mingw you should look under the section “Prebuilt dynamic libraries using Mingw”.
In case you have experience using CMake, you can try and follow the “Easy Windows Build” path (this will compile the LAPACK library on your computer). Depending on where your LAPACK library gets installed, you might need to modify your PATH environment variable.
Then you should be able to compile your example with:
gfortran FEM.f90 -o FEM.exe -lapack -lblas
Personally, I like to use the Windows Subsystem for Linux which I find is much easier to set up for Fortran development. But I would be happy to learn from other Windows users on our Discourse, how do they get their Fortran development environment set up with Lapack, BLAS, fftw, etc. ? (assuming they are not using Simply Fortran, or Visual Studio + Intel Compiler)