libROM icon indicating copy to clipboard operation
libROM copied to clipboard

Add empty Fortran source file to force Fortran linkage in CMake

Open goxberry opened this issue 6 years ago • 0 comments

In the event that we use a CMake-based build system, CMake cannot detect whether BLAS or LAPACK require linking in libraries from a Fortran compiler. This issue does not arise with OpenBLAS or MKL, but does occur with reference BLAS in https://github.com/Reference-LAPACK/lapack.

A fix is discussed in https://cmake.org/pipermail/cmake/2010-July/038172.html by one of the CMake developers: add an empty Fortran source file to the library. This workaround ensures that Fortran libraries are added as dependencies when linking libROM to any executable.

I have a branch that implements this fix as part of work for Youngsoo, and hopefully I'll get around to submitting a PR later this week.

goxberry avatar Sep 25 '19 00:09 goxberry