[CMake] FindBlas and header file "blas.h"
Tim Gallagher
tim.gallagher at gatech.edu
Fri Mar 1 13:06:34 EST 2013
And have you tried printing out the value of BLAS_INCLUDE_DIR? I'm not sure that actually exists, I don't see it set in my FindBLAS.cmake module.
What is the path to blas.h? Have you verified it exists and is in one of the standard include locations such as /usr/include, /usr/local/include etc?
It's possible it is in something like /usr/include/blas/blas.h and so it isn't found by default.
Tim
----- Original Message -----
From: "Nicholas Kinar" <n.kinar at usask.ca>
To: "tim gallagher" <tim.gallagher at gatech.edu>
Cc: cmake at cmake.org
Sent: Friday, March 1, 2013 12:57:33 PM
Subject: Re: [CMake] FindBlas and header file "blas.h"
On 01/03/2013 11:43 AM, Tim Gallagher wrote:
> Have you installed the development package for blas and lapack? Typically distributions have a library-only package and then a development package that includes the headers. Check for libblas-dev in Ubuntu.
>
> Tim
>
Thanks, Tim; yes, I can verify that I have installed the developer
packages. Here is my bash output when I try to use sudo to install
libblas-dev.
nkinar at Betty:~$ sudo apt-get install libblas-dev
[sudo] password for nkinar:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libblas-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Moreover, running Cmake (via make compilation) tells me that the files
are found; however, the "blas.h" header file is not found.
nkinar at Betty:/media/RESEARCH/DEVELOP-SEISMIC/dip$ make
-- A library with BLAS API found.
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Configuring done
-- Generating done
-- Build files have been written to: /media/RESEARCH/DEVELOP-SEISMIC/dip
[ 9%] Building C object CMakeFiles/stest.dir/conjgrad.c.o
/media/RESEARCH/DEVELOP-SEISMIC/dip/conjgrad.c:26:18: fatal error:
blas.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/stest.dir/conjgrad.c.o] Error 1
make[1]: *** [CMakeFiles/stest.dir/all] Error 2
make: *** [all] Error 2
What am I still doing wrong here? Here is a full Cmake file that was
used to create the output above:
########################################
cmake_minimum_required (VERSION 2.6)
project (stretch-test)
# Blas library
find_package( BLAS REQUIRED )
find_package( LAPACK REQUIRED )
# Required C99 compiler
set(CMAKE_C_FLAGS "-std=c99")
include_directories(${BLAS_INCLUDE_DIR} ${LAPACK_INCLUDE_DIR})
add_executable( stest
main.c
allp3.c
apfilt.c
conjgrad.c
dip3.c
divn.c
helper.c
trianglen.c
komplex.c
adjnull.c
c99.c
) # end
# link with math library on Linux
# link with blas on Linux
TARGET_LINK_LIBRARIES(stest m blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
More information about the CMake
mailing list