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

Dirk Eddelbuettel edd at debian.org
Mon Dec 18 00:21:32 CET 2017


On 17 December 2017 at 19:15, Baptiste Auguie wrote:
| 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).

All of the above only pass through to Lapack, and R is their only interface
(in the use case of R packages we consider here).

As you use complex variables (which is rare otherwise) this can bite _if_ the
internal-to-R and incomplete Lapack system uses the internal copy which may
not be complete.

| 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

Only if R is compiled / set-up to use the internal Lapack. For example the
Debian and Ubuntu package generally are not.

| 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)?

There was a recent NEWS item to this effect:

   CHANGES IN R 3.4.3 patched:

     NEW FEATURES:
 
       [...]

       • The version of LAPACK included in the sources has been updated to
         3.8.0 (for the routines used by R a very minor bug-fix change).

so this may be related.

Dirk
 
| - 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]]
| 
| ______________________________________________
| R-package-devel at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-package-devel
-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-package-devel mailing list