summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjulie <julielangou@users.noreply.github.com>2010-12-15 18:42:50 +0000
committerjulie <julielangou@users.noreply.github.com>2010-12-15 18:42:50 +0000
commit141210af9cf13bb12427d99fa4447459c3ad0ae6 (patch)
treee60c4779b46f4864a8b91fe4149d1a5fe36d8aa9
parent1ab7dfd850b653f6cddc1fcba6c1a71498449090 (diff)
downloadlapack-141210af9cf13bb12427d99fa4447459c3ad0ae6.tar.gz
lapack-141210af9cf13bb12427d99fa4447459c3ad0ae6.tar.bz2
lapack-141210af9cf13bb12427d99fa4447459c3ad0ae6.zip
Added compiler flags from FindBLAS.
-rw-r--r--CMAKE/FindBLAS.cmake13
-rw-r--r--CMakeLists.txt4
2 files changed, 11 insertions, 6 deletions
diff --git a/CMAKE/FindBLAS.cmake b/CMAKE/FindBLAS.cmake
index 558f1eff..fd559dbe 100644
--- a/CMAKE/FindBLAS.cmake
+++ b/CMAKE/FindBLAS.cmake
@@ -146,10 +146,11 @@ macro( _BLAS_LOCATE_AND_TEST __BLAS_VENDOR __BLAS_LIBNAMES __BLAS_FLAGS )
set( BLAS_${__BLAS_VENDOR}_LINKER_FLAGS "${__BLAS_FLAGS}" )
if( _CHECK_FORTRAN )
set( CMAKE_REQUIRED_LIBRARIES ${BLAS_${__BLAS_VENDOR}_LIBRARIES} )
- set( CMAKE_REQUIRED_FLAGS "${BLAS_${__BLAS_VENDOR}_LINKER_FLAGS}" )
+ set( CMAKE_Fortran_FLAGS_ORIG "${CMAKE_Fortran_FLAGS}" )
+ set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${BLAS_${__BLAS_VENDOR}_LINKER_FLAGS}" )
CHECK_FORTRAN_FUNCTION_EXISTS( "dgemm" BLAS_${__BLAS_VENDOR}_DGEMM )
+ set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_ORIG}" )
unset( CMAKE_REQUIRED_LIBRARIES )
- unset( CMAKE_REQUIRED_FLAGS )
# Check the library as C
#else()
@@ -251,7 +252,7 @@ foreach( _BLAS_VENDOR ${BLAS_VENDORS} )
)
else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
_BLAS_LOCATE_AND_TEST(
- ${_BLAS_VENDOR} "gomp;mkl_core;mkl_gnu_thread;mkl_intel_ia32" ""
+ ${_BLAS_VENDOR} "mkl_core;mkl_gnu_thread;mkl_intel_ia32" "-fopenmp"
)
endif()
@@ -268,7 +269,7 @@ foreach( _BLAS_VENDOR ${BLAS_VENDORS} )
)
else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
_BLAS_LOCATE_AND_TEST(
- ${_BLAS_VENDOR} "gomp;mkl_core;mkl_gnu_thread;mkl_intel_lp64" ""
+ ${_BLAS_VENDOR} "mkl_core;mkl_gnu_thread;mkl_intel_lp64" "-fopenmp"
)
endif()
@@ -285,7 +286,7 @@ foreach( _BLAS_VENDOR ${BLAS_VENDORS} )
)
else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
_BLAS_LOCATE_AND_TEST(
- ${_BLAS_VENDOR} "gomp;mkl_core;mkl_gnu_thread;mkl_intel_ilp64" ""
+ ${_BLAS_VENDOR} "mkl_core;mkl_gnu_thread;mkl_intel_ilp64" "-fopenmp"
)
endif()
@@ -320,7 +321,7 @@ if( _BLAS_VENDORS_FOUND_LENGTH EQUAL 0 )
return()
endif()
list( GET BLAS_VENDORS_FOUND 0 BLAS_VENDOR_FOUND )
-message( STATUS "FindBLAS: BLAS Vendor selected - ${BLAS_VENDOR_FOUND}" )
+message( STATUS "FindBLAS: BLAS vendor selected: ${BLAS_VENDOR_FOUND}" )
set( BLAS_LIBRARIES ${BLAS_${BLAS_VENDOR_FOUND}_LIBRARIES} CACHE PATH "")
set( BLAS_LINKER_FLAGS ${BLAS_${BLAS_VENDOR_FOUND}_LINKER_FLAGS} CACHE PATH "" )
set( BLAS_FOUND TRUE CACHE OPTION "")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f7a4bb4..7a72dc5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,10 @@ endif(LOOK_FOR_OPTIMZED_BLAS)
if(NOT BLAS_FOUND)
add_subdirectory(BLAS)
set( BLAS_LIBRARIES blas )
+else()
+ set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${BLAS_LINKER_FLAGS}"
+ CACHE STRING "Flags for Fortran compiler" FORCE
+ )
endif( NOT BLAS_FOUND )