Skip to content

Commit

Permalink
Merge pull request #67 from shwina/add-nvtx-dir
Browse files Browse the repository at this point in the history
Add support for `NVTX_DIR`, drop Python 3.7
  • Loading branch information
shwina authored Mar 13, 2023
2 parents 5c7d47c + 55f87ae commit 9b93d70
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
10 changes: 10 additions & 0 deletions python/docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ Or `conda`:
::

conda install -c conda-forge nvtx

On Windows, or another system for which pre-built packages are not
published, you can try to install from source. This requires: (1) that
Cython is installed, and (2) that the ``NVTX_PREFIX`` environment
variable is set to the directory containing ``nvtx3``, the C header
library. On systems with CUDA installed, this is typically the CUDA
include directory (e.g., ``/usr/local/cuda/include``).
::

NVTX_PREFIX=/path/to/nvtx/prefix/ python -m pip install nvtx --no-binary nvtx
5 changes: 4 additions & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
include_dirs = [os.path.dirname(sysconfig.get_path("include")),]
library_dirs = [get_python_lib()]

if nvtx_include_dir := os.getenv("NVTX_PREFIX"):
include_dirs.insert(0, nvtx_include_dir)

extensions = [
Extension(
"*",
Expand Down Expand Up @@ -55,7 +58,7 @@

setup(
name="nvtx",
version="0.2.5",
version="0.2.6",
description="PyNVTX - Python code annotation library",
url="https://github.com/NVIDIA/nvtx",
author="NVIDIA Corporation",
Expand Down
4 changes: 2 additions & 2 deletions python/tools/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function repair_wheel {
export C_INCLUDE_PATH=/io/c/include

# Compile wheels
for PY_VERSION in 37 38 39 310; do
for PY_VERSION in 38 39 310; do
PYBIN=/opt/python/cp${PY_VERSION}*/bin/
${PYBIN}/pip wheel /io/python/ --no-deps -w wheels/
done
Expand All @@ -25,7 +25,7 @@ for whl in wheels/*.whl; do
done

# Install packages and test
for PY_VERSION in 37 38 39 310; do
for PY_VERSION in 38 39 310; do
PYBIN=/opt/python/cp${PY_VERSION}*/bin
${PYBIN}/pip install nvtx --no-index -f /io/python/wheels/
${PYBIN}/pip install -r /io/python/test_requirements.txt
Expand Down

0 comments on commit 9b93d70

Please sign in to comment.