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

ERROR: env CMAKE_BUILD_PARALLEL_LEVEL="" pip install . #126

Closed
bobz965 opened this issue Dec 11, 2023 · 9 comments · Fixed by #1332
Closed

ERROR: env CMAKE_BUILD_PARALLEL_LEVEL="" pip install . #126

bobz965 opened this issue Dec 11, 2023 · 9 comments · Fixed by #1332

Comments

@bobz965
Copy link

bobz965 commented Dec 11, 2023

image

(vv) ➜  mlx git:(main) env CMAKE_BUILD_PARALLEL_LEVEL="" pip install .
Looking in indexes: http://pypi.douban.com/simple
Processing /Users/aoy/g/m/mlx
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mlx
  Building wheel for mlx (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for mlx (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [146 lines of output]
      running bdist_wheel
      running build
      running build_py
      copying python/mlx/optimizers.py -> build/lib.macosx-14-arm64-cpython-311/mlx
      copying python/mlx/utils.py -> build/lib.macosx-14-arm64-cpython-311/mlx
      copying python/mlx/extension.py -> build/lib.macosx-14-arm64-cpython-311/mlx
      copying python/mlx/_reprlib_fix.py -> build/lib.macosx-14-arm64-cpython-311/mlx
      copying python/mlx/nn/__init__.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn
      copying python/mlx/nn/utils.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn
      copying python/mlx/nn/losses.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn
      copying python/mlx/nn/layers/convolution.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/embedding.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/activations.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/containers.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/linear.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/__init__.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/transformer.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/dropout.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/positional_encoding.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/normalization.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      copying python/mlx/nn/layers/base.py -> build/lib.macosx-14-arm64-cpython-311/mlx/nn/layers
      running egg_info
      writing python/mlx.egg-info/PKG-INFO
      writing dependency_links to python/mlx.egg-info/dependency_links.txt
      writing requirements to python/mlx.egg-info/requires.txt
      writing top-level names to python/mlx.egg-info/top_level.txt
      reading manifest file 'python/mlx.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'python/mlx.egg-info/SOURCES.txt'
      running build_ext
      -- Building MLX for arm64 processor on Darwin
      -- Building METAL sources
      -- Building with SDK for MacOS version 14.0

      -- Accelerate found /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/Accelerate.framework
      -- Building Python bindings.
      -- Found pybind11: /Users/aoy/vv/include (found version "2.11.1")
      -- Configuring done (1.8s)
      -- Generating done (0.0s)
      -- Build files have been written to: /Users/aoy/g/m/mlx/build/temp.macosx-14-arm64-cpython-311/mlx.core
      [  2%] Building indexing.air
      [  2%] Building sort.air
      [  5%] Building reduce.air
      [  8%] Building softmax.air
      [ 10%] Building random.air
      [  9%] Building arange.air
      [ 12%] Building scan.air
      [ 12%] Building unary.air
      [ 12%] Building gemv.air
      [ 15%] Building binary.air
      [ 17%] Building gemm.air
      [ 17%] Building copy.air
      [ 19%] Building conv.air
      [ 19%] Building arg_reduce.air
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      make[2]: *** [mlx/backend/metal/kernels/indexing.air] Error 72
      make[2]: *** Waiting for unfinished jobs....
      make[2]: *** [mlx/backend/metal/kernels/sort.air] Error 72
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      make[2]: *** [mlx/backend/metal/kernels/reduce.air] Error 72
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      make[2]: *** [mlx/backend/metal/kernels/softmax.air] Error 72
      make[2]: *** [mlx/backend/metal/kernels/arange.air] Error 72
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      make[2]: *** [mlx/backend/metal/kernels/unary.air] Error 72
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      make[2]: *** [mlx/backend/metal/kernels/gemm.air] Error 72
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      make[2]: *** [mlx/backend/metal/kernels/conv.air] Error 72
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      make[2]: *** [mlx/backend/metal/kernels/scan.air] Error 72
      xcrun: error: unable to find utility "metal", not a developer tool or in PATH
      make[2]: *** [mlx/backend/metal/kernels/binary.air] Error 72
      make[2]: *** [mlx/backend/metal/kernels/copy.air] Error 72
      make[2]: *** [mlx/backend/metal/kernels/random.air] Error 72
      make[2]: *** [mlx/backend/metal/kernels/arg_reduce.air] Error 72
      make[2]: *** [mlx/backend/metal/kernels/gemv.air] Error 72
      make[1]: *** [mlx/backend/metal/kernels/CMakeFiles/mlx-metallib.dir/all] Error 2
      make: *** [all] Error 2
      Traceback (most recent call last):
        File "/Users/aoy/vv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/aoy/vv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/aoy/vv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 404, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
          self.run_setup()
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 141, in <module>
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/normal/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 110, in run
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 88, in run
          _build_ext.run(self)
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/private/var/folders/9j/ppqlnxr15ps1phvqb89bynvm0000gn/T/pip-build-env-8xbwkq4y/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "<string>", line 102, in build_extension
        File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install']' returned non-zero exit status 2.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mlx
Failed to build mlx
ERROR: Could not build wheels for mlx, which is required to install pyproject.toml-based projects
(vv) ➜  mlx git:(main)
@awni
Copy link
Member

awni commented Dec 11, 2023

Looks like a duplicate of #103

Could you see if the guidance in that issue solves your problem? If not, comment here and I will reopen.

@awni awni closed this as completed Dec 11, 2023
@venkadesh-p
Copy link

venkadesh-p commented Dec 11, 2023

I am also facing same issue and I have tried the #103, but it didn't solved my issue. Here is my error output:

  error: subprocess-exited-with-error
  
  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/Users/venk/Library/Python/3.9/lib/python/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/venk/Library/Python/3.9/lib/python/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/venk/Library/Python/3.9/lib/python/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 132, in get_requires_for_build_editable
          return hook(config_settings)
        File "/private/var/folders/j_/m18b2md50hldfvst6hsy94x00000gn/T/pip-build-env-m6ter3nl/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 441, in get_requires_for_build_editable
          return self.get_requires_for_build_wheel(config_settings)
        File "/private/var/folders/j_/m18b2md50hldfvst6hsy94x00000gn/T/pip-build-env-m6ter3nl/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/j_/m18b2md50hldfvst6hsy94x00000gn/T/pip-build-env-m6ter3nl/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/j_/m18b2md50hldfvst6hsy94x00000gn/T/pip-build-env-m6ter3nl/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 143, in <module>
        File "<string>", line 23, in get_version
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['git', 'rev-parse', '--short', 'HEAD']' returned non-zero exit status 128.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@awni Can u pls help me to solve this issue?

@ibehnam
Copy link

ibehnam commented Aug 15, 2024

Looks like a duplicate of #103

Could you see if the guidance in that issue solves your problem? If not, comment here and I will reopen.

It's not a dupe. I'm also running into this issue:

Following the documentation instructions ↓

╰─❯ CMAKE_BUILD_PARALLEL_LEVEL="" pip install .
Processing /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mlx
  Building wheel for mlx (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for mlx (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [173 lines of output]
      running bdist_wheel
      running build
      running build_py
      copying python/mlx/_os_warning.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx
      copying python/mlx/utils.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx
      copying python/mlx/extension.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx
      copying python/mlx/_reprlib_fix.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx
      copying python/mlx/nn/__init__.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn
      copying python/mlx/nn/utils.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn
      copying python/mlx/nn/losses.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn
      copying python/mlx/nn/init.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn
      copying python/mlx/optimizers/__init__.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/optimizers
      copying python/mlx/optimizers/optimizers.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/optimizers
      copying python/mlx/optimizers/schedulers.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/optimizers
      copying python/mlx/nn/layers/convolution.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/quantized.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/embedding.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/recurrent.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/activations.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/containers.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/linear.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/pooling.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/__init__.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/upsample.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/transformer.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/dropout.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/positional_encoding.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/normalization.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      copying python/mlx/nn/layers/base.py -> build/lib.macosx-10.9-universal2-cpython-312/mlx/nn/layers
      running egg_info
      writing python/mlx.egg-info/PKG-INFO
      writing dependency_links to python/mlx.egg-info/dependency_links.txt
      writing requirements to python/mlx.egg-info/requires.txt
      writing top-level names to python/mlx.egg-info/top_level.txt
      reading manifest file 'python/mlx.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'python/mlx.egg-info/SOURCES.txt'
      copying python/mlx/py.typed -> build/lib.macosx-10.9-universal2-cpython-312/mlx
      running build_ext
      -- Building MLX for arm64 processor on Darwin
      -- Building METAL sources
      -- Building with SDK for macOS version 14.5

      -- Accelerate found /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/System/Library/Frameworks/Accelerate.framework
      -- Checking for module 'mpi-c'
      --   No package 'mpi-c' found
      -- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
      -- Checking for module 'mpi-cxx'
      --   No package 'mpi-cxx' found
      -- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
      -- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
      -- Downloading json
      -- Using the multi-header code from /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core/_deps/json-src/include/
      -- Downloading gguflib
      -- Version: 10.2.1
      -- Build type: Release
      -- Building Python bindings.
      -- Configuring done (5.7s)
      -- Generating done (0.1s)
      -- Build files have been written to: /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core
      [  0%] Built target cpu_compiled_preamble
      [  1%] Generating jit/reduce_utils.cpp
      [  1%] Generating jit/binary_ops.cpp
      [  1%] Generating jit/ternary_ops.cpp
      [  2%] Generating jit/gather.cpp
      [  3%] Generating jit/unary_ops.cpp
      [  5%] Generating jit/utils.cpp
      [  5%] Generating jit/scatter.cpp
      [  6%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/nb_func.cpp.o
      [  6%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/nb_static_property.cpp.o
      [  6%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/nb_enum.cpp.o
      [  7%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/nb_ndarray.cpp.o
      [  7%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/nb_internals.cpp.o
      [ 13%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/nb_type.cpp.o
      [ 18%] Generating jit/hadamard.cpp
      [ 25%] Built target mlx-metallib
      [ 26%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/error.cpp.o
      [ 27%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/common.cpp.o
      [ 28%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/implicit.cpp.o
      [ 28%] Building C object mlx/io/CMakeFiles/gguflib.dir/__/__/_deps/gguflib-src/fp16.c.o
      [ 29%] Building C object mlx/io/CMakeFiles/gguflib.dir/__/__/_deps/gguflib-src/gguflib.c.o
      [ 29%] Building CXX object python/src/CMakeFiles/nanobind-static.dir/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/nanobind/src/trampoline.cpp.o
      /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/mlx/backend/metal/make_compiled_preamble.sh: line 21: /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core/mlx/backend/metal/jit/binary_ops.cpp: No such file or directory
      /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/mlx/backend/metal/make_compiled_preamble.sh: line 21: /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core/mlx/backend/metal/jit/gather.cpp: No such file or directory
      make[2]: *** [mlx/backend/metal/jit/binary_ops.cpp] Error 1
      /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/mlx/backend/metal/make_compiled_preamble.sh: line 21: /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core/mlx/backend/metal/jit/ternary_ops.cpp: No such file or directory
      make[1]: *** [mlx/backend/metal/CMakeFiles/binary_ops.dir/all] Error 2
      make[1]: *** Waiting for unfinished jobs....
      /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/mlx/backend/metal/make_compiled_preamble.sh: line 21: /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core/mlx/backend/metal/jit/reduce_utils.cpp: No such file or directory
      make[2]: *** [mlx/backend/metal/jit/gather.cpp] Error 1
      /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/mlx/backend/metal/make_compiled_preamble.sh: line 21: /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core/mlx/backend/metal/jit/unary_ops.cpp: No such file or directory
      make[2]: *** [mlx/backend/metal/jit/ternary_ops.cpp] Error 1
      make[1]: *** [mlx/backend/metal/CMakeFiles/ternary_ops.dir/all] Error 2
      /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/mlx/backend/metal/make_compiled_preamble.sh: line 21: /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core/mlx/backend/metal/jit/utils.cpp: No such file or directory
      make[2]: *** [mlx/backend/metal/jit/reduce_utils.cpp] Error 1
      make[1]: *** [mlx/backend/metal/CMakeFiles/reduce_utils.dir/all] Error 2
      make[1]: *** [mlx/backend/metal/CMakeFiles/gather.dir/all] Error 2
      make[2]: *** [mlx/backend/metal/jit/utils.cpp] Error 1
      make[2]: *** [mlx/backend/metal/jit/unary_ops.cpp] Error 1
      make[1]: *** [mlx/backend/metal/CMakeFiles/utils.dir/all] Error 2
      make[1]: *** [mlx/backend/metal/CMakeFiles/unary_ops.dir/all] Error 2
      /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/mlx/backend/metal/make_compiled_preamble.sh: line 21: /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core/mlx/backend/metal/jit/scatter.cpp: No such file or directory
      make[2]: *** [mlx/backend/metal/jit/scatter.cpp] Error 1
      make[1]: *** [mlx/backend/metal/CMakeFiles/scatter.dir/all] Error 2
      /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/mlx/backend/metal/make_compiled_preamble.sh: line 21: /Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/code/mlx/build/temp.macosx-10.9-universal2-cpython-312/mlx.core/mlx/backend/metal/jit/hadamard.cpp: No such file or directory
      make[2]: *** [mlx/backend/metal/jit/hadamard.cpp] Error 1
      make[1]: *** [mlx/backend/metal/CMakeFiles/hadamard.dir/all] Error 2
      [ 30%] Linking C static library libgguflib.a
      [ 30%] Built target gguflib
      [ 30%] Linking CXX static library libnanobind-static.a
      [ 30%] Built target nanobind-static
      make: *** [all] Error 2
      Traceback (most recent call last):
        File "/Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/behnam/Library/Mobile Documents/com~apple~CloudDocs/Documents/Papers/9. NOICE/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 415, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir
          self.run_setup()
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 164, in <module>
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 108, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
          dist.run_commands()
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 964, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 945, in run_command
          super().run_command(command)
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 983, in run_command
          cmd_obj.run()
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/command/bdist_wheel.py", line 373, in run
          self.run_command("build")
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 945, in run_command
          super().run_command(command)
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 983, in run_command
          cmd_obj.run()
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 945, in run_command
          super().run_command(command)
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 983, in run_command
          cmd_obj.run()
        File "<string>", line 109, in run
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 93, in run
          _build_ext.run(self)
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
          self.build_extensions()
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 476, in build_extensions
          self._build_extensions_serial()
        File "/private/var/folders/cm/cqyqmzs946x4fzvpz6q7y3xr0000gn/T/pip-build-env-5i2h8wk0/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 502, in _build_extensions_serial
          self.build_extension(ext)
        File "<string>", line 101, in build_extension
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install']' returned non-zero exit status 2.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mlx
Failed to build mlx
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (mlx)

Could you please tell us what to do?

@altaic
Copy link

altaic commented Aug 15, 2024

Looks like you're trying to build on macOS 10.9, but macOS 13.5+ is required.

@ibehnam
Copy link

ibehnam commented Aug 15, 2024

@altaic Weird, I'm actually on macOS 14.5.

@altaic
Copy link

altaic commented Aug 15, 2024

I was looking at this output:
build/lib.macosx-10.9-universal2-cpython-312

Perhaps your python was built for 10.9?

@awni
Copy link
Member

awni commented Aug 15, 2024

@ibehnam The problem is the space character in your path. I can try and send a patch for that shortly. But it should build if you move mlx to a path without a space (like /Users/behnam/Library/mlx).

Re the OS10.9 message, that is very odd.. it might be worth looking into separately as perhaps setup.py / CMake are assuming an invalid target (but I think it should build despite that).

@awni
Copy link
Member

awni commented Aug 15, 2024

It uses sysconfig.get_platform() to pick those names. And for some reason that give a really outdated OS number. Perhaps it's something like the minimum supported platform.. but I'm not sure.

@ibehnam
Copy link

ibehnam commented Aug 16, 2024

@ibehnam The problem is the space character in your path. I can try and send a patch for that shortly. But it should build if you move mlx to a path without a space (like /Users/behnam/Library/mlx).

Re the OS10.9 message, that is very odd.. it might be worth looking into separately as perhaps setup.py / CMake are assuming an invalid target (but I think it should build despite that).

Thanks, using a path without spaces helped fix the problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants