mirror of
https://github.com/csukuangfj/kaldifeat.git
synced 2025-08-09 01:52:39 +00:00
* Support macOS. * Remove extra files. * Minor fixes. * Minor fixes. * fix an error. * Fix building pip packages on macOS. * Fix test errors. * Release v1.4. * Fix test errors.
26 lines
856 B
CMake
26 lines
856 B
CMake
# Copyright (c) 2020 Fangjun Kuang (csukuangfj@gmail.com)
|
|
# See ../LICENSE for clarification regarding multiple authors
|
|
|
|
# PYTHON_EXECUTABLE is set by cmake/pybind11.cmake
|
|
message(STATUS "Python executable: ${PYTHON_EXECUTABLE}")
|
|
execute_process(
|
|
COMMAND "${PYTHON_EXECUTABLE}" -c "import os; import torch; print(os.path.dirname(torch.__file__))"
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
OUTPUT_VARIABLE TORCH_DIR
|
|
)
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH "${TORCH_DIR}")
|
|
find_package(Torch REQUIRED)
|
|
|
|
# set the global CMAKE_CXX_FLAGS so that
|
|
# kaldifeat uses the same ABI flag as PyTorch
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
|
|
|
|
execute_process(
|
|
COMMAND "${PYTHON_EXECUTABLE}" -c "import torch; print(torch.__version__)"
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
OUTPUT_VARIABLE TORCH_VERSION
|
|
)
|
|
|
|
message(STATUS "PyTorch version: ${TORCH_VERSION}")
|