Skip to content

Commit 6a283a5

Browse files
author
ripley
committed
workarounds for externalBLAS missing the 2025 additions
git-svn-id: https://svn.r-project.org/R/trunk@87889 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent e709673 commit 6a283a5

File tree

5 files changed

+73
-8
lines changed

5 files changed

+73
-8
lines changed

configure

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@ LIBR1
775775
LIBR0
776776
BLAS_SHLIB_FALSE
777777
BLAS_SHLIB_TRUE
778+
BUILD_2025BLAS_FALSE
779+
BUILD_2025BLAS_TRUE
778780
RMATH_HAVE_WORKING_LOG1P
779781
LIBOBJS
780782
ALLOCA
@@ -1096,6 +1098,7 @@ enable_lto
10961098
enable_java
10971099
with_blas
10981100
with_lapack
1101+
with_2025blas
10991102
with_readline
11001103
with_pcre2
11011104
with_pcre1
@@ -1907,6 +1910,7 @@ Optional Packages:
19071910
it [unset]
19081911
--with-lapack use system LAPACK library (if available), or specify
19091912
it [unset]
1913+
--with-2025blas compile 2025 BLAS additions into Rlapack [no]
19101914
--with-readline use readline library [yes]
19111915
--with-pcre2 use PCRE2 library (if available) [yes]
19121916
--with-pcre1 use PCRE1 library (if available and PCRE2 is not)
@@ -4839,6 +4843,22 @@ esac
48394843
fi
48404844

48414845

4846+
4847+
# Check whether --with-2025blas was given.
4848+
if test ${with_2025blas+y}
4849+
then :
4850+
withval=$with_2025blas; if test "${withval}" = no; then
4851+
use_2025blas=no
4852+
else
4853+
use_2025blas=yes
4854+
fi
4855+
4856+
else case e in #(
4857+
e) use_2025blas=no ;;
4858+
esac
4859+
fi
4860+
4861+
48424862
## Readline.
48434863

