create own module proxies for blas/lapack

This commit is contained in:
Radovan Bast 2015-09-19 15:45:42 +02:00
parent c56e9eaa56
commit 9e32dd790d
8 changed files with 54 additions and 14 deletions

20
modules/math/blas.cmake Normal file
View File

@ -0,0 +1,20 @@
#.rst:
#
# Find and link to BLAS.
#
# Variables defined::
#
# BLAS_FOUND - describe me, uncached
# BLAS_LIBRARIES - describe me, uncached
# BLAS_INCLUDE_DIR - describe me, uncached
#
# autocmake.cfg configuration::
#
# docopt: --blas Find and link to BLAS [default: False].
# define: '-DENABLE_BLAS=%s' % arguments['--blas']
option(ENABLE_BLAS "Find and link to BLAS" OFF)
if(ENABLE_BLAS)
find_package(BLAS REQUIRED)
endif()

20
modules/math/lapack.cmake Normal file
View File

@ -0,0 +1,20 @@
#.rst:
#
# Find and link to LAPACK.
#
# Variables defined::
#
# LAPACK_FOUND - describe me, uncached
# LAPACK_LIBRARIES - describe me, uncached
# LAPACK_INCLUDE_DIR - describe me, uncached
#
# autocmake.cfg configuration::
#
# docopt: --lapack Find and link to LAPACK [default: False].
# define: '-DENABLE_LAPACK=%s' % arguments['--lapack']
option(ENABLE_LAPACK "Find and link to LAPACK" OFF)
if(ENABLE_LAPACK)
find_package(LAPACK REQUIRED)
endif()

View File

@ -5,8 +5,8 @@ min_cmake_version: 2.8
[fc]
source: ../../../modules/fc.cmake
[math_libs]
source: ../../../modules/math_libs.cmake
[math]
source: ../../../modules/math/blas.cmake
[default_build_paths]
source: ../../../modules/default_build_paths.cmake

View File

@ -1,6 +1,6 @@
if(BLAS_FOUND)
add_executable(example example.f90)
target_link_libraries(example ${MATH_LIBS})
target_link_libraries(example ${BLAS_LIBRARIES})
else()
message(FATAL_ERROR "BLAS library not found for the test fc_blas!")
message(FATAL_ERROR "BLAS library not found")
endif()

View File

@ -5,8 +5,8 @@ min_cmake_version: 2.8
[fc]
source: ../../../modules/fc.cmake
[math_libs]
source: ../../../modules/math_libs.cmake
[math]
source: ../../../modules/math/lapack.cmake
[default_build_paths]
source: ../../../modules/default_build_paths.cmake

View File

@ -1,6 +1,6 @@
if(LAPACK_FOUND)
add_executable(example example.F90)
target_link_libraries(example ${MATH_LIBS})
add_executable(example example.f90)
target_link_libraries(example ${LAPACK_LIBRARIES})
else()
message(FATAL_ERROR "LAPACK library not found for the test fc_lapack!")
message(FATAL_ERROR "LAPACK library not found")
endif()

View File

@ -128,7 +128,11 @@ def test_fc_omp():
def test_fc_blas():
configure_build_and_exe('fc_blas', 'python setup.py --fc=gfortran --cmake-options="-DMATH_LIB_SEARCH_ORDER=\'OPENBLAS;ATLAS;MKL;SYSTEM_NATIVE\'"')
configure_build_and_exe('fc_blas', 'python setup.py --fc=gfortran --blas')
def test_fc_lapack():
configure_build_and_exe('fc_lapack', 'python setup.py --fc=gfortran --lapack')
@skip_on_osx
@ -136,10 +140,6 @@ def test_cxx_cblas():
configure_build_and_exe('cxx_cblas', 'python setup.py --cxx=g++ --cblas')
def test_fc_lapack():
configure_build_and_exe('fc_lapack', 'python setup.py --fc=gfortran --cmake-options="-DMATH_LIB_SEARCH_ORDER=\'OPENBLAS;ATLAS;MKL;SYSTEM_NATIVE\'"')
@skip_on_osx
@skip_on_linux
def test_cxx_lapacke():