Skip to content

I cannot create a new build of jaxlib on my macBook Pro with M4 Apple Silicon #28121

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

Closed
sjlearmonth opened this issue Apr 18, 2025 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@sjlearmonth
Copy link

Description

I have tried following the instructions at;

Build for macOS

to create a fresh build of jaxlib on my M4 Apple Silicon macbook Pro and using Python 3.11.9 in a conda environment but the build process fails with the following output in Terminal;

(py3119) /Users/StephenLearmonth/jax $: python build/build.py build --wheels=jaxlib --python_version=3.11.9 --verbose
2025-04-18 16:42:41,217 - INFO -
_ _ __ __
| | / \ \ / /
_ | |/ _ \ \ /
| || / ___ /
___/
/ /_/_\

2025-04-18 16:42:41,217 - INFO - Verbose logging enabled
2025-04-18 16:42:41,245 - DEBUG - Bazel path: ./bazel-7.4.1-darwin-x86_64
2025-04-18 16:42:41,245 - DEBUG - Bazel version: 7.4.1
2025-04-18 16:42:41,245 - DEBUG - Hermetic Python version: 3.11.9
2025-04-18 16:42:41,321 - DEBUG - Using Clang as the compiler, clang path: /usr/bin/clang, clang version: 17
2025-04-18 16:42:41,321 - DEBUG - Enabling MKL DNN
2025-04-18 16:42:41,321 - DEBUG - Using release cpu features: --config=avx_posix
2025-04-18 16:42:41,321 - INFO - Bazel options written to .jax_configure.bazelrc
2025-04-18 16:42:41,321 - DEBUG - Artifacts output directory: /Users/StephenLearmonth/jax/dist