48444864
# Check whether --with-readline was given.
@@ -27529,7 +27549,7 @@ _ACEOF
2752927549
# flags.
2753027550
r_save_CFLAGS=$CFLAGS
2753127551
CFLAGS="$CFLAGS $r_verb"
27532-
(eval echo $as_me:27532: \"$ac_link\") >&5
27552+
(eval echo $as_me:27552: \"$ac_link\") >&5
2753327553
r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
2753427554
echo "$r_c_v_output" >&5
2753527555
CFLAGS=$r_save_CFLAGS
@@ -27607,7 +27627,7 @@ _ACEOF
2760727627
# flags.
2760827628
r_save_CFLAGS=$CFLAGS
2760927629
CFLAGS="$CFLAGS $r_cv_prog_c_v"
27610-
(eval echo $as_me:27610: \"$ac_link\") >&5
27630+
(eval echo $as_me:27630: \"$ac_link\") >&5
2761127631
r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
2761227632
echo "$r_c_v_output" >&5
2761327633
CFLAGS=$r_save_CFLAGS
@@ -51532,6 +51552,20 @@ if test "${acx_blas_ok}" != "yes"; then
5153251552
esac
5153351553
fi
5153451554

51555+
if test "${use_2025blas}" = yes; then
51556+
if test "${acx_lapack_ok}" = "yes"; then
51557+
as_fn_error $? "--with-2025blas cannot be used with --with-lapack" "$LINENO" 5
51558+
fi
51559+
fi
51560+
if test "${use_2025blas}" = yes; then
51561+
BUILD_2025BLAS_TRUE=
51562+
BUILD_2025BLAS_FALSE='#'
51563+
else
51564+
BUILD_2025BLAS_TRUE='#'
51565+
BUILD_2025BLAS_FALSE=
51566+
fi
51567+
51568+
5153551569
if test "x${use_blas_shlib}" = xyes; then
5153651570
BLAS_SHLIB_TRUE=
5153751571
BLAS_SHLIB_FALSE='#'
@@ -64097,6 +64131,10 @@ if test -z "${USE_EXPORTFILES_TRUE}" && test -z "${USE_EXPORTFILES_FALSE}"; then
6409764131
as_fn_error $? "conditional \"USE_EXPORTFILES\" was never defined.
6409864132
Usually this means the macro was only invoked conditionally." "$LINENO" 5
6409964133
fi
64134+
if test -z "${BUILD_2025BLAS_TRUE}" && test -z "${BUILD_2025BLAS_FALSE}"; then
64135+
as_fn_error $? "conditional \"BUILD_2025BLAS\" was never defined.
64136+
Usually this means the macro was only invoked conditionally." "$LINENO" 5
64137+
fi
6410064138
if test -z "${BLAS_SHLIB_TRUE}" && test -z "${BLAS_SHLIB_FALSE}"; then
6410164139
as_fn_error $? "conditional \"BLAS_SHLIB\" was never defined.
6410264140
Usually this means the macro was only invoked conditionally." "$LINENO" 5

configure.ac

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ AC_ARG_WITH([lapack],
426426
[R_ARG_USE(lapack)],
427427
[use_lapack=unset])
428428

429+
AC_ARG_WITH([2025blas],
430+
[AS_HELP_STRING([--with-2025blas],[compile 2025 BLAS additions into Rlapack @<:@no@:>@])],
431+
[R_ARG_USE(2025blas)],
432+
[use_2025blas=no])
433+
429434
## Readline.
430435
AC_ARG_WITH([readline],
431436
[AS_HELP_STRING([--with-readline],[use readline library @<:@yes@:>@])],
@@ -2403,6 +2408,13 @@ if test "${acx_blas_ok}" != "yes"; then
24032408
esac
24042409
fi
24052410

2411+
if test "${use_2025blas}" = yes; then
2412+
if test "${acx_lapack_ok}" = "yes"; then
2413+
AC_MSG_ERROR([--with-2025blas cannot be used with --with-lapack])
2414+
fi
2415+
fi
2416+
AM_CONDITIONAL(BUILD_2025BLAS, [test "${use_2025blas}" = yes])
2417+
24062418
AM_CONDITIONAL(BLAS_SHLIB, [test "x${use_blas_shlib}" = xyes])
24072419

24082420
case "${host_os}" in

doc/NEWS.Rd

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,14 @@
207207
\I{Ella Kaye}, \I{Heather Turner}, and \I{Kristen Gorman}.
208208

209209
\item The bundled BLAS and LAPACK sources have been updated to
210-
those shipped with LAPACK 3.12.1. This is mainly bug fixes, but
211-
includes a handful of new ancillary routines, including two new
212-
BLAS routines \code{dgemmtr} and \code{zgemmtr} which are now used
213-
by LAPACK routines. So an external BLAS to be used with the
214-
internal LAPACK (unusual) needs to provide those routines.
210+
those shipped with LAPACK 3.12.1.
211+
212+
This is mainly bug fixes, but includes a handful of new ancillary
213+
routines, including two new BLAS routines \code{dgemmtr} and
214+
\code{zgemmtr} which are now used by LAPACK routines. So an
215+
external BLAS to be used with the internal LAPACK (unusual) needs
216+
to provide those routines, and if an external LAPACK is 3.12.1 or
217+
later, the BLAS used must contain the 2025 additions.
215218
}
216219
}
217220

@@ -251,6 +254,11 @@
251254
\item There is now support for installing the debug symbols for
252255
recommended packages on macOS: see \samp{REC_INSTALL_OPT} in file
253256
\file{config.site}.
257+
258+
\item There is a new \command{configure} option
259+
\option{--with-2025blas} which will compile the 2025 BLAS
260+
additions in the internal LAPACK to allow an external BLAS which
261+
lacks them to be used.
254262
}
255263
}
256264

src/extra/blas/Makefile.win

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ blas00.o: blas00.c
88
$(CC) -O3 -I../../include -c $< -o $@
99

1010
## Rblas.dll imports xerbla_ from R.dll
11+
## OpenBLAS 0.3.29 includes [dz]gemmtr but ATLAS does not.
12+
## So to use latter, copy [dz]gemmtr.f from ../../modules/lapack
13+
## and add dgemmtr.o zgemmtr.o to the dependencies.
1114
ifeq "$(USE_ATLAS)" "YES"
1215
../../../$(BINDIR)/Rblas.dll: blas00.o ../../gnuwin32/dllversion.o
1316
@$(ECHO) -------- Building $@ --------

src/modules/lapack/Makefile.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ SOURCES = $(SOURCES_C) $(SOURCES_F) $(SOURCES_F90)
2323
OBJECTS = $(SOURCES_C:.c=.o) $(SOURCES_F:.f=.o) flexiblas.o
2424
HEADERS = Lapack.h
2525

26+
@BUILD_2025BLAS_TRUE@2025OBJECTS = dgemmtr.o \
27+
@COMPILE_FORTRAN_DOUBLE_COMPLEX_FALSE@ zgemmtr.o
2628
## Sources for -lRlapack.
2729
## On macOS this will be linked directly to the vecLib/Accelerate
2830
## framework if --with-blas=Acceleraate --with-lapack is used, so
@@ -32,6 +34,7 @@ LIBSOURCES = dlamch.f dlapack.f \
3234
LIBSOURCES90 = dlartg.f90 dlassq.f90 la_constants.f90 la_xisnan.f90 \
3335
@COMPILE_FORTRAN_DOUBLE_COMPLEX_FALSE@ zlartg.f90 zlassq.f90
3436
LIBOBJECTS = $(LIBSOURCES:.f=.o) $(LIBSOURCES90:.f90=.o) \
37+
$(2025OBJECTS) \
3538
@USE_VECLIB_G95FIX_TRUE@ vecLibg95f.o vecLibg95c.o
3639

3740
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
@@ -43,7 +46,8 @@ DISTFILES = \
4346
cmplx.f dlapack.f dlamch.f \
4447
dlartg.f90 dlassq.f90 la_constants.f90 la_xisnan.f90 \
4548
zlartg.f90 zlassq.f90 \
46-
dble.txt cmplx.txt R.patch
49+
dble.txt cmplx.txt R.patch \
50+
dgemmtr.f zgemmtr.f
4751

4852
lapack_la = lapack$(SHLIB_EXT)
4953
lapack_la_OBJECTS = $(OBJECTS)

0 commit comments

Comments
 (0)