Skip to content

Commit c8b51cd

Browse files
authored
Michelp/binarywheels (#82)
* binary wheels. * binary wheels. * bump setup for wheels. * bump setup for wheels. * bump setup for wheels. * cleanup manylinux * bump * pdoc gen
1 parent cd45926 commit c8b51cd

File tree

10 files changed

+152
-48
lines changed

10 files changed

+152
-48
lines changed

Dockerfile-manylinux

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ARG BASE_CONTAINER=quay.io/pypa/manylinux2010_x86_64
2+
FROM ${BASE_CONTAINER}
3+
4+
RUN yum install -y cmake make gcc git openmpi-devel llvm-devel
5+
6+
ARG SS_RELEASE=v4.0.3
7+
ARG SS_COMPACT=0
8+
9+
WORKDIR /build
10+
RUN git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git --depth 1 --branch $SS_RELEASE
11+
12+
WORKDIR /build/GraphBLAS/build
13+
RUN cmake .. -DGBCOMPACT=${SS_COMPACT} && make -j8 && make install
14+
RUN ldconfig
15+
RUN /bin/rm -Rf /build

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,26 @@ library. Once you have these installed, pygraphblas can be installed
1717
with:
1818

1919
python setup.py install
20-
21-
An installation script for Ubuntu 18.04 is provided in the `install-ubuntu.sh` file.
20+
21+
There are two ways to download precompiled binaries of pygraphblas
22+
with SuiteSparse included. One way is to use `pip install
23+
pygraphblas` on an Intel Linux machine. This will download a package
24+
compatible with most modern linux distributions. This also works in a
25+
Docker container on Mac.
26+
27+
There are also pre-build docker images based on Ubuntu 20.04 that have
28+
a pre-compiled SuiteSparse and pygraphblas installed. These come in
29+
two flavors `minimal` which is the Ipython interpreter-only, and
30+
`notebook` which comes with a complete Jupyter Notebook server. These
31+
containers also work on Mac.
32+
33+
An installation script for Ubuntu 18.04 is provided in the
34+
`install-ubuntu.sh` file.
35+
36+
NOTE: DO NOT USE THESE PRE-COMPILED BINARIES FOR BENCHMARKING
37+
SUITESPARSE. These binaries are not guaranteed to be idealy compiled
38+
for your environment. You must build your own binaries on your own
39+
platforms if you intend to do ANY valid benchmarking.
2240

2341
## Docker
2442

@@ -151,3 +169,9 @@ referred to as "plus_times". This is the common operation of
151169
multiplying two matrices containing real numbers, the corresponding row
152170
and column entries are multipled and the results are summed for the
153171
final value.
172+
173+
## Code of Conduct
174+
175+
Everyone interacting in the pygraphblas project's codebases, issue
176+
trackers, chat rooms, and mailing lists is expected to follow the [PSF
177+
Code of Conduct](https://www.python.org/psf/conduct/).

docs/pygraphblas/gviz.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ <h1 class="title">Module <code>pygraphblas.gviz</code></h1>
3838
&#34;&#34;&#34;
3939
from graphviz import Digraph, Source
4040
from PIL import Image, ImageDraw
41-
from IPython.display import display
4241

4342

4443
__all__ = [

docs/pygraphblas/index.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,42 @@ <h2 class="section-title" id="header-classes">Types</h2>
817817
<td>In-place Matrix Element-Wise Intersection</td>
818818
<td>type default DIV combiner</td>
819819
</tr>
820+
<tr>
821+
<td>A ==
822+
B</td>
823+
<td>Compare Element-Wise Union</td>
824+
<td>type default EQ operator</td>
825+
</tr>
826+
<tr>
827+
<td>A !=
828+
B</td>
829+
<td>Compare Element-Wise Union</td>
830+
<td>type default NE operator</td>
831+
</tr>
832+
<tr>
833+
<td>A &lt;
834+
B</td>
835+
<td>Compare Element-Wise Union</td>
836+
<td>type default LT operator</td>
837+
</tr>
838+
<tr>
839+
<td>A &gt;
840+
B</td>
841+
<td>Compare Element-Wise Union</td>
842+
<td>type default GT operator</td>
843+
</tr>
844+
<tr>
845+
<td>A &lt;=
846+
B</td>
847+
<td>Compare Element-Wise Union</td>
848+
<td>type default LE operator</td>
849+
</tr>
850+
<tr>
851+
<td>A &gt;=
852+
B</td>
853+
<td>Compare Element-Wise Union</td>
854+
<td>type default GE operator</td>
855+
</tr>
820856
</tbody>
821857
</table>
822858
<p>Note that all the above operator syntax is mearly sugar over
@@ -856,6 +892,12 @@ <h2 class="section-title" id="header-classes">Types</h2>
856892
A *= B | In-place Matrix Element-Wise Intersection | type default TIMES combiner
857893
A / B | Matrix Element-Wise Intersection | type default DIV combiner
858894
A /= B | In-place Matrix Element-Wise Intersection | type default DIV combiner
895+
A == B | Compare Element-Wise Union | type default EQ operator
896+
A != B | Compare Element-Wise Union | type default NE operator
897+
A &lt; B | Compare Element-Wise Union | type default LT operator
898+
A &gt; B | Compare Element-Wise Union | type default GT operator
899+
A &lt;= B | Compare Element-Wise Union | type default LE operator
900+
A &gt;= B | Compare Element-Wise Union | type default GE operator
859901

860902
Note that all the above operator syntax is mearly sugar over
861903
various combinations of calling `Matrix.mxm`, `Matrix.mxv`,

docs/pygraphblas/matrix.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ <h1 class="title">Module <code>pygraphblas.matrix</code></h1>
9797
A *= B | In-place Matrix Element-Wise Intersection | type default TIMES combiner
9898
A / B | Matrix Element-Wise Intersection | type default DIV combiner
9999
A /= B | In-place Matrix Element-Wise Intersection | type default DIV combiner
100+
A == B | Compare Element-Wise Union | type default EQ operator
101+
A != B | Compare Element-Wise Union | type default NE operator
102+
A &lt; B | Compare Element-Wise Union | type default LT operator
103+
A &gt; B | Compare Element-Wise Union | type default GT operator
104+
A &lt;= B | Compare Element-Wise Union | type default LE operator
105+
A &gt;= B | Compare Element-Wise Union | type default GE operator
100106

101107
Note that all the above operator syntax is mearly sugar over
102108
various combinations of calling `Matrix.mxm`, `Matrix.mxv`,
@@ -2287,6 +2293,42 @@ <h2 class="section-title" id="header-classes">Types</h2>
22872293
<td>In-place Matrix Element-Wise Intersection</td>
22882294
<td>type default DIV combiner</td>
22892295
</tr>
2296+
<tr>
2297+
<td>A ==
2298+
B</td>
2299+
<td>Compare Element-Wise Union</td>
2300+
<td>type default EQ operator</td>
2301+
</tr>
2302+
<tr>
2303+
<td>A !=
2304+
B</td>
2305+
<td>Compare Element-Wise Union</td>
2306+
<td>type default NE operator</td>
2307+
</tr>
2308+
<tr>
2309+
<td>A &lt;
2310+
B</td>
2311+
<td>Compare Element-Wise Union</td>
2312+
<td>type default LT operator</td>
2313+
</tr>
2314+
<tr>
2315+
<td>A &gt;
2316+
B</td>
2317+
<td>Compare Element-Wise Union</td>
2318+
<td>type default GT operator</td>
2319+
</tr>
2320+
<tr>
2321+
<td>A &lt;=
2322+
B</td>
2323+
<td>Compare Element-Wise Union</td>
2324+
<td>type default LE operator</td>
2325+
</tr>
2326+
<tr>
2327+
<td>A &gt;=
2328+
B</td>
2329+
<td>Compare Element-Wise Union</td>
2330+
<td>type default GE operator</td>
2331+
</tr>
22902332
</tbody>
22912333
</table>
22922334
<p>Note that all the above operator syntax is mearly sugar over
@@ -2326,6 +2368,12 @@ <h2 class="section-title" id="header-classes">Types</h2>
23262368
A *= B | In-place Matrix Element-Wise Intersection | type default TIMES combiner
23272369
A / B | Matrix Element-Wise Intersection | type default DIV combiner
23282370
A /= B | In-place Matrix Element-Wise Intersection | type default DIV combiner
2371+
A == B | Compare Element-Wise Union | type default EQ operator
2372+
A != B | Compare Element-Wise Union | type default NE operator
2373+
A &lt; B | Compare Element-Wise Union | type default LT operator
2374+
A &gt; B | Compare Element-Wise Union | type default GT operator
2375+
A &lt;= B | Compare Element-Wise Union | type default LE operator
2376+
A &gt;= B | Compare Element-Wise Union | type default GE operator
23292377

23302378
Note that all the above operator syntax is mearly sugar over
23312379
various combinations of calling `Matrix.mxm`, `Matrix.mxv`,

manylinux-requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cffi
2+
numpy
3+
scipy
4+
numba
5+
pytest
6+
setuptools
7+
contextvars
8+
matplotlib
9+
graphviz

pygraphblas/gviz.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55
from graphviz import Digraph, Source
66
from PIL import Image, ImageDraw
7-
from IPython.display import display
87

98

109
__all__ = [

pygraphblas/matrix.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ class Matrix:
6565
A *= B | In-place Matrix Element-Wise Intersection | type default TIMES combiner
6666
A / B | Matrix Element-Wise Intersection | type default DIV combiner
6767
A /= B | In-place Matrix Element-Wise Intersection | type default DIV combiner
68+
A == B | Compare Element-Wise Union | type default EQ operator
69+
A != B | Compare Element-Wise Union | type default NE operator
70+
A < B | Compare Element-Wise Union | type default LT operator
71+
A > B | Compare Element-Wise Union | type default GT operator
72+
A <= B | Compare Element-Wise Union | type default LE operator
73+
A >= B | Compare Element-Wise Union | type default GE operator
6874
6975
Note that all the above operator syntax is mearly sugar over
7076
various combinations of calling `Matrix.mxm`, `Matrix.mxv`,

setup-local.sh

100644100755
Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,10 @@
11
#!/bin/bash
22

3-
# this script is to setup a locally installed copy of SuiteSparse and
4-
# pygraphblas into a local venv style virtual environment.
5-
6-
# you will need
7-
# apt-get update && apt-get install -yq cmake make wget libpython3-dev python3-pip libreadline-dev llvm-10-dev git python3-virtualenv
8-
9-
SS_RELEASE=v4.0.0draft5
10-
SS_BURBLE=0
11-
SS_COMPACT=1
12-
13-
mkdir -p local/build
14-
cd local/build
15-
git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git --depth 1 --branch ${SS_RELEASE}
16-
17-
cd GraphBLAS
18-
cmake . -DGB_BURBLE=${SS_BURBLE} -DGBCOMPACT=${SS_COMPACT} && make -j8 && make DESTDIR=.. install
19-
20-
cd ..
21-
22-
python3 -m virtualenv --python=python3 venv
23-
24-
git clone https://github.com/Graphegon/pygraphblas.git --depth 1 --branch Graphegon/${SS_RELEASE}
3+
git clone https://github.com/Graphegon/pygraphblas.git --depth 1 --branch main
254
cd pygraphblas
265

27-
cat <<'EOF' >> libpatch.diff
28-
diff --git a/pygraphblas/build.py b/pygraphblas/build.py
29-
index 72b42e3..f448892 100644
30-
--- a/pygraphblas/build.py
31-
+++ b/pygraphblas/build.py
32-
@@ -40,6 +40,8 @@ def build_ffi():
33-
"_pygraphblas",
34-
source,
35-
libraries=["graphblas"],
36-
+ include_dirs=['../usr/local/include'],
37-
+ library_dirs=['../usr/local/lib'],
38-
extra_compile_args=[
39-
"-std=c11",
40-
"-lm",
41-
EOF
42-
43-
git apply libpatch.diff
44-
45-
virtualenv --python=python3 venv
6+
python3 -m virtualenv --python=python3 venv
467
. venv/bin/activate
478

48-
pip3 install -r minimal-requirements.txt
49-
python3 setup.py install
9+
RUN pip3 install -r minimal-requirements.txt
10+
RUN python3 setup.py install

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
packages=['pygraphblas'],
1010
setup_requires=["pytest-runner", "cffi>=1.0.0"],
1111
cffi_modules=["pygraphblas/build.py:ffibuilder"],
12-
install_requires=["cffi>=1.0.0", "numpy>=1.15", "numba", "scipy"],
12+
install_requires=["cffi>=1.0.0", "numpy>=1.15", "numba", "scipy", "graphviz", "matplotlib", "contextvars"],
1313
# tests_require=["pytest","pytest-cov"],
1414
# entry_points = {
1515
# 'rdf.plugins.store': [
1616
# 'graphblas = pygraphblas.rdflib:GraphBLASStore',
1717
# ],
1818
# }
1919
)
20+

0 commit comments

Comments
 (0)