Skip to content

Commit 9e9af14

Browse files
authored
Merge pull request #98 from ledatelescope/replace_pyclibrary_with_ctypesgen
Replace pyclibrary with ctypesgen
2 parents 8d5d922 + 11fe2c4 commit 9e9af14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+451
-623
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
doc
22
version.py
3+
*_generated.py
34
.log*.txt
45
test/data/
6+
*.bin
57

68
# Byte-compiled / optimized / DLL files
79
__pycache__/
@@ -12,6 +14,7 @@ __pycache__/
1214
*.o*
1315
*.lo
1416
*.la
17+
*.a
1518

1619
# Backup files
1720
*~

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ install:
3131
simplejson \
3232
pint \
3333
graphviz \
34-
git+https://github.com/MatthieuDartiailh/pyclibrary.git \
34+
git+https://github.com/davidjamesca/ctypesgen.git@3d2d9803339503d2988382aa861b47a6a4872c32 \
3535
coveralls \
3636
codecov
3737
- sudo make -j NOCUDA=1

Dockerfile.cpu

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@ RUN pip --no-cache-dir install \
3131
contextlib2 \
3232
simplejson \
3333
pint \
34+
git+https://github.com/davidjamesca/ctypesgen.git@3d2d9803339503d2988382aa861b47a6a4872c32 \
3435
graphviz
3536

36-
RUN git clone https://github.com/MatthieuDartiailh/pyclibrary.git && \
37-
cd pyclibrary && \
38-
python setup.py install
39-
4037
ENV TERM xterm
4138

4239
# Build the library

Dockerfile.gpu

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@ RUN pip --no-cache-dir install \
3131
contextlib2 \
3232
simplejson \
3333
pint \
34+
git+https://github.com/davidjamesca/ctypesgen.git@3d2d9803339503d2988382aa861b47a6a4872c32 \
3435
graphviz
3536

36-
RUN git clone https://github.com/MatthieuDartiailh/pyclibrary.git && \
37-
cd pyclibrary && \
38-
python setup.py install
39-
4037
ENV TERM xterm
4138

4239
# Build the library

Dockerfile_prereq.gpu

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@ RUN pip --no-cache-dir install \
3131
contextlib2 \
3232
simplejson \
3333
pint \
34+
git+https://github.com/davidjamesca/ctypesgen.git@3d2d9803339503d2988382aa861b47a6a4872c32 \
3435
graphviz
3536

36-
RUN git clone https://github.com/MatthieuDartiailh/pyclibrary.git && \
37-
cd pyclibrary && \
38-
python setup.py install
39-
4037
ENV TERM xterm
4138

4239
# Build the library

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,21 @@ INC_DIR = src
77
SRC_DIR = src
88

99
BIFROST_PYTHON_DIR = python
10-
BIFROST_PYTHON_VERSION_FILE = $(BIFROST_PYTHON_DIR)/bifrost/version.py
1110

12-
all: libbifrost $(BIFROST_PYTHON_VERSION_FILE) python
11+
all: libbifrost python
1312
.PHONY: all
1413

1514
libbifrost:
1615
$(MAKE) -C $(SRC_DIR) all
1716
.PHONY: libbifrost
1817

19-
$(BIFROST_PYTHON_VERSION_FILE): config.mk
20-
@echo "__version__ = \"$(LIBBIFROST_MAJOR).$(LIBBIFROST_MINOR).$(LIBBIFROST_PATCH)\"" > $@
21-
2218
test:
2319
#$(MAKE) -C $(SRC_DIR) test
2420
cd test && python -m unittest discover
2521
.PHONY: test
2622
clean:
2723
$(MAKE) -C $(BIFROST_PYTHON_DIR) clean || true
2824
$(MAKE) -C $(SRC_DIR) clean
29-
rm -f $(BIFROST_PYTHON_VERSION_FILE)
3025
.PHONY: clean
3126
install: $(INSTALL_LIB_DIR)/$(LIBBIFROST_SO_MAJ_MIN) $(INSTALL_INC_DIR)/$(BIFROST_NAME)
3227
$(MAKE) -C $(BIFROST_PYTHON_DIR) install

NOTICE

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ This product includes software developed at NVIDIA Corporation.
66

77
Bifrost includes source code from the int_fastdiv library (Copyright
88
2014 Maxim Milakov) licensed under the Apache License Version 2.0.
9-
10-
Bifrost uses the PyCLibrary library (Copyright 2010 Luke Campagnola,
11-
2015 Matthieu Dartiailh) licensed under the MIT License.

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,22 @@ Install dependencies:
8383

8484
Install dependencies:
8585

