在android系统中安装gcc,达到在android系统本地编译应用程序进行开发的目的
2012-12-14 17:54
591 查看
FROM: http://rwiki.sciviews.org/doku.php?id=getting-started:installation:android
But building requires a lot of patching as the libc is bionic (reduced).
[edit] 2011 Aug 1: Fixed Rscript’s R_HOME (was /data/local/work/R lol)
Also fixed sysutils.c(libR.so) (and littler.c)’s hardcoded /tmp to /data/local/gcc/tmp. You need root to mkdir /tmp on Android.
[edit2] 2011 Aug 5: Fixed lib/R/library/*’s permission. Now non-root user can untar.
[edit3] 2011 Aug 6: Fixed R/Rcmd/...’s /sbin/bash dependency (now they use /system/bin/sh correctly).
You should update to r1a2.
that dir. You should write file or you can use “r -e EXPR”.
You need busybox’s uname and rm in $PATH.
https://www.dropbox.com/s/uammywfed6d2rgj/android_gcc_r2a.tar.bz2
https://www.dropbox.com/s/uammywfed6d2rgj/android_gcc_supplement.tar.bz2
https://www.dropbox.com/s/uammywfed6d2rgj/android_R_r1a2.tar.bz2
then (here I suppose you have GNU tar or busybox):
finally (writing to bashrc is recommended):
This consumes 170MB, so be careful if your Android’s /data is small.
If you still want to compile and install R by yourself check
Build R section.
as it is described elsewhere.
If your device isn’t rooted, you will have to “chmod -R o+rx /data/local/gcc/lib/R/library”.
function.
grep() work.
extract https://www.dropbox.com/s/uammywfed6d2rgj/android_R_r1a_src.tar.bz2 to /sdcard/
execute “remount -o remount,rw,exec /mnt/sdcard /mnt/sdcard” (bah, this requires root)
execute “/sdcard/R-2.13.0/configure –prefix=/data/local/gcc –enable-R-shlib –with-system-zlib –with-system-bzlib –with-system-pcre –without-x”
src/include/config.h #define H***E_LOCALE_H 1 -> remove
src/include/config.h #define H***E_LIBC_STACK_END 1 -> remove
src/include/Rconfig.h #define SUPPORT_UTF8 1 -> remove
src/include/Rconfig.h #define SUPPORT_MBCS 1 -> remove
src/extra/blas/Makefile: change: “SOURCES = xerbla.c blas00.c blas.f cmplxblas.f” change: “blas_OBJS=blas.o cmplxblas.o xerbla.o blas00.o”
src/modules/lapack/Makefile: change: “SOURCES_C = blas00.c xerbla.c Lapack.c” change: “LIBOBJECTS = $(LIBSOURCES:.f=.o) xerbla.o”
Fix Makeconf’s abs_top_builddir
execute “make”
Perhaps you don’t have enough space to execute “make install”. So modify bin/R and etc/{ldpaths,Renviron} by hand.
Well, this configured R is compatible with http://dirk.eddelbuettel.com/code/littler.html .
Download https://www.dropbox.com/s/uammywfed6d2rgj/android_gcc_R.ext2.bz2 and decompress to /sdcard
execute “mount /sdcard/android_gcc_R.ext2 /data/local/gcc”
Of course your kernel must have ext2(or ext3) support... Aww only if vfat had symlink stuff...
R on Android
As Android is similar to Linux, you can easily install R on it.But building requires a lot of patching as the libc is bionic (reduced).
[edit] 2011 Aug 1: Fixed Rscript’s R_HOME (was /data/local/work/R lol)
Also fixed sysutils.c(libR.so) (and littler.c)’s hardcoded /tmp to /data/local/gcc/tmp. You need root to mkdir /tmp on Android.
[edit2] 2011 Aug 5: Fixed lib/R/library/*’s permission. Now non-root user can untar.
[edit3] 2011 Aug 6: Fixed R/Rcmd/...’s /sbin/bash dependency (now they use /system/bin/sh correctly).
You should update to r1a2.
Limitation
“Rscript -e EXPR” uses tmpfile(), which uses /tmp. You need root to createthat dir. You should write file or you can use “r -e EXPR”.
You need busybox’s uname and rm in $PATH.
Install R
get 3 files:https://www.dropbox.com/s/uammywfed6d2rgj/android_gcc_r2a.tar.bz2
https://www.dropbox.com/s/uammywfed6d2rgj/android_gcc_supplement.tar.bz2
https://www.dropbox.com/s/uammywfed6d2rgj/android_R_r1a2.tar.bz2
then (here I suppose you have GNU tar or busybox):
adb shell mkdir /data/local/gcc adb push android_gcc_r2a.tar.bz2 /data/local/gcc adb push android_gcc_supplement.tar.bz2 /data/local/gcc adb push android_R_r1a2.tar.bz2 /data/local/gcc adb shell cd /data/local/gcc tar xjf android_gcc_r2a.tar.bz2 tar xjf android_gcc_supplement.tar.bz2 tar xjf android_R_r1a2.tar.bz2
finally (writing to bashrc is recommended):
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/gcc/lib export PATH=$PATH:/data/local/gcc/bin
This consumes 170MB, so be careful if your Android’s /data is small.
If you still want to compile and install R by yourself check
Build R section.
Install R packages
As only R binary is provided by this package, you have to install packages in R way viainstall.packages().
install.packages()
For non-basic packages, you can normally useinstall.packages()
as it is described elsewhere.
If your device isn’t rooted, you will have to “chmod -R o+rx /data/local/gcc/lib/R/library”.
Update R packages
Packages can be updated via R’supdate.packages()
function.
Miscellaneous
Build R
TBA. There are too many patches around glob/wctrans/tre_regwcomp. I had to kill WCHAR support to makegrep() work.
extract https://www.dropbox.com/s/uammywfed6d2rgj/android_R_r1a_src.tar.bz2 to /sdcard/
execute “remount -o remount,rw,exec /mnt/sdcard /mnt/sdcard” (bah, this requires root)
execute “/sdcard/R-2.13.0/configure –prefix=/data/local/gcc –enable-R-shlib –with-system-zlib –with-system-bzlib –with-system-pcre –without-x”
src/include/config.h #define H***E_LOCALE_H 1 -> remove
src/include/config.h #define H***E_LIBC_STACK_END 1 -> remove
src/include/Rconfig.h #define SUPPORT_UTF8 1 -> remove
src/include/Rconfig.h #define SUPPORT_MBCS 1 -> remove
src/extra/blas/Makefile: change: “SOURCES = xerbla.c blas00.c blas.f cmplxblas.f” change: “blas_OBJS=blas.o cmplxblas.o xerbla.o blas00.o”
src/modules/lapack/Makefile: change: “SOURCES_C = blas00.c xerbla.c Lapack.c” change: “LIBOBJECTS = $(LIBSOURCES:.f=.o) xerbla.o”
Fix Makeconf’s abs_top_builddir
execute “make”
Perhaps you don’t have enough space to execute “make install”. So modify bin/R and etc/{ldpaths,Renviron} by hand.
Well, this configured R is compatible with http://dirk.eddelbuettel.com/code/littler.html .
Running R
Once installed, open up a console and type:R
very low /data capacity
If you have VERY low /data capacity and 170MB is too much, there is a workaround if your Android is rooted.Download https://www.dropbox.com/s/uammywfed6d2rgj/android_gcc_R.ext2.bz2 and decompress to /sdcard
execute “mount /sdcard/android_gcc_R.ext2 /data/local/gcc”
Of course your kernel must have ext2(or ext3) support... Aww only if vfat had symlink stuff...
相关文章推荐
- Android系统开发(1)——GCC编译器的编译和安装过程
- Android系统开发(1)——GCC编译器的编译和安装过程
- 编译apache系统提示缺少gcc,可以使用yum进行安装
- 调用android系统内部的安装apk应用界面进行安装应用程序,例如需要更新应用程序
- 怎么样将自己开发的Android应用程序编译到系统Image中
- Android开发:使用Intent打开电话、短信、邮箱、本地文件等系统应用程序整理大全
- Ubuntu 12.04系统交叉编译开发工具的安装(arm-linux-gcc-4.4.3都一样)
- 【怎样在fans-rt上进行开发】1.windows 系统下 gcc 交叉编译环境搭建(cortex-m3)
- Linux 环境下部署Hadoop 2.x,建议尝试64位系统下进行本地编译的安装方式
- Linux 环境下部署Hadoop 2.x,建议尝试64位系统下进行本地编译的安装方式
- Android开发:使用Intent打开电话、短信、邮箱、本地文件等系统应用程序整理大全
- 在ubuntu-16.04系统中安装arm-linux-gcc-4.3.2交叉编译工具
- 安装、输入-LinuxNote3.WIn7与ubuntu双系统以及Android开发环境-by小雨
- CentOS 系统下编译安装 gcc4.8.2过程及编译问题详解
- Android开发——Android系统启动以及APK安装、启动过程
- Android本地视频播放器开发--NDK编译FFmpeg
- Ubuntu 12.04系统天嵌Linux交叉编译开发工具的安装
- Android中使用jni进行本地开发
- 编译android内核和文件系统,已经安装jdk,提示build/core/config.mk:268: *** Error: could not find jdk tools.jar
- Android开发linux下系统大模块编译、单模块编译、代码定位、指令总结