Skip to content

Commit

Permalink
Use vendored pybind11
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquev6 committed Jun 12, 2024
1 parent 175339c commit f66fd96
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 29 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-topics-test-gha-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
python-version: ${{ matrix.python_version }}
- name: Install Python packages
run: pip${{ matrix.python_version }} install auditwheel build Chrones pybind11 twine wheel
run: pip${{ matrix.python_version }} install auditwheel build Chrones twine
- name: Install CUDA
run: |
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
uses: actions/checkout@v4

- name: Build the wheel
run: python${{ matrix.python_version }} -m build --no-isolation --wheel --outdir local-dist
run: python${{ matrix.python_version }} -m build --wheel --outdir local-dist
env:
LINCS_DEV_FORCE_NVCC: "true"
LINCS_DEV_FORCE_CHRONES: "true"
Expand All @@ -79,7 +79,7 @@ jobs:
with:
python-version: ${{ matrix.python_version }}
- name: Install Python packages
run: pip install build delvewheel pybind11 twine wheel
run: pip install build delvewheel twine
- name: Install CUDA
uses: Jimver/[email protected]
id: cuda-toolkit
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
uses: actions/checkout@v4

- name: Build the wheel
run: python -m build --no-isolation --wheel --outdir local-dist (get-item lincs-*)
run: python -m build --wheel --outdir local-dist
env:
LINCS_DEV_FORCE_NVCC: "true"
LINCS_DEV_DEPENDENCIES: d:\lincs-deps
Expand All @@ -153,7 +153,7 @@ jobs:
with:
python-version: ${{ matrix.python_version }}
- name: Install Python packages
run: pip3 install build delocate pybind11 twine wheel
run: pip3 install build delocate twine
- name: Install OpenMP
run: |
cd /Users/runner/work
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
uses: actions/checkout@v4

- name: Build the wheel
run: python3 -m build --no-isolation --wheel --outdir local-dist lincs-*
run: python3 -m build --wheel --outdir local-dist
- name: Make the wheel machine-independent
run: delocate-wheel --wheel-dir dist local-dist/*.whl
- name: Check the wheel
Expand Down
1 change: 0 additions & 1 deletion development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked \
&& python3 -m bash_kernel.install \
&& for python_version in $LINCS_DEV_PYTHON_VERSIONS; do python$python_version -m pip install \
build \
pybind11 \
|| exit 1; done
# Recent patchelf version for 'auditwheel repair'
RUN --mount=type=bind,from=download-patchelf,source=/download,target=/download \
Expand Down
5 changes: 2 additions & 3 deletions lincs/liblincs/liblincs-module/converters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
#include <string>
#include <vector>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "../lincs.hpp"
#include "../vendored/lov-e.hpp"
#include "../vendored/pybind11/pybind11.h"
#include "../vendored/pybind11/stl.h"


namespace py = pybind11;
Expand Down
5 changes: 2 additions & 3 deletions lincs/liblincs/liblincs-module/generation-functions.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Copyright 2023-2024 Vincent Jacques

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "../classification.hpp"
#include "../generation.hpp"
#include "../vendored/pybind11/pybind11.h"
#include "../vendored/pybind11/stl.h"


namespace py = pybind11;
Expand Down
6 changes: 3 additions & 3 deletions lincs/liblincs/liblincs-module/io-classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <pybind11/pybind11.h>
#include <pybind11/operators.h>
#include <pybind11/stl.h>

#include "../io.hpp"
#include "../vendored/magic_enum.hpp"
#include "../vendored/pybind11/pybind11.h"
#include "../vendored/pybind11/operators.h"
#include "../vendored/pybind11/stl.h"


namespace py = pybind11;
Expand Down
5 changes: 2 additions & 3 deletions lincs/liblincs/liblincs-module/learning-classes.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright 2023-2024 Vincent Jacques

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "../learning.hpp"
#include "../vendored/pybind11/pybind11.h"
#include "../vendored/pybind11/stl.h"


namespace py = pybind11;
Expand Down
5 changes: 2 additions & 3 deletions lincs/liblincs/liblincs-module/main.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright 2023-2024 Vincent Jacques

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "../chrones.hpp"
#include "../vendored/pybind11/pybind11.h"
#include "../vendored/pybind11/stl.h"

#ifndef DOCTEST_CONFIG_DISABLE
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
Expand Down
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/attr.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/buffer_info.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/cast.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/detail/class.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/detail/common.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/detail/descr.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/detail/init.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/detail/internals.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/detail/type_caster_base.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/detail/typeid.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/gil.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/gil_safe_call_once.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/operators.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/options.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/pybind11.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/pytypes.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/stl.h
1 change: 1 addition & 0 deletions lincs/liblincs/vendored/pybind11/typing.h
7 changes: 0 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,6 @@ def make_liblincs_extension():
else:
print("WARNING: 'chrones' was not found, lincs will be compiled without Chrones", file=sys.stderr)

try:
import pybind11
except ImportError:
print("WARNING: 'pybind11' was not found, compilation will fail. (Source distribution is OK)", file=sys.stderr)
else:
include_dirs += [pybind11.get_include()]

if sys.platform == "linux":
extra_compile_args["c++"] = ["-std=c++17", "-Werror=switch", "-fopenmp"]
extra_compile_args["vendored-c++"] = ["-std=c++17", "-Werror=switch", "-w", "-DQUIET", "-DNBUILD", "-DNCONTRACTS"]
Expand Down

0 comments on commit f66fd96

Please sign in to comment.