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

Issues when building a conda package #863

Closed
vigneshmanick opened this issue Aug 18, 2024 · 4 comments
Closed

Issues when building a conda package #863

vigneshmanick opened this issue Aug 18, 2024 · 4 comments

Comments

@vigneshmanick
Copy link

I am testing building a conda package with scikit-build-core and have started with the pybind example and have run into some issues

Issues

  1. The necessary packages that are automatically installed and injected into the environment (cmake, ninja, setuptools_scm etc.) doesn't seem to work when running with conda build.
  2. When running the example on a local machine that has no cmake installed, the build errors out with cmake not found. This is working in the github pipeline since the github runners already have cmake installed. i.e cmake is missing from the build section in the recipe
  3. The build also doesn't run in parallel even if ninja is set in the host/build section. The env variable CMAKE_BUILD_PARALLEL_LEVEL needs to be set.

There could be other discrepancies but these are the most prominent ones that i found

Reproducilbe example

git clone https://github.com/pybind/scikit_build_example.git
conda create -n cb conda-build conda-verify pytest
conda activate cb && cd scikit_build_example && conda build conda.recipe
# errors because cmake is not found
# after cmake is defined in the build section, the compiling is run in serial

any pointers on what need to be set for a conda build process to work similar to usual pip install . with scikit build core would be very helpful.

Thanks!

@henryiii
Copy link
Collaborator

henryiii commented Aug 19, 2024

We need more docs on setting up Conda-build. The rules:

  • Conda builds are made in conda environments, so you have to set them up manually in your recipe.
  • You must add a dependency on cmake. The scikit-build-core package can't depend on cmake, make, or ninja due to conda limitations.
  • You either have to have a dependency on make, or you have to unset CMAKE_GENERATOR or set it to "Ninja". conda-build hard-codes it to make even if make is not present. If you use make, then it will build on one core unless CMAKE_BUILD_PARALLEL_LEVEL is set. Ninja multithreads automatically.

@henryiii
Copy link
Collaborator

@henryiii
Copy link
Collaborator

henryiii commented Aug 19, 2024

Oh, that's the pybind/scikit_build_example, it's missing these parts, that's embarrassing...

Fix at pybind/scikit_build_example#149.

@vigneshmanick
Copy link
Author

Thanks for the quick response, this works!

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

No branches or pull requests

2 participants