Skip to content

Commit 686e1c6

Browse files
author
Release Manager
committed
gh-35524: Accept system openblas 0.3.23 and newer (needed for archlinux) ### 📚 Description The configure script was updated to reject openblas 0.3.22 but the test introduced in #35377 is too restrictive and excludes openblas 0.3.23. This patch addresses the issue for the non `pkg-config` case (currently on Archlinux, `openblas.pc` has no version number and `pkg-config` is not used in the configure process). ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies URL: #35524 Reported by: Rémy Oudompheng Reviewer(s): Dima Pasechnik, Matthias Köppe, Rémy Oudompheng
2 parents 5bd81de + 3d0467f commit 686e1c6

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

build/pkgs/openblas/spkg-configure.m4

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SAGE_SPKG_CONFIGURE([openblas], [
1010
dnl Reject openblas 0.3.22 - https://github.com/sagemath/sage/pull/35371
1111
m4_pushdef([SAGE_OPENBLAS_LT_VERSION_MAJOR], [0])
1212
m4_pushdef([SAGE_OPENBLAS_LT_VERSION_MINOR], [3])
13-
m4_pushdef([SAGE_OPENBLAS_LT_VERSION_MICRO], [22])
13+
m4_pushdef([SAGE_OPENBLAS_LT_VERSION_MICRO], [99])
1414
m4_pushdef([SAGE_OPENBLAS_LT_VERSION], [SAGE_OPENBLAS_LT_VERSION_MAJOR.SAGE_OPENBLAS_LT_VERSION_MINOR.SAGE_OPENBLAS_LT_VERSION_MICRO])
1515
PKG_CHECK_MODULES([OPENBLAS], [openblas >= ]SAGE_OPENBLAS_MIN_VERSION [openblas < ]SAGE_OPENBLAS_LT_VERSION, [
1616
LIBS="$OPENBLAS_LIBS $LIBS"
@@ -40,6 +40,21 @@ SAGE_SPKG_CONFIGURE([openblas], [
4040
AC_MSG_WARN([Unable to locate the directory of openblas.pc. This should not happen!])
4141
sage_spkg_install_openblas=yes
4242
])
43+
AS_IF([test x$sage_spkg_install_openblas != xyes], [
44+
AC_MSG_CHECKING([the OpenBLAS version using openblas_get_config])
45+
AC_LANG_PUSH([C])
46+
AC_RUN_IFELSE([
47+
dnl Reject 0.3.22 - see https://github.com/sagemath/sage/pull/35377
48+
AC_LANG_PROGRAM([[#include <string.h>
49+
char *openblas_get_config(void); ]],
50+
[[if (!strncmp(openblas_get_config(), "OpenBLAS 0.3.22", 15)) return 1;]])
51+
], [
52+
AC_MSG_RESULT([good])
53+
], [
54+
AC_MSG_RESULT([known bad version])
55+
sage_spkg_install_openblas=yes])
56+
AC_LANG_POP([C])
57+
])
4358
AS_IF([test x$sage_spkg_install_openblas != xyes], [
4459
AC_SUBST([SAGE_SYSTEM_FACADE_PC_FILES])
4560
AC_SUBST([SAGE_OPENBLAS_PC_COMMAND], ["\$(LN) -sf \"$OPENBLASPCDIR/openblas.pc\" \"\$(@)\""])
@@ -66,6 +81,7 @@ SAGE_SPKG_CONFIGURE([openblas], [
6681
AC_LANG_PUSH([C])
6782
AC_RUN_IFELSE([
6883
AC_LANG_PROGRAM([[#include <stdio.h>
84+
#include <string.h>
6985
char *openblas_get_config(void);
7086
int version[3]; ]],
7187
[[version[0] = version[1] = version[2] = 0;
@@ -86,7 +102,8 @@ SAGE_SPKG_CONFIGURE([openblas], [
86102
>=10000 * ]]SAGE_OPENBLAS_LT_VERSION_MAJOR[[
87103
+ 100 * ]]SAGE_OPENBLAS_LT_VERSION_MINOR[[
88104
+ ]]SAGE_OPENBLAS_LT_VERSION_MICRO[[)
89-
return 1;]])
105+
return 1;
106+
if (!strncmp(openblas_get_config(), "OpenBLAS 0.3.22", 15)) return 1;]])
90107
], [AS_VAR_SET([HAVE_OPENBLAS], [yes])], [AS_VAR_SET([HAVE_OPENBLAS], [no])],
91108
[AS_VAR_SET([HAVE_OPENBLAS], [yes])])
92109
AC_LANG_POP([C])

0 commit comments

Comments
 (0)