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

[DOC] Adding MacOS install instructions #78

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading