Skip to content
Open
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
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ $ conda install alartum::ncvis

**Important**: be sure to have *OpenMP* available.

Install for Mac: `$ brew install libomp`

First of all, download the *pcg-cpp* and *hnswlib* libraries:
```bash
$ make libs
Expand All @@ -103,7 +105,9 @@ If *conda* environment is used, it replaces library search paths. To prevent com

* Pip
```bash
$ pip install numpy cython pybind11
$ uv venv --python 3.11
$ source .venv/bin/activate
$ uv pip install -r requirements.txt
$ make wrapper
```

Expand Down
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cython==3.0.2
numpy==1.26.1
pybind11==2.13.6
scipy==1.15.2
setuptools==61.0.0
21 changes: 11 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,9 @@ def finalize_options(self):
deps = runtime_deps


try:
from Cython.Build import cythonize
import numpy
import pybind11 # noqa: F401
except ImportError:
print("numpy/cython/pybind11 are not installed:")
print(">> pip install numpy cython pybind11")
exit(1)
from Cython.Build import cythonize
import numpy
import pybind11 # noqa: F401

with open("recipe/meta.yaml", "r") as f:
config = f.read()
Expand Down Expand Up @@ -118,21 +113,27 @@ def finalize_options(self):
"-std=c++14",
"-fpic",
"-ffast-math",
"-fopenmp=libiomp5",
"-fopenmp",
"-Wl,-rpath,/opt/homebrew/opt/libomp/lib"
]
libraries = ["m", "iomp5"]
extra_link_args = ["-L/opt/homebrew/opt/libomp/lib", "-lomp"]
libraries = ["m"]
include_dirs = [numpy.get_include(), "/opt/homebrew/opt/libomp/include"]
elif sys.platform.startswith("linux"):
extra_compile_args = ["-O3", "-std=c++14", "-ffast-math", "-fopenmp"]
extra_link_args = []
libraries = ["m", "gomp"]
elif sys.platform.startswith("win32"):
extra_compile_args = ["/O2", "/fp:fast", "/openmp"]
extra_link_args = []
libraries = ["/openmp"]

extensions = [
Extension(
"ncvis",
["wrapper/*.pyx", *src],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
libraries=libraries,
include_dirs=[numpy.get_include()],
language="c++",
Expand Down
Loading