-
Notifications
You must be signed in to change notification settings - Fork 8
/
openblas.cmake
47 lines (36 loc) · 1.5 KB
/
openblas.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Install OpenBLAS from source
#
if (NOT openblas_NAME)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
include (ExternalProject)
include (ExternalSource)
external_git_repo (openblas
0.2.5
http://github.com/xianyi/OpenBLAS)
if(NOT EXISTS ${MINGW_PATH}/gfortran.exe)
MESSAGE(FATAL_ERROR "ERROR: gfortran.exe not found in MINGW_PATH '${MINGW_PATH}'")
endif()
if(NOT EXISTS ${MSYS_PATH}/make.exe)
MESSAGE(FATAL_ERROR "ERROR: make.exe not found in MSYS_PATH '${MSYS_PATH}'")
endif()
configure_file(build_openblas.bat.in ${ILASTIK_DEPENDENCY_DIR}/tmp/build_openblas.bat)
file(TO_NATIVE_PATH ${ILASTIK_DEPENDENCY_DIR}/tmp/build_openblas.bat OPENBLAS_BUILD_BAT)
# NOTE: 'make' downloads and compiles lapack-3.4.2 on the fly and puts blas and lapack
# together into libopenblas.dll. numpy wants two separate libraries, so we copy the
# link library libopenblas.lib under the two names blas.lib and lapack.lib.
message ("Installing ${openblas_NAME} into ilastik build area: ${ILASTIK_DEPENDENCY_DIR} ...")
ExternalProject_Add(${openblas_NAME}
# DEPENDS
PREFIX ${ILASTIK_DEPENDENCY_DIR}
GIT_REPOSITORY ${openblas_URL}
GIT_TAG v0.2.5
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ${OPENBLAS_BUILD_BAT}
BUILD_IN_SOURCE 1
INSTALL_COMMAND "" # ${OPENBLAS_BUILD_BAT} already installs
)
set_target_properties(${openblas_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
endif (NOT openblas_NAME)