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
CI/BLD: use scipy-openblas wheel when building #20585
base: main
Are you sure you want to change the base?
Conversation
@@ -139,7 +138,7 @@ test-command = "bash {project}/tools/wheels/cibw_test_command.sh {project}" | |||
[tool.cibuildwheel.linux] | |||
manylinux-x86_64-image = "manylinux2014" | |||
manylinux-aarch64-image = "manylinux2014" | |||
before-build = "bash {project}/tools/wheels/cibw_before_build_linux.sh {project}" | |||
before-build = "bash {project}/tools/wheels/cibw_before_build.sh {project}" | |||
|
|||
[tool.cibuildwheel.macos] | |||
before-build = "bash {project}/tools/wheels/cibw_before_build_macos.sh {project}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line will override any config specified in [tool.cibuildwheel]
(i.e. the new file you add won't get called). Ditto the specific windows file.
For me it makes sense to separate configuration into separate cibw_before_build_platform
files, a single file can get convoluted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps there could be a common file, and individual files in this line, i.e.
before-build = "bash {project}/tools/wheels/cibw_before_build_common.sh; bash {project}/tools/wheels/cibw_before_build_macos.sh {project}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line will override any config specified in
[tool.cibuildwheel]
(i.e. the new file you add won't get called).
At this time, I only want to override the linux wheel building to prove the wheels work. If it works, we can think about how to generalize it in another PR/other commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. The changes you make here are also overridden in wheels.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oy. I will try removing the redundant line from wheels.yml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a duplicate is sometimes useful. e.g. if you want to develop locally you want things specified in pyproject.toml. If you want a fixed config for scipy/scipy to build wheels for public consumption you may want to do that in wheels.yml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it makes sense to separate configuration into separate ...
OK, adopted in the latest commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a duplicate is sometimes useful.
Hmm. On the other hand, it is a bit obscure and makes replicating the wheel build locally more difficult...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could document the ability to override the pyproject.toml values with local environment variables, and local specialized builds would do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. The main reason to do so is e.g. employ specific package versions, etc.
4737ad9
to
8214296
Compare
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This need for LD_LIBRARY_PATH
is quite annoying. @ev-br pinged me about an issue with this as well yesterday. I haven't been able to reproduce it myself, but my conclusion was that Libs: -L{libdir} -lscipy_openblas
in the generated .pc
file is not reliable since it depends on the loader's library search path configuration as well as whether site-packages
is under sysroot or not, and it should be replaced with /abspath/to/scipy_openblas.so
to ensure the built extension modules will always find scipy_openblas.so
at runtime.
All of the boilerplate of copying shared libraries around should be reduceable to:
$ python -c "import scipy_openblas32; print(scipy_openblas32.get_pkg_config())" > scipy-openblas.pc
$ export PKG_CONFIG_PATH=$PWD
Does that sound right to you @mattip?
For LD_LIBRARY_PATH, my band-aid fix was to copy the .so file from build/ to build-install: https://github.com/ev-br/openblas-bench/blob/main/.github/workflows/codspeed.yml#L42 Still puzzling why the two libs have different linkage. |
LD_LIBRARY_PATH is needed at runtime, not build time. The linker arguments in the pkg_config file are for build time, not runtime. In a proper wheel, delocate/auditwheel are used so LD_LIBRARY_PATH is no longer needed. But in the CI workflows, we need to either copy the dependencies into somwhere like /usr/local/lib, which is what the current scripts do, or use LD_LIBRARY_PATH |
I know it's a runtime thing, I am saying that it should not be needed. It is bad for a build to succeed and then fail at runtime.
We have a goal of wanting it to work without vendoring. Also, folks are trying to use the I don't think it's hard. It should only require passing an absolute path rather than |
Makes sense. I can try this next week |
That seems to work on linux. How should this work on macos? Linking with the absolute path does not preserve the path for runtime, nor does using |
This is what conda-forge compilers use on macOS, so I expect it to work:
It would be surprising if it works when given via |
The The missing part is that I need to do this in order to "burn" the
I am still trying to figure out how to set the |
The
or with:
To test that, you can fix it locally like this:
After that, the install name is correct:
and adding You can also try checking install names of for example the tl;dr rebuilding |
Replaces #20074. Uses the scipy-openblas32 wheel for building Scipy
The first commit changes linux wheel builds to use the scipy-openblas32 wheel
Reference issue
What does this implement/fix?
Additional information
cc @rgommers