Files
mlx/docs/build/doctrees/install.doctree

102 lines
29 KiB
Plaintext
Raw Normal View History

2024-01-17 17:15:29 -08:00
<EFBFBD><05><>t<00>sphinx.addnodes<65><73>document<6E><74><EFBFBD>)<29><>}<7D>(<28> rawsource<63><65><00><>children<65>]<5D><>docutils.nodes<65><73>section<6F><6E><EFBFBD>)<29><>}<7D>(hhh]<5D>(h <09>title<6C><65><EFBFBD>)<29><>}<7D>(h<05>Build and Install<6C>h]<5D>h <09>Text<78><74><EFBFBD><EFBFBD>Build and Install<6C><6C><EFBFBD><EFBFBD><EFBFBD>}<7D>(<28>parent<6E>h<11> _document<6E>h<03>source<63>N<EFBFBD>line<6E>Nuba<62>
attributes<EFBFBD>}<7D>(<28>ids<64>]<5D><>classes<65>]<5D><>names<65>]<5D><>dupnames<65>]<5D><>backrefs<66>]<5D>u<EFBFBD>tagname<6D>hhh hhh<1D>0/Users/awnihannun/repos/mlx/docs/src/install.rst<73>hKubh )<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05>Python Installation<6F>h]<5D>h<16>Python Installation<6F><6E><EFBFBD><EFBFBD><EFBFBD>}<7D>(hh0hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhh-hhhh,hKubh <09> paragraph<70><68><EFBFBD>)<29><>}<7D>(h<05>_MLX is available on PyPI. All you have to do to use MLX with your own Apple
silicon computer is<69>h]<5D>h<16>_MLX is available on PyPI. All you have to do to use MLX with your own Apple
silicon computer is<69><73><EFBFBD><EFBFBD><EFBFBD>}<7D>(hh@hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKhh-hhubh <09> literal_block<63><6B><EFBFBD>)<29><>}<7D>(h<05>pip install mlx<6C>h]<5D>h<16>pip install mlx<6C><78><EFBFBD><EFBFBD><EFBFBD>}<7D>hhPsbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><> xml:space<63><65>preserve<76><65>force<63><65><EFBFBD>language<67><65>shell<6C><6C>highlight_args<67>}<7D>uh+hNhh,hK
hh-hhubh?)<29><>}<7D>(h<05>>To install from PyPI you must meet the following requirements:<3A>h]<5D>h<16>>To install from PyPI you must meet the following requirements:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hhehhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKhh-hhubh <09> bullet_list<73><74><EFBFBD>)<29><>}<7D>(hhh]<5D>(h <09> list_item<65><6D><EFBFBD>)<29><>}<7D>(h<05>&Using an M series chip (Apple silicon)<29>h]<5D>h?)<29><>}<7D>(hh|h]<5D>h<16>&Using an M series chip (Apple silicon)<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hh~hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKhhzubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hxhhuhhhh,hNubhy)<29><>}<7D>(h<05>Using a native Python >= 3.8<EFBFBD>h]<5D>h?)<29><>}<7D>(hh<>h]<5D>h<16>Using a native Python >= 3.8<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(hh<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKhh<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hxhhuhhhh,hNubhy)<29><>}<7D>(h<05>macOS >= 13.3
<EFBFBD>h]<5D>h?)<29><>}<7D>(h<05> macOS >= 13.3<EFBFBD>h]<5D>h<16> macOS >= 13.3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(hh<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKhh<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hxhhuhhhh,hNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>bullet<65><74>-<2D>uh+hshh,hKhh-hhubh <09>note<74><65><EFBFBD>)<29><>}<7D>(h<05>hMLX is only available on devices running macOS >= 13.3
It is highly recommended to use macOS 14 (Sonoma)<29>h]<5D>h?)<29><>}<7D>(h<05>hMLX is only available on devices running macOS >= 13.3
It is highly recommended to use macOS 14 (Sonoma)<29>h]<5D>h<16>hMLX is only available on devices running macOS >= 13.3
It is highly recommended to use macOS 14 (Sonoma)<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hh<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKhh<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h<>hh-hhhh,hNubh?)<29><>}<7D>(h<05>CMLX is also available on conda-forge. To install MLX with conda do:<3A>h]<5D>h<16>CMLX is also available on conda-forge. To install MLX with conda do:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hh<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKhh-hhubhO)<29><>}<7D>(h<05>conda install conda-forge::mlx<6C>h]<5D>h<16>conda install conda-forge::mlx<6C><78><EFBFBD><EFBFBD><EFBFBD>}<7D>hh<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hKhh-hhubh )<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05>Troubleshooting<6E>h]<5D>h<16>Troubleshooting<6E><67><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhjhhhh,hK!ubh?)<29><>}<7D>(h<05>j*My OS and Python versions are in the required range but pip still does not find
a matching distribution.*<2A>h]<5D>h <09>emphasis<69><73><EFBFBD>)<29><>}<7D>(hjh]<5D>h<16>hMy OS and Python versions are in the required range but pip still does not find
a matching distribution.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jhjubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK#hjhhubh?)<29><>}<7D>(h<05>9Probably you are using a non-native Python. The output of<6F>h]<5D>h<16>9Probably you are using a non-native Python. The output of<6F><66><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj*hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK&hjhhubhO)<29><>}<7D>(h<05>8python -c "import platform; print(platform.processor())"<22>h]<5D>h<16>8python -c "import platform; print(platform.processor())"<22><><EFBFBD><EFBFBD><EFBFBD>}<7D>hj8sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK(hjhhubh?)<29><>}<7D>(h<05><>should be ``arm``. If it is ``i386`` (and you have M series machine) then you
are using a non-native Python. Switch your Python to a native Python. A good
way to do this is with `Conda <https://stackoverflow.com/q/65415996>`_.<2E>h]<5D>(h<16>
should be <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjHhhhNhNubh <09>literal<61><6C><EFBFBD>)<29><>}<7D>(h<05>``arm``<60>h]<5D>h<16>arm<72><6D><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjRhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjHubh<16> . If it is <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjHhhhNhNubjQ)<29><>}<7D>(h<05>``i386``<60>h]<5D>h<16>i386<38><36><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjdhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjHubh<16><> (and you have M series machine) then you
are using a non-native Python. Switch your Python to a native Python. A good
way to do this is with <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjHhhhNhNubh <09> reference<63><65><EFBFBD>)<29><>}<7D>(h<05>/`Conda <https://stackoverflow.com/q/65415996>`_<>h]<5D>h<16>Conda<64><61><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjxhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>name<6D><65>Conda<64><61>refuri<72><69>$https://stackoverflow.com/q/65415996<39>uh+jvhjHubh <09>target<65><74><EFBFBD>)<29><>}<7D>(h<05>' <https://stackoverflow.com/q/65415996><3E>h]<5D>h}<7D>(h!]<5D><>conda<64>ah#]<5D>h%]<5D><>conda<64>ah']<5D>h)]<5D><>refuri<72>j<EFBFBD>uh+j<><00>
referenced<EFBFBD>KhjHubh<16>.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjHhhhNhNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK,hjhhubeh}<7D>(h!]<5D><>troubleshooting<6E>ah#]<5D>h%]<5D>h']<5D><>troubleshooting<6E>ah)]<5D>uh+h
hh-hhhh,hK!j<>Kubeh}<7D>(h!]<5D><>python-installation<6F>ah#]<5D>h%]<5D><>python installation<6F>ah']<5D>h)]<5D>uh+h
hh hhhh,hKubh )<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05>Build from source<63>h]<5D>h<16>Build from source<63><65><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhj<>hhhh,hK2ubh )<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05>Build Requirements<74>h]<5D>h<16>Build Requirements<74><73><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhj<>hhhh,hK5ubht)<29><>}<7D>(hhh]<5D>(hy)<29><>}<7D>(h<05>5A C++ compiler with C++17 support (e.g. Clang >= 5.0)<29>h]<5D>h?)<29><>}<7D>(hj<>h]<5D>h<16>5A C++ compiler with C++17 support (e.g. Clang >= 5.0)<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK7hj<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hxhj<>hhhh,hNubhy)<29><>}<7D>(h<05>D`cmake <https://cmake.org/>`_ -- version 3.24 or later, and ``make``<60>h]<5D>h?)<29><>}<7D>(hj<>h]<5D>(jw)<29><>}<7D>(h<05>`cmake <https://cmake.org/>`_<>h]<5D>h<16>cmake<6B><65><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>name<6D><65>cmake<6B>j<EFBFBD><00>https://cmake.org/<2F>uh+jvhj<>ubj<62>)<29><>}<7D>(h<05> <https://cmake.org/><3E>h]<5D>h}<7D>(h!]<5D><>cmake<6B>ah#]<5D>h%]<5D><>cmake<6B>ah']<5D>h)]<5D><>refuri<72>juh+j<>j<>Khj<>ubh<16> version 3.24 or later, and <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubjQ)<29><>}<7D>(h<05>``make``<60>h]<5D>h<16>make<6B><65><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj<>ubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK8hj<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hxhj<>hhhh,hNubhy)<29><>}<7D>(h<05>5Xcode >= 14.3 (Xcode >= 15.0 for macOS 14 and above)
<EFBFBD>h]<5D>h?)<29><>}<7D>(h<05>4Xcode >= 14.3 (Xcode >= 15.0 for macOS 14 and above)<29>h]<5D>h<16>4Xcode >= 14.3 (Xcode >= 15.0 for macOS 14 and above)<29><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj7hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK9hj3ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hxhj<>hhhh,hNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h<EFBFBD>h<EFBFBD>uh+hshh,hK7hj<>hhubh<62>)<29><>}<7D>(h<05><>Ensure your shell environment is native ``arm``, not ``x86`` via Rosetta. If
the output of ``uname -p`` is ``x86``, see the :ref:`troubleshooting section <build shell>` below.<2E>h]<5D>h?)<29><>}<7D>(h<05><>Ensure your shell environment is native ``arm``, not ``x86`` via Rosetta. If
the output of ``uname -p`` is ``x86``, see the :ref:`troubleshooting section <build shell>` below.<2E>h]<5D>(h<16>(Ensure your shell environment is native <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjUhhhNhNubjQ)<29><>}<7D>(h<05>``arm``<60>h]<5D>h<16>arm<72><6D><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj]hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjUubh<16>, not <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjUhhhNhNubjQ)<29><>}<7D>(h<05>``x86``<60>h]<5D>h<16>x86<38><36><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjohhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjUubh<16> via Rosetta. If
the output of <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjUhhhNhNubjQ)<29><>}<7D>(h<05> ``uname -p``<60>h]<5D>h<16>uname -p<><70><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjUubh<16> is <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjUhhhNhNubjQ)<29><>}<7D>(h<05>``x86``<60>h]<5D>h<16>x86<38><36><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjUubh<16>
, see the <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjUhhhNhNubh<00> pending_xref<65><66><EFBFBD>)<29><>}<7D>(h<05>,:ref:`troubleshooting section <build shell>`<60>h]<5D>h <09>inline<6E><65><EFBFBD>)<29><>}<7D>(hj<>h]<5D>h<16>troubleshooting section<6F><6E><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>(<28>xref<65><66>std<74><64>std-ref<65>eh%]<5D>h']<5D>h)]<5D>uh+j<>hj<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>refdoc<6F><63>install<6C><6C> refdomain<69>j<EFBFBD><00>reftype<70><65>ref<65><66> refexplicit<69><74><EFBFBD>refwarn<72><6E><EFBFBD> reftarget<65><74> build shell<6C>uh+j<>hh,hK<hjUubh<16> below.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjUhhhNhNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<hjQubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h<>hj<>hhhh,hNubeh}<7D>(h!]<5D><>build-requirements<74>ah#]<5D>h%]<5D><>build requirements<74>ah']<5D>h)]<5D>uh+h
hj<>hhhh,hK5ubh )<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05>
Python API<50>h]<5D>h<16>
Python API<50><49><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhj<>hhhh,hK@ubh?)<29><>}<7D>(h<05><>To build and install the MLX python library from source, first, clone MLX from
`its GitHub repo <https://github.com/ml-explore/mlx>`_:<3A>h]<5D>(h<16>OTo build and install the MLX python library from source, first, clone MLX from
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubjw)<29><>}<7D>(h<05>6`its GitHub repo <https://github.com/ml-explore/mlx>`_<>h]<5D>h<16>its GitHub repo<70><6F><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>name<6D><65>its GitHub repo<70>j<EFBFBD><00>!https://github.com/ml-explore/mlx<6C>uh+jvhj<>ubj<62>)<29><>}<7D>(h<05>$ <https://github.com/ml-explore/mlx><3E>h]<5D>h}<7D>(h!]<5D><>its-github-repo<70>ah#]<5D>h%]<5D><>its github repo<70>ah']<5D>h)]<5D><>refuri<72>j uh+j<>j<>Khj<>ubh<16>:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKBhj<>hhubhO)<29><>}<7D>(h<05>9git clone git@github.com:ml-explore/mlx.git mlx && cd mlx<6C>h]<5D>h<16>9git clone git@github.com:ml-explore/mlx.git mlx && cd mlx<6C><78><EFBFBD><EFBFBD><EFBFBD>}<7D>hj%sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hKEhj<>hhubh?)<29><>}<7D>(h<05><>Make sure that you have `pybind11 <https://pybind11.readthedocs.io/en/stable/index.html>`_
installed. You can install ``pybind11`` with ``pip``, ``brew`` or ``conda`` as follows:<3A>h]<5D>(h<16>Make sure that you have <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj5hhhNhNubjw)<29><>}<7D>(h<05>B`pybind11 <https://pybind11.readthedocs.io/en/stable/index.html>`_<>h]<5D>h<16>pybind11<31><31><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj=hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>name<6D><65>pybind11<31>j<EFBFBD><00>4https://pybind11.readthedocs.io/en/stable/index.html<6D>uh+jvhj5ubj<62>)<29><>}<7D>(h<05>7 <https://pybind11.readthedocs.io/en/stable/index.html><3E>h]<5D>h}<7D>(h!]<5D><>pybind11<31>ah#]<5D>h%]<5D><>pybind11<31>ah']<5D>h)]<5D><>refuri<72>jMuh+j<>j<>Khj5ubh<16>
installed. You can install <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj5hhhNhNubjQ)<29><>}<7D>(h<05> ``pybind11``<60>h]<5D>h<16>pybind11<31><31><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj_hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj5ubh<16> with <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj5hhhNhNubjQ)<29><>}<7D>(h<05>``pip``<60>h]<5D>h<16>pip<69><70><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjqhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj5ubh<16>, <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj5hhhNhNubjQ)<29><>}<7D>(h<05>``brew``<60>h]<5D>h<16>brew<65><77><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj5ubh<16> or <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj5hhhNhNubjQ)<29><>}<7D>(h<05> ``conda``<60>h]<5D>h<16>conda<64><61><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj5ubh<16> as follows:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj5hhhNhNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKIhj<>hhubhO)<29><>}<7D>(h<05>Kpip install "pybind11[global]"
conda install pybind11
brew install pybind11<31>h]<5D>h<16>Kpip install "pybind11[global]"
conda install pybind11
brew install pybind11<31><31><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hKLhj<>hhubh?)<29><>}<7D>(h<05>+Then simply build and install it using pip:<3A>h]<5D>h<16>+Then simply build and install it using pip:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKRhj<>hhubhO)<29><>}<7D>(h<05>/env CMAKE_BUILD_PARALLEL_LEVEL="" pip install .<2E>h]<5D>h<16>/env CMAKE_BUILD_PARALLEL_LEVEL="" pip install .<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hKThj<>hhubh?)<29><>}<7D>(h<05>'For developing use an editable install:<3A>h]<5D>h<16>'For developing use an editable install:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKXhj<>hhubhO)<29><>}<7D>(h<05>2env CMAKE_BUILD_PARALLEL_LEVEL="" pip install -e .<2E>h]<5D>h<16>2env CMAKE_BUILD_PARALLEL_LEVEL="" pip install -e .<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hKZhj<>hhubh?)<29><>}<7D>(h<05>7To make sure the install is working run the tests with:<3A>h]<5D>h<16>7To make sure the install is working run the tests with:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK^hj<>hhubhO)<29><>}<7D>(h<05>Apip install ".[testing]"
python -m unittest discover python/tests<74>h]<5D>h<16>Apip install ".[testing]"
python -m unittest discover python/tests<74><73><EFBFBD><EFBFBD><EFBFBD>}<7D>hjsbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK`hj<>hhubh?)<29><>}<7D>(h<05>SOptional: Install stubs to enable auto completions and type checking from your IDE:<3A>h]<5D>h<16>SOptional: Install stubs to enable auto completions and type checking from your IDE:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKehj<>hhubhO)<29><>}<7D>(h<05>3pip install ".[dev]"
python setup.py generate_stubs<62>h]<5D>h<16>3pip install ".[dev]"
python setup.py generate_stubs<62><73><EFBFBD><EFBFBD><EFBFBD>}<7D>hj%sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hKghj<>hhubeh}<7D>(h!]<5D><>
python-api<70>ah#]<5D>h%]<5D><>
python api<70>ah']<5D>h)]<5D>uh+h
hj<>hhhh,hK@ubh )<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05>C++ API<50>h]<5D>h<16>C++ API<50><49><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj@hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhj=hhhh,hKmubh?)<29><>}<7D>(h<05>7Currently, MLX must be built and installed from source.<2E>h]<5D>h<16>7Currently, MLX must be built and installed from source.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjNhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKohj=hhubh?)<29><>}<7D>(h<05><>Similarly to the python library, to build and install the MLX C++ library start
by cloning MLX from `its GitHub repo
<https://github.com/ml-explore/mlx>`_:<3A>h]<5D>(h<16>dSimilarly to the python library, to build and install the MLX C++ library start
by cloning MLX from <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj\hhhNhNubjw)<29><>}<7D>(h<05>6`its GitHub repo
<https://github.com/ml-explore/mlx>`_<>h]<5D>h<16>its GitHub repo<70><6F><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjdhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>name<6D><65>its GitHub repo<70>j<EFBFBD><00>!https://github.com/ml-explore/mlx<6C>uh+jvhj\ubj<62>)<29><>}<7D>(h<05>$
<https://github.com/ml-explore/mlx><3E>h]<5D>h}<7D>(h!]<5D><>id1<64>ah#]<5D>h%]<5D>h']<5D><>its github repo<70>ah)]<5D><>refuri<72>jtuh+j<>j<>Khj\ubh<16>:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj\hhhNhNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKqhj=hhubhO)<29><>}<7D>(h<05>9git clone git@github.com:ml-explore/mlx.git mlx && cd mlx<6C>h]<5D>h<16>9git clone git@github.com:ml-explore/mlx.git mlx && cd mlx<6C><78><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hKuhj=hhubh?)<29><>}<7D>(h<05>0Create a build directory and run CMake and make:<3A>h]<5D>h<16>0Create a build directory and run CMake and make:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hKyhj=hhubhO)<29><>}<7D>(h<05>.mkdir -p build && cd build
cmake .. && make -j<>h]<5D>h<16>.mkdir -p build && cd build
cmake .. && make -j<><6A><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK{hj=hhubh?)<29><>}<7D>(h<05>Run tests with:<3A>h]<5D>h<16>Run tests with:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj=hhubhO)<29><>}<7D>(h<05> make test<73>h]<5D>h<16> make test<73><74><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK<>hj=hhubh?)<29><>}<7D>(h<05> Install with:<3A>h]<5D>h<16> Install with:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj=hhubhO)<29><>}<7D>(h<05> make install<6C>h]<5D>h<16> make install<6C><6C><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK<>hj=hhubh?)<29><>}<7D>(hX Note that the built ``mlx.metallib`` file should be either at the same
directory as the executable statically linked to ``libmlx.a`` or the
preprocessor constant ``METAL_PATH`` should be defined at build time and it
should point to the path to the built metal library.<2E>h]<5D>(h<16>Note that the built <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubjQ)<29><>}<7D>(h<05>``mlx.metallib``<60>h]<5D>h<16> mlx.metallib<69><62><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj<>ubh<16>T file should be either at the same
directory as the executable statically linked to <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubjQ)<29><>}<7D>(h<05> ``libmlx.a``<60>h]<5D>h<16>libmlx.a<><61><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj<>ubh<16> or the
preprocessor constant <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubjQ)<29><>}<7D>(h<05>``METAL_PATH``<60>h]<5D>h<16>
METAL_PATH<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj"hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj<>ubh<16>\ should be defined at build time and it
should point to the path to the built metal library.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj=hhubh <09>table<6C><65><EFBFBD>)<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05> Build Options<6E>h]<5D>h<16> Build Options<6E><73><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj?hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhh,hK<>hj<ubh <09>tgroup<75><70><EFBFBD>)<29><>}<7D>(hhh]<5D>(h <09>colspec<65><63><EFBFBD>)<29><>}<7D>(hhh]<5D>h}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>colwidth<74>Kuh+jRhjOubjS)<29><>}<7D>(hhh]<5D>h}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>j]Kuh+jRhjOubh <09>thead<61><64><EFBFBD>)<29><>}<7D>(hhh]<5D>h <09>row<6F><77><EFBFBD>)<29><>}<7D>(hhh]<5D>(h <09>entry<72><79><EFBFBD>)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>Option<6F>h]<5D>h<16>Option<6F><6E><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjvhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hjsubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhjnubjr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>Default<6C>h]<5D>h<16>Default<6C><74><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhjnubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jlhjiubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jghjOubh <09>tbody<64><79><EFBFBD>)<29><>}<7D>(hhh]<5D>(jm)<29><>}<7D>(hhh]<5D>(jr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>MLX_BUILD_TESTS<54>h]<5D>h<16>MLX_BUILD_TESTS<54><53><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhj<>ubjr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>ON<4F>h]<5D>h<16>ON<4F><4E><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhj<>ubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jlhj<>ubjm)<29><>}<7D>(hhh]<5D>(jr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>MLX_BUILD_EXAMPLES<45>h]<5D>h<16>MLX_BUILD_EXAMPLES<45><53><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhj<>ubjr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>OFF<46>h]<5D>h<16>OFF<46><46><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hjubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhj<>ubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jlhj<>ubjm)<29><>}<7D>(hhh]<5D>(jr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>MLX_BUILD_BENCHMARKS<4B>h]<5D>h<16>MLX_BUILD_BENCHMARKS<4B><53><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj&hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj#ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhj ubjr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>OFF<46>h]<5D>h<16>OFF<46><46><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj=hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj:ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhj ubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jlhj<>ubjm)<29><>}<7D>(hhh]<5D>(jr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>MLX_BUILD_METAL<41>h]<5D>h<16>MLX_BUILD_METAL<41><4C><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj]hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hjZubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhjWubjr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>ON<4F>h]<5D>h<16>ON<4F><4E><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjthhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hjqubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhjWubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jlhj<>ubjm)<29><>}<7D>(hhh]<5D>(jr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>MLX_BUILD_PYTHON_BINDINGS<47>h]<5D>h<16>MLX_BUILD_PYTHON_BINDINGS<47><53><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhj<>ubjr)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>OFF<46>h]<5D>h<16>OFF<46><46><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jqhj<>ubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jlhj<>ubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+j<>hjOubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>cols<6C>Kuh+jMhj<ubeh}<7D>(h!]<5D><>id3<64>ah#]<5D><>colwidths-given<65>ah%]<5D>h']<5D>h)]<5D>uh+j:hj=hhhNhNubh<62>)<29><>}<7D>(hX<>If you have multiple Xcode installations and wish to use
a specific one while building, you can do so by adding the
following environment variable before building
.. code-block:: shell
export DEVELOPER_DIR="/path/to/Xcode.app/Contents/Developer/"
Further, you can use the following command to find out which
macOS SDK will be used
.. code-block:: shell
xcrun -sdk macosx --show-sdk-version<6F>h]<5D>(h?)<29><>}<7D>(h<05><>If you have multiple Xcode installations and wish to use
a specific one while building, you can do so by adding the
following environment variable before building<6E>h]<5D>h<16><>If you have multiple Xcode installations and wish to use
a specific one while building, you can do so by adding the
following environment variable before building<6E><67><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>ubhO)<29><>}<7D>(h<05>=export DEVELOPER_DIR="/path/to/Xcode.app/Contents/Developer/"<22>h]<5D>h<16>=export DEVELOPER_DIR="/path/to/Xcode.app/Contents/Developer/"<22><><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK<>hj<>ubh?)<29><>}<7D>(h<05>SFurther, you can use the following command to find out which
macOS SDK will be used<65>h]<5D>h<16>SFurther, you can use the following command to find out which
macOS SDK will be used<65><64><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>ubhO)<29><>}<7D>(h<05>$xcrun -sdk macosx --show-sdk-version<6F>h]<5D>h<16>$xcrun -sdk macosx --show-sdk-version<6F><6E><EFBFBD><EFBFBD><EFBFBD>}<7D>hj
sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK<>hj<>ubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h<>hj=hhhNhNubeh}<7D>(h!]<5D><>c-api<70>ah#]<5D>h%]<5D><>c++ api<70>ah']<5D>h)]<5D>uh+h
hj<>hhhh,hKmubh )<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05>Troubleshooting<6E>h]<5D>h<16>Troubleshooting<6E><67><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj+hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhj(hhhh,hK<>ubh )<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05>Metal not found<6E>h]<5D>h<16>Metal not found<6E><64><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhj9hhhh,hK<>ubh?)<29><>}<7D>(h<05>2You see the following error when you try to build:<3A>h]<5D>h<16>2You see the following error when you try to build:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjJhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj9hhubhO)<29><>}<7D>(h<05>Ferror: unable to find utility "metal", not a developer tool or in PATH<54>h]<5D>h<16>Ferror: unable to find utility "metal", not a developer tool or in PATH<54><48><EFBFBD><EFBFBD><EFBFBD>}<7D>hjXsbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK<>hj9hhubh?)<29><>}<7D>(h<05>6To fix this, first make sure you have Xcode installed:<3A>h]<5D>h<16>6To fix this, first make sure you have Xcode installed:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj9hhubhO)<29><>}<7D>(h<05>xcode-select --install<6C>h]<5D>h<16>xcode-select --install<6C><6C><EFBFBD><EFBFBD><EFBFBD>}<7D>hjvsbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK<>hj9hhubh?)<29><>}<7D>(h<05>(Then set the active developer directory:<3A>h]<5D>h<16>(Then set the active developer directory:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj9hhubhO)<29><>}<7D>(h<05>Esudo xcode-select --switch /Applications/Xcode.app/Contents/Developer<65>h]<5D>h<16>Esudo xcode-select --switch /Applications/Xcode.app/Contents/Developer<65><72><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<>sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK<>hj9hhubeh}<7D>(h!]<5D><>metal-not-found<6E>ah#]<5D>h%]<5D><>metal not found<6E>ah']<5D>h)]<5D>uh+h
hj(hhhh,hK<>ubh )<29><>}<7D>(hhh]<5D>(h)<29><>}<7D>(h<05> x86 Shell<6C>h]<5D>h<16> x86 Shell<6C><6C><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+hhj<>hhhh,hK<>ubj<62>)<29><>}<7D>(h<05>.. _build shell:<3A>h]<5D>h}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>refid<69><64> build-shell<6C>uh+j<>hK<>hj<>hhhh,ubh?)<29><>}<7D>(h<05>lIf the ouptut of ``uname -p`` is ``x86`` then your shell is running as x86 via
Rosetta instead of natively.<2E>h]<5D>(h<16>If the ouptut of <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubjQ)<29><>}<7D>(h<05> ``uname -p``<60>h]<5D>h<16>uname -p<><70><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj<>ubh<16> is <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubjQ)<29><>}<7D>(h<05>``x86``<60>h]<5D>h<16>x86<38><36><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhj<>ubh<16>C then your shell is running as x86 via
Rosetta instead of natively.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubeh}<7D>(h!]<5D>j<EFBFBD>ah#]<5D>h%]<5D><> build shell<6C>ah']<5D>h)]<5D>uh+h>hh,hK<>hj<>hh<03>expect_referenced_by_name<6D>}<7D>j<EFBFBD>j<>s<>expect_referenced_by_id<69>}<7D>j<EFBFBD>j<>subh?)<29><>}<7D>(h<05><>To fix this, find the application in Finder (``/Applications`` for iTerm,
``/Applications/Utilities`` for Terminal), right-click, and click “Get Info”.
Uncheck “Open using Rosetta”, close the “Get Info” window, and restart your
terminal.<2E>h]<5D>(h<16>-To fix this, find the application in Finder (<28><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubjQ)<29><>}<7D>(h<05>``/Applications``<60>h]<5D>h<16> /Applications<6E><73><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjubh<16> for iTerm,
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubjQ)<29><>}<7D>(h<05>``/Applications/Utilities``<60>h]<5D>h<16>/Applications/Utilities<65><73><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjubh<16><> for Terminal), right-click, and click “Get Info”.
Uncheck “Open using Rosetta”, close the “Get Info” window, and restart your
terminal.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjhhhNhNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>hhubh?)<29><>}<7D>(h<05>BVerify the terminal is now running natively the following command:<3A>h]<5D>h<16>BVerify the terminal is now running natively the following command:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj2hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>hhubhO)<29><>}<7D>(h<05>$ uname -p
arm<EFBFBD>h]<5D>h<16>$ uname -p
arm<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>hj@sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK<>hj<>hhubh?)<29><>}<7D>(h<05>8Also check that cmake is using the correct architecture:<3A>h]<5D>h<16>8Also check that cmake is using the correct architecture:<3A><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjPhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>hhubhO)<29><>}<7D>(h<05>c$ cmake --system-information | grep CMAKE_HOST_SYSTEM_PROCESSOR
CMAKE_HOST_SYSTEM_PROCESSOR "arm64"<22>h]<5D>h<16>c$ cmake --system-information | grep CMAKE_HOST_SYSTEM_PROCESSOR
CMAKE_HOST_SYSTEM_PROCESSOR "arm64"<22><><EFBFBD><EFBFBD><EFBFBD>}<7D>hj^sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>h^h_h`<60>ha<68>shell<6C>hc}<7D>uh+hNhh,hK<>hj<>hhubh?)<29><>}<7D>(h<05><>If you see ``"x86_64"``, try re-installing ``cmake``. If you see ``"arm64"``
but the build errors out with "Building for x86_64 on macOS is not supported."
wipe your build cahce with ``rm -rf build/`` and try again.<2E>h]<5D>(h<16> If you see <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjnhhhNhNubjQ)<29><>}<7D>(h<05> ``"x86_64"``<60>h]<5D>h<16>"x86_64"<22><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjvhhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjnubh<16>, try re-installing <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjnhhhNhNubjQ)<29><>}<7D>(h<05> ``cmake``<60>h]<5D>h<16>cmake<6B><65><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjnubh<16> . If you see <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjnhhhNhNubjQ)<29><>}<7D>(h<05> ``"arm64"``<60>h]<5D>h<16>"arm64"<22><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjnubh<16>o
but the build errors out with “Building for x86_64 on macOS is not supported.”
wipe your build cahce with <20><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjnhhhNhNubjQ)<29><>}<7D>(h<05>``rm -rf build/``<60>h]<5D>h<16> rm -rf build/<2F><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<>hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+jPhjnubh<16> and try again.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjnhhhNhNubeh}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hh,hK<>hj<>hhubeh}<7D>(h!]<5D><> x86-shell<6C>ah#]<5D>h%]<5D><> x86 shell<6C>ah']<5D>h)]<5D>uh+h
hj(hhhh,hK<>ubeh}<7D>(h!]<5D><>id2<64>ah#]<5D>h%]<5D>h']<5D>j<EFBFBD>ah)]<5D>uh+h
hj<>hhhh,hK<>j<EFBFBD>Kubeh}<7D>(h!]<5D><>build-from-source<63>ah#]<5D>h%]<5D><>build from source<63>ah']<5D>h)]<5D>uh+h
hh hhhh,hK2ubeh}<7D>(h!]<5D><>build-and-install<6C>ah#]<5D>h%]<5D><>build and install<6C>ah']<5D>h)]<5D>uh+h
hhhhhh,hKubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>source<63>h,uh+h<01>current_source<63>N<EFBFBD> current_line<6E>N<EFBFBD>settings<67><73>docutils.frontend<6E><64>Values<65><73><EFBFBD>)<29><>}<7D>(hN<> generator<6F>N<EFBFBD> datestamp<6D>N<EFBFBD> source_link<6E>N<EFBFBD>
source_url<EFBFBD>N<EFBFBD> toc_backlinks<6B>jq<00>footnote_backlinks<6B>K<01> sectnum_xform<72>K<01>strip_comments<74>N<EFBFBD>strip_elements_with_classes<65>N<EFBFBD> strip_classes<65>N<EFBFBD> report_level<65>K<02>
halt_level<EFBFBD>K<05>exit_status_level<65>K<05>debug<75>N<EFBFBD>warning_stream<61>N<EFBFBD> traceback<63><6B><EFBFBD>input_encoding<6E><67> utf-8-sig<69><67>input_encoding_error_handler<65><72>strict<63><74>output_encoding<6E><67>utf-8<><38>output_encoding_error_handler<65>j <00>error_encoding<6E><67>utf-8<><38>error_encoding_error_handler<65><72>backslashreplace<63><65> language_code<64><65>en<65><6E>record_dependencies<65>N<EFBFBD>config<69>N<EFBFBD> id_prefix<69>h<06>auto_id_prefix<69><78>id<69><64> dump_settings<67>N<EFBFBD>dump_internals<6C>N<EFBFBD>dump_transforms<6D>N<EFBFBD>dump_pseudo_xml<6D>N<EFBFBD>expose_internals<6C>N<EFBFBD>strict_visitor<6F>N<EFBFBD>_disable_config<69>N<EFBFBD>_source<63>h,<2C> _destination<6F>N<EFBFBD> _config_files<65>]<5D><>file_insertion_enabled<65><64><EFBFBD> raw_enabled<65>K<01>line_length_limit<69>M'<27>pep_references<65>N<EFBFBD> pep_base_url<72><6C>https://peps.python.org/<2F><>pep_file_url_template<74><65>pep-%04d<34><64>rfc_references<65>N<EFBFBD> rfc_base_url<72><6C>&https://datatracker.ietf.org/doc/html/<2F><> tab_width<74>K<08>trim_footnote_reference_space<63><65><EFBFBD>syntax_highlight<68><74>long<6E><67> smart_quotes<65><73><EFBFBD>smartquotes_locales<65>]<5D><>character_level_inline_markup<75><70><EFBFBD>doctitle_xform<72><6D><EFBFBD> docinfo_xform<72>K<01>sectsubtitle_xform<72><6D><EFBFBD> image_loading<6E><67>link<6E><6B>embed_stylesheet<65><74><EFBFBD>cloak_email_addresses<65><73><EFBFBD>section_self_link<6E><6B><EFBFBD>env<6E>Nub<75>reporter<65>N<EFBFBD>indirect_targets<74>]<5D><>substitution_defs<66>}<7D><>substitution_names<65>}<7D><>refnames<65>}<7D><>refids<64>}<7D>j<EFBFBD>]<5D>j<EFBFBD>as<61>nameids<64>}<7D>(j<>j<>j<>j<><00>troubleshooting<6E>Nj<4E>j<>j<>j<>j<>j<>jjj:j7jjjWjTj%j"j<>j<>j<>j<>j<>j<>u<> nametypes<65>}<7D>(j<><00>j<EFBFBD><00>jI <00>j<EFBFBD><00>j<EFBFBD><00>j<EFBFBD><00>j<00>j:<00>j<00>jW<00>j%<00>j<EFBFBD><00>j<EFBFBD><00>j<EFBFBD><00>uh!}<7D>(j<>h j<>h-j<>jj<>j<>j<>j<>j<>j<>jjj7j<>jjjTjNj"j=j{juj<>j(j<>j9j<>j<>j<>j<>j<>j<u<> footnote_refs<66>}<7D><> citation_refs<66>}<7D><> autofootnotes<65>]<5D><>autofootnote_refs<66>]<5D><>symbol_footnotes<65>]<5D><>symbol_footnote_refs<66>]<5D><> footnotes<65>]<5D><> citations<6E>]<5D><>autofootnote_start<72>K<01>symbol_footnote_start<72>K<00>
id_counter<EFBFBD><EFBFBD> collections<6E><73>Counter<65><72><EFBFBD>}<7D>j Ks<><73>R<EFBFBD><52>parse_messages<65>]<5D>(h <09>system_message<67><65><EFBFBD>)<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>2Duplicate explicit target name: "its github repo".<2E>h]<5D>h<16>6Duplicate explicit target name: “its github repo”.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hjm hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hjj ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>j{a<>level<65>K<01>type<70><65>INFO<46><4F>source<63>h,<2C>line<6E>Kuh+jh hj=hhhh,hKsubji )<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(h<05>2Duplicate implicit target name: "troubleshooting".<2E>h]<5D>h<16>6Duplicate implicit target name: “troubleshooting”.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>(hj<> hhhNhNubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hj<> ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>j<EFBFBD>a<>level<65>K<01>type<70>j<EFBFBD> <00>source<63>h,<2C>line<6E>K<EFBFBD>uh+jh hj(hhhh,hK<>ube<62>transform_messages<65>]<5D>ji )<29><>}<7D>(hhh]<5D>h?)<29><>}<7D>(hhh]<5D>h<16>1Hyperlink target "build-shell" is not referenced.<2E><><EFBFBD><EFBFBD><EFBFBD>}<7D>hj<> sbah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D>uh+h>hj<> ubah}<7D>(h!]<5D>h#]<5D>h%]<5D>h']<5D>h)]<5D><>level<65>K<01>type<70>j<EFBFBD> <00>source<63>h,<2C>line<6E>K<EFBFBD>uh+jh uba<62> transformer<65>N<EFBFBD> include_log<6F>]<5D><>
decoration<EFBFBD>Nhhub.