add GOTO2 and clean a bit the cmake macros

This commit is contained in:
Gael Guennebaud 2011-01-31 10:45:03 +01:00
parent 6e67d15795
commit 9a73bfeb85
6 changed files with 58 additions and 63 deletions

View File

@ -1,17 +1,7 @@
# include(FindLibraryWithDebug)
if (ACML_INCLUDES AND ACML_LIBRARIES)
if (ACML_LIBRARIES)
set(ACML_FIND_QUIETLY TRUE)
endif (ACML_INCLUDES AND ACML_LIBRARIES)
find_path(ACML_INCLUDES
NAMES
acml.h
PATHS
$ENV{ACMLDIR}/include
$ENV{ACML_DIR}/include
${INCLUDE_INSTALL_DIR}
)
endif (ACML_LIBRARIES)
find_library(ACML_LIBRARIES
NAMES
@ -54,7 +44,6 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ACML DEFAULT_MSG
ACML_INCLUDES ACML_LIBRARIES)
find_package_handle_standard_args(ACML DEFAULT_MSG ACML_LIBRARIES)
mark_as_advanced(ACML_INCLUDES ACML_LIBRARIES)
mark_as_advanced(ACML_LIBRARIES)

View File

@ -1,16 +1,7 @@
# include(FindLibraryWithDebug)
if (ATLAS_INCLUDES AND ATLAS_LIBRARIES)
if (ATLAS_LIBRARIES)
set(ATLAS_FIND_QUIETLY TRUE)
endif (ATLAS_INCLUDES AND ATLAS_LIBRARIES)
find_path(ATLAS_INCLUDES
NAMES
cblas.h
PATHS
$ENV{ATLASDIR}/include
${INCLUDE_INSTALL_DIR}
)
endif (ATLAS_LIBRARIES)
find_file(ATLAS_LIB libatlas.so.3 PATHS /usr/lib $ENV{ATLASDIR} ${LIB_INSTALL_DIR})
find_library(ATLAS_LIB atlas PATHS $ENV{ATLASDIR} ${LIB_INSTALL_DIR})
@ -34,7 +25,8 @@ if(ATLAS_LIB AND ATLAS_CBLAS AND ATLAS_LAPACK AND ATLAS_F77BLAS)
set(ATLAS_LIBRARIES ${ATLAS_LAPACK} ${ATLAS_CBLAS} ${ATLAS_F77BLAS} ${ATLAS_LIB})
# search the default lapack lib link to it
find_library(ATLAS_REFERENCE_LAPACK lapack PATHS $ENV{ATLASDIR} ${LIB_INSTALL_DIR})
find_file(ATLAS_REFERENCE_LAPACK liblapack.so.3 PATHS /usr/lib /usr/lib64)
find_library(ATLAS_REFERENCE_LAPACK NAMES lapack)
if(ATLAS_REFERENCE_LAPACK)
set(ATLAS_LIBRARIES ${ATLAS_LIBRARIES} ${ATLAS_REFERENCE_LAPACK})
endif()
@ -42,7 +34,6 @@ if(ATLAS_LIB AND ATLAS_CBLAS AND ATLAS_LAPACK AND ATLAS_F77BLAS)
endif(ATLAS_LIB AND ATLAS_CBLAS AND ATLAS_LAPACK AND ATLAS_F77BLAS)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ATLAS DEFAULT_MSG
ATLAS_INCLUDES ATLAS_LIBRARIES)
find_package_handle_standard_args(ATLAS DEFAULT_MSG ATLAS_LIBRARIES)
mark_as_advanced(ATLAS_INCLUDES ATLAS_LIBRARIES)
mark_as_advanced(ATLAS_LIBRARIES)

View File

@ -1,18 +1,8 @@
# include(FindLibraryWithDebug)
if (GOTO_INCLUDES AND GOTO_LIBRARIES)
if (GOTO_LIBRARIES)
set(GOTO_FIND_QUIETLY TRUE)
endif (GOTO_INCLUDES AND GOTO_LIBRARIES)
endif (GOTO_LIBRARIES)
find_path(GOTO_INCLUDES
NAMES
cblas.h
PATHS
$ENV{GOTODIR}/include
${INCLUDE_INSTALL_DIR}
)
find_file(GOTO_LIBRARIES libgoto.so PATHS /usr/lib $ENV{GOTODIR} ${LIB_INSTALL_DIR})
find_library(GOTO_LIBRARIES goto PATHS $ENV{GOTODIR} ${LIB_INSTALL_DIR})
if(GOTO_LIBRARIES AND CMAKE_COMPILER_IS_GNUCXX)
@ -20,7 +10,6 @@ if(GOTO_LIBRARIES AND CMAKE_COMPILER_IS_GNUCXX)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GOTO DEFAULT_MSG
GOTO_INCLUDES GOTO_LIBRARIES)
find_package_handle_standard_args(GOTO DEFAULT_MSG GOTO_LIBRARIES)
mark_as_advanced(GOTO_INCLUDES GOTO_LIBRARIES)
mark_as_advanced(GOTO_LIBRARIES)

