Skip to content

Commit

Permalink
docs: update local in-place build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Dec 8, 2023
1 parent 6b39117 commit 32fb56a
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,30 @@ Install in "development/editable" mode including dev/test dependencies:

```sh
git clone https://github.com/AMYPAD/CuVec && cd CuVec
export SETUPTOOLS_ENABLE_FEATURES=legacy-editable
pip install -e .[dev]

# `pip install -e .[dev]` won't work due to https://github.com/scikit-build/scikit-build-core/issues/114
# work-around:
# 1. install dependencies (one-off)
pip install toml
python -c 'import toml; c=toml.load("pyproject.toml")
print("\0".join(c["build-system"]["requires"] + c["project"]["dependencies"] + c["project"]["optional-dependencies"]["dev"]), end="")' \
| xargs -0 pip install -U ninja cmake
# 2. delete build artefacts, (re)build & install in-place with debug info
git clean -Xdf
pip install --no-build-isolation --no-deps -t . -U -v . \
-Ccmake.define.CUVEC_DEBUG=1
-Ccmake.define.CMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type"
git restore cuvec/src # undo deletion of sources
```

Alternatively, if `cmake` and a generator (such as `make` or `ninja`) are
available, then `setup.py build` and `develop` can be explicitly called;
optionally with extra `cmake` and generator arguments:
Once installed in development/editable mode, tests may be run using:

```sh
python setup.py build develop easy_install cuvec[dev] -- -DCUVEC_DEBUG:BOOL=ON -- -j8
pytest
```

Once installed in development/editable mode, tests may be run using:
To run performance tests, build with debugging disabled (`CUVEC_DEBUG=0`), then run:

```sh
pytest
python tests/test_perf.py
```

0 comments on commit 32fb56a

Please sign in to comment.