簡體   English   中英

錯誤安裝RMysql RHEL 7.3

[英]Error install RMysql RHEL 7.3

我正在使用:R版本:3.3.3。
操作系統:EC2上的RHEL 7.3。
我正在嘗試安裝RMysql。
因此,在R終端中,我提交命令:install.packages(“ RMySQL”)

第一次嘗試失敗,並給出錯誤消息: 找不到libmysqlclient

Using PKG_LIBS=-lmysqlclient
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libmysqlclient was not found. Try installing:
 * deb: libmariadb-client-lgpl-dev (Debian, Ubuntu 16.04)
        libmariadbclient-dev (Ubuntu 14.04)
 * rpm: mariadb-devel | mysql-devel (Fedora, CentOS, RHEL)
 * csw: mysql56_dev (Solaris)
 * brew: mariadb-connector-c (OSX)
If libmysqlclient is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libmysqlclient.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘RMySQL’
* removing ‘/usr/lib64/R/library/RMySQL’

The downloaded source packages are in
    ‘/tmp/Rtmpx1vsUG/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("RMySQL") :
  installation of package ‘RMySQL’ had non-zero exit status

所以我安裝了mysql-devel。 (sudo yum安裝mysql-devel)

在此之后,我嘗試再次安裝RMysql。 但這不會再次起作用。 PKG_LIBS -lmariadb出了點問題。

gcc -m64 -std = gnu99 -shared -L / usr / lib64 / R / lib -Wl,-z,relro -o RMySQL.so RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o -L / usr / lib64 / -lmariadb -lpthread -ldl -lm -lssl -lcrypto -L / usr / lib64 / R / lib -lR / bin / ld:找不到-lmariadb

這是整個R輸出。

* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
Found mysql_config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/mysql -I/usr/include/mysql/mysql
Using PKG_LIBS=-L/usr/lib64/ -lmariadb -lpthread -ldl -lm -lssl -lcrypto
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c RMySQL-init.c -o RMySQL-init.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c connection.c -o connection.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c db-apply.c -o db-apply.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c driver.c -o driver.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c exception.c -o exception.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c fields.c -o fields.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c result.c -o result.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c utils.c -o utils.o
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -Wl,-z,relro -o RMySQL.so RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o -L/usr/lib64/ -lmariadb -lpthread -ldl -lm -lssl -lcrypto -L/usr/lib64/R/lib -lR
/bin/ld: cannot find -lmariadb
collect2: error: ld returned 1 exit status
make: *** [RMySQL.so] Error 1
ERROR: compilation failed for package ‘RMySQL’
* removing ‘/usr/lib64/R/library/RMySQL’

The downloaded source packages are in
    ‘/tmp/RtmpYEs7XA/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("RMySQL") :
  installation of package ‘RMySQL’ had non-zero exit status

好的,所以我終於可以解決這個問題了! 我為自己感到驕傲:)

我安裝了mariadb-devel

名稱:MariaDB-devel
拱門:x86_64
版本:10.2.6
發布:1.el7.centos

libmariadb.so丟失了。 相反,我有libmariadbclient.a。 (/usr/lib64/libmariadbclient.a)
所以我不得不做一個符號鏈接:

sudo ln -s /usr/lib64/libmariadbclient.a /usr/lib64/libmariadb.a

在此RMysql安裝成功之后:

**建築配套指數
**測試是否可以裝入已安裝的軟件包
*完成(RMySQL)
使'packages.html'...完成

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM