Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 313649 | Differences between
and this patch

Collapse All | Expand All

(-)3rdparty/CMakeLists.txt (-1 / +3 lines)
Lines 1-5 Link Here
1
add_subdirectory(flann)
1
add_subdirectory(flann)
2
add_subdirectory(lapack)
2
if(BUILD_LAPACK)
3
  add_subdirectory(lapack)
4
endif()
3
add_subdirectory(zlib)
5
add_subdirectory(zlib)
4
if(OPENCV_BUILD_3RDPARTY_LIBS)
6
if(OPENCV_BUILD_3RDPARTY_LIBS)
5
    add_subdirectory(libjasper)
7
    add_subdirectory(libjasper)
(-)FindBLAS.cmake (+433 lines)
Line 0 Link Here
1
# - Find BLAS library
2
# This module finds an installed fortran library that implements the BLAS
3
# linear-algebra interface (see http://www.netlib.org/blas/).
4
# The list of libraries searched for is taken
5
# from the autoconf macro file, acx_blas.m4 (distributed at
6
# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
7
#
8
# This module sets the following variables:
9
#  BLAS_FOUND - set to true if a library implementing the BLAS interface
10
#    is found
11
#  BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
12
#    and -L).
13
#  BLAS_LIBRARIES - uncached list of libraries (using full path name) to
14
#    link against to use BLAS
15
#  BLAS95_LIBRARIES - uncached list of libraries (using full path name)
16
#    to link against to use BLAS95 interface
17
#  BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
18
#    is found
19
#  BLA_STATIC  if set on this determines what kind of linkage we do (static)
20
#  BLA_VENDOR  if set checks only the specified vendor, if not set checks
21
#     all the posibilities
22
#  BLA_F95     if set on tries to find the f95 interfaces for BLAS/LAPACK
23
##########
24
### List of vendors (BLA_VENDOR) valid in this module
25
##  ATLAS, PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model),
26
##  Intel( older versions of mkl 32 and 64 bit), ACML,Apple, NAS, Generic
27
# C/CXX should be enabled to use Intel mkl
28
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
29
30
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _threads)
31
# This macro checks for the existence of the combination of fortran libraries
32
# given by _list.  If the combination is found, this macro checks (using the
33
# Check_Fortran_Function_Exists macro) whether can link against that library
34
# combination using the name of a routine given by _name using the linker
35
# flags given by _flags.  If the combination of libraries is found and passes
36
# the link test, LIBRARIES is set to the list of complete library paths that
37
# have been found.  Otherwise, LIBRARIES is set to FALSE.
38
39
# N.B. _prefix is the prefix applied to the names of all cached variables that
40
# are generated internally and marked advanced by this macro.
41
42
set(_libraries_work TRUE)
43
set(${LIBRARIES})
44
set(_combined_name)
45
foreach(_library ${_list})
46
  set(_combined_name ${_combined_name}_${_library})
47
48
  if(_libraries_work)
49
   if ( WIN32 )
50
    if(BLA_STATIC)
51
      set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll")
52
    endif(BLA_STATIC)
53
    find_library(${_prefix}_${_library}_LIBRARY
54
    NAMES ${_library}
55
    PATHS ENV LIB
56
    )
57
   endif ( WIN32 )
58
59
   if ( APPLE )
60
    if(BLA_STATIC)
61
     set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll")
62
    endif(BLA_STATIC)
63
    find_library(${_prefix}_${_library}_LIBRARY
64
    NAMES ${_library}
65
    PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
66
    )
67
68
   else ( APPLE )
69
    if(BLA_STATIC)
70
      set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
71
    endif(BLA_STATIC)
72
    find_library(${_prefix}_${_library}_LIBRARY
73
    NAMES ${_library}
74
    PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
75
    )
76
   endif( APPLE )
77
    mark_as_advanced(${_prefix}_${_library}_LIBRARY)
78
    set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
79
    set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
80
  endif(_libraries_work)
81
endforeach(_library ${_list})
82
if(NOT _libraries_work)
83
  set(${LIBRARIES} FALSE)
