[CMake] FindBlas and header file "blas.h"

Nicholas Kinar n.kinar at usask.ca
Fri Mar 1 11:50:06 EST 2013


Hello,

On Ubuntu 12.04, I am compiling some third-party program code that 
#includes the BLAS header file "blas.h".  Although Cmake does find the 
BLAS and LAPACK libraries, I receive the following gcc compiler error:

fatal error: blas.h: No such file or directory

I've tried to change this include to  other files such as "lapacke.h" 
but the include file is still not found.  What I am doing wrong here?  
My Cmake file is reproduced below.

Nicholas

#################################################
cmake_minimum_required (VERSION 2.6)
project (stretch-test)

find_package( BLAS REQUIRED )
find_package( LAPACK REQUIRED )

set(CMAKE_C_FLAGS "-std=c99")

include_directories(${BLAS_INCLUDE_DIR} ${LAPACK_INCLUDE_DIR})

add_executable( stest
main.c)
# also link with C math library
TARGET_LINK_LIBRARIES(stest m blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})


More information about the CMake mailing list