86-
* [PyCLibrary fork](https://github.com/MatthieuDartiailh/pyclibrary)
87-
* Numpy
86+
* numpy
8887
* matplotlib
8988
* contextlib2
9089
* pint
91-
90+
* ctypesgen
9291

9392
```
94-
$ sudo pip install numpy matplotlib contextlib2 pint git+https://github.com/MatthieuDartiailh/pyclibrary.git@dff70337fd904a43de2bdd05dc548620160354d0
93+
$ sudo pip install numpy matplotlib contextlib2 pint git+https://github.com/davidjamesca/ctypesgen.git@3d2d9803339503d2988382aa861b47a6a4872c32
9594
```
9695

9796
### Bifrost installation
9897

9998
Edit **user.mk** to suit your system, then run:
10099

101100
$ make -j
102-
$ sudo make install
101+
$ sudo make install
103102

104103
which will install the library and headers into /usr/local/lib and
105104
/usr/local/include respectively.
@@ -108,12 +107,6 @@ You can call the following for a local Python installation:
108107

109108
$ sudo make install PYINSTALLFLAGS="--prefix=$HOME/usr/local"
110109

111-
Note that the bifrost module's use of PyCLibrary means it must have
112-
access to both the bifrost shared library and the bifrost headers at
113-
import time. The LD_LIBRARY_PATH and BIFROST_INCLUDE_PATH environment
114-
variables can be used to add search paths for these dependencies
115-
respectively.
116-
117110
### Docker container
118111

119112
Install dependencies:
@@ -157,7 +150,7 @@ Doxygen documentation can be generated by running:
157150
$ make doc
158151

159152
This documentation can then be used in a Sphinx build
160-
by running
153+
by running
161154

162155
$ make html
163156

docs/source/Common-installation-and-execution-problems.rst

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ timeout, and some blocks are not ending themselves. Quit the program (by
1212
ctrl-\\), and make sure every block in your pipeline is reading/writing
1313
to its rings as it should.
1414

15-
ImportError: No module named pyclibrary
16-
---------------------------------------
17-
18-
You have not installed PyCLibrary, or you are using two different python
19-
installations (e.g., one installed via apt-get, and one installed from
20-
source in a local directory, or one in a virtual environment). Make sure
21-
you are using the same Python to install libraries as you are to run
22-
programs. Get PyCLibrary from
23-
`here <https://github.com/MatthieuDartiailh/pyclibrary>`__.
24-
2515
OSError: ..../lib/libbifrost.so: undefined symbol: cudaFreeHost
2616
---------------------------------------------------------------
2717

@@ -33,9 +23,9 @@ still having trouble, raise an issue.
3323
OSError: Can't find library with name libbifrost.so
3424
---------------------------------------------------
3525

36-
This means that PyCLibrary can't find your Bifrost installation.
37-
Whatever library folders it searches for Bifrost, you do not have the
38-
libbifrost.so file there. To fix this, type
26+
This means that the bifrost Python wrapper can't find your Bifrost
27+
installation. Whatever library folders it searches for Bifrost, you
28+
do not have the libbifrost.so file there. To fix this, type
3929

4030
``echo $LD_LIBRARY_PATH``
4131

@@ -47,7 +37,7 @@ problem. Perform
4737

4838
where ``/my/bifrost/installation`` is the folder where you installed the
4939
Bifrost "lib" (in config.mk, this folder is given as
50-
``INSTALL_LIB_DIR``). This should add Bifrost to the PyCLibrary search
40+
``INSTALL_LIB_DIR``). This should add Bifrost to the wrapper's search
5141
path.
5242

5343
OSError: libcudart.so.x.0: cannot open shared object file: No such file or directory

docs/source/Getting-started-guide.rst

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,11 @@ as follows:
3737
3. Check pip is working with ``pip list``, which will give the versions
3838
of pip and setuptools.
3939

40-
numpy, matplotlib, contextlib2, simplejson, pint, graphviz
41-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40+
numpy, matplotlib, contextlib2, simplejson, pint, graphviz, ctypesgen
41+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4242

4343
If you have already installed pip, this step should be as simple as
44-
``pip install --user numpy matplotlib contextlib2 simplejson pint graphviz``.
45-
46-
`PyCLibrary (modified) <https://github.com/MatthieuDartiailh/pyclibrary>`__
47-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48-
49-
PyCLibrary is a Python library that will parse C files and ease the
50-
interaction with ``ctypes``. The entire Bifrost front end is built with
51-
it. **Do not install the pip version, as it is out of date**. You need
52-
to get the source from
53-
`GitHub <https://github.com/MatthieuDartiailh/pyclibrary>`__, and
54-
install it manually:
55-
56-
1. Download PyCLibrary by running
57-
``git clone https://github.com/MatthieuDartiailh/pyclibrary``
58-
2. Enter the PyCLibrary folder that was just created, and run
59-
``python setup.py install --user``.
60-
3. Check that PyCLibrary installed correctly by running ``python``, and
61-
then trying ``import pyclibrary``. If this works, you are ready to
62-
go.
44+
``pip install --user numpy matplotlib contextlib2 simplejson pint graphviz git+https://github.com/davidjamesca/ctypesgen.git@3d2d9803339503d2988382aa861b47a6a4872c32``.
6345

6446
C++ dependencies
6547
~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)