FBartos / RoBMA

RoBMA R package for estimating robust Bayesian meta-analyses
https://fbartos.github.io/RoBMA/
8 stars 3 forks source link

Installation fails: cannot find -llapack #24

Closed Enchufa2 closed 1 year ago

Enchufa2 commented 2 years ago

I see that this flag is hardcoded, but R (nor JAGS) needs to be necessarily compiled against LAPACK. E.g., in Fedora we use FlexiBLAS for BLAS and LAPACK. Therefore, this should be dynamically discovered using the combination from R CMD config BLAS_LIBS and R CMD config LAPACK_LIBS.

FBartos commented 2 years ago

Hi,

I have very little knowledge about how the compiler settings work to be honest and I do not really remember why I set them up in the first place. I can try removing them and checking whether the package passes CRAN checks.

Also, I'm importing some Fortran functions in an almost finished PR (https://github.com/FBartos/RoBMA/pull/21/files#diff-377906ae5554b6ba6d0ef64bdd5bfdc0e7415f220beb57009f06797f37ee7995) and, if I remember correctly, I could not compile the package without the flags. So, I'm not sure if I end up needing them back in then.

Cheers, Frantisek

Enchufa2 commented 2 years ago

FlexiBLAS provides the same symbols as BLAS + LAPACK. I would check first if the compilation succeeds for all platforms without -llapack. If not, according to the Writing R Extensions manual, you should do the following in your configure script:

LAPACK_LIBS=`"${R_HOME}/bin/R" CMD config LAPACK_LIBS`
BLAS_LIBS=`"${R_HOME}/bin/R" CMD config BLAS_LIBS`
FLIBS=`"${R_HOME}/bin/R" CMD config FLIBS`

Then, they should be appended to PKG_LIBS in that order.