1 | # levmar CMake file; see http://www.cmake.org and
|
---|
2 | # http://www.insightsoftwareconsortium.org/wiki/index.php/CMake_Tutorial
|
---|
3 |
|
---|
4 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
---|
5 | PROJECT(LEVMAR)
|
---|
6 |
|
---|
7 | SET(HAVE_LAPACK 1 CACHE BOOL "Do we have LAPACK/BLAS?")
|
---|
8 | # the directory where the lapack/blas/f2c libraries reside
|
---|
9 | SET(LAPACKBLAS_DIR "/usr/lib" CACHE PATH "Path to lapack/blas libraries")
|
---|
10 | SET(NEED_F2C 1 CACHE BOOL "Do we need either f2c or F77/I77?")
|
---|
11 | SET(HAVE_PLASMA 0 CACHE BOOL "Do we have PLASMA parallel linear algebra library?")
|
---|
12 | IF(HAVE_PLASMA)
|
---|
13 | SET(PLASMA_DIR "/usr/local/PLASMA" CACHE PATH "Path to PLASMA root")
|
---|
14 | ENDIF(HAVE_PLASMA)
|
---|
15 | SET(LINSOLVERS_RETAIN_MEMORY 1 CACHE BOOL "Should linear solvers retain working memory between calls? (non-reentrant!)")
|
---|
16 | SET(LM_DBL_PREC 1 CACHE BOOL "Build double precision routines?")
|
---|
17 | SET(LM_SNGL_PREC 1 CACHE BOOL "Build single precision routines?")
|
---|
18 | OPTION(BUILD_DEMO "Build demo program?" FALSE)
|
---|
19 |
|
---|
20 | # actual names for the lapack/blas/f2c libraries
|
---|
21 | SET(LAPACKBLAS_LIB_NAMES "lapack;blas" CACHE STRING "The name of the lapack & blas libraries")
|
---|
22 | #SET(LAPACKBLAS_LIB_NAMES "mkl_solver_sequential;mkl_intel_c;mkl_sequential;mkl_core" CACHE STRING "The name of the lapack library") # MKL
|
---|
23 | IF(NEED_F2C)
|
---|
24 | SET(F2C_LIB_NAME f2c CACHE STRING "The name of the f2c or F77/I77 library")
|
---|
25 | # f2c is sometimes equivalent to libF77 & libI77
|
---|
26 | #SET(F2C_LIB_NAME "libF77;libI77" CACHE STRING "The name of the f2c or F77/I77 library")
|
---|
27 | ELSE(NEED_F2C)
|
---|
28 | SET(F2C_LIB_NAME "" CACHE STRING "The name of the f2c or F77/I77 library")
|
---|
29 | ENDIF(NEED_F2C)
|
---|
30 |
|
---|
31 | # actual names for the PLASMA libraries
|
---|
32 | IF(HAVE_PLASMA)
|
---|
33 | SET(PLASMA_LIB_NAMES "plasma;coreblas;quark;lapacke" CACHE STRING "The names of the PLASMA libraries")
|
---|
34 | ENDIF(HAVE_PLASMA)
|
---|
35 |
|
---|
36 |
|
---|
37 | IF(0)
|
---|
38 | # treat paths relative to the source dir.
|
---|
39 | IF(COMMAND CMAKE_POLICY)
|
---|
40 | CMAKE_POLICY(SET CMP0015 NEW)
|
---|
41 | ENDIF(COMMAND CMAKE_POLICY)
|
---|
42 | ENDIF(0)
|
---|
43 |
|
---|
44 | # compiler flags
|
---|
45 | #ADD_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # do not free memory between linear solvers calls
|
---|
46 | REMOVE_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # free memory between calls
|
---|
47 |
|
---|
48 |
|
---|
49 |
|
---|
50 |
|
---|
51 | ########################## NO CHANGES BEYOND THIS POINT ##########################
|
---|
52 |
|
---|
53 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/levmar.h.in ${CMAKE_CURRENT_SOURCE_DIR}/levmar.h)
|
---|
54 |
|
---|
55 | INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
|
---|
56 | IF(HAVE_PLASMA)
|
---|
57 | INCLUDE_DIRECTORIES(${PLASMA_DIR}/include ${PLASMA_DIR}/quark)
|
---|
58 | ENDIF(HAVE_PLASMA)
|
---|
59 |
|
---|
60 | # PLASMA headers in Axb.c should be compiled as C++
|
---|
61 | IF(HAVE_PLASMA)
|
---|
62 | SET_SOURCE_FILES_PROPERTIES(Axb.c PROPERTIES LANGUAGE CXX)
|
---|
63 | ENDIF(HAVE_PLASMA)
|
---|
64 |
|
---|
65 | # levmar library source files
|
---|
66 | ADD_LIBRARY(levmar STATIC
|
---|
67 | lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c lmbleic.c
|
---|
68 | levmar.h misc.h compiler.h
|
---|
69 | )
|
---|
70 |
|
---|