1 cmake_minimum_required(VERSION 2.6)
2 project(LAPACK Fortran)
4 if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
5 set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
9 macro(lapack_install_library lib)
10 install(TARGETS ${lib} EXPORT lapack-targets
11 ARCHIVE DESTINATION lib
12 LIBRARY DESTINATION lib
13 RUNTIME DESTINATION bin
17 # --------------------------------------------------
23 # --------------------------------------------------
25 set(CMAKE_MODULE_PATH ${LAPACK_SOURCE_DIR} ${CMAKE_MODULE_PATH})
27 # --------------------------------------------------
28 # Check second function
30 include(CheckTimeFunction)
31 set(TIME_FUNC NONE ${TIME_FUNC})
32 CHECK_TIME_FUNCTION(NONE TIME_FUNC)
33 CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC)
34 CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC)
35 CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC)
36 CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC)
37 message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.")
39 set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f)
40 set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f)
42 # --------------------------------------------------
43 # Subdirectories that need to be processed
45 add_subdirectory(BLAS)
47 add_subdirectory(TESTING)
49 # --------------------------------------------------
52 SET(CPACK_PACKAGE_NAME "LAPACK")
53 SET(CPACK_PACKAGE_VENDOR "University of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd")
54 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LAPACK- Linear Algebra Package")
55 set(LAPACK_VERSION 3.2.2)
56 set(CPACK_PACKAGE_VERSION_MAJOR 3)
57 set(CPACK_PACKAGE_VERSION_MINOR 2)
58 set(CPACK_PACKAGE_VERSION_PATCH 2)
59 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
60 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "LAPACK")
61 IF(WIN32 AND NOT UNIX)
62 # There is a bug in NSI that does not handle full unix paths properly. Make
63 # sure there is at least one set of four (4) backlasshes.
64 SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum")
65 SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/lapack")
66 SET(CPACK_NSIS_CONTACT "lapack@eecs.utk.edu")
67 SET(CPACK_NSIS_MODIFY_PATH ON)
68 SET(CPACK_NSIS_DISPLAY_NAME "LAPACK-${LAPACK_VERSION}")
69 set(CPACK_PACKAGE_RELOCATABLE "true")
70 ELSE(WIN32 AND NOT UNIX)
71 SET(CPACK_GENERATOR "TGZ")
72 SET(CPACK_SOURCE_GENERATOR TGZ)
73 SET(CPACK_SOURCE_PACKAGE_FILE_NAME "lapack-${LAPACK_VERSION}" )
74 SET(CPACK_SOURCE_IGNORE_FILES ~$ .svn ${CPACK_SOURCE_IGNORE_FILES} )
75 ENDIF(WIN32 AND NOT UNIX)
79 # --------------------------------------------------
80 # By default static library
81 OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF )
82 #OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON )
84 export(TARGETS blas lapack FILE lapack-targets.cmake)
85 configure_file(${LAPACK_SOURCE_DIR}/lapack-config-version.cmake.in
86 ${LAPACK_BINARY_DIR}/lapack-config-version.cmake @ONLY)
87 configure_file(${LAPACK_SOURCE_DIR}/lapack-config.cmake.in
88 ${LAPACK_BINARY_DIR}/lapack-config.cmake @ONLY)
90 configure_file(${LAPACK_SOURCE_DIR}/lapack-config-install.cmake.in
91 ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake @ONLY)
93 ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake
94 ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
95 DESTINATION lib/cmake/lapack-${LAPACK_VERSION}
97 install(EXPORT lapack-targets
98 DESTINATION lib/cmake/lapack-${LAPACK_VERSION})