2025-04-18 16:42:41,321 - INFO - Building jaxlib for darwin x86_64...
2025-04-18 16:42:41,321 - INFO - [EXECUTING] ./bazel-7.4.1-darwin-x86_64 run --repo_env=HERMETIC_PYTHON_VERSION=3.11.9 --verbose_failures=true --action_env=CLANG_COMPILER_PATH="/usr/bin/clang" --repo_env=CC="/usr/bin/clang" --repo_env=CXX="/usr/bin/clang++" --repo_env=BAZEL_COMPILER="/usr/bin/clang" --config=clang --define=xnn_enable_avxvnniint8=false --config=mkl_open_source_only --config=avx_posix //jaxlib/tools:build_wheel -- --output_path="/Users/StephenLearmonth/jax/dist" --cpu=x86_64 --jaxlib_git_hash=767c741da62399590da2554081b9547e5411823b
WARNING: The following configs were expanded more than once: [clang, mkl_open_source_only, avx_posix]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=120
INFO: Reading rc options for 'run' from /Users/StephenLearmonth/jax/.bazelrc:
Inherited 'common' options: --noenable_bzlmod --noincompatible_enable_cc_toolchain_resolution --announce_rc --experimental_cc_shared_library --experimental_repo_remote_exec
INFO: Reading rc options for 'run' from /Users/StephenLearmonth/jax/.bazelrc:
Inherited 'build' options: --spawn_strategy=local --enable_platform_specific_config --define=grpc_no_ares=true --define=tsl_link_protobuf=true -c opt --output_filter=DONT_MATCH_ANYTHING --copt=-DMLIR_PYTHON_PACKAGE_PREFIX=jaxlib.mlir. --copt=-DNB_DOMAIN=jax --repo_env USE_PYWRAP_RULES=1
INFO: Reading rc options for 'run' from /Users/StephenLearmonth/jax/.jax_configure.bazelrc:
Inherited 'build' options: --repo_env=HERMETIC_PYTHON_VERSION=3.11.9 --verbose_failures=true --action_env=CLANG_COMPILER_PATH=/usr/bin/clang --repo_env=CC=/usr/bin/clang --repo_env=CXX=/usr/bin/clang++ --repo_env=BAZEL_COMPILER=/usr/bin/clang --config=clang --define=xnn_enable_avxvnniint8=false --config=mkl_open_source_only --config=avx_posix
INFO: Found applicable config definition build:clang in file /Users/StephenLearmonth/jax/.bazelrc: --copt=-Wno-gnu-offsetof-extensions --copt=-Qunused-arguments --copt=-Werror=mismatched-tags --copt=-Wno-error=c23-extensions
INFO: Found applicable config definition build:mkl_open_source_only in file /Users/StephenLearmonth/jax/.bazelrc: --define=tensorflow_mkldnn_contraction_kernel=1
INFO: Found applicable config definition build:avx_posix in file /Users/StephenLearmonth/jax/.bazelrc: --copt=-mavx --host_copt=-mavx
INFO: Found applicable config definition build:clang in file /Users/StephenLearmonth/jax/.bazelrc: --copt=-Wno-gnu-offsetof-extensions --copt=-Qunused-arguments --copt=-Werror=mismatched-tags --copt=-Wno-error=c23-extensions
INFO: Found applicable config definition build:mkl_open_source_only in file /Users/StephenLearmonth/jax/.bazelrc: --define=tensorflow_mkldnn_contraction_kernel=1
INFO: Found applicable config definition build:avx_posix in file /Users/StephenLearmonth/jax/.bazelrc: --copt=-mavx --host_copt=-mavx
INFO: Found applicable config definition build:macos in file /Users/StephenLearmonth/jax/.bazelrc: --config=posix --apple_platform_type=macos --linkopt=-Wl,-undefined,dynamic_lookup --host_linkopt=-Wl,-undefined,dynamic_lookup --apple_crosstool_top=@local_config_apple_cc//:toolchain --crosstool_top=@local_config_apple_cc//:toolchain --host_crosstool_top=@local_config_apple_cc//:toolchain
INFO: Found applicable config definition build:posix in file /Users/StephenLearmonth/jax/.bazelrc: --copt=-fvisibility=hidden --copt=-Wno-sign-compare --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
INFO: Repository python_version_repo instantiated at:
/Users/StephenLearmonth/jax/WORKSPACE:10:25: in
/private/var/tmp/_bazel_StephenLearmonth/fd1cbd5ef161471eb3034c09ec069cdd/external/xla/third_party/py/python_init_repositories.bzl:13:22: in python_init_repositories
Repository rule python_repository defined at:
/private/var/tmp/_bazel_StephenLearmonth/fd1cbd5ef161471eb3034c09ec069cdd/external/xla/third_party/py/python_repo.bzl:209:36: in
ERROR: /private/var/tmp/_bazel_StephenLearmonth/fd1cbd5ef161471eb3034c09ec069cdd/external/xla/third_party/py/python_repo.bzl:37:13: An error occurred during the fetch of repository 'python_version_repo':
Traceback (most recent call last):
File "/private/var/tmp/_bazel_StephenLearmonth/fd1cbd5ef161471eb3034c09ec069cdd/external/xla/third_party/py/python_repo.bzl", line 37, column 13, in _python_repository_impl
fail("""
Error in fail:
Could not find requirements_lock.txt file matching specified Python version.
Specified python version: 3.11.9
Python versions with available requirement_lock.txt files: 3.10, 3.11, 3.12, 3.13, 3.13-ft, 3.14-ft
Please check python_init_repositories() in your WORKSPACE file.
ERROR: Error computing the main repository mapping: no such package '@@python_version_repo//':
Could not find requirements_lock.txt file matching specified Python version.
Specified python version: 3.11.9
Python versions with available requirement_lock.txt files: 3.10, 3.11, 3.12, 3.13, 3.13-ft, 3.14-ft
Please check python_init_repositories() in your WORKSPACE file.
Computing main repo mapping:
2025-04-18 16:42:41,776 - DEBUG - Command finished with return code 1
Traceback (most recent call last):
File "/Users/StephenLearmonth/jax/build/build.py", line 778, in
asyncio.run(main())
File "/opt/anaconda3/envs/py3119/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/py3119/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/py3119/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/StephenLearmonth/jax/build/build.py", line 723, in main
raise RuntimeError(f"Command failed with return code {result.return_code}")
RuntimeError: Command failed with return code 1
`

System info (python version, jaxlib version, accelerator, etc.)

Python 3.11.9
macOS Sequioa 15.4.1

@sjlearmonth sjlearmonth added the bug Something isn't working label Apr 18, 2025
@hawkinsp
Copy link
Collaborator

Try --python_version=3.11 (no patch version number).

@jakevdp
Copy link
Collaborator

jakevdp commented Apr 18, 2025

Could you try with --python_version=3.11 rather than --python_version=3.11.9?

@sjlearmonth
Copy link
Author

sjlearmonth commented Apr 18, 2025 via email

@jakevdp
Copy link
Collaborator

jakevdp commented Apr 18, 2025

--python_version=3.11 should work with any 3.11.X version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants