This forum has been archived. All content is frozen. Please use KDE Discuss instead.

BLAS API not found

Tags: None
(comma "," separated)
giorgosk
Registered Member
Posts
2
Karma
0

BLAS API not found

Mon Nov 05, 2012 2:50 pm
Hi all,

I am trying to configure a program in KDevelop 4.3 which makes use of the BLAS package. However, KDevelop is apparently not able to find some required BLAS API package. I get following output when I try to configure the project:

/path/to/build/map/project> /usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug /path/to/project
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The Fortran compiler identification is GNU
-- Check for working Fortran compiler: /usr/bin/gfortran
-- Check for working Fortran compiler: /usr/bin/gfortran -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found.
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at /usr/share/cmake/Modules/FindBLAS.cmake:594 (message):
A required library with BLAS API not found. Please specify library
location.
Call Stack (most recent call first):
CMakeLists.txt:25 (find_package)


-- Configuring incomplete, errors occurred!

Any help would be welcome. I have found a post about a similar error elsewhere, and it was fixed by adjusting a line in FindBLAS.cmake (it had also to do with pthread). However, I don't have write access to the folder where FindBLAS.cmake is situated. Another program that I have written works fine using almost an identical CMakeLists.txt file (only the project name differs), so probably my error is unrelated to the content of FindBLAS.cmake. The CMakeLists.txt file looks as follows:

project(projectname)

cmake_minimum_required(VERSION 2.6)

enable_language(Fortran)

set(CMAKE_C_FLAGS "-std=gnu99 -Wall")


set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

# default build type is Release
if (NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE "Release")
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set (CMAKE_CXX_FLAGS_DEBUG "-g3 -O0")
set (CMAKE_Fortran_FLAGS_DEBUG "-g3 -O0")
endif()
string( TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UP)

# find blas and lapack
set(BLAS_DIR /usr/lib64/atlas)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)

# FFTW
find_package(FFTW REQUIRED)
include_directories(${FFTW_INCLUDES})

set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} m)

# configure external libraries
add_subdirectory(extern)
include_directories("${CMAKE_SOURCE_DIR}/extern")
include_directories("${CMAKE_SOURCE_DIR}/src")

# configure src
add_subdirectory(src)

# auto optimize
if (CMAKE_BUILD_TYPE STREQUAL "Release")
include(OptimizeForArchitecture)
OptimizeForArchitecture()
endif()

# show summary of configuration
message( STATUS )
message( STATUS "-------------------------------------------------------")
message( STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message( STATUS "C compiler options: ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UP}} ${CMAKE_C_FLAGS}")
message( STATUS "Linker options: ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UP}}")
message( STATUS "BLAS vendor: ${BLA_VENDOR}")
message( STATUS "BLAS libraries: ${BLAS_LIBRARIES}")
message( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS}")
message( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}")
message( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS}")
message( STATUS "FFTW libraries: ${FFTW_LIBRARIES}")
message( STATUS "FFTW includes: ${FFTW_INCLUDES}")
message( STATUS "Install directory: ${CMAKE_INSTALL_PREFIX}")
message( STATUS "-------------------------------------------------------")
message( STATUS )


add_subdirectory(bin)

This CMakeLists.txt file was written by another person working on a similar subject before me and, as I told before, has worked fine until now. I am quite new to programming, so all this is quite difficult to grasp for me. Has anybody an idea? If more info is required, please ask.

Thanks in advance,
Giorgos
giorgosk
Registered Member
Posts
2
Karma
0

Re: BLAS API not found

Tue Nov 06, 2012 12:01 pm
Solved it, apparently the two codes were not using the same FindBLAS.cmake file...


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient