Skip to content

Commit

Permalink
Referring to bezier.libs/ instead of bezier/.libs/.
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Hermes committed Apr 8, 2020
1 parent f79e029 commit 1b79ce7
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions docs/python/binary-extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ against these local copies of dependencies.
Linux
=====

The command line tool `auditwheel`_ adds a ``bezier/.libs`` directory
The command line tool `auditwheel`_ adds a ``bezier.libs`` directory
with a modified ``libbezier`` and all of its dependencies (e.g.
``libgfortran``)

Expand All @@ -64,7 +64,7 @@ with a modified ``libbezier`` and all of its dependencies (e.g.
# macOS specific.
dylibs_directory = os.path.join(base_dir, ".dylibs")
# Linux specific.
libs_directory = os.path.join(base_dir, ".libs")
libs_directory = os.path.abspath(os.path.join(base_dir, "..", "bezier.libs"))


def invoke_shell(*args):
Expand All @@ -74,6 +74,18 @@ with a modified ``libbezier`` and all of its dependencies (e.g.
output_bytes = subprocess.check_output(args, cwd=base_dir)
print(output_bytes.decode("utf-8"), end="")
.. doctest:: linux-libs
:linux-only:

>>> libs_directory
'.../site-packages/bezier.libs'
>>> print_tree(libs_directory)
bezier.libs/
libbezier-28a97ca3.so.2020.2.3
libgfortran-2e0d59d6.so.5.0.0
libquadmath-2d0c479f.so.0.0.0
libz-eb09ad1d.so.1.2.3

The ``bezier._speedup`` module depends on this local copy of ``libbezier``:

.. testcode:: linux-readelf-py
Expand All @@ -88,26 +100,26 @@ The ``bezier._speedup`` module depends on this local copy of ``libbezier``:

Dynamic section at offset 0x43e000 contains 27 entries:
Tag Type Name/Value
0x000000000000000f (RPATH) Library rpath: [$ORIGIN/.libs]
0x000000000000000f (RPATH) Library rpath: [$ORIGIN/../bezier.libs]
0x0000000000000001 (NEEDED) Shared library: [libbezier-28a97ca3.so.2020.2.3]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000c (INIT) 0x9d40
...

and the local copy of ``libbezier`` depends on the other dependencies in
``.libs/`` (both directly and indirectly):
``bezier.libs/`` (both directly and indirectly):

.. testcode:: linux-readelf-lib
:hide:

invoke_shell("readelf", "-d", ".libs/libbezier-28a97ca3.so.2020.2.3")
invoke_shell("readelf", "-d", ".libs/libgfortran-2e0d59d6.so.5.0.0")
invoke_shell("readelf", "-d", "../bezier.libs/libbezier-28a97ca3.so.2020.2.3")
invoke_shell("readelf", "-d", "../bezier.libs/libgfortran-2e0d59d6.so.5.0.0")

.. testoutput:: linux-readelf-lib
:linux-only:

$ readelf -d .libs/libbezier-28a97ca3.so.2020.2.3
$ readelf -d ../bezier.libs/libbezier-28a97ca3.so.2020.2.3

Dynamic section at offset 0x44dd8 contains 28 entries:
Tag Type Name/Value
Expand All @@ -118,7 +130,7 @@ and the local copy of ``libbezier`` depends on the other dependencies in
0x000000000000000e (SONAME) Library soname: [libbezier-28a97ca3.so.2020.2.3]
0x000000000000000c (INIT) 0x2be8
...
$ readelf -d .libs/libgfortran-2e0d59d6.so.5.0.0
$ readelf -d ../bezier.libs/libgfortran-2e0d59d6.so.5.0.0

Dynamic section at offset 0x207db8 contains 31 entries:
Tag Type Name/Value
Expand All @@ -138,23 +150,6 @@ and the local copy of ``libbezier`` depends on the other dependencies in

.. _auditwheel: https://github.com/pypa/auditwheel

.. doctest:: linux-libs
:linux-only:

>>> libs_directory
'.../site-packages/bezier/.libs'
>>> libs_parent = os.path.dirname(libs_directory) # Temporary
>>> libs_parent # Temporary
'.../site-packages/bezier'
>>> print_tree(libs_parent) # Temporary
-1
>>> print_tree(libs_directory)
.libs/
libbezier-28a97ca3.so.2020.2.3
libgfortran-2e0d59d6.so.5.0.0
libquadmath-2d0c479f.so.0.0.0
libz-eb09ad1d.so.1.2.3

macOS
=====

Expand Down

0 comments on commit 1b79ce7

Please sign in to comment.