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

Add recipe for Scine Python bindings #18482

Merged
merged 3 commits into from
Apr 7, 2022
Merged

Conversation

awvwgk
Copy link
Member

@awvwgk awvwgk commented Mar 26, 2022

Checklist

  • Title of this PR is meaningful: e.g. "Adding my_nifty_package", not "updated meta.yaml".
  • License file is packaged (see here for an example).
  • Source is from official source.
  • Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged).
  • If static libraries are linked in, the license of the static library is packaged.
  • Build number is 0.
  • A tarball (url) rather than a repo (e.g. git_url) is used in your recipe (see here for more details).
  • GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there.
  • When in trouble, please check our knowledge base documentation before pinging a team.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/scine-utilities-python) and found it was in an excellent condition.

@awvwgk awvwgk changed the title Add recipe for Sparrow Python bindings Add recipe for Scine Python bindings Mar 26, 2022
@awvwgk awvwgk force-pushed the scine branch 3 times, most recently from 7d65f01 to 297c1fd Compare March 26, 2022 21:26
@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/scine-utilities-python) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipes/scine-utilities-python:

  • Jinja2 variable references are suggested to take a {{<one space><variable name><one space>}} form. See lines [31, 32].

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/scine-utilities-python) and found it was in an excellent condition.

@awvwgk awvwgk marked this pull request as ready for review March 26, 2022 22:46
@awvwgk
Copy link
Member Author

awvwgk commented Mar 27, 2022

@conda-forge/help-python-c This recipe for Python bindings to a C++ library is ready for review (pybind11, CMake).

Some patching is required to make it work, this is mainly to avoid compiling the C++ library together with the Python bindings, since the C++ part already takes half an hour to compile and is huge.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipes/celluloid, recipes/eko, recipes/fps-kernels) and found some lint.

Here's what I've got...

For recipes/celluloid:

  • Feedstock with the same name exists in conda-forge.

For recipes/eko:

  • Feedstock with the same name exists in conda-forge.

For recipes/fps-kernels:

  • Feedstock with the same name exists in conda-forge.

@awvwgk
Copy link
Member Author

awvwgk commented Mar 31, 2022

@conda-forge/staged-recipes This recipe is ready for review.

Copy link
Member

@carterbox carterbox left a comment

Choose a reason for hiding this comment

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

Hi @awvwgk,

Could you point me to the conda-forge feedstock(s) that build the other scine packages? I can't seem to find them. Thanks!

recipes/scine-utilities-python/meta.yaml Outdated Show resolved Hide resolved
recipes/scine-utilities-python/meta.yaml Outdated Show resolved Hide resolved
recipes/scine-utilities-python/meta.yaml Outdated Show resolved Hide resolved
Comment on lines +52 to +56
- boost-cpp
- eigen
- gtest
- gmock
- libblas
Copy link
Member

Choose a reason for hiding this comment

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

Are all of these included because your patched build fails if they aren't present? In theory python bindings should only depend on the library it is binding. i.e. scine

Copy link
Member Author

Choose a reason for hiding this comment

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

The upstream package has the bad habit of downloading everything that is not present in the host environment. Since I patched the build files I need most of those present as well, alternative I can try to patch the build files further to only require the essential ones.

Copy link
Member

Choose a reason for hiding this comment

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

I am concerned about overlinking from the python module to libraries that are not actually used directly. It looks like the module should only link to scine and yaml, but it is also linking to BLAS.

https://github.com/qcscine/utilities/blob/493b8db45772b231bc0296535a09905b8e292f77/src/Utils/CMakeLists.txt#L135

What do you know about that?

Copy link
Member

Choose a reason for hiding this comment

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

I'm concerned about over-linking because conda-build will not be able to detect it since BLAS is listed in the host section in order to satisfy the build system requirements.

Copy link
Member Author

@awvwgk awvwgk Apr 7, 2022

Choose a reason for hiding this comment

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

