Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR #17319: Fixes XLA build with numpy>=2.1.0 #17713

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions xla/tsl/python/lib/core/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ limitations under the License.
#define NO_IMPORT_ARRAY
#endif

// Prevent linking error with numpy>=2.1.0
// error: undefined hidden symbol: _xla_numpy_apiPyArray_RUNTIME_VERSION
// Without this define, Numpy's API symbols will have hidden symbol visibility,
// which may break things if Bazel chooses to build a cc_library target into
// its own .so file. Bazel typically does this for debug builds.
#define NPY_API_SYMBOL_ATTRIBUTE

// clang-format off
// Place `<locale>` before <Python.h> to avoid build failure in macOS.
#include <locale>
Expand Down
Loading