[Rd] R build BLAS/LAPACK debugging ('dgemmtr_' undefined)

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Mon Jan 26 18:45:41 CET 2026


   I'm sure I'm doing something dumb, but having trouble building R from 
source on PopOS! 22.04 LTS (debian/Ubuntu 'jammy' derivative): 
"undefined symbol: dgemmtr_" when trying to load stuff from LAPACK.

R appears to find stuff at the configure step (FWIW I get the same error 
below if I take out "with-blas=-lopenblas")

$ ../r-devel/configure --enable-R-shlib --enable-memory-profiling 
--with-blas=-lopenblas | grep blas
configure: WARNING: C23 support is unavailable
checking for dgemm_ in -lopenblas... yes
config.status: creating src/extra/blas/Makefile

Then `make` fails with:

byte-compiling package 'grDevices'
Warning in solve.default(rgb) :
   unable to load shared object '/home/bolker/R/r-build/modules//lapack.so':
   /home/bolker/R/r-build/lib/libRlapack.so: undefined symbol: dgemmtr_
Error in solve.default(rgb) : LAPACK routines cannot be loaded

   I do see a NEWS item from R 4.5.0 
https://github.com/r-devel/r-svn/blob/42e81d981a540f4afc01d1002a64ab347eb5dc15/doc/NEWS.Rd#L956-L961 
(I thought things were working until recently, but I haven't re-built 
from scratch in a while ...)

\item This update was mainly bug fixes but contained a barely
       documented major change.  The set of BLAS routines had been
       unchanged since 1988, so throughout \R's history.  This update
       introduced new BLAS routines \code{dgemmtr} and \code{zgemmtr}
       which are now used by LAPACK routines.  This means that BLAS
       implementations are no longer interchangeable.

Section A.3.1 
https://rstudio.github.io/r-manuals/r-admin/Essential-and-useful-other-programs-under-a-Unix-alike.html:

 > The configure code checks that the external BLAS is complete (as of 
LAPACK 3.9.1: it must include all double precision and double complex 
routines, as well as LSAME), and appears to be usable. However, an 
external BLAS has to be usable from a shared object (so must contain 
position-independent code), and that is not checked.

   I'd be surprised if by BLAS libraries *didn't* contain PIC, but ... ??

   Suggestions for diagnostics/debugging welcome ...

   cheers
    Ben Bolker



More information about the R-devel mailing list