diff --git a/.github/workflows/build-topics-test-gha-branch.yml b/.github/workflows/build-topics-test-gha-branch.yml index 7c7c7f6c..acbaaa37 100644 --- a/.github/workflows/build-topics-test-gha-branch.yml +++ b/.github/workflows/build-topics-test-gha-branch.yml @@ -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 @@ -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" @@ -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/cuda-toolkit@v0.2.14 id: cuda-toolkit @@ -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 (get-item lincs-*) env: LINCS_DEV_FORCE_NVCC: "true" LINCS_DEV_DEPENDENCIES: d:\lincs-deps @@ -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 @@ -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 lincs-* - name: Make the wheel machine-independent run: delocate-wheel --wheel-dir dist local-dist/*.whl - name: Check the wheel diff --git a/development/Dockerfile b/development/Dockerfile index ba841872..52ba525c 100644 --- a/development/Dockerfile +++ b/development/Dockerfile @@ -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 \ diff --git a/lincs/liblincs/liblincs-module/converters.cpp b/lincs/liblincs/liblincs-module/converters.cpp index 59726bdf..a96a6d1d 100644 --- a/lincs/liblincs/liblincs-module/converters.cpp +++ b/lincs/liblincs/liblincs-module/converters.cpp @@ -5,11 +5,10 @@ #include #include -#include -#include - #include "../lincs.hpp" #include "../vendored/lov-e.hpp" +#include "../vendored/pybind11/pybind11.h" +#include "../vendored/pybind11/stl.h" namespace py = pybind11; diff --git a/lincs/liblincs/liblincs-module/generation-functions.cpp b/lincs/liblincs/liblincs-module/generation-functions.cpp index 7e6dbf04..460b923e 100644 --- a/lincs/liblincs/liblincs-module/generation-functions.cpp +++ b/lincs/liblincs/liblincs-module/generation-functions.cpp @@ -1,10 +1,9 @@ // Copyright 2023-2024 Vincent Jacques -#include -#include - #include "../classification.hpp" #include "../generation.hpp" +#include "../vendored/pybind11/pybind11.h" +#include "../vendored/pybind11/stl.h" namespace py = pybind11; diff --git a/lincs/liblincs/liblincs-module/io-classes.cpp b/lincs/liblincs/liblincs-module/io-classes.cpp index a92173f4..f9b2bab6 100644 --- a/lincs/liblincs/liblincs-module/io-classes.cpp +++ b/lincs/liblincs/liblincs-module/io-classes.cpp @@ -2,12 +2,12 @@ #include #include -#include -#include -#include #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; diff --git a/lincs/liblincs/liblincs-module/learning-classes.cpp b/lincs/liblincs/liblincs-module/learning-classes.cpp index b101f80f..672f4687 100644 --- a/lincs/liblincs/liblincs-module/learning-classes.cpp +++ b/lincs/liblincs/liblincs-module/learning-classes.cpp @@ -1,9 +1,8 @@ // Copyright 2023-2024 Vincent Jacques -#include -#include - #include "../learning.hpp" +#include "../vendored/pybind11/pybind11.h" +#include "../vendored/pybind11/stl.h" namespace py = pybind11; diff --git a/lincs/liblincs/liblincs-module/main.cpp b/lincs/liblincs/liblincs-module/main.cpp index 5da685b0..23b77c79 100644 --- a/lincs/liblincs/liblincs-module/main.cpp +++ b/lincs/liblincs/liblincs-module/main.cpp @@ -1,9 +1,8 @@ // Copyright 2023-2024 Vincent Jacques -#include -#include - #include "../chrones.hpp" +#include "../vendored/pybind11/pybind11.h" +#include "../vendored/pybind11/stl.h" #ifndef DOCTEST_CONFIG_DISABLE #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/lincs/liblincs/vendored/pybind11/attr.h b/lincs/liblincs/vendored/pybind11/attr.h new file mode 120000 index 00000000..c0760b44 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/attr.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/attr.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/buffer_info.h b/lincs/liblincs/vendored/pybind11/buffer_info.h new file mode 120000 index 00000000..1ac2ace1 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/buffer_info.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/buffer_info.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/cast.h b/lincs/liblincs/vendored/pybind11/cast.h new file mode 120000 index 00000000..c1c1e212 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/cast.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/cast.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/detail/class.h b/lincs/liblincs/vendored/pybind11/detail/class.h new file mode 120000 index 00000000..4310e4c9 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/detail/class.h @@ -0,0 +1 @@ +../../../../../vendored/pybind11/include/pybind11/detail/class.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/detail/common.h b/lincs/liblincs/vendored/pybind11/detail/common.h new file mode 120000 index 00000000..6ac5097c --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/detail/common.h @@ -0,0 +1 @@ +../../../../../vendored/pybind11/include/pybind11/detail/common.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/detail/descr.h b/lincs/liblincs/vendored/pybind11/detail/descr.h new file mode 120000 index 00000000..bed373bb --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/detail/descr.h @@ -0,0 +1 @@ +../../../../../vendored/pybind11/include/pybind11/detail/descr.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/detail/init.h b/lincs/liblincs/vendored/pybind11/detail/init.h new file mode 120000 index 00000000..e6441892 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/detail/init.h @@ -0,0 +1 @@ +../../../../../vendored/pybind11/include/pybind11/detail/init.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/detail/internals.h b/lincs/liblincs/vendored/pybind11/detail/internals.h new file mode 120000 index 00000000..8c82ca80 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/detail/internals.h @@ -0,0 +1 @@ +../../../../../vendored/pybind11/include/pybind11/detail/internals.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/detail/type_caster_base.h b/lincs/liblincs/vendored/pybind11/detail/type_caster_base.h new file mode 120000 index 00000000..684c1e7d --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/detail/type_caster_base.h @@ -0,0 +1 @@ +../../../../../vendored/pybind11/include/pybind11/detail/type_caster_base.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/detail/typeid.h b/lincs/liblincs/vendored/pybind11/detail/typeid.h new file mode 120000 index 00000000..f3d25962 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/detail/typeid.h @@ -0,0 +1 @@ +../../../../../vendored/pybind11/include/pybind11/detail/typeid.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/gil.h b/lincs/liblincs/vendored/pybind11/gil.h new file mode 120000 index 00000000..c6c19677 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/gil.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/gil.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/gil_safe_call_once.h b/lincs/liblincs/vendored/pybind11/gil_safe_call_once.h new file mode 120000 index 00000000..60b3cc01 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/gil_safe_call_once.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/gil_safe_call_once.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/operators.h b/lincs/liblincs/vendored/pybind11/operators.h new file mode 120000 index 00000000..06c0edc5 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/operators.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/operators.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/options.h b/lincs/liblincs/vendored/pybind11/options.h new file mode 120000 index 00000000..9401c676 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/options.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/options.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/pybind11.h b/lincs/liblincs/vendored/pybind11/pybind11.h new file mode 120000 index 00000000..1a1f12f2 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/pybind11.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/pybind11.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/pytypes.h b/lincs/liblincs/vendored/pybind11/pytypes.h new file mode 120000 index 00000000..4dfb2327 --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/pytypes.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/pytypes.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/stl.h b/lincs/liblincs/vendored/pybind11/stl.h new file mode 120000 index 00000000..cd8f493c --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/stl.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/stl.h \ No newline at end of file diff --git a/lincs/liblincs/vendored/pybind11/typing.h b/lincs/liblincs/vendored/pybind11/typing.h new file mode 120000 index 00000000..1075e79b --- /dev/null +++ b/lincs/liblincs/vendored/pybind11/typing.h @@ -0,0 +1 @@ +../../../../vendored/pybind11/include/pybind11/typing.h \ No newline at end of file diff --git a/setup.py b/setup.py index 920e8b3c..206825a6 100644 --- a/setup.py +++ b/setup.py @@ -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"]