[CMake] compiler wrappers and linking libraries

🐋 Jan Hegewald jan.hegewald at awi.de
Wed Feb 17 07:45:19 EST 2016


Dear all,
on a system with a cray compiler environment cmake fails to find a blas capable library via

	find_package(BLAS) 

The compilers on this system are wrappers which already link the local blas libraries (from the cray-libsci library). I guess this is why a call to

	check_fortran_function_exists(sgemm HAS_BLAS)
or
	check_function_exists(cblas_sgemm HAS_BLAS)

actually succeeds. (sgemm is a symbol from BLAS)

So the code requires blas functionality, but I can not just call find_package(BLAS) and then add the BLAS_LIBRARIES to the targets linker flags as on other platforms.
Do you think we should refine the FindBLAS.cmake to actually detect if blas is already be found by the compiler/linker and then set BLAS_FOUND to true and BLAS_LIBRARIES to an empty list?

Thanks for any thoughts about this,
Jan 


More information about the CMake mailing list