[R-pkg-devel] Lapack: undefined symbol: zgbsv_

Baptiste Auguie baptiste.auguie at gmail.com
Sun Dec 17 07:15:21 CET 2017


Hi,

The CRAN maintainers recently informed me that my cda package now fails on
CRAN. The root cause seems to be this error:

** testing if installed package can be loaded
Error: package or namespace load failed for ‘cda’ in dyn.load(file, DLLpath
= DLLpath, ...):
 unable to load shared object ‘/home/hornik/tmp/R.check/r-
release-gcc/Work/build/Packages/cda/libs/cda.so’:
  /home/hornik/tmp/R.check/r-release-gcc/Work/build/Packages/cda/libs/cda.so:
undefined symbol: zgbsv_

Google informs me that zgbsv is part of Lapack (specifically, a function to
solve a complex system of linear equations with 'banded matrices'). I
should note that I have not updated the package for quite a while, so this
breakage is likely occurring because of upstream changes in R or Rcpp or
RcppArmadillo or Armadillo (my guess).

I've encountered this type of problem at least twice in the past 5-6 years:
my package relies on Armadillo's C++ solve() function to solve a complex
linear system (not "banded" though, as far as I know), and Armadillo tends
to assume that a full Lapack is available, whereas R includes a subset. In
the past the problem had occurred with zgels and zgesvx, and once before
that with zgetri. I was quite relieved when R Core added many Lapack
routines last year:

https://github.com/wch/r-source/commit/98acd96f22eb795a933879c0d3f740
e802855473

which solved (no pun intended) my problems. Dirk (Rcpp) and Conrad
(Armadillo) both agreed this was the best way forward. Unfortunately the
problem has resurfaced out of the blue with zgbsv, which is not on this
list. I'm left wondering:

- what recent change could have caused my package to need this new routine
(if it is needed)?

- what would be a good way forward? In the past I tried adding the required
file from Netlib directly into my package, but that brings other issues
(unnecessary code duplication, especially if the code isn't even needed,
but also authorship changes, etc.)

Thanks for any advice.

Best regards,

baptiste

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list