zhilizheng / SBayesRC

GNU General Public License v3.0
25 stars 5 forks source link

An installation error (undefined symbol: sgecon_) can be escaped by adding LAPACK dependency #3

Closed shinichinamba closed 1 year ago

shinichinamba commented 1 year ago

Dear Zhili,

Thank you for your fantastic package! While trying to install this package, I got an error message shown below:

Error: package or namespace load failed for ‘SBayesRC’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/XXX/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-SBayesRC/00new/SBayesRC/libs/SBayesRC.so':
  /home/XXX/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-SBayesRC/00new/SBayesRC/libs/SBayesRC.so: undefined symbol: sgecon_
Error: loading failed
Execution halted

I tried the installation in two environments (R3.6.3 in Ubuntu20 on WSL2 and R4.1 in CentOS), but I observed the same error.

Googling the error message, I successfully installed the package after editing src/MakeVars.

The edited src/MakeVars file is as follows, in which I simply added $(LAPACK_LIBS)

CXX_STD = CXX11
PKG_CPPFLAGS = $(SHLIB_OPENMP_CFLAGS) $(LAPACK_LIBS) -w
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS) $(LAPACK_LIBS)

I hope this report will help other users install this package.

Best,

Shinichi

zhilizheng commented 1 year ago

Hi Shinichi,

Thanks for the report. We installed the openblas package by default, hence didn't notice the issue. I suggest to install this package, as it would make the performce better.

I will have a test of the flags, whether this will affect the link to the better BLAS package or not.

Thanks for the sharing.

Regards, Zhili

shinichinamba commented 1 year ago

Hi Zhili,

Thank you for your quick reply and your suggestion. I'll try the openblas package!

Best, Shinichi

zhilizheng commented 1 year ago

Hi Shinichi,

Thanks. I have tested, the flag doesn't affect the link to the better BLAS package. Only the modifiction to PKG_LIBS is neccessary.

I also tested, there is also no problem when openblas is installed.

I have updated to the repository.

Thanks for your suggestion.

Regards, Zhili