From a7181bcde8786c13df880257739a25dd988aff0c Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Fri, 15 Jul 2022 07:55:25 +0000 Subject: [PATCH] fix pybind11/numpy.h not found --- CMakeLists.txt | 2 +- cmake/summary.cmake | 6 +++++- paddlespeech/audio/src/CMakeLists.txt | 2 +- paddlespeech/audio/src/pybind/kaldi/feature_common.h | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d260dd3d..57d806e16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ include(openblas) # packages find_package(Python3 COMPONENTS Interpreter Development) -find_package(pybind11 CONFIG) +find_package(pybind11 CONFIG REQUIRED) # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -O0 -Wall -g") diff --git a/cmake/summary.cmake b/cmake/summary.cmake index 67e8be0a9..f04d44698 100644 --- a/cmake/summary.cmake +++ b/cmake/summary.cmake @@ -37,5 +37,9 @@ function (onnx_print_configuration_summary) message(STATUS " Python executable : ${Python_EXECUTABLE}") message(STATUS " Python includes : ${Python_INCLUDE_DIR}") message(STATUS " Python libraries : ${Python_LIBRARY}") - + message(STATUS " PYBIND11 : ${pybind11_FOUND}") + message(STATUS " Pybind11 version : ${pybind11_VERSION}") + message(STATUS " Pybind11 include : ${pybind11_INCLUDE_DIR}") + message(STATUS " Pybind11 includes : ${pybind11_INCLUDE_DIRS}") + message(STATUS " Pybind11 libraries : ${pybind11_LIBRARIES}") endfunction() \ No newline at end of file diff --git a/paddlespeech/audio/src/CMakeLists.txt b/paddlespeech/audio/src/CMakeLists.txt index 4249e04e2..eea07f637 100644 --- a/paddlespeech/audio/src/CMakeLists.txt +++ b/paddlespeech/audio/src/CMakeLists.txt @@ -105,7 +105,7 @@ function(define_extension name sources include_dirs libraries definitions) add_library(${name} SHARED ${sources}) target_compile_definitions(${name} PRIVATE "${definitions}") target_include_directories( - ${name} PRIVATE ${PROJECT_SOURCE_DIR} ${Python_INCLUDE_DIR} ${include_dirs}) + ${name} PRIVATE ${PROJECT_SOURCE_DIR} ${Python_INCLUDE_DIR} ${pybind11_INCLUDE_DIR} ${include_dirs}) target_link_libraries( ${name} ${libraries} diff --git a/paddlespeech/audio/src/pybind/kaldi/feature_common.h b/paddlespeech/audio/src/pybind/kaldi/feature_common.h index dbac4ceac..05522bb7e 100644 --- a/paddlespeech/audio/src/pybind/kaldi/feature_common.h +++ b/paddlespeech/audio/src/pybind/kaldi/feature_common.h @@ -14,8 +14,8 @@ #pragma once -#include -#include +#include "pybind11/pybind11.h" +#include "pybind11/numpy.h" #include "feat/feature-window.h" namespace paddleaudio {