首页 > 代码库 > R语言使用遇到的问题

R语言使用遇到的问题

(1) R语言需要是用ODBC连接mysql数据库。需要编译RODBC

报错如下:

configure:1747: $? = 2configure:1770: checking for C compiler default output file nameconfigure:1774: $CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5 checking for C compiler default output file nameconfigure:1775: /usr/bin/make64 MAC=64 -s -f /usr/local/lib64/R/etc/Makeconf -f /usr/local/lib64/R/share/make/config.mk print R_HOME=/usr/local/lib64/R VAR=CCgcc -std=gnu99 === /usr/bin/make64 MAC=64 -s -f /usr/local/lib64/R/etc/Makeconf -f /usr/local/lib64/R/share/make/config.mk print R_HOME=/usr/local/lib64/R VAR=CFLAGS-g -O2configure:1776: /usr/bin/make64 MAC=64 -s -f /usr/local/lib64/R/etc/Makeconf -f /usr/local/lib64/R/share/make/config.mk print R_HOME=/usr/local/lib64/R VAR=CCgcc -std=gnu99 /usr/bin/make64 MAC=64 -s -f /usr/local/lib64/R/etc/Makeconf -f /usr/local/lib64/R/share/make/config.mk print R_HOME=/usr/local/lib64/R VAR=CFLAGS-g -O2 /usr/bin/make64 MAC=64 -s -f /usr/local/lib64/R/etc/Makeconf -f /usr/local/lib64/R/share/make/config.mk print R_HOME=/usr/local/lib64/R VAR=CPPFLAGS-I/usr/local/include -I.  conftest.c  >&5/usr/bin/make64: invalid option -- =/usr/bin/make64: invalid option -- g/usr/bin/make64: invalid option -- u/usr/bin/make64: invalid option -- 9/usr/bin/make64: invalid option -- 9/usr/bin/make64: invalid option -- g/usr/bin/make64: invalid option -- O/usr/bin/make64: invalid option -- 2Usage: make64 [options] [target] ...

经查原因解决方法如下:

CC=eval `"${R_HOME}/bin/R" CMD config CC`CPP=eval `"${R_HOME}/bin/R" CMD config CPP`CFLAGS=eval `"${R_HOME}/bin/R" CMD config CFLAGS`CPPFLAGS=eval `"${R_HOME}/bin/R" CMD config CPPFLAGS`

 需要用到的调试命令如下:

export R_SHARE_DIR=/usr/local/lib64/R/share

 

R语言使用遇到的问题