Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install leidenbase #24

Open
bsmith030465 opened this issue Feb 18, 2021 · 3 comments
Open

Unable to install leidenbase #24

bsmith030465 opened this issue Feb 18, 2021 · 3 comments

Comments

@bsmith030465
Copy link

bsmith030465 commented Feb 18, 2021

Hi,

I am trying to install monocle3 on RStudio and have to install leidenbase. I executed the command 'devtools::install_github('cole-trapnell-lab/leidenbase')', but get an error:

.
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘leidenbase’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/bst/Library/R/4.0/library/00LOCK-leidenbase/00new/leidenbase/libs/leidenbase.so':
dlopen(/Users/bst/Library/R/4.0/library/00LOCK-leidenbase/00new/leidenbase/libs/leidenbase.so, 6): Symbol not found: ___addtf3
Referenced from: /usr/local/lib/libquadmath.0.dylib
Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
in /usr/local/lib/libquadmath.0.dylib
Error: loading failed
Execution halted
ERROR: loading failed

  • removing ‘/Users/bst/Library/R/4.0/library/leidenbase’

=========== Details on gcc, gfortran ====
| => gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0

| => gfortran --version
GNU Fortran (Homebrew GCC 10.2.0_4) 10.2.0

======================
My RStudio 'Makeconf' file shows:

AR = ar
BLAS_LIBS = -L"$(R_HOME)/lib$(R_ARCH)" -lRblas
C_VISIBILITY =
CC = clang -mmacosx-version-min=10.13
CFLAGS = -Wall -g -O2 $(LTO)
CPICFLAGS = -fPIC
CPPFLAGS = -I/usr/local/include
CXX = clang++ -mmacosx-version-min=10.13 -std=gnu++11

Not used by anything in R, in particular not for the .cc.d rule

but used via R CMD config by several packages

CXXCPP = $(CXX) -E
CXXFLAGS = -Wall -g -O2 $(LTO)
CXXPICFLAGS = -fPIC
CXX11 = clang++ -mmacosx-version-min=10.13
CXX11FLAGS = -Wall -g -O2 $(LTO)
CXX11PICFLAGS = -fPIC
CXX11STD = -std=gnu++11
CXX14 = clang++ -mmacosx-version-min=10.13
CXX14FLAGS = -Wall -g -O2 $(LTO)
CXX14PICFLAGS = -fPIC
CXX14STD = -std=gnu++14
CXX17 = clang++ -mmacosx-version-min=10.13
CXX17FLAGS = -Wall -g -O2 $(LTO)
CXX17PICFLAGS = -fPIC
CXX17STD = -std=gnu++17
CXX20 = clang++ -mmacosx-version-min=10.13
CXX20FLAGS = -Wall -g -O2 $(LTO)
CXX20PICFLAGS = -fPIC
CXX20STD = -std=gnu++2a
CXX_VISIBILITY =
DYLIB_EXT = .dylib
DYLIB_LD = $(CC)
DYLIB_LDFLAGS = -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress# $(CFLAGS) $(CPICFLAGS)

should be used by packges for dylibs, but at the time of writing was not

DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
ECHO = echo
ECHO_C = \c
ECHO_N =
ECHO_T =
F_VISIBILITY =

FC is the compiler used for all Fortran as from R 3.6.0

FC = gfortran -mmacosx-version-min=10.13
FCFLAGS = -Wall -g -O2 $(LTO_FC)

additional libs needed when linking with $(FC), e.g. on some Oracle compilers

FCLIBS_XTRA =
FFLAGS = -Wall -g -O2 $(LTO_FC)
FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
FPICFLAGS = -fPIC
FOUNDATION_CPPFLAGS =
FOUNDATION_LIBS = -framework Foundation
JAR = /usr/bin/jar

==============

My R sessionInfo() is:

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] rstudioapi_0.13 magrittr_2.0.1 usethis_2.0.1 devtools_2.3.2 pkgload_1.1.0
[6] R6_2.5.0 rlang_0.4.10 fastmap_1.1.0 tools_4.0.3 pkgbuild_1.2.0
[11] sessioninfo_1.1.1 cli_2.3.0 withr_2.4.1 ellipsis_0.3.1 remotes_2.2.0
[16] assertthat_0.2.1 rprojroot_2.0.2 lifecycle_1.0.0 crayon_1.4.1 processx_3.4.5
[21] purrr_0.3.4 callr_3.5.1 fs_1.5.0 ps_1.5.0 curl_4.3
[26] testthat_3.0.2 memoise_2.0.0 glue_1.4.2 cachem_1.0.4 compiler_4.0.3
[31] desc_1.2.0 prettyunits_1.1.1bst

What do I need to do? Thanks for your help!

@brgew
Copy link
Collaborator

brgew commented Feb 24, 2021

Hi,

There may be conflicts with installed compilers. The error message says that a symbol is not found related to libraries in /usr/local/lib:

/usr/local/lib/libquadmath.0.dylib
/usr/local/lib/libgcc_s_x86_64.1.dylib

Your gfortran compiler says it is build by Homebrew and gcc says it's Apple clang. The Homebrew packages are supposed to be installed in something like '/usr/local/Cellar' and I expect the Apple clang-related libraries to be installed in a system-like directory, for example, /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib. (In my experience, user-installed software is installed in /usr/local/*). When I check the gcc version on my Mac, I get

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

which coincides with my expectation. I am guessing that someone installed another compiler in /usr/local and either clang or gfortran is trying to link those libraries instead of their libraries. You might check for gcc and/or gfortran in /usr/local/bin. These are likely to link libraries in /usr/local/lib. If this is the case, I cannot confidently suggest a solution because you may have other software that was compiled with the compilers in /usr/local.

@cadyyuheng
Copy link

Hello,

I also encountered some issues installing leidenbase. I wonder if it's because of some dependencies of the package. Here's the error I got:

** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘leidenbase’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/yfy/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-leidenbase/00new/leidenbase/libs/leidenbase.so':
  libicui18n.so.68: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/yfy/R/x86_64-pc-linux-gnu-library/4.0/leidenbase’
* restoring previous ‘/home/yfy/R/x86_64-pc-linux-gnu-library/4.0/leidenbase’
Error: Failed to install 'leidenbase' from GitHub:
  (converted from warning) installation of package '/tmp/RtmpQedji7/file1e281b74212f/leidenbase_0.1.2.tar.gz' had non-zero exit status

@mingwhy
Copy link

mingwhy commented Apr 15, 2022

Hello,
I ran into the same issue when installing leidenbase, my mac OS is Monterey Version 12.1 and my R version is R 4.1.3.

Below solution works for me
I reinstalled gfortran with gfortran-Intel-11.2-Monterey.dmg, then modified the Makevar file as follows:

(base) .R $cat Makevars

LOC = /usr/local/gfortran
CC=$(LOC)/bin/gcc -fopenmp
CXX=$(LOC)/bin/g++ -fopenmp
CXX11 = $(LOC)/bin/g++ -fopenmp

## check that the version of gfortran, in my case, it's 11.2.0
FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin21/11.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
CXX1X=/usr/local/gfortran/bin/g++
CXX98=/usr/local/gfortran/bin/g++
CXX14=/usr/local/gfortran/bin/g++
CXX17=/usr/local/gfortran/bin/g++

And then the installation went smooth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants