Closed jbakosi closed 7 years ago
Isn't the compiler version already determined by cmake and stores in ${CMAKE_CXX_COMPILER_VERSION}
?
Indeed, I did not know about that! I will rewrite this to use that instead and extract the major as that is the only thing we need in FindLAPACK.cmake.
Okay, @junghans. This now uses CMAKE_CXX_COMPILER_VERSION
and greps the major and uses that in FindLAPACK.cmake
.
In concert with https://github.com/quinoacomputing/quinoa/pull/150 and https://github.com/quinoacomputing/quinoa-tpl/pull/16.
Attempting to use g++ 7.1, I bumped into this cmake error, coming out of the detection of the gcc version by calling
gcc -dumpversion
from cmake:The fix is a simple guard, checking the length of the list and not querying the minor version if not returned by
-dumpversion
.As the version detection code appears in both tpl and quinoa, I also lifted the corrected code and placed it under the cmake repo in a new file
DetectGCCVersion.cmake
from which both TPL and quinoa can now use it.