You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pkgconfig files are missing in the built package #74
See scipy/scipy#16187 (comment) for more context. All development headers and CMake files are present, but .pc files are missing. We need those for building with Meson.
I made a PR to add pkgconfig files in #77. The file assumes the tarball will be unpacked into C:\opt on windows and /usr/local otherwise. We should document the need to set PKG_CONFIG_PATH. Also, local builds will prefer to set PKG_CONFIG_SYSROOT_DIR since they may not be able to unpack into those locations.
We should document the need to set PKG_CONFIG_PATH. Also, local builds will prefer to set PKG_CONFIG_SYSROOT_DIR since they may not be able to unpack into those locations.
This is only relevant for SciPy at this point, I'm not sure that it needs documenting anywhere (aside from the CI files where it's used).
Note #77 was missing the git config --global --add safe.directory '*' fix for the versions, so the first OpenBLAS tarballs with openblas.pc files are the v0.3.20 releases.
The file assumes the tarball will be unpacked into C:\opt on windows and /usr/local otherwise. We should document the need to set PKG_CONFIG_PATH. Also, local builds will prefer to set PKG_CONFIG_SYSROOT_DIR since they may not be able to unpack into those locations.
Basically, assuming everything is in C:/opt/lib/pkgconfig and C:/opt/lib and C:/opt/include you want this
includedir=${prefix}/include
libdir=${prefix}/lib
So far pretty normal. The interesting thing is, what is prefix? Usually that is /usr/local or I guess C:/opt, but pkg-config has support for relocatable installs, which look like this instead:
prefix=${pcfiledir}/../..
This can then be extracted absolutely anywhere, and pkg-config will expand pcfiledir to the directory that the .pc file is in, which per the designated structure is in lib/pkgconfig relative to the extraction path, so two levels up from there is your relocatable prefix.
Supporting this here could be done either by reimplementing the openblas pkg-config file (or patching it at least), or else by working with openblas upstream to add an option for it. Unfortunately there is no good abstraction like the meson one. :( So it may be a bit messy to figure out exactly which path should be specified in every case.
When testing on some supercomputer hardware I had to manually edit the /usr/local pkgconf stuff to another path (b/c don't have root on the comp of course). This was pretty easy to do though.
Activity
mattip commentedon May 18, 2022
It seems this might be solved by fixing #68 from this comment:
rgommers commentedon May 18, 2022
That's a bigger lift though, and Windows-only. We need
.pcfiles on all platforms.mattip commentedon May 19, 2022
I made a PR to add pkgconfig files in #77. The file assumes the tarball will be unpacked into
C:\opton windows and/usr/localotherwise. We should document the need to setPKG_CONFIG_PATH. Also, local builds will prefer to setPKG_CONFIG_SYSROOT_DIRsince they may not be able to unpack into those locations.rgommers commentedon May 19, 2022
Thanks @mattip!
This is only relevant for SciPy at this point, I'm not sure that it needs documenting anywhere (aside from the CI files where it's used).
mattip commentedon May 19, 2022
Note #77 was missing the
git config --global --add safe.directory '*'fix for the versions, so the first OpenBLAS tarballs withopenblas.pcfiles are the v0.3.20 releases.eli-schwartz commentedon May 19, 2022
https://github.com/xianyi/OpenBLAS/blob/0b678b19dc03f2a999d6e038814c4c50b9640a4e/Makefile.install#L152-L159
#Generating openblas.pc @echo Generating $(LIBSONAMEBASE).pc in "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)" @echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc" @echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc" @echo 'openblas_config= USE_64BITINT='$(USE_64BITINT) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'DYNAMIC_OLDER='$(DYNAMIC_OLDER) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc" @echo 'version='$(VERSION) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc" @echo 'extralib='$(PKG_EXTRALIB) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc" @cat openblas.pc.in >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE).pc"This embeds OPENBLAS_LIBRARY_DIR and OPENBLAS_INCLUDE_DIR which don't have pkg-config
${prefix}relocation.Meson in git master has built-in support for relocatable pkg-config files, which is how I know this is possible... I discussed it with the implementer and merged it.
Basically, assuming everything is in
C:/opt/lib/pkgconfigandC:/opt/libandC:/opt/includeyou want thisSo far pretty normal. The interesting thing is, what is prefix? Usually that is
/usr/localor I guessC:/opt, but pkg-config has support for relocatable installs, which look like this instead:This can then be extracted absolutely anywhere, and pkg-config will expand pcfiledir to the directory that the .pc file is in, which per the designated structure is in
lib/pkgconfigrelative to the extraction path, so two levels up from there is your relocatable prefix.Supporting this here could be done either by reimplementing the openblas pkg-config file (or patching it at least), or else by working with openblas upstream to add an option for it. Unfortunately there is no good abstraction like the meson one. :( So it may be a bit messy to figure out exactly which path should be specified in every case.
tylerjereddy commentedon Jun 29, 2022
When testing on some supercomputer hardware I had to manually edit the
/usr/localpkgconf stuff to another path (b/c don't have root on the comp of course). This was pretty easy to do though.