View File

@ -0,0 +1,25 @@
if (GOTO2_LIBRARIES)
set(GOTO2_FIND_QUIETLY TRUE)
endif (GOTO2_LIBRARIES)
#
# find_path(GOTO_INCLUDES
# NAMES
# cblas.h
# PATHS
# $ENV{GOTODIR}/include
# ${INCLUDE_INSTALL_DIR}
# )
find_file(GOTO2_LIBRARIES libgoto2.so PATHS /usr/lib $ENV{GOTO2DIR} ${LIB_INSTALL_DIR})
find_library(GOTO2_LIBRARIES goto2 PATHS $ENV{GOTO2DIR} ${LIB_INSTALL_DIR})
if(GOTO2_LIBRARIES AND CMAKE_COMPILER_IS_GNUCXX)
set(GOTO2_LIBRARIES ${GOTO2_LIBRARIES} "-lpthread -lgfortran")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GOTO2 DEFAULT_MSG
GOTO2_LIBRARIES)
mark_as_advanced(GOTO2_LIBRARIES)

View File

@ -1,15 +1,7 @@
if (MKL_INCLUDES AND MKL_LIBRARIES)
set(CBLAS_FIND_QUIETLY TRUE)
endif (MKL_INCLUDES AND MKL_LIBRARIES)
find_path(MKL_INCLUDES
NAMES
cblas.h
PATHS
$ENV{MKLDIR}/include
${INCLUDE_INSTALL_DIR}
)
if (MKL_LIBRARIES)
set(MKL_FIND_QUIETLY TRUE)
endif (MKL_LIBRARIES)
if(CMAKE_MINOR_VERSION GREATER 4)
@ -68,7 +60,6 @@ endif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
endif(CMAKE_MINOR_VERSION GREATER 4)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MKL DEFAULT_MSG
MKL_INCLUDES MKL_LIBRARIES)
find_package_handle_standard_args(MKL DEFAULT_MSG MKL_LIBRARIES)
mark_as_advanced(MKL_INCLUDES MKL_LIBRARIES)
mark_as_advanced(MKL_LIBRARIES)

View File

@ -1,7 +1,7 @@
find_package(ATLAS)
if (ATLAS_FOUND)
include_directories(${ATLAS_INCLUDES} ${PROJECT_SOURCE_DIR}/libs/f77)
include_directories(${PROJECT_SOURCE_DIR}/libs/f77)
btl_add_bench(btl_atlas main.cpp)
if(BUILD_btl_atlas)
target_link_libraries(btl_atlas ${ATLAS_LIBRARIES})
@ -11,7 +11,7 @@ endif (ATLAS_FOUND)
find_package(MKL)
if (MKL_FOUND)
include_directories(${MKL_INCLUDES} ${PROJECT_SOURCE_DIR}/libs/f77)
include_directories(${PROJECT_SOURCE_DIR}/libs/f77)
btl_add_bench(btl_mkl main.cpp)
if(BUILD_btl_mkl)
target_link_libraries(btl_mkl ${MKL_LIBRARIES})
@ -21,7 +21,7 @@ endif (MKL_FOUND)
find_package(GOTO)
if (GOTO_FOUND)
include_directories(${GOTO_INCLUDES} ${PROJECT_SOURCE_DIR}/libs/f77)
include_directories(${PROJECT_SOURCE_DIR}/libs/f77)
btl_add_bench(btl_goto main.cpp)
if(BUILD_btl_goto)
target_link_libraries(btl_goto ${GOTO_LIBRARIES} )
@ -30,9 +30,19 @@ if (GOTO_FOUND)
endif (GOTO_FOUND)
find_package(GOTO2)
if (GOTO2_FOUND)
include_directories(${PROJECT_SOURCE_DIR}/libs/f77)
btl_add_bench(btl_goto2 main.cpp)
if(BUILD_btl_goto2)
target_link_libraries(btl_goto2 ${GOTO_LIBRARIES} )
set_target_properties(btl_goto2 PROPERTIES COMPILE_FLAGS "-DCBLASNAME=GOTO2 -DPUREBLAS")
endif(BUILD_btl_goto2)
endif (GOTO2_FOUND)
find_package(ACML)
if (ACML_FOUND)
include_directories(${ACML_INCLUDES} ${PROJECT_SOURCE_DIR}/libs/f77)
include_directories(${PROJECT_SOURCE_DIR}/libs/f77)
btl_add_bench(btl_acml main.cpp)
if(BUILD_btl_acml)
target_link_libraries(btl_acml ${ACML_LIBRARIES} )