The Python export of the utilities library is actually quite heavy and more than just a thin wrapper around the respective C++ library, making use of most of the libraries in host, which are also found correctly by conda-build:

   INFO: sysroot: '/home/conda/staged-recipes/build_artifacts/scine-utilities-python_1649310291400/_build_env/x86_64-conda-linux-gnu/sysroot/' files: '['/home/conda/staged-recipes/build_artifacts/scine-utilities-python_1649310291400/_build_env/x86_64-conda-linux-gnu/sysroot/usr/share/zoneinfo/zone.tab', '/home/conda/staged-recipes/build_artifacts/scine-utilities-python_1649310291400/_build_env/x86_64-conda-linux-gnu/sysroot/usr/share/zoneinfo/tzdata.zi', '/home/conda/staged-recipes/build_artifacts/scine-utilities-python_1649310291400/_build_env/x86_64-conda-linux-gnu/sysroot/usr/share/zoneinfo/right/Zulu', '/home/conda/staged-recipes/build_artifacts/scine-utilities-python_1649310291400/_build_env/x86_64-conda-linux-gnu/sysroot/usr/share/zoneinfo/right/WET']'
   INFO (scine-utilities-python,lib/python3.8/site-packages/scine_utilities/scine_utilities.cpython-38-x86_64-linux-gnu.so): Needed DSO lib/libutilsos.so found in conda-forge::scine-utilsos-4.0.0-hab723ef_0
   INFO (scine-utilities-python,lib/python3.8/site-packages/scine_utilities/scine_utilities.cpython-38-x86_64-linux-gnu.so): Needed DSO lib/libcore.so found in conda-forge::scine-core-4.0.0-h6e2fe03_0
   INFO (scine-utilities-python,lib/python3.8/site-packages/scine_utilities/scine_utilities.cpython-38-x86_64-linux-gnu.so): Needed DSO lib/libyaml-cpp.so.0.6 found in conda-forge::yaml-cpp-0.6.3-he1b5a44_4
   INFO (scine-utilities-python,lib/python3.8/site-packages/scine_utilities/scine_utilities.cpython-38-x86_64-linux-gnu.so): Needed DSO lib/libblas.so.3 found in conda-forge::libblas-3.8.0-11_h6e990d7_netlib
   INFO (scine-utilities-python,lib/python3.8/site-packages/scine_utilities/scine_utilities.cpython-38-x86_64-linux-gnu.so): Needed DSO lib/libstdc++.so.6 found in conda-forge::libstdcxx-ng-11.2.0-he4da1e4_14
   INFO (scine-utilities-python,lib/python3.8/site-packages/scine_utilities/scine_utilities.cpython-38-x86_64-linux-gnu.so): Needed DSO x86_64-conda-linux-gnu/sysroot/lib64/libm.so.6 found in CDT/compiler package conda-forge::sysroot_linux-64-2.12-he073ed8_15
   INFO (scine-utilities-python,lib/python3.8/site-packages/scine_utilities/scine_utilities.cpython-38-x86_64-linux-gnu.so): Needed DSO lib/libgcc_s.so.1 found in conda-forge::libgcc-ng-11.2.0-h1d223b6_14
   INFO (scine-utilities-python,lib/python3.8/site-packages/scine_utilities/scine_utilities.cpython-38-x86_64-linux-gnu.so): Needed DSO x86_64-conda-linux-gnu/sysroot/lib64/libc.so.6 found in CDT/compiler package conda-forge::sysroot_linux-64-2.12-he073ed8_15
WARNING (scine-utilities-python): interpreter (Python) package conda-forge::python-3.8.13-ha86cf86_0_cpython in requirements/run but it is not used (i.e. it is overdepending or perhaps statically linked? If that is what you want then add it to `build/ignore_run_exports`)
WARNING (scine-utilities-python): run-exports library package conda-forge::_openmp_mutex-4.5-1_gnu in requirements/run but it is not used (i.e. it is overdepending or perhaps statically linked? If that is what you want then add it to `build/ignore_run_exports`)
WARNING (scine-utilities-python): run-exports library package conda-forge::pybind11-abi-4-hd8ed1ab_3 in requirements/run but it is not used (i.e. it is overdepending or perhaps statically linked? If that is what you want then add it to `build/ignore_run_exports`)

I can further patch the build files to remove dependencies like gtest/gmock, which are actually superfluous here, but downloading a few additional packages in the host environment which don't add any run exports or pins not already present from the C++ library seems not very harmful to me, especially when the C++ library is pinned with an exact version constraint.

Copy link
Member Author

Choose a reason for hiding this comment

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

Having libblas in host is useful to have the netlib variant installed via conda-forge-pinning, without the OpenBLAS variant would get in the build step.

Copy link
Member

Choose a reason for hiding this comment

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

The Python export of the utilities library is actually quite heavy and more than just a thin wrapper around the respective C++ library

Good enough for me.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/scine-utilities-python) and found it was in an excellent condition.

@carterbox carterbox merged commit 984e11d into conda-forge:main Apr 7, 2022
@awvwgk awvwgk deleted the scine branch April 9, 2022 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants