@@ -6,12 +6,9 @@ include(GNUInstallDirs)
6
6
include (Utils)
7
7
include (third_party/get_third_party)
8
8
9
- # Should update cmake to a more recent version which supports FindPython3.
10
9
find_package (PythonInterp)
11
- if (NOT PYTHON_EXECUTABLE OR PYTHON_VERSION_MAJOR LESS 3)
12
- message (WARNING "Needs python3 to auto-generate most CMake files, but not found. "
13
- "Will try `python3` directly..." )
14
- set (PYTHON_EXECUTABLE "python3" )
10
+ if (NOT PYTHON_EXECUTABLE)
11
+ message (FATAL_ERROR "Needs python to auto-generate most CMake files, but not found." )
15
12
endif ()
16
13
17
14
message (STATUS "Running gen_cmake_skeleton.py" )
@@ -63,12 +60,16 @@ if(MATHLIB STREQUAL "OpenBLAS")
63
60
include_directories (${CMAKE_CURRENT_SOURCE_DIR} /tools/CLAPACK)
64
61
link_libraries (${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} )
65
62
elseif (MATHLIB STREQUAL "MKL" )
66
- set (BLA_VENDOR "Intel10_64lp" )
67
- # find_package(BLAS REQUIRED)
63
+ if (NOT DEFINED ENV{MKLROOT} OR "$ENV{MKLROOT} " STREQUAL "" )
64
+ message (FATAL_ERROR "Environment variable MKLROOT is not defined" )
65
+ else ()
66
+ message (STATUS "Finding MKL from \" $ENV{MKLROOT} \" " )
67
+ endif ()
68
68
normalize_env_path(ENV{MKLROOT})
69
+ set (BLA_VENDOR "Intel10_64lp_seq" ) # use the single threaded MKL by default
69
70
find_package (LAPACK REQUIRED)
70
71
add_definitions (-DHAVE_MKL=1)
71
- include_directories ($ENV{MKLROOT} /include ) # TODO: maybe not use env, idk, find_package doesnt handle includes...
72
+ include_directories ($ENV{MKLROOT} /include )
72
73
link_libraries (${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} )
73
74
elseif (MATHLIB STREQUAL "Accelerate" )
74
75
execute_process (COMMAND sw_vers -productVersion
@@ -113,8 +114,6 @@ endif()
113
114
114
115
find_package (CUDA)
115
116
if (CUDA_FOUND)
116
- set (CUB_ROOT_DIR "${PROJECT_SOURCE_DIR} /tools/cub" )
117
-
118
117
set (CUDA_PROPAGATE_HOST_FLAGS ON )
119
118
set (KALDI_CUDA_NVCC_FLAGS "--default-stream=per-thread;-std=c++${CMAKE_CXX_STANDARD} " )
120
119
if (MSVC )
@@ -146,6 +145,8 @@ if(CUDA_FOUND)
146
145
include_directories (${NvToolExt_INCLUDE_DIR} )
147
146
link_libraries (${NvToolExt_LIBRARIES} )
148
147
148
+ get_third_party(cub)
149
+ set (CUB_ROOT_DIR "${CMAKE_BINARY_DIR} /cub" )
149
150
find_package (CUB REQUIRED)
150
151
include_directories (${CUB_INCLUDE_DIR} )
151
152
endif ()
@@ -159,7 +160,7 @@ if(${KALDI_USE_PATCH_NUMBER})
159
160
endif ()
160
161
161
162
get_third_party(openfst)
162
- set (OPENFST_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR } /openfst)
163
+ set (OPENFST_ROOT_DIR ${CMAKE_BINARY_DIR } /openfst)
163
164
include (third_party/openfst_lib_target)
164
165
link_libraries (fst)
165
166
0 commit comments