I use "MinGW Makefile" generator and Intel Parallel Studio XE 2015 to build mylib under windows 7 command console:
D:\dev\cmake\fortran_depend_fpp\build>cmake -G"MinGW Makefiles" -DCMAKE_Fortran_ COMPILER=ifort ..\src -- The Fortran compiler identification is Intel 18.104.22.16850121 -- Check for working Fortran compiler: C:/Intel/Composer XE 2015/bin/intel64/ifo rt.exe -- Check for working Fortran compiler: C:/Intel/Composer XE 2015/bin/intel64/ifo rt.exe -- works -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Checking whether C:/Intel/Composer XE 2015/bin/intel64/ifort.exe supports For tran 90 -- Checking whether C:/Intel/Composer XE 2015/bin/intel64/ifort.exe supports For tran 90 -- yes -- Configuring done -- Generating done -- Build files have been written to: D:/dev/cmake/fortran_depend_fpp/build
When building library mylib, it failed:
D:\dev\cmake\fortran_depend_fpp\build>mingw32-make mylib Scanning dependencies of target mylib [ 33%] Building Fortran object CMakeFiles/mylib.dir/x.f90.obj D:\dev\cmake\fortran_depend_fpp\src\x.f90(4): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [Z] use z ------^ compilation aborted for D:\dev\cmake\fortran_depend_fpp\src\x.f90 (code 1) CMakeFiles\mylib.dir\build.make:61: recipe for target 'CMakeFiles/mylib.dir/x.f9 0.obj' failed mingw32-make: *** [CMakeFiles/mylib.dir/x.f90.obj] Error 1 CMakeFiles\Makefile2:104: recipe for target 'CMakeFiles/mylib.dir/all' failed mingw32-make: *** [CMakeFiles/mylib.dir/all] Error 2 CMakeFiles\Makefile2:117: recipe for target 'CMakeFiles/mylib.dir/rule' failed mingw32-make: *** [CMakeFiles/mylib.dir/rule] Error 2 Makefile:130: recipe for target 'mylib' failed mingw32-make: *** [mylib] Error 2
The reason is that x.f90 is compiled before z.f90. It seems that the makefile doesn't contain the rule about module x's dependency on module z. How could I correct it? Thanks in advance for your suggestions.
BTW: the "Visual Studio 12 2013" generator works fine.