简体   繁体   English

从源代码构建 openvino 的错误:在 MacOS 上未从 Python header 文件定义 TAPI

[英]error for building openvino from source: TAPI is not defined from Python header file on MacOS

I am trying to build openvino from source, but I got a very weird error complaining我正在尝试从源代码构建 openvino,但我收到了一个非常奇怪的错误抱怨

In file included from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/include/python3.7m/Python.h:139: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/include/python3.7m/pythonrun.h:142:5: error: 'TAPI' is not defined, evaluates to 0 [-Werror,-Wundef] #if TAPI在 /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/include/python3.7m/Python.h:139 包含的文件中:/Applications/Xcode.app/Contents/Developer/ Library/Frameworks/Python3.framework/Versions/3.7/include/python3.7m/pythonrun.h:142:5:错误:未定义“TAPI”,计算结果为 0 [-Werror,-Wundef] #if TAPI

This is how I configure the cmake这就是我配置 cmake 的方式

cmake .. -DCMAKE_BUILD_TYPE=Release \
-DENABLE_PYTHON=ON \
-DPYTHON_EXECUTABLE=/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/bin/python3.7 \
-DPYTHON_LIBRARY=/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/libpython3.7m.dylib \
-DPYTHON_INCLUDE_DIR=/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/include/python3.7m \
-DENABLE_CLDNN=OFF \

I am using MacOS Catalina 10.15.6 with python3.7.我正在使用带有 python3.7 的 MacOS Catalina 10.15.6。

I have searched online, but couldn't find any related resources.我在网上搜索过,但找不到任何相关资源。

Use the following options to specify an exact Python version:使用以下选项指定准确的 Python 版本:

-DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7
-DPYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib -DPYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib
-DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m

More information is available at the following link: https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md#additional-build-options-3更多信息可通过以下链接获得: https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md#additional-build-options-3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM