问题描述
我在 SUSE Tumbleweed 20210618 上安装 RMySQL 时遇到了一个“新”问题。我以前使用过 RMySQL,但在项目之间,RMySQL 神秘地从 R 中消失了。
现在,当我运行“install.packages”时 - 它错误地读取了我的 mysql_config 参数(如下所示)。从 mysql_config 信息(也显示如下)可以明显看出,两者不匹配。
有没有办法“更正”设置 PKG_CFLAGS 和 PKG_LIBS 的方式 - 以便它们指向正确的位置?或者,是否存在其他问题导致这种情况持续存在?
谢谢...
这是我的“install.packages”运行:
Installing package into ‘/home/craig/R/x86_64-suse-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/RMySQL_0.10.21.tar.gz'
Content type 'application/x-gzip' length 53075 bytes (51 KB)
==================================================
downloaded 51 KB
* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
** using staged installation
Found mysql_config cflags and libs!
Using PKG_CFLAGS=-I/usr//usr/include/mysql -I/usr//usr/include/mysql/mysql
Using PKG_LIBS=-L/usr//usr/lib64/ -lmariadb
-----------------------------[ ANTICONF ]-----------------------------
Configure could not find suitable mysql/mariadb client library. Try installing:
* deb: libmariadbclient-dev | libmariadb-client-lgpl-dev (Debian,Ubuntu)
* rpm: mariadb-connector-c-devel | mariadb-devel | mysql-devel (Fedora,CentOS,RHEL)
* csw: mysql56_dev (Solaris)
* brew: mariadb-connector-c (OSX)
If you already have a mysql client library installed,verify that either
mariadb_config or mysql_config is on your PATH. If these are unavailable
you can also set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------[ ERROR MESSAGE ]----------------------------
<stdin>:1:10: fatal error: mysql.h: No such file or directory
compilation terminated.
-----------------------------------------------------------------------
ERROR: configuration failed for package ‘RMySQL’
* removing ‘/home/craig/R/x86_64-suse-linux-gnu-library/4.1/RMySQL’
Warning in install.packages :
installation of package ‘RMySQL’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpvBirrZ/downloaded_packages’
我从 mysql_config 得到的信息是:
Copyright 2011-2020 MariaDB Corporation AB
Get compiler flags for using the MariaDB Connector/C.
Usage: mysql_config [OPTIONS]
Compiler: GNU 11.1.1
--cflags [-I//usr/include/mysql -I//usr/include/mysql/mysql]
--include [-I//usr/include/mysql -I//usr/include/mysql/mysql]
--libs [-L//usr/lib64/ -lmariadb]
--libs_r [-L//usr/lib64/ -lmariadb]
--libs_sys [-lz -ldl -lm -lpthread -lssl -lcrypto]
--version [10.5.5]
--cc_version [3.1.12]
--socket [/run/mysql/mysql.sock]
--port [3306]
--plugindir [-L/usr/lib64 -lmariadbprivate -lz -ldl -lm -lpthread -lssl -lcrypto]
--tlsinfo [//usr/lib64/mysql/plugin/]
--variable=OpenSSL 1.1.1k
pkgincludedir [//usr/include/mysql]
pkglibdir [//usr/lib64]
pkgplugindir [//usr/lib64/mysql/plugin/]
--privatelibs [VAR VAR is one of:]
请注意,install.packages 命令中的 PKG_CFLAGS 正在错误地读取配置文件(例如,将其转换为 -I/usr//usr/include... 而不是 -I//usr/include... ).
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)