cmake_minimum_required(VERSION 2.6)
project(LAPACK Fortran)
-set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_INT_ETIME.f)
-set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_INT_ETIME.f)
+if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
+ set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
+endif ()
enable_testing()
include(CTest)
enable_testing()
set(CMAKE_MODULE_PATH ${LAPACK_SOURCE_DIR} ${CMAKE_MODULE_PATH})
include(CheckTimeFunction)
set(TIME_FUNC NONE ${TIME_FUNC})
+CHECK_TIME_FUNCTION(NONE TIME_FUNC)
CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC)
CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC)
CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC)
set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f)
set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f)
-
add_subdirectory(BLAS)
add_subdirectory(SRC)
add_subdirectory(TESTING)
macro(CHECK_TIME_FUNCTION FUNCTION VARIABLE)
- execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -o secondtst second_${FUNCTION}.f secondtst.f
- WORKING_DIRECTORY ${LAPACK_SOURCE_DIR}/INSTALL
- RESULT_VARIABLE RES
- OUTPUT_VARIABLE OUT
- ERROR_VARIABLE ERR
- )
+ try_compile(${VARIABLE}
+ ${PROJECT_BINARY_DIR}/INSTALL
+ ${PROJECT_SOURCE_DIR}/INSTALL
+ TIMING secondtst_${FUNCTION}
+ OUTPUT_VARIABLE OUTPUT)
- if(${RES} EQUAL 0)
+ if(${VARIABLE})
set(${VARIABLE} ${FUNCTION} CACHE INTERNAL "Have Fortran function ${FUNCTION}")
message(STATUS "Looking for Fortran ${FUNCTION} - found")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Fortran ${FUNCTION} exists. ${OUT} \n\n")
- else(${RES} EQUAL 0)
+ "Fortran ${FUNCTION} exists. ${OUTPUT} \n\n")
+ else(${VARIABLE})
message(STATUS "Looking for Fortran ${FUNCTION} - not found")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Fortran ${FUNCTION} does not exist. \n ${ERR} \n")
- endif(${RES} EQUAL 0)
+ "Fortran ${FUNCTION} does not exist. \n ${OUTPUT} \n")
+ endif(${VARIABLE})
endmacro(CHECK_TIME_FUNCTION)
+
+
--- /dev/null
+cmake_minimum_required(VERSION 2.6)
+project(TIMING Fortran)
+add_executable(secondtst_NONE second_NONE.f secondtst.f)
+add_executable(secondtst_EXT_ETIME second_EXT_ETIME.f secondtst.f)
+add_executable(secondtst_EXT_ETIME_ second_EXT_ETIME_.f secondtst.f)
+add_executable(secondtst_INT_ETIME second_INT_ETIME.f secondtst.f)
+add_executable(secondtst_INT_CPU_TIME second_INT_CPU_TIME.f secondtst.f)
+++ /dev/null
-# Install script for directory: /Users/julie/Documents/Boulot/lapack-dev/lapack/trunk
-
-# Set the install prefix
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
- SET(CMAKE_INSTALL_PREFIX "/usr/local")
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
- IF(BUILD_TYPE)
- STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
- CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
- ELSE(BUILD_TYPE)
- SET(CMAKE_INSTALL_CONFIG_NAME "")
- ENDIF(BUILD_TYPE)
- MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-
-# Set the component getting installed.
-IF(NOT CMAKE_INSTALL_COMPONENT)
- IF(COMPONENT)
- MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
- SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
- ELSE(COMPONENT)
- SET(CMAKE_INSTALL_COMPONENT)
- ENDIF(COMPONENT)
-ENDIF(NOT CMAKE_INSTALL_COMPONENT)
-
-IF(CMAKE_INSTALL_COMPONENT)
- SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-ELSE(CMAKE_INSTALL_COMPONENT)
- SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-ENDIF(CMAKE_INSTALL_COMPONENT)
-
-FILE(WRITE "/Users/julie/Documents/Boulot/lapack-dev/lapack/trunk/${CMAKE_INSTALL_MANIFEST}" "")
-FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
- FILE(APPEND "/Users/julie/Documents/Boulot/lapack-dev/lapack/trunk/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
-ENDFOREACH(file)