在Linux 下,给R 安装RODBC包,报错:
> install.packages("~/R/library/RODBC_1.3-3.tar.gz",repos = NULL)
Warning in install.packages :
argument 'lib' is missing: using '/home/dave/R/library'
* installing *source* package ‘RODBC’ ...
checking for gcc... gcc -m64 -std=gnu99
checking for C compiler default output filename... a.out
checking whether the C compiler works...yes
checking whether we are cross compiling...no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU Ccompiler... yes
checking whether gcc -m64 -std=gnu99accepts -g... yes
checking for gcc -m64 -std=gnu99 option toaccept ANSI C... none needed
checking how to run the C preprocessor...gcc -m64 -std=gnu99 -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking sqlext.h usability... no
checking sqlext.h presence... no
checking for sqlext.h... no
configure: error: "ODBC headers sql.hand sqlext.h not found"
ERROR: configuration failed for package‘RODBC’
* removing ‘/home/dave/R/library/RODBC’
Warning in install.packages :
installation of package '/home/dave/R/library/RODBC_1.3-3.tar.gz' hadnon-zero exit status
configure: error:"ODBC headers sql.h and sqlext.h not found"
是因为没有在Linux 下安装ODBC包。RODBC 需要 unixODBC 和unixODBC development 包,使用YUM 安装之后即可解决。
Linux 使用光盘搭建 本地 YUM 服务器
http://blog.csdn.net/tianlesoftware/article/details/7302358
[root@rac1 mnt]# yum install unixODBC
Loaded plugins: refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package unixODBC.x86_640:2.2.14-11.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
unixODBC x86_64 2.2.14-11.el6 dave 378 k
Transaction Summary
====================================================================================================
Install 1 Package(s)
Total download size: 378 k
Installed size: 1.1 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s),'yum check' output follows:
R-core-2.10.0-2.el5.x86_64 has missingrequires of libtcl8.4.so()(64bit)
R-core-2.10.0-2.el5.x86_64 has missingrequires of libtk8.4.so()(64bit)
R-core-2.10.0-2.el5.x86_64 has missingrequires of perl(File::Copy::Recursive)
Installing : unixODBC-2.2.14-11.el6.x86_641/1
Installed:
unixODBC.x86_64 0:2.2.14-11.el6
Complete!
[root@rac1 mnt]# yum install unixODBC-devel
Loaded plugins: refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package unixODBC-devel.x86_640:2.2.14-11.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
unixODBC-devel x86_64 2.2.14-11.el6 dave 53 k
Transaction Summary
====================================================================================================
Install 1 Package(s)
Total download size: 53 k
Installed size: 182 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : unixODBC-devel-2.2.14-11.el6.x86_641/1
Installed:
unixODBC-devel.x86_64 0:2.2.14-11.el6
Complete!
[root@rac1 mnt]#
安装完unixODBC后在安装RODBC:
> install.packages("~/R/library/RODBC_1.3-3.tar.gz",repos = NULL)
Warning in install.packages :
argument 'lib' is missing: using '/home/dave/R/library'
* installing *source* package ‘RODBC’ ...
checking for gcc... gcc -m64 -std=gnu99
checking for C compiler default output filename... a.out
checking whether the C compiler works...yes
checking whether we are cross compiling...no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU Ccompiler... yes
checking whether gcc -m64 -std=gnu99accepts -g... yes
checking for gcc -m64 -std=gnu99 option toaccept ANSI C... none needed
checking how to run the C preprocessor...gcc -m64 -std=gnu99 -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sql.h usability... yes
checking sql.h presence... yes
checking for sql.h... yes
checking sqlext.h usability... yes
checking sqlext.h presence... yes
checking for sqlext.h... yes
checking for library containingSQLTables... -lodbc
checking for SQLLEN... yes
checking for SQLULEN... yes
checking for long... yes
checking size of long... 8
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/config.h
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -I.-I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -cRODBC.c -o RODBC.o
gcc -m64 -std=gnu99 -shared-L/usr/local/lib64 -o RODBC.so RODBC.o -lodbc -L/usr/lib64/R/lib -lR
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices ...
* DONE (RODBC)
成功安装。
-------------------------------------------------------------------------------------------------------
版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!
Skype: tianlesoftware
Email: [email protected]
Blog: http://www.tianlesoftware.com
Weibo: http://weibo.com/tianlesoftware
Twitter: http://twitter.com/tianlesoftware
Facebook: http://www.facebook.com/tianlesoftware
Linkedin: http://cn.linkedin.com/in/tianlesoftware
-------加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请----
DBA1 群:62697716(满); DBA2 群:62697977(满)DBA3 群:62697850(满)
DBA 超级群:63306533(满); DBA4 群:83829929 DBA5群: 142216823
DBA6 群:158654907 DBA7 群:172855474 DBA总群:104207940