jax-ml / jax

Composable transformations of Python+NumPy programs: differentiate, vectorize, JIT to GPU/TPU, and more

Home Page:http://jax.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

building from source fails due to mlir BUILD referring to MlirHloModule.cc instead of MlirHloModule.cpp

randyau opened this issue · comments

building jax from source with --enable_cuda flag,
freshly cloned from the repo
on an WSL2 ubuntu install

gets this error in building:
ERROR: /mnt/e/linux/ubuntu/jax/jaxlib/mlir/_mlir_libs/BUILD.bazel:90:13: no such target '@org_tensorflow//tensorflow/compiler/mlir/hlo:python/MlirHloModule.cc': target 'python/MlirHloModule.cc' not declared in package 'tensorflow/compiler/mlir/hlo' (did you mean 'python/MlirHloModule.cpp'?) defined by /home/agi/.cache/bazel/_bazel_agi/e71f5b8290a4fc88939262d32d7b9edb/external/org_tensorflow/tensorflow/compiler/mlir/hlo/BUILD and referenced by '//jaxlib/mlir/_mlir_libs:_mlirHlo.so'

Issue can be fixed by going to
/mnt/e/linux/ubuntu/jax/jaxlib/mlir/_mlir_libs/BUILD.bazel:90
and changing the file extension from .cc to .cpp

Looks like the line was recently patched from .cpp to .cc to "Fix broken builds"
not sure why there's conflicting build experiences

See the linked pull-request I just opened - the real change happened inside of the Tensorflow repository, where the MlirHLO compiler lies, and where cpp files were renamed to cc files. When bumping the version of the Tensorflow repo in the WORKSPACE file to a more current one, this issue is fixed.

Try again now from main - it should work now :)

This is now fixed at head due to #11073 (Thanks for the PR @ludgerpaehler !)