Skip to content

Commit eac6d11

Browse files
authored
[Docs] Update macOS installation guide for new release (#358)
1 parent 8704922 commit eac6d11

File tree

1 file changed

+43
-41
lines changed

1 file changed

+43
-41
lines changed

doc/dev/installation.rst

+43-41
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ Installation
22
============
33

44

5-
Catalyst is officially supported on Linux (x86_64) and macOS (aarch64) platforms, and pre-built binaries
6-
are being distributed via the Python Package Index (PyPI) for Python versions 3.9 and higher. To install
7-
it, simply run the following ``pip`` command:
5+
Catalyst is officially supported on Linux (x86_64) and macOS (aarch64, x86_64) platforms, and
6+
pre-built binaries are being distributed via the Python Package Index (PyPI) for Python versions
7+
3.9 and higher. To install it, simply run the following ``pip`` command:
88

99
.. code-block:: console
1010
1111
pip install pennylane-catalyst
1212
1313
14-
Pre-built packages for Windows and MacOS are not yet available, and comptability with those
15-
platforms is untested and cannot be guaranteed. If you are using one of these platforms, please
14+
Pre-built packages for Windows are not yet available, and comptability with other platforms is
15+
untested and cannot be guaranteed. If you are using one of these platforms, please
1616
try out our Docker and Dev Container images described in the `next section <#dev-containers>`_.
1717

1818
If you wish to contribute to Catalyst or develop against our runtime or compiler, instructions for
@@ -46,6 +46,7 @@ source, and requires launching the post-install script at ``.devcontainer/dev/po
4646
from whithin the root of the running container.
4747

4848
.. note::
49+
4950
Due to `a bug <https://github.com/microsoft/vscode-remote-release/issues/8412>`_ in the Dev
5051
Containers extension, clicking on the "Launch" badge will not prompt for a choice between the User
5152
and Dev containers. Instead, the User container is automatically chosen.
@@ -58,69 +59,75 @@ Building from source
5859
--------------------
5960

6061

61-
To build Catalyst from its source code, developers should follow the
62-
instructions provided below for building all three modules: the Python
63-
frontend, the MLIR compiler, and runtime library.
62+
To build Catalyst from source, developers should follow the instructions provided below for building
63+
all three modules: the Python frontend, the MLIR compiler, and the runtime library.
6464

6565
Requirements
6666
^^^^^^^^^^^^
6767

6868

69-
In order to build Catalyst from source, developers need to ensure the
70-
following pre-requisites are installed and available on the path:
69+
In order to build Catalyst from source, developers need to ensure the following pre-requisites are
70+
installed and available on the path (depending on the platform):
7171

72-
- The `clang <https://clang.llvm.org/>`_ compiler, `LLD
73-
<https://lld.llvm.org/>`_ linker, `CCache <https://ccache.dev/>`_ compiler
74-
cache, and `OpenMP <https://www.openmp.org/>`_.
72+
- The `clang <https://clang.llvm.org/>`_ compiler, `LLD <https://lld.llvm.org/>`_ linker
73+
(Linux only), `CCache <https://ccache.dev/>`_ compiler cache (optional, recommended), and
74+
`OpenMP <https://www.openmp.org/>`_ (Linux only).
7575

76-
- The `Ninja <https://ninja-build.org/>`_, `Make
77-
<https://www.gnu.org/software/make/>`_, and `CMake
78-
<https://cmake.org/download/>`_ (v3.20 or greater) build tools.
76+
- The `Ninja <https://ninja-build.org/>`_, `Make <https://www.gnu.org/software/make/>`_, and
77+
`CMake <https://cmake.org/download/>`_ (v3.20 or greater) build tools.
7978

8079
- `Python <https://www.python.org/>`_ 3.9 or higher for the Python frontend.
8180

82-
- ``pip`` must be version 22.3 or higher.
81+
- The Python package manager ``pip`` must be version 22.3 or higher.
8382

84-
They can be installed on Debian/Ubuntu via:
83+
They can be installed on **Debian/Ubuntu** via:
8584

8685
.. code-block:: console
8786
8887
sudo apt install clang lld ccache libomp-dev ninja-build make cmake
8988
90-
They can be installed on macOS via:
89+
.. Note::
90+
91+
If the CMake version available in your system is too old, you can also install up-to-date
92+
versions of it via ``pip install cmake``.
93+
94+
On **macOS**, it is strongly recommended to install the official XCode Command Line Tools
95+
(for ``clang`` & ``make``). The remaining packages can then be installed via ``pip``:
9196

9297
.. code-block:: console
9398
94-
brew install cmake ninja
99+
pip install cmake ninja
95100
96101
If you install Catalyst on a macOS system with ``ARM`` architecture (e.g. Apple M1/M2), you
97102
additionally need to install `Rust <https://www.rust-lang.org/tools/install>`_ and the
98103
``llvm-tools-preview`` rustup component:
99104

100105
.. code-block:: console
101106
107+
curl https://sh.rustup.rs -sSf | sh
108+
source "$HOME/.cargo/env"
102109
rustup component add llvm-tools-preview
103110
104-
.. Note::
105-
If the CMake version available in your system is too old, you can also install up-to-date
106-
versions of it via ``pip install cmake``.
107-
108111
All additional build and developer dependencies are managed via the repository's
109112
``requirements.txt`` and can be installed as follows:
110113

111114
.. code-block:: console
112115
113116
pip install -r requirements.txt
114117
115-
Once the pre-requisites are installed, start by cloning the project repository
116-
including all its submodules:
118+
.. Note::
119+
120+
Please ensure that your local site-packages for Python are available on the ``PATH`` - watch out
121+
for the corresponding warning that ``pip`` may give you during installation.
122+
123+
Once the pre-requisites are installed, start by cloning the project repository including all its
124+
submodules:
117125

118126
.. code-block:: console
119127
120-
git clone --recurse-submodules --shallow-submodules -j2 https://github.com/PennyLaneAI/catalyst.git
128+
git clone --recurse-submodules --shallow-submodules https://github.com/PennyLaneAI/catalyst.git
121129
122-
For an existing copy of the repository without its submodules, they can also
123-
be fetched via:
130+
For an existing copy of the repository without its submodules, they can also be fetched via:
124131

125132
.. code-block:: console
126133
@@ -129,22 +136,15 @@ be fetched via:
129136
Catalyst
130137
^^^^^^^^
131138

132-
The build process for Catalyst is managed via a series of Makefiles for each
133-
component. To build the entire project from start to finish simply run the
134-
following make target from the top level directory:
139+
The build process for Catalyst is managed via a series of Makefiles for each component. To build
140+
the entire project from start to finish simply run the following make target from the top level
141+
directory:
135142

136143
.. code-block:: console
137144
138145
make all
139146
140-
To build the project on macOS with ``ARM`` architecture (e.g. Apple M1/M2):
141-
142-
.. code-block:: console
143-
144-
BUILD_QIR_STDLIB_FROM_SRC=ON ENABLE_LLD=OFF make all
145-
146-
To build each component one by one starting from the runtime, you can follow
147-
the instructions below.
147+
To build each component one by one starting from the runtime, you can follow the instructions below.
148148

149149
Runtime
150150
"""""""
@@ -162,7 +162,9 @@ directory:
162162
163163
The runtime supports multiple backend devices, enabling the execution of quantum
164164
circuits locally on CPUs and GPUs, and remotely on Amazon Braket NISQ hardware.
165-
A list of supported backends, along with Make arguments for each device, is available in the `Catalyst Runtime <https://docs.pennylane.ai/projects/catalyst/en/latest/modules/runtime.html>`_ page.
165+
A list of supported backends, along with Make arguments for each device, is available in the
166+
`Catalyst Runtime <https://docs.pennylane.ai/projects/catalyst/en/latest/modules/runtime.html>`_
167+
page.
166168

167169
MLIR Dialects
168170
"""""""""""""

0 commit comments

Comments
 (0)