adding lapacke.cmake stub

This commit is contained in:
Radovan Bast
2015-09-17 10:44:30 +02:00
parent e399058e37
commit 6efc29457d
5 changed files with 49 additions and 32 deletions

View File

@ -5,8 +5,8 @@ min_cmake_version: 2.8
[cxx]
source: ../../../modules/cxx.cmake
[math_libs]
source: ../../../modules/math_libs.cmake
[lapacke]
source: ../../../modules/lapacke.cmake
[default_build_paths]
source: ../../../modules/default_build_paths.cmake

View File

@ -1,13 +1,7 @@
if(LAPACK_FOUND)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
#windows needs to find <lapacke.h> of openblas
include_directories($ENV{PATH})
else()
#ftravis-ci needs find <clapack.h> of ATLAS
include_directories(/usr/include/atlas)
endif()
if(LAPACKE_FOUND)
include_directories(${LAPACKE_INCLUDE_DIR})
add_executable(example example.cpp)
target_link_libraries(example ${MATH_LIBS})
target_link_libraries(example ${LAPACKE_LIBRARIES})
else()
message(FATAL_ERROR "LAPACK library not found for the test cc_lapacke!")
message(FATAL_ERROR "LAPACKE library not found")
endif()

View File

@ -1,19 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#if defined HAVE_MKL_LAPACK
#include <mkl_lapacke.h>
#include <mkl_cblas.h>
#pragma message "Using Intel MKL c-lapack interface, <mkl_lapacke.h>."
#elif defined HAVE_OPENBLAS_LAPACK
#include <lapacke.h>
#include <cblas.h>
#pragma message "Using OpenBLAS C-lapack interface, <lapacke.h>."
#else
#include <clapack.h>
#include <cblas.h>
#pragma message "Using ATLAS/SYSTEM_NATIVE C lapack interface, <clapack.h>."
#endif
#include "lapacke.h"
int main()
{
@ -39,12 +27,7 @@ int main()
int ierr;
int ipiv[n];
/* MKL, OpenBLAS */
#if defined HAVE_MKL_LAPACK || defined HAVE_OPENBLAS_LAPACK
ierr = LAPACKE_dgesv(CblasColMajor, n, 1, a, n, ipiv, b, n);
#else /* ATLAS, SYSTEM_NATIVE */
ierr = clapack_dgesv(CblasColMajor, n, 1, a, n, ipiv, b, n);
#endif
if (ierr != 0)
{
fprintf(stderr, "\ndgesv failure with error %i\n", ierr);