jeroen / mongolite

Fast and Simple MongoDB Client for R
https://jeroen.github.io/mongolite/
286 stars 65 forks source link

undefined symbol: _mongoc_linux_distro_scanner_get_distro #132

Closed jet456 closed 3 years ago

jet456 commented 6 years ago

Hi,

I'm installing mongolite on R 3.4.0, CentOS 7 (Linux), and am running into the issue below. I've confirmed that all prerequisite packages (openssl-devel and cyrus-sasl-devel) are installed to the system, and have tried installing mongolite via CRAN and source.

Thanks-

> install.packages("/apps/R-3.4.0/bin/mongolite.tar.gz", repos=NULL, type="source")
* installing *source* package ‘mongolite’ ...
Found pkg-config cflags and libs!
Using PKG_CFLAGS=
Using PKG_LIBS=-lsasl2 -lssl -lcrypto   -lresolv
SASL does not have sasl_client_done.
Compiling with extra alignment.
** libs
gcc -std=gnu99 -I/apps/R-3.4.0/lib64/R/include -DNDEBUG -I. -Ijsonsl -Ibson -Imongoc -DBSON_COMPILATION -DMONGOC_COMPILATION -DBSON_EXTRA_ALIGN  -I/usr/local/include   -fpic  -I/apps/zlib-1.2.8/include -I/apps/curl-7.49.1/include/curl -I/apps/bzip2-1.0.6/include -I/apps/xz-5.2.2/include -I/apps/pcre-8.39b/include -I/apps/mpfr-3.1.5/include  -c bson.c -o bson.o

{ Lots of compiling output }

installing to /apps/R-3.4.0/lib64/R/library/mongolite/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘mongolite’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/apps/R-3.4.0/lib64/R/library/mongolite/libs/mongolite.so':
  /apps/R-3.4.0/lib64/R/library/mongolite/libs/mongolite.so: undefined symbol: _mongoc_linux_distro_scanner_get_distro
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/apps/R-3.4.0/lib64/R/library/mongolite’
Warning message:
In install.packages("/apps/R-3.4.0/bin/mongolite.tar.gz",  :
  installation of package ‘/apps/R-3.4.0/bin/mongolite.tar.gz’ had non-zero exit status
>
jeroen commented 6 years ago

Which version is this? Can you try installing the development version:

devtools::install_github("jeroen/mongolite")
jet456 commented 6 years ago

I've tried that, and have also tried: install.packages("mongolite")

Same error each time.

jeroen commented 6 years ago

Can you show me the full output of devtools::install_github("jeroen/mongolite") please?

jet456 commented 6 years ago

Sure-- thank you for looking into this. devtoolsOutput.txt

jeroen commented 6 years ago

Probably caused by this: https://github.com/jeroen/mongolite/blob/master/configure#L115-L118

What is the value of your $OSTYPE environment variable?

jet456 commented 6 years ago

$OSTYPE is linux-gnu.

jeroen commented 6 years ago

That's strange it should match the regex. Does it work when you remove this line from the configure file?

jet456 commented 6 years ago

Apologies for the late response. Here is what I did:

wget https://cran.r-project.org/src/contrib/mongolite_1.5.tar.gz
tar xvzf mongolite-1.5.tar.gz
cd mongolite
vi configure
# here I removed the entire if/fi statement from around line 117, write-quit
./R

In R:

> install.packages("/apps/R-3.4.0/bin/mongolite-1.5.tar.gz", repos=NULL, type="source")

And it worked! The library will load with library(mongolite) now. Thanks again!

jeroen commented 6 years ago

OK but that doesn't explain why this happens. Could you modify the configure script to echo $OSTYPE around line 117? Also do you know what shell your configure script runs in? Just bash?

vjcitn commented 5 years ago

I ran into this also. My centos system responds "Linux". Removing the lines in configure allowed installation.

vjcitn commented 3 years ago

Ran into this again. As above: removing the lines in configure for mongolite 2.2.1 for "prevent compiler warning for empty unit" permitted installation for a centos system returning "Linux" for $OSTYPE. Just for the record.