Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: allow offline build using system libraries #512

Merged
merged 3 commits into from
Mar 8, 2022
Merged

Build: allow offline build using system libraries #512

merged 3 commits into from
Mar 8, 2022

Conversation

drewrisinger
Copy link
Contributor

@drewrisinger drewrisinger commented Mar 3, 2022

Goal of this PR is to support offline build using a system like https://nixos.org/, which does not support buildtime network access. This prevents the current system of fetching a specific version of pybind11 via git.

Essentially, this refactors the pybind11 library search process (via cmake) to a module, and then sets that module to default to the system pybind11 library. This will only change your build process if you also have pybind11 libraries installed on the path.

I'm also open to a flag to switch behavior between system library vs specified pybind11 version.

@drewrisinger drewrisinger changed the title dr pr offline build Build: allow offline build using system libraries Mar 3, 2022
drewrisinger added a commit to drewrisinger/nur-packages that referenced this pull request Mar 3, 2022
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me, and I support the "try offline first, then fallback to install process" philosophy. Just a couple of notes.

requirements-dev.txt Outdated Show resolved Hide resolved
pybind_interface/GetPybind11.cmake Show resolved Hide resolved
Defaults to pre-installed version of pybind11. The search was refactored to a cmake module.

Will default to using the system pybind11, and fetch pybind11 via git if it is not installed
@95-martin-orion 95-martin-orion added the kokoro:run Trigger Kokoro builds for this PR. label Mar 8, 2022
@qsim-qsimh-bot qsim-qsimh-bot removed the kokoro:run Trigger Kokoro builds for this PR. label Mar 8, 2022
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix!

@95-martin-orion 95-martin-orion merged commit f8a2059 into quantumlib:master Mar 8, 2022
@drewrisinger drewrisinger deleted the dr-pr-offline-build branch March 9, 2022 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants