Fix build issue on mac with python-3.7.10 and clang-9.1.0
While building tensorflow on mac with python-2.7.10
and llvm 9.1.0 (macOS High Sierra 10.15.5), the following compilation
errors surface:
```
In file included from tensorflow/python/lib/core/py_util.cc:20:
In file included from ./tensorflow/core/lib/core/errors.h:19:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/sstream:174:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:216:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:492:15: error: C++ requires a type specifier for all declarations
char_type toupper(char_type __c) const
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:731:29: note: expanded from macro 'toupper'
...
...
```
The error is related to the issue in `pyport.h`.
The build error could be fixed by including `#include <locale>`
before including `#include <Python.h>`.
The changes in this PR allows the build to succeed.
Signed-off-by:
Yong Tang <yong.tang.github@outlook.com>
Loading
Please sign in to comment