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

Problems installing RMariaDB on ubuntu 22 #343

Closed
vboyce opened this issue Aug 26, 2024 · 4 comments
Closed

Problems installing RMariaDB on ubuntu 22 #343

vboyce opened this issue Aug 26, 2024 · 4 comments

Comments

@vboyce
Copy link

vboyce commented Aug 26, 2024

I have installed libmariadb-dev and libssl-dev.

sudo apt-get install -y libmariadb-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libmariadb-dev is already the newest version (1:10.6.18-0ubuntu0.22.04.1).

sudo apt install libssl-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libssl-dev is already the newest version (3.0.2-0ubuntu1.17).

When I try to install RMariaDB using install.packages("RMariaDB"), I get the following error:

Error: package or namespace load failed for ‘RMariaDB’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-RMariaDB/00new/RMariaDB/libs/RMariaDB.so':
libmysqlclient.so.20: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted

This seems like it may be the same issue as #168.

The same issue occurs if I install libmysqlclient-dev instead of libmariadb-dev.

The same issue occurs if I install the dev version of RMariaDB from github.

In case it's relevant, it says that it's using "mysql_config" -- I don't know how to force it to use mariadb_config instead or whether this matters.

@krlmlr
Copy link
Member

krlmlr commented Aug 27, 2024

Thanks. Can you please post the complete log from install.packages() ?

@vboyce
Copy link
Author

vboyce commented Aug 27, 2024

install.packages("RMariaDB")
Installing package into ‘/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/RMariaDB_1.3.2.tar.gz'
Content type 'application/x-gzip' length 909239 bytes (887 KB)
==================================================
downloaded 887 KB

  • installing source package ‘RMariaDB’ ...
    ** package ‘RMariaDB’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Using mysql_config
    RMariaDB 1.2.0 will default to use mariadb_config.
    Set the RMARIADB_FORCE_MYSQLCONFIG environment variable to a nonempty value to force mysql_config.
    Found mysql_config cflags and libs!
    Using PKG_CFLAGS=-I/home/vboyce/miniconda3/include/mysql
    Using PKG_LIBS=-L/home/vboyce/miniconda3/lib -lmysqlclient -lpthread -lm -lrt -latomic -lssl -lcrypto -ldl
    Using PKG_PLOGR=
    ** libs
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c DbConnection.cpp -o DbConnection.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c DbResult.cpp -o DbResult.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c MariaBinding.cpp -o MariaBinding.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c MariaResult.cpp -o MariaResult.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c MariaResultImpl.cpp -o MariaResultImpl.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c MariaResultPrep.cpp -o MariaResultPrep.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c MariaResultSimple.cpp -o MariaResultSimple.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c MariaRow.cpp -o MariaRow.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c MariaTypes.cpp -o MariaTypes.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c MariaUtils.cpp -o MariaUtils.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c connection.cpp -o connection.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c cpp11.cpp -o cpp11.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c driver.cpp -o driver.o
    g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/home/vboyce/miniconda3/include/mysql -Ivendor -DBOOST_NO_AUTO_PTR -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include' -I'/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/plogr/include' -fpic -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c result.cpp -o result.o
    g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o RMariaDB.so DbConnection.o DbResult.o MariaBinding.o MariaResult.o MariaResultImpl.o MariaResultPrep.o MariaResultSimple.o MariaRow.o MariaTypes.o MariaUtils.o connection.o cpp11.o driver.o result.o -L/home/vboyce/miniconda3/lib -lmysqlclient -lpthread -lm -lrt -latomic -lssl -lcrypto -ldl -L/usr/lib/R/lib -lR
    installing to /home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-RMariaDB/00new/RMariaDB/libs
    ** R
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded from temporary location
    Error: package or namespace load failed for ‘RMariaDB’ in dyn.load(file, DLLpath = DLLpath, ...):
    unable to load shared object '/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-RMariaDB/00new/RMariaDB/libs/RMariaDB.so':
    libmysqlclient.so.20: cannot open shared object file: No such file or directory
    Error: loading failed
    Execution halted
    ERROR: loading failed
  • removing ‘/home/vboyce/R/x86_64-pc-linux-gnu-library/4.1/RMariaDB’
    Warning in install.packages :
    installation of package ‘RMariaDB’ had non-zero exit status

The downloaded source packages are in
‘/tmp/Rtmp6WBxMs/downloaded_packages’

@krlmlr
Copy link
Member

krlmlr commented Aug 27, 2024

For some reason, compilation seems to use libs from miniconda:

Found mysql_config cflags and libs!
Using PKG_CFLAGS=-I/home/vboyce/miniconda3/include/mysql
Using PKG_LIBS=-L/home/vboyce/miniconda3/lib -lmysqlclient -lpthread -lm -lrt -latomic -lssl -lcrypto -ldl

Is this intended? Is there a libmysqlclient.so.20 somewhere underneath the miniconda path?

@vboyce
Copy link
Author

vboyce commented Aug 27, 2024

That was not my intention at least.

I did conda remove mysql and then restarted R and RMariaDB installed just fine. Thanks!

@vboyce vboyce closed this as completed Aug 27, 2024
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

3 participants
@krlmlr @vboyce and others