Challenges with a complex scikit-build core package

Anyone have a good example of a (fairly complex) conda-forge recipe for a package that uses scikit-build-core ?

Our project:

We have a bunch of Cython code that wraps C++ code. (and a pile of Python on top of it)

The C++ code links to netcdf4, which links to hdf (4 and 5?).

  • We got it all to build with scikit-build-core
  • We got conda packages to build locally on Mac, and Linux

But…

Trying to make a feedstock recipe has been a mess.

I *think * the issues are with the cross-compilation system – still quite confused about what we need to put in the host requirements.

On OS-X:
Lots o’ errors with “overlinking check failed” - there seem to be a lot of libs missing.

I think the only non-system libs our code is linking against is libnetcdf, but that then needs a bunch of others, that need a bunch of others …

But when we added all the ones it’s looking for to the hosts requirement, conda was unable to resolve the dependencies. - so I guess we are over-specifying.

Since libnetcdf is the only one we are directly linking to, we tried to see if the only that would do (and it would bring in the others) – but then a bunch of missing libs again.

It also complains that , e.g. libnetcdf is not in the run requirements, which it isn’t because we are requiring netCDF4 (the python wrappers) which bring in libnetcf. But maybe because we are directly linking the libnetcdf, we do need that?

But what about all the others? It seems odd that we should have to specify the entire chain …

NOTE: we looked at the libnetcdf recipe – and it seems to have mostly “host” requirements, and only zlib in “run” (and a note that that shouldn’t be required, either).

So if it’s in “host”, you don’t also need it in “run”?

Windows issue:

Again, this all works locally, but in conda build, it can’t find the shared library we are building – it looks like it’s getting installed in lib, and the RPATH is looking in lib, but somehow ???

That may be a scikit-build issue, rather than a conda-build one, but it does would outside of conda-build.

Anyway, if anyone has a workign example of a complex build (ideally one that uses libnetcdf) that would be great.

recipe PR:

source:

NOTE: ignore the conda recipes in the PYGNOME project – they are old cruft.

Looks like you got it working, right?

yes, we do.

we’re not confident we’ve done it the best way to go, but it’s building!

Any comments, review would be great.

Thanks,

NOTE: one real confusion for us was in the host requirments, which the docs din’t make clear to us at all:

  1. apparently you have to put libs in host even if the package isn’t directly using them – e.g.:
    we build against netcdf, and netcdf needs hdf5, and hdf5 needs libzip. …

In the end, we needed to add a LOT of libs to host.

  1. if it’s a host requirement, you shouldn’t also add it to run requirements. Presumably the final run reqs will include them.

Where can I post a PR for the docs to clarify this? If I have it right :slight_smile: