Skip to content

Commit

Permalink
[docs/macos_install] Adding install instructions for MacOS to docs an…
Browse files Browse the repository at this point in the history
…d readme
  • Loading branch information
jamesETsmith committed Oct 10, 2024
1 parent e9c0e48 commit 6fbae0a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<a href='https://qognitive-fast-pauli.readthedocs-hosted.com/en/latest/?badge=latest'>
<img src='https://readthedocs.com/projects/qognitive-fast-pauli/badge/?version=latest' alt='Documentation Status' />
</a>
<a href="https://github.com/qognitive/fast-pauli/tree/develop?tab=readme-ov-file#installation"><img src="https://img.shields.io/badge/Docs-Installation-blue" alt="Installation"></a>
<a href="https://qognitive-fast-pauli.readthedocs-hosted.com/en/latest/#installation"><img src="https://img.shields.io/badge/Docs-Installation-blue" alt="Installation"></a>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -64,19 +64,37 @@ There are two strategies for building `fast_pauli` from source. One is a quick a
- [Ninja](https://pypi.org/project/ninja/) >= 1.11
- C++ compiler with OpenMP and C++20 support ([LLVM](https://apt.llvm.org/) recommended)
- [Python](https://www.python.org/downloads/) >= 3.10
- [scikit-build-core](https://pypi.org/project/scikit-build-core/) (ONLY for building from source with custom configuration)

#### Quick Start (Users)
#### Build from Source (Linux)
```bash
# Build
python -m pip install -e ".[dev]"
# Test
pytest -v tests/fast_pauli
```

#### Configurable Build (Developers)
#### Build from Source (MacOS)

```bash
# Setup
python -m pip install --upgrade pip
python -m pip install scikit-build-core
brew install llvm
# Build
pip install -e . -C cmake.args="-DCMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/clang++;-DCMAKE_CXX_FLAGS='-stdlib=libc++ -fexperimental-library'"
# Test
pytest -v tests/fast_pauli # + other pytest flags
```

#### Build from Source (Custom Configuration)
```bash
# Setup
python -m pip install --upgrade pip
python -m pip install scikit-build-core
# Build
python -m pip install --no-build-isolation -ve ".[dev]" -C cmake.args="-DCMAKE_CXX_COMPILER=<compiler> + <other cmake flags>"
# Test
pytest -v tests/fast_pauli # + other pytest flags
```
Compiled `_fast_pauli` python module gets installed into `fast_pauli` directory.

20 changes: 19 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ Installation
============
In order to get started, we'll need to install the package and its dependencies.

Requirements
------------
- `CMake <https://pypi.org/project/cmake/>`_ >= 3.25
- `Ninja <https://pypi.org/project/ninja/>`_ >= 1.11
- C++ compiler with OpenMP and C++20 support (`LLVM <https://apt.llvm.org/>`_ recommended)
- `Python <https://www.python.org/downloads/>`_ >= 3.10
- `scikit-build-core <https://pypi.org/project/scikit-build-core/>`_ (ONLY for building from source with custom configuration)

In the following subsections, we describe several options for installing ``fast_pauli``.

Install the Latest Release
Expand All @@ -36,14 +44,24 @@ Install the Latest Release
pip install fast_pauli
Build from Source (Default Config)
Build from Source (Linux)
-----------------------------------------
.. code-block:: bash
git clone [email protected]:qognitive/fast-pauli.git
cd fast_pauli
python -m pip install -e ".[dev]"
Build from Source (MacOS)
-----------------------------------------
.. code-block:: bash
git clone [email protected]:qognitive/fast-pauli.git
cd fast_pauli
python -m pip install --upgrade pip
python -m pip install scikit-build-core
brew install llvm
pip install -e . -C cmake.args="-DCMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/clang++;-DCMAKE_CXX_FLAGS='-stdlib=libc++ -fexperimental-library'"
Build from Source (Custom Config)
---------------------------------
Expand Down

0 comments on commit 6fbae0a

Please sign in to comment.