84
endif(NOT _libraries_work)
85
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
86
endmacro(Check_Fortran_Libraries)
87
88
set(BLAS_LINKER_FLAGS)
89
set(BLAS_LIBRARIES)
90
set(BLAS95_LIBRARIES)
91
if ($ENV{BLA_VENDOR} MATCHES ".+")
92
  set(BLA_VENDOR $ENV{BLA_VENDOR})
93
else ($ENV{BLA_VENDOR} MATCHES ".+")
94
  if(NOT BLA_VENDOR)
95
    set(BLA_VENDOR "All")
96
  endif(NOT BLA_VENDOR)
97
endif ($ENV{BLA_VENDOR} MATCHES ".+")
98
99
#BLAS in intel mkl 10 library? (em64t 64bit)
100
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
101
 if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
102
  if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
103
    find_package(Threads)
104
  else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
105
    find_package(Threads REQUIRED)
106
  endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
107
  if (WIN32)
108
  if(BLA_F95)
109
    if(NOT BLAS95_LIBRARIES)
110
    check_fortran_libraries(
111
    BLAS95_LIBRARIES
112
    BLAS
113
    sgemm
114
    ""
115
    "mkl_blas95;mkl_intel_c;mkl_intel_thread;mkl_core;libguide40"
116
    ""
117
    )
118
    endif(NOT BLAS95_LIBRARIES)
119
  else(BLA_F95)
120
    if(NOT BLAS_LIBRARIES)
121
    check_fortran_libraries(
122
    BLAS_LIBRARIES
123
    BLAS
124
    SGEMM
125
    ""
126
    "mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40"
127
    ""
128
    )
129
    endif(NOT BLAS_LIBRARIES)
130
  endif(BLA_F95)
131
  else(WIN32)
132
  if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
133
    if(BLA_F95)
134
      if(NOT BLAS95_LIBRARIES)
135
      check_fortran_libraries(
136
      BLAS95_LIBRARIES
137
      BLAS
138
      sgemm
139
      ""
140
      "mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide"
141
      "${CMAKE_THREAD_LIBS_INIT}"
142
      )
143
      endif(NOT BLAS95_LIBRARIES)
144
    else(BLA_F95)
145
    if(NOT BLAS_LIBRARIES)
146
      check_fortran_libraries(
147
      BLAS_LIBRARIES
148
      BLAS
149
      sgemm
150
      ""
151
      "mkl_intel;mkl_intel_thread;mkl_core;guide"
152
      "${CMAKE_THREAD_LIBS_INIT}"
153
      )
154
      endif(NOT BLAS_LIBRARIES)
155
    endif(BLA_F95)
