I'm trying to clean up a legacy C-FORTRAN FLOSS code and I'm facing a rather bizarre error. There are some libraries/folders added via the add_subdirectory in the top CMakeLists.txt file. Running the cmake .. command in the build folder successfully generates the MakeFile s (except some minor warnings which might be false positive). However, when compiling with make I get a wiered error:

Scanning dependencies of target umfpack mingw32-make[2]: Leaving directory '/path/to/elmerfem/build' mingw32-make[2]: Entering directory '/path/to/elmerfem/build' [ 46%] Building C object umfpack/src/umfpack/CMakeFiles/umfpack.dir/umfpack_timer.c.o mingw32-make[2]: *** No rule to make target '/mingw64/include/cblas.h', needed by 'umfpack/src/umfpack/CMakeFiles/umfpack.dir/umfpack_tictoc.c.o'. Stop. mingw32-make[2]: Leaving directory '/path/to/elmerfem/build' mingw32-make[1]: *** [CMakeFiles/Makefile2:265: umfpack/src/umfpack/CMakeFiles/umfpack.dir/all] Error 2 mingw32-make[1]: Leaving directory '/path/to/elmerfem/build' mingw32-make: *** [Makefile:163: all] Error 2

which I don't know how to debug. In this case the /mingw64/include/cblas.h exists, and the prior CMake outputs:

-- Looking for Fortran sgemm -- Looking for Fortran sgemm - found -- Found BLAS: /mingw64/lib/libopenblas.dll.a -- Looking for Fortran cheev -- Looking for Fortran cheev - found -- A library with LAPACK API found. -- ------------------------------------------------ -- BLAS library: /mingw64/lib/libopenblas.dll.a -- LAPACK library: /mingw64/lib/libopenblas.dll.a

Show that BLAS and LAPACK have been successfully found.

I would appreciate it if you could help me know what is the problem and how I can fix it. Thanks for your kind support in advance.

The environment is:

MSYS2: MSYS_NT-10.0-18363

Windows Version 1909

cmake version 3.15.5

GNU Make 4.3

gcc.exe (Rev1, Built by MSYS2 project) 9.3.0

P.S.1. I just tested the code on macOS and it compiled with no problem. So it seems to be a Windows/MSYS2 specific problem.

P.S.2. I was told that I should install suitesparse library so I did

pacman -S mingw64/mingw-w64-x86_64-suitesparse

it did not help.

P.S.3. Also following this Tweet, I should clarify that I'm using MSYS2's packages for CMake and GNU Make as explained here and here.