0

I am trying to build openvino from source, but I got a very weird error complaining

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

This is how I configure the 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.

I have searched online, but couldn't find any related resources.

jiashenC
  • 1,812
  • 2
  • 16
  • 31

1 Answers1

0

Use the following options to specify an exact Python version:

-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_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

Rommel_Intel
  • 1,369
  • 1
  • 4
  • 8
  • I don't have Python.framework under Library. That's the reason why I use /Application ... instead. Actually I believe your doc is instead out dated. I am on MacOS Cataline (1.15.6) – jiashenC Aug 12 '20 at 13:41
  • I suggest you install Python3 using python.org installer, which installs into a folder in /Applications, and its library into /Library/Frameworks/Python.framework. – Rommel_Intel Aug 19 '20 at 08:28