156
  endif (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
157
  if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
158
   if(BLA_F95)
159
    if(NOT BLAS95_LIBRARIES)
160
      check_fortran_libraries(
161
      BLAS95_LIBRARIES
162
      BLAS
163
      sgemm
164
      ""
165
      "mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
166
      "${CMAKE_THREAD_LIBS_INIT}"
167
      )
168
    endif(NOT BLAS95_LIBRARIES)
169
   else(BLA_F95)
170
     if(NOT BLAS_LIBRARIES)
171
      check_fortran_libraries(
172
      BLAS_LIBRARIES
173
      BLAS
174
      sgemm
175
      ""
176
      "mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
177
      "${CMAKE_THREAD_LIBS_INIT}"
178
      )
179
     endif(NOT BLAS_LIBRARIES)
180
   endif(BLA_F95)
181
  endif (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
182
  endif (WIN32)
183
  #older vesions of intel mkl libs
184
  # BLAS in intel mkl library? (shared)
185
  if(NOT BLAS_LIBRARIES)
186
    check_fortran_libraries(
187
    BLAS_LIBRARIES
188
    BLAS
189
    sgemm
190
    ""
191
    "mkl;guide"
192
    "${CMAKE_THREAD_LIBS_INIT}"
193
    )
194
  endif(NOT BLAS_LIBRARIES)
195
  #BLAS in intel mkl library? (static, 32bit)
196
  if(NOT BLAS_LIBRARIES)
197
    check_fortran_libraries(
198
    BLAS_LIBRARIES
199
    BLAS
200
    sgemm
201
    ""
202
    "mkl_ia32;guide"
203
    "${CMAKE_THREAD_LIBS_INIT}"
204
    )
205
  endif(NOT BLAS_LIBRARIES)
206
  #BLAS in intel mkl library? (static, em64t 64bit)
207
  if(NOT BLAS_LIBRARIES)
208
    check_fortran_libraries(
209
    BLAS_LIBRARIES
210
    BLAS
211
    sgemm
212
    ""
213
    "mkl_em64t;guide"
214
    "${CMAKE_THREAD_LIBS_INIT}"
215
    )
216
  endif(NOT BLAS_LIBRARIES)
217
 endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
218
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
219
220
#BLAS in acml library?
221
if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All")
222
 if(NOT BLAS_LIBRARIES)
223
  check_fortran_libraries(
224
  BLAS_LIBRARIES
225
  BLAS
226
  sgemm
227
  ""
228
  "acml"
229
  ""
230
  )
231
 endif(NOT BLAS_LIBRARIES)
232
endif (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All")
233
234
# Apple BLAS library?
235
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
236
if(NOT BLAS_LIBRARIES)
237
  check_fortran_libraries(
238
  BLAS_LIBRARIES
239
  BLAS
240
  cblas_dgemm
241
  ""
242
  "Accelerate"
243
  ""
244
  )
245
 endif(NOT BLAS_LIBRARIES)
246
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
247
248
if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
249
 if(NOT BLAS_LIBRARIES)
250
  # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
251
  check_fortran_libraries(
252
  BLAS_LIBRARIES
253
  BLAS
254
  cblas_dgemm
255
  ""
256
  "cblas;f77blas;atlas"
257
  ""
258
  )
259
 endif(NOT BLAS_LIBRARIES)
260
endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
261
262
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
263
if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
264
 if(NOT BLAS_LIBRARIES)
265
  check_fortran_libraries(
266
  BLAS_LIBRARIES
267
  BLAS
268
  sgemm
269
  ""
270
  "sgemm;dgemm;blas"
271
  ""
272
  )
273
 endif(NOT BLAS_LIBRARIES)
274
endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
275
276
# BLAS in Alpha CXML library?
277
if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
278
 if(NOT BLAS_LIBRARIES)
279
  check_fortran_libraries(
280
  BLAS_LIBRARIES
281
  BLAS
282
  sgemm
283
  ""
284
  "cxml"
285
  ""
286
  )
287
 endif(NOT BLAS_LIBRARIES)
288
endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
289
290
# BLAS in Alpha DXML library? (now called CXML, see above)
291
if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
292
 if(NOT BLAS_LIBRARIES)
293
  check_fortran_libraries(
294
  BLAS_LIBRARIES
295
  BLAS
296
  sgemm
297
  ""
298
  "dxml"
299
  ""
300
  )
301
 endif(NOT BLAS_LIBRARIES)
302
endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
303
304
# BLAS in Sun Performance library?
305
if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
306
 if(NOT BLAS_LIBRARIES)
307
  check_fortran_libraries(
308
  BLAS_LIBRARIES
309
  BLAS
310
  sgemm
311
  "-xlic_lib=sunperf"
312
  "sunperf;sunmath"
313
  ""
314
  )
315
  if(BLAS_LIBRARIES)
316
    set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
317
  endif(BLAS_LIBRARIES)
318
 endif(NOT BLAS_LIBRARIES)
319
endif (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
320
321
# BLAS in SCSL library?  (SGI/Cray Scientific Library)
322
if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
323
 if(NOT BLAS_LIBRARIES)
324
  check_fortran_libraries(
325
  BLAS_LIBRARIES
326
  BLAS
327
  sgemm
328
  ""
329
  "scsl"
330
  ""
331
  )
332
 endif(NOT BLAS_LIBRARIES)
333
endif (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
334
335
# BLAS in SGIMATH library?
336
if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
337
 if(NOT BLAS_LIBRARIES)
338
  check_fortran_libraries(
339
  BLAS_LIBRARIES
340
  BLAS
341
  sgemm
342
  ""
343
  "complib.sgimath"
344
  ""
345
  )
346
 endif(NOT BLAS_LIBRARIES)
347
endif (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
348
349
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
350
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
351
 if(NOT BLAS_LIBRARIES)
352
  check_fortran_libraries(
353
  BLAS_LIBRARIES
354
  BLAS
355
  sgemm
356
  ""
357
  "essl;blas"
358
  ""
359
  )
360
 endif(NOT BLAS_LIBRARIES)
361
endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
362
363
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
364
 if ( NOT BLAS_LIBRARIES )
365
    check_fortran_libraries(
366
    BLAS_LIBRARIES
367
    BLAS
368
    cblas_dgemm
369
    ""
370
    "vecLib"
371
    ""
372
    )
373
 endif ( NOT BLAS_LIBRARIES )
374
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
375
# Generic BLAS library?
376
if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
377
 if(NOT BLAS_LIBRARIES)
378
  check_fortran_libraries(
379
  BLAS_LIBRARIES
380
  BLAS
381
  sgemm
382
  ""
383
  "blas"
384
  ""
385
  )
386
 endif(NOT BLAS_LIBRARIES)
387
endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
388
389
if(BLA_F95)
390
 if(BLAS95_LIBRARIES)
391
    set(BLAS95_FOUND TRUE)
392
  else(BLAS95_LIBRARIES)
393
    set(BLAS95_FOUND FALSE)
394
  endif(BLAS95_LIBRARIES)
395
396
  if(NOT BLAS_FIND_QUIETLY)
397
    if(BLAS95_FOUND)
398
      message(STATUS "A library with BLAS95 API found.")
399
    else(BLAS95_FOUND)
400
      if(BLAS_FIND_REQUIRED)
401
        message(FATAL_ERROR
402
        "A required library with BLAS95 API not found. Please specify library location.")
403
      else(BLAS_FIND_REQUIRED)
404
        message(STATUS
405
        "A library with BLAS95 API not found. Please specify library location.")
406
      endif(BLAS_FIND_REQUIRED)
407
    endif(BLAS95_FOUND)
408
  endif(NOT BLAS_FIND_QUIETLY)
409
  set(BLAS_FOUND TRUE)
410
  set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
411
else(BLA_F95)
412
  if(BLAS_LIBRARIES)
413
    set(BLAS_FOUND TRUE)
414
  else(BLAS_LIBRARIES)
415
    set(BLAS_FOUND FALSE)
416
  endif(BLAS_LIBRARIES)
417
418
  if(NOT BLAS_FIND_QUIETLY)
419
    if(BLAS_FOUND)
420
      message(STATUS "A library with BLAS API found.")
421
    else(BLAS_FOUND)
422
      if(BLAS_FIND_REQUIRED)
423
        message(FATAL_ERROR
424
        "A required library with BLAS API not found. Please specify library location."
425
        )
426
      else(BLAS_FIND_REQUIRED)
427
        message(STATUS
428
        "A library with BLAS API not found. Please specify library location."
429
        )
430
      endif(BLAS_FIND_REQUIRED)
431
    endif(BLAS_FOUND)
432
  endif(NOT BLAS_FIND_QUIETLY)
433
endif(BLA_F95)
(-)FindLAPACK.cmake (+254 lines)
Line 0 Link Here
1
# - Find LAPACK library
2
# This module finds an installed fortran library that implements the LAPACK
3
# linear-algebra interface (see http://www.netlib.org/lapack/).
4
#
5
# The approach follows that taken for the autoconf macro file, acx_lapack.m4
6
# (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
7
#
8
# This module sets the following variables:
9
#  LAPACK_FOUND - set to true if a library implementing the LAPACK interface
10
#    is found
11
#  LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
12
#    and -L).
13
#  LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
14
#    link against to use LAPACK
15
#  LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
16
#    link against to use LAPACK95
17
#  LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
18
#    interface is found
19
#  BLA_STATIC  if set on this determines what kind of linkage we do (static)
20
#  BLA_VENDOR  if set checks only the specified vendor, if not set checks
21
#     all the posibilities
22
#  BLA_F95     if set on tries to find the f95 interfaces for BLAS/LAPACK
23
### List of vendors (BLA_VENDOR) valid in this module
24
##  Intel(mkl), ACML,Apple, NAS, Generic
25
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
26
set(LAPACK_FOUND FALSE)
27
set(LAPACK95_FOUND FALSE)
28
29
macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads)
30
# This macro checks for the existence of the combination of fortran libraries
31
# given by _list.  If the combination is found, this macro checks (using the
32
# Check_Fortran_Function_Exists macro) whether can link against that library
33
# combination using the name of a routine given by _name using the linker
34
# flags given by _flags.  If the combination of libraries is found and passes
35
# the link test, LIBRARIES is set to the list of complete library paths that
36
# have been found.  Otherwise, LIBRARIES is set to FALSE.
37
38
# N.B. _prefix is the prefix applied to the names of all cached variables that
39
# are generated internally and marked advanced by this macro.
40
41
set(_libraries_work TRUE)
42
set(${LIBRARIES})
43
set(_combined_name)
44
foreach(_library ${_list})
45
  set(_combined_name ${_combined_name}_${_library})
46
47
  if(_libraries_work)
48
  IF (WIN32)
49
    if(BLA_STATIC)
50
      set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll")
51
    endif(BLA_STATIC)
52
    find_library(${_prefix}_${_library}_LIBRARY
53
    NAMES ${_library}
54
    PATHS ENV LIB
55
    )
56
  ENDIF (WIN32)
57
58
  if(APPLE)
59
    if(BLA_STATIC)
60
      set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib")
61
    endif(BLA_STATIC)
62
    find_library(${_prefix}_${_library}_LIBRARY
63
    NAMES ${_library}
64
    PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
65
    )
66
    else(APPLE)
67
    if(BLA_STATIC)
68
     set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
69
    endif(BLA_STATIC)
70
    find_library(${_prefix}_${_library}_LIBRARY
71
    NAMES ${_library}
72
    PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
73
    )
74
    endif(APPLE)
75
76
    mark_as_advanced(${_prefix}_${_library}_LIBRARY)
77
    set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
78
    set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
79
  endif(_libraries_work)
80
endforeach(_library ${_list})
81
82
if(_libraries_work)
83
  set(${LIBRARIES} ${${LIBRARIES}} ${_blas})
84
else(_libraries_work)
85
  set(${LIBRARIES} FALSE)
86
endif(_libraries_work)
87
88
endmacro(Check_Lapack_Libraries)
89
90
91
set(LAPACK_LINKER_FLAGS)
92
set(LAPACK_LIBRARIES)
93
set(LAPACK95_LIBRARIES)
94
95
96
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
97
  find_package(BLAS)
98
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
99
  find_package(BLAS REQUIRED)
100
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
101
102
103
if(BLAS_FOUND)
104
  set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
105
  if ($ENV{BLA_VENDOR} MATCHES ".+")
106
    set(BLA_VENDOR $ENV{BLA_VENDOR})
107
  else ($ENV{BLA_VENDOR} MATCHES ".+")
108
    if(NOT BLA_VENDOR)
109
      set(BLA_VENDOR "All")
110
    endif(NOT BLA_VENDOR)
111
  endif ($ENV{BLA_VENDOR} MATCHES ".+")
112
113
  #intel lapack
114
 if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
115
  if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
116
   if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
117
      find_PACKAGE(Threads)
118
   else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
119
       find_package(Threads REQUIRED)
120
   endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
121
   if (BLA_F95)
122
    if(NOT LAPACK95_LIBRARIES)
123
     check_lapack_libraries(
124
     LAPACK95_LIBRARIES
125
     LAPACK
126
     cheev
127
     ""
128
     "mkl_lapack95"
129
     "${BLAS95_LIBRARIES}"
130
     "${CMAKE_THREAD_LIBS_INIT}"
131
     )
132
    endif(NOT LAPACK95_LIBRARIES)
133
   else(BLA_F95)
134
    if(NOT LAPACK_LIBRARIES)
135
     check_lapack_libraries(
136
     LAPACK_LIBRARIES
137
     LAPACK
138
     cheev
139
     ""
140
     "mkl_lapack"
141
     "${BLAS_LIBRARIES}"
142
     "${CMAKE_THREAD_LIBS_INIT}"
143
     )
144
    endif(NOT LAPACK_LIBRARIES)
145
   endif(BLA_F95)
146
  endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
147
 endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
148
else(BLAS_FOUND)
149
  message(STATUS "LAPACK requires BLAS")
150
endif(BLAS_FOUND)
151
152
#acml lapack
153
 if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All")
154
  if(NOT LAPACK_LIBRARIES)
155
   check_lapack_libraries(
156
    LAPACK_LIBRARIES
157
    LAPACK
158
    cheev
159
    ""
160
    "acml"
161
    ""
162
    ""
163
    )
164
  endif(NOT LAPACK_LIBRARIES)
165
 endif (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All")
166
167
# Apple LAPACK library?
168
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
169
 if(NOT LAPACK_LIBRARIES)
170
  check_lapack_libraries(
171
  LAPACK_LIBRARIES
172
  LAPACK
173
  cheev
174
  ""
175
  "Accelerate"
176
  "${BLAS_LIBRARIES}"
177
  ""
178
  )
179
 endif(NOT LAPACK_LIBRARIES)
180
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
181
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
182
  if ( NOT LAPACK_LIBRARIES )
183
    check_lapack_libraries(
184
    LAPACK_LIBRARIES
185
    LAPACK
186
    cheev
187
    ""
188
    "vecLib"
189
    "${BLAS_LIBRARIES}"
190
    ""
191
    )
192
  endif ( NOT LAPACK_LIBRARIES )
193
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
194
# Generic LAPACK library?
195
if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
196
  if ( NOT LAPACK_LIBRARIES )
197
    check_lapack_libraries(
198
    LAPACK_LIBRARIES
199
    LAPACK
200
    cheev
201
    ""
202
    "lapack"
203
    "${BLAS_LIBRARIES}"
204
    ""
205
    )
206
  endif ( NOT LAPACK_LIBRARIES )
207
endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
208
209
if(BLA_F95)
210
 if(LAPACK95_LIBRARIES)
211
  set(LAPACK95_FOUND TRUE)
212
 else(LAPACK95_LIBRARIES)
213
  set(LAPACK95_FOUND FALSE)
214
 endif(LAPACK95_LIBRARIES)
215
 if(NOT LAPACK_FIND_QUIETLY)
216
  if(LAPACK95_FOUND)
217
    message(STATUS "A library with LAPACK95 API found.")
218
  else(LAPACK95_FOUND)
219
    if(LAPACK_FIND_REQUIRED)
220
      message(FATAL_ERROR
221
      "A required library with LAPACK95 API not found. Please specify library location."
222
      )
223
    else(LAPACK_FIND_REQUIRED)
224
      message(STATUS
225
      "A library with LAPACK95 API not found. Please specify library location."
226
      )
227
    endif(LAPACK_FIND_REQUIRED)
228
  endif(LAPACK95_FOUND)
229
 endif(NOT LAPACK_FIND_QUIETLY)
230
 set(LAPACK_FOUND "${LAPACK95_FOUND}")
231
 set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}")
232
else(BLA_F95)
233
 if(LAPACK_LIBRARIES)
234
  set(LAPACK_FOUND TRUE)
235
 else(LAPACK_LIBRARIES)
236
  set(LAPACK_FOUND FALSE)
237
 endif(LAPACK_LIBRARIES)
238
239
 if(NOT LAPACK_FIND_QUIETLY)
240
  if(LAPACK_FOUND)
241
    message(STATUS "A library with LAPACK API found.")
242
  else(LAPACK_FOUND)
243
    if(LAPACK_FIND_REQUIRED)
244
      message(FATAL_ERROR
245
      "A required library with LAPACK API not found. Please specify library location."
246
      )
247
    else(LAPACK_FIND_REQUIRED)
248
      message(STATUS
249
      "A library with LAPACK API not found. Please specify library location."
250
      )
251
    endif(LAPACK_FIND_REQUIRED)
252
  endif(LAPACK_FOUND)
253
 endif(NOT LAPACK_FIND_QUIETLY)
254
endif(BLA_F95)
(-)CMakeLists.txt.orig (+14 lines)
Lines 10-15 Link Here
10
# ----------------------------------------------------------------------------
10
# ----------------------------------------------------------------------------
11
11
12
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
12
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
13
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
13
# Add these standard paths to the search paths for FIND_LIBRARY
14
# Add these standard paths to the search paths for FIND_LIBRARY
14
# to find libraries from these locations first
15
# to find libraries from these locations first
15
if(UNIX)
16
if(UNIX)
Lines 178-183 Link Here
178
179
179
# Build/install (or not) some apps:
180
# Build/install (or not) some apps:
180
# ===================================================
181
# ===================================================
182
set(BUILD_LAPACK ON CACHE BOOL "Build Lapack")
181
set(BUILD_EXAMPLES OFF CACHE BOOL "Build all examples")
183
set(BUILD_EXAMPLES OFF CACHE BOOL "Build all examples")
182
set(INSTALL_C_EXAMPLES OFF CACHE BOOL "Install C examples")
184
set(INSTALL_C_EXAMPLES OFF CACHE BOOL "Install C examples")
183
set(INSTALL_PYTHON_EXAMPLES OFF CACHE BOOL "Install Python examples")
185
set(INSTALL_PYTHON_EXAMPLES OFF CACHE BOOL "Install Python examples")
Lines 335-340 Link Here
335
      endif()
337
      endif()
336
    endif()
338
    endif()
337
339
340
    if(BUILD_LAPACK)
341
      set(LAPACK_LIBRARIES "opencv_lapack")
342
    else()
343
      find_package(LAPACK REQUIRED)
344
    endif()
345
338
    if(WITH_UNICAP)
346
    if(WITH_UNICAP)
339
      CHECK_MODULE(libunicap HAVE_UNICAP_)
347
      CHECK_MODULE(libunicap HAVE_UNICAP_)
340
      CHECK_MODULE(libucil HAVE_UNICAP_UCIL)
348
      CHECK_MODULE(libucil HAVE_UNICAP_UCIL)
Lines 1195-1200 Link Here
1195
message(STATUS "    Use TBB:                   NO")
1203
message(STATUS "    Use TBB:                   NO")
1196
endif()
1204
endif()
1197
1205
1206
if(BUILD_LAPACK)
1207
  message(STATUS "    Building Lapack             ")
1208
else()
1209
  message(STATUS "    Using External Lapack ")
1210
endif()
1211
1198
if(BUILD_LATEX_DOCS AND PDFLATEX_COMPILER)
1212
if(BUILD_LATEX_DOCS AND PDFLATEX_COMPILER)
1199
message(STATUS "    Build Documentation        1")
1213
message(STATUS "    Build Documentation        1")
1200
else()
1214
else()
(-)src/cxcore/CMakeLists.txt.orig (-1 / +1 lines)
Lines 53-59 Link Here
53
    )
53
    )
54
54
55
# Add the required libraries for linking:
55
# Add the required libraries for linking:
56
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} opencv_lapack zlib flann)
56
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${LAPACK_LIBRARIES} zlib flann)
57
57
58
# Linker flag needed for Windows Mobile 5 and 6 SDKs
58
# Linker flag needed for Windows Mobile 5 and 6 SDKs
59
if(MSVC)
59
if(MSVC)

Return to bug 313649