Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to compiled R souce code in termux? #135

Closed
leechaowen opened this issue Nov 9, 2021 · 30 comments
Closed

how to compiled R souce code in termux? #135

leechaowen opened this issue Nov 9, 2021 · 30 comments

Comments

@leechaowen
Copy link

wget https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/base/R-4/R-4.1.2.tar.gz

tar -xzvf R-4.1.2.tar.gz

cd R-4.1.2

./configure --prefix=/data/data/com.termux/files/usr/var/R.4.12

after run config show below,but make install fail

R is now configured for aarch64-unknown-linux-gnu

Source directory: .
Installation directory: /data/data/com.termux/files/usr/var/R.4.12

C compiler: gcc -g -O2
Fortran fixed-form compiler: gfortran -fno-optimize-sibling-calls -g -O2

Default C++ compiler: g++ -std=gnu++14 -g -O2
C++11 compiler: g++ -std=gnu++11 -g -O2
C++14 compiler: g++ -std=gnu++14 -g -O2
C++17 compiler: g++ -std=gnu++17 -g -O2
C++20 compiler: g++ -std=gnu++20 -g -O2
Fortran free-form compiler: gfortran -fno-optimize-sibling-calls -g -O2
Obj-C compiler: gcc -g -O2 -fobjc-exceptions

Interfaces supported: X11
External libraries: pcre2, readline, curl
Additional capabilities: PNG, JPEG, TIFF, NLS, cairo, ICU
Options enabled: shared BLAS, R profiling

Capabilities skipped:
Options not enabled: memory profiling

Recommended packages: yes

configure: WARNING: you cannot build info or HTML versions of the R manuals
configure: WARNING: you cannot build PDF versions of the R manuals
configure: WARNING: you cannot build PDF versions of vignettes and help pages

~/Downloads/R-4.1.2 $ make install
make[1]: Entering directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/m4'
make[1]: Nothing to be done for 'install'.
make[1]: Leaving directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/m4'
make[1]: Entering directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/tools'
make[1]: Nothing to be done for 'install'.
make[1]: Leaving directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/tools'
make[1]: Entering directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/doc'
installing doc ...
install: cannot stat 'NEWS.rds': No such file or directory
install: cannot stat 'NEWS.2.rds': No such file or directory
install: cannot stat 'NEWS.3.rds': No such file or directory
make[1]: *** [Makefile:147: install-sources2] Error 1
make[1]: Leaving directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/doc'
make: *** [Makefile:95: install] Error 1

@leechaowen
Copy link
Author

i have compied r-base source code in termux today. but still meet some issues. some packages faild to installed. still on finding the way

~ $ R

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

@leechaowen
Copy link
Author

i could compiled r-base source code in termux now. i will make summary note later.

@leechaowen
Copy link
Author

leechaowen commented Nov 12, 2021

the R could not working after update termux. Here is my way to compile latest r-base source code.

  1. install gcc ,libgfortran and some necessary packages. I forget which package is necessary. I list the packages i need use. remove the old r-base before compile.
cd ~
wget https://its-pointless.github.io/setup-pointless-repo.sh
chmod +x setup-pointless-repo.sh
bash setup-pointless-repo.sh
pkg uninstall r-base
pkg uninstall r-cran*
apt autoremove
pkg install   libgomp-10 gcc-10 libgfortran5
termux-setupgcc-10
termux-setupclang-gfort-10
pkg install bzip2 libcurl readline liblzma xz-utils pcre pcre-static bthread bthread-static
pkg install openssh curl gnupg boost boost-static python mpv make libtiff libcairo librsvg clang openssl libcurl libicu libxml2 sox openjdk-17 vim wget git perl 
  1. Download r-base code
cd ~
mkdir -p $PREFIX/local/R-4.1.2
mkdir Downloads
cd Downloads
wget https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/base/R-4/R-4.1.2.tar.gz
  1. confige
tar -xzvf R-4.1.2.tar.gz

cd R-4.1.2

./configure --enable-R-shlib --prefix=$PREFIX/local/R-4.1.2

after finish config

image

  1. make

make

after finish make

image

  1. make install

make install

after make install

image

  1. update PATH, write below content in the first line of this file .bashrc
cd ~
vim .bashrc

PATH=/data/data/com.termux/files/usr/local/R-4.1.2/bin:$PATH

  1. source .bashrc

source .bashrc

Finish complete.

@leechaowen
Copy link
Author

i try another phone , there has error comes out after config, sorry i forget the detail error. run below commands before config if has error comes out after first config.

CFLAGS=" -fno-PIC -fnoPIC"$CFLAGS" -fno-PIC -fnoPIC"
CXXGLAGS=$CFLAGS

@jimyokl
Copy link

jimyokl commented Dec 8, 2021

谢谢

@rrodrigueznt
Copy link

Worked for me. Thanks!

Still, please, could we make your work even more useful for others? Does it make it sense to make available for others the new compiled releases?

@leechaowen
Copy link
Author

leechaowen commented Dec 10, 2021

Worked for me. Thanks!

Still, please, could we make your work even more useful for others? Does it make it sense to make available for others the new compiled releases?

i learn from internet, try way one by one, lucky success at last. Thanks internet. Thanks everyone who share their knowledge in the internet. i do not know whether the R could working or not once termux upgrade in the following days. So i used to run pkg update & pkg upgrade every week, until now the compile R still could working. i hope more and more R fans would like using R in termux, the more people using R in termux the more issues would be found and solved. Lucky , the most R packages i used could be installed in termux.

@leechaowen
Copy link
Author

leechaowen commented Dec 12, 2021

The compile way only for android version 11 and termux version 0.117.

~ $ termux-info
Application version:
0.117
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable main
# game-repo (sources.list.d/game.list)
deb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-games games stable
# science-repo (sources.list.d/science.list)
deb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-science science stable
# sources.list.d/pointless.list
deb https://its-pointless.github.io/files/21 termux extras
Updatable packages:
All packages up to date
Android version:
11
Kernel build information:
Linux localhost 4.19.113-perf-g41a3186f100e #1 SMP PREEMPT Wed Oct 27 23:23:53 CST 2021 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
M2012K11AC
~ $ R

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: aarch64-unknown-linux-gnu (64-bit)

Matrix products: default
BLAS:   /data/data/com.termux/files/usr/local/R-4.1.2/lib/R/lib/libRblas.so
LAPACK: /data/data/com.termux/files/usr/local/R-4.1.2/lib/R/lib/libRlapack.so

locale:
[1] C.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.1.2
>

I try to compile for my old phone which android version is 7.1.2 this weekend. it has error comes out after run make. it doesn't matter. i think most users would use the latest android and termux version.

WARNING: linker: /data/data/com.termux/files/home/Downloads/R-4.1.2/bin/exec/R: unsupported flags DT_FLAGS_1=0x8000001
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/home/Downloads/R-4.1.2/bin/exec/R": cannot locate symbol "glob" referenced by "/data/data/com.termux/files/home/Downloads/R-4.1.2/lib/libR.so"...
Aborted
make[4]: *** [../../../share/make/basepkg.mk:151: sysdata] Error 134
make[4]: Leaving directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/src/library/tools'
make[3]: *** [Makefile:36: all] Error 2
make[3]: Leaving directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/src/library/tools'
make[2]: *** [Makefile:37: R] Error 1
make[2]: Leaving directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/src/library'
make[1]: *** [Makefile:28: R] Error 1
make[1]: Leaving directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/src'
make: *** [Makefile:61: R] Error 1

@chipschap
Copy link

I couldn't quite get the methods above to work although they were a lot of help in figuring this out.

Here is how I built a working version of R on my old Android 7
tablet. I'd be interested to hear if it works on newer Android
releases as I have yet to try it on my Android 10 and 11 phones (not much need for R on my phone).

Get the source of R-4.1.2 and unpack somewhere. Go to that directory.
Be sure you have all the prereqs installed. This includes jre and
others, the list is fairly long. They are enumerated in this
discussion someplace although don't forget jre.

In Makeconf.in change (approx line 60) from

LIBS = @libs@

to

LIBS = @libs@ -landroid-glob

Run "configure" as follows (should all be on one line):

./configure --with-x=no --enable-R-shlib --prefix=/data/data/com.termux/files/usr/local/R-4.1.2

then

make

and

make install

If "R" already installed from pkg, then remove
/data/data/com.termux/usr/bin/R .

Add /data/data/com.termux/usr/local/R-4.1.2/bin to PATH.

Go to /data/data/com.termux/usr/local/R-4.1.2/bin/exec and run

termux-elf-cleaner *

That should do it.

If you find errors here or it doesn't work please let me know, and
improvements are especially welcome.

bobnewell@bobnewell.net

No guarantees but it's working for me so far.

@elig0n
Copy link

elig0n commented Jan 26, 2022

I'm trying to compile R for Termux under Android 11 according to @leechaowen instructions in this thread but make fails as follows:

building/updating vignettes for package 'stats' ...
processing ‘reshape.Rnw’                                
Error: compiling TeX file ‘reshape.tex’ failed with message:                                                    
cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file 'reshape.log': No such file or directory                                                     
Execution halted                                        
make[1]: *** [Makefile:103: vignettes] Error 1          
make[1]: Leaving directory '/data/data/com.termux/files/home/Downloads/R-4.1.2/src/library'                     
make: *** [Makefile:80: vignettes] Error 2

I tried installing all latex packages apt could find me : biber, tectonic, texlab, texlive-latexextra and texlive-latexrecommended but that did not help.

@leechaowen
Copy link
Author

i ununstall termux then reinstall latest termux from f-droid again for my old phone. Complete finish compile R from my way.


~ $ termux-info
Application version:
0.117
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24/ stable main
# sources.list.d/pointless.list
deb https://its-pointless.github.io/files/24 termux extras
# game-repo (sources.list.d/game.list)
deb https://packages.termux.org/apt/termux-games games stable
# science-repo (sources.list.d/science.list)
deb https://packages.termux.org/apt/termux-science science stable
Updatable packages:
git/stable 2.35.0 aarch64 [upgradable from: 2.34.1]
libexpat/stable 2.4.4 aarch64 [upgradable from: 2.4.3]
termux-tools/stable 0.159 all [upgradable from: 0.158]
Android version:
10
Kernel build information:
Linux localhost 4.9.186-perf-g10af704 #1 SMP PREEMPT Wed Jul 7 13:06:12 CST 2021 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
MIX 2S
~ $ R

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: aarch64-unknown-linux-gnu (64-bit)

Matrix products: default
BLAS:   /data/data/com.termux/files/usr/local/R-4.1.2/lib/R/lib/libRblas.so
LAPACK: /data/data/com.termux/files/usr/local/R-4.1.2/lib/R/lib/libRlapack.so

locale:
[1] C.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.1.2
>

@NaturallyAsh
Copy link

Thanks so much @leechaowen The only issue I ran into was because I did have wget installed. After doing that, your solution worked like a charm!

@ronnac
Copy link

ronnac commented Apr 15, 2022

I ran apt update today and the above instructions no longer worked, because libicu is v 70.1 now.
However I was able to install R using the following modifications.
Follow @leechaowen 's instructions, but:

  • replace R-4.1.2 by R-4.1.3 (otherwise incompatible version of libicu)
  • mv ~/../usr/lib/gcc/arm-linux-androideabi/10.3.0/libm.so ~/../usr/lib/gcc/arm-linux-androideabi/10.3.0/libm.so.bkp
    --> (otherwise I get an error. There is a newer available version in termux: ./usr/lib/gcc/arm-linux-androideabi/11.1.0/libm.so)

@kurokirasama
Copy link

kurokirasama commented May 27, 2022

I'm trying to follow your instructions, but I'm getting this error:

configure:8499: gfortran -c -g  conftest.f >&5
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/usr/libexec/gcc/aarch64-linux-android/8.3.0/f951": library "libz.so.1" not found: needed by main executable

I checked and zlib is installed and libz.so.1 is in $PREFIX/lib

@leechaowen
Copy link
Author

leechaowen commented May 27, 2022 via email

@kurokirasama
Copy link

thanks!!! I'll try it now

@kurokirasama
Copy link

it worked. Thanks!

@leechaowen
Copy link
Author

leechaowen commented May 28, 2022

termux is not native linux system , it's hard to install some packages, like shiny. i really like run shiny in my android table, Most R packages i used could install in termux. the good news is the R-project in termux could be shared by ubuntu, run shiny in ubuntu not in termux.

First , install Anlinux from F-Droid, Second install ubuntu follow the guide from Anlinux, then run ubuntu and compile R in ubuntu.

Here comes the detail steps.

1. install ubuntu in termux
cd ~ pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Ubuntu/ubuntu.sh && bash ubuntu.sh

2. run ubuntu after success ubuntu.

./start-ubuntu.sh

Please pay attention all below action run in ubuntu.

3.install necessary packages in ubuntu

apt-get update
apt-get install vim default-jdk wget 
apt-get install build-essential gfortran
apt-get install bzip2  libbz2-dev xz-utils zip gnupg libxml2  libreadline-dev libtiff-dev
apt-get install libcairo2-dev libicu-dev liblzma-dev 
apt-get install libxml2-dev libssl-dev libpng-devel

4. compiled openssl curl libpng in ubuntu

#openssl
wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
tar -xzvf openssl-1.1.1o.tar.gz
cd openssl-1.1.1o
mkdir -p  /usr/local/openssl-1.1.1o
./config shared --prefix=/usr/local/openssl-1.1.1o
make
make install
echo "/usr/local/openssl-1.1.1o/lib" >> /etc/ld.so.conf
ldconfig -v
#curl
apt-get remove curl libcurl4
apt autoremove
wget https://github.com/curl/curl/releases/download/curl-7_83_0/curl-7.83.0.tar.gz
tar -xzvf curl-7.83.0.tar.gz
cd curl-7.83.0 
./configure  --with-wolfssl --with-openssl=/usr/local/openssl-1.1.1o
make
make install
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig -v
#libpng
wget  https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz
tar -xzvf libpng-1.6.37.tar.gz
cd libpng-1.6.37
./configure
make
make install

5.compiled R in ubuntu

cd ~
mkdir Downloads
cd Downloads
wget https://cran.r-project.org/src/base/R-4/R-4.2.0.tar.gz
tar -xzvf R-4.2.0.tar.gz
cd R-4.2.0
mkdir -p  /usr/local/R-4.2.0
./configure --enable-R-shlib --with-libpng --prefix=/usr/local/R-4.2.0
make
make install

6. append below line in .bashrc, then run source .bashrc

PATH=/usr/local/R-4.2.0/bin:$PATH

7. append below line in .Rprofile

options(bitmapType='cairo')

root@localhost:~# cat .Rprofile
options(bitmapType='cairo')

@kurokirasama
Copy link

thank you so much for the detailed step. I'll try it!
Just to be clear,

  1. steps 3 to 5 in ubuntu and 6-7 in termux? and run R in termux, or
  2. all in ubuntu?

If 1., R packages should be installed in ubuntu?

@leechaowen
Copy link
Author

thank you so much for the detailed step. I'll try it! Just to be clear,

  1. steps 3 to 5 in ubuntu and 6-7 in termux? and run R in termux, or
  2. all in ubuntu?

If 1., R packages should be installed in ubuntu?

step3 to 7 run in ubuntu.
I mean the main function using R run in termux, and shiny run in ubuntu beacuse the Rproject folder in termux could be shared in ubuntu. Run R in ubuntu by proot is slow,but it doesn't matter. There is no better way to run shiny in termux now, this is the best solution.

@ronnac
Copy link

ronnac commented May 30, 2022

termux is not native linux system , it's hard to install some packages, like shiny. i really like run shiny in my android table, Most R packages i used could install in termux. the good news is the R-project in termux could be shared by ubuntu, run shiny in ubuntu not in termux.

First , install Anlinux from F-Droid, Second install ubuntu follow the guide from Anlinux, then run ubuntu and compile R in ubuntu.

Here comes the detail steps.

1. install ubuntu in termux cd ~ pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Ubuntu/ubuntu.sh && bash ubuntu.sh

2. run ubuntu after success ubuntu.

./start-ubuntu.sh

Please pay attention all below action run in ubuntu.

3.install necessary packages in ubuntu

apt-get update
apt-get install vim default-jdk wget 
apt-get install build-essential gfortran
apt-get install bzip2  libbz2-dev xz-utils zip gnupg libxml2  libreadline-dev libtiff-dev
apt-get install libcairo2-dev libicu-dev liblzma-dev 
apt-get install libxml2-dev libssl-dev libpng-devel

4. compiled openssl curl libpng in ubuntu

#openssl
wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
tar -xzvf openssl-1.1.1o.tar.gz
cd openssl-1.1.1o
mkdir -p  /usr/local/openssl-1.1.1o
./config shared --prefix=/usr/local/openssl-1.1.1o
make
make install
echo "/usr/local/openssl-1.1.1o/lib" >> /etc/ld.so.conf
ldconfig -v
#curl
apt-get remove curl libcurl4
apt autoremove
wget https://github.com/curl/curl/releases/download/curl-7_83_0/curl-7.83.0.tar.gz
tar -xzvf curl-7.83.0.tar.gz
cd curl-7.83.0 
./configure  --with-wolfssl --with-openssl=/usr/local/openssl-1.1.1o
make
make install
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig -v
#libpng
wget  https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz
tar -xzvf libpng-1.6.37.tar.gz
cd libpng-1.6.37
./configure
make
make install

5.compiled R in ubuntu

cd ~
mkdir Downloads
cd Downloads
wget https://cran.r-project.org/src/base/R-4/R-4.2.0.tar.gz
tar -xzvf R-4.2.0.tar.gz
cd R-4.2.0
mkdir -p  /usr/local/R-4.2.0
./configure --enable-R-shlib --with-libpng --prefix=/usr/local/R-4.2.0
make
make install

6. append below line in .bashrc, then run source .bashrc

PATH=/usr/local/R-4.2.0/bin:$PATH

7. append below line in .Rprofile

options(bitmapType='cairo')

root@localhost:~# cat .Rprofile options(bitmapType='cairo')

Just curious: why do you use AnLinux instead of the ubuntu that is available in termux via proot-distro ?

@leechaowen
Copy link
Author

Just curious: why do you use AnLinux instead of the ubuntu that is available in termux via proot-distro ?

No need to compile again once copy the relates folders and files to other devices after complied R in the ubuntu when using AnLinux . Not sure whether it could be workd when using proot-distro for such case . i do not like compile again and again , specailly broken the dependency it need uninstall termux and install termux again . At least no need complie R again for ubuntu when using Anlinux, only need to copy the backup to termux.

@kxxt
Copy link

kxxt commented Jun 18, 2022

I got this error while running make.

make[4]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src/library/tools'
make[4]: Entering directory '/data/data/com.termux/files/home/R-4.2.0/src/library/tools'
installing 'sysdata.rda'
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/home/R-4.2.0/bin/exec/R": invalid ELF file "/data/data/com.termux/files/usr/lib/gcc/aarch64-linux-android/10.3.0/libm.so" load segment[4]: p_offset (0x5000) + p_filesz (0x0) ( = 0x5000) past end of file (0x4540)
make[4]: *** [../../../share/make/basepkg.mk:151: sysdata] Error 1
make[4]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src/library/tools'
make[3]: *** [Makefile:36: all] Error 2
make[3]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src/library/tools'
make[2]: *** [Makefile:37: R] Error 1
make[2]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src/library'
make[1]: *** [Makefile:28: R] Error 1
make[1]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src'
make: *** [Makefile:61: R] Error 1
termux-info
Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://grimler.se/termux-packages-24/ stable main
# sources.list.d/pointless.list
deb https://its-pointless.github.io/files/24 termux extras
# root-repo (sources.list.d/root.list)
deb https://packages.termux.org/apt/termux-root root stable
# x11-repo (sources.list.d/x11.list)
deb https://packages.termux.org/apt/termux-x11 x11 main
Updatable packages:
ffmpeg/stable 5.0.1-2 aarch64 [upgradable from: 5.0.1-1]
htop/stable 3.2.0-1 aarch64 [upgradable from: 3.2.0]
libvpx/stable 1.12.0-rc1-0 aarch64 [upgradable from: 1.11.0]
starship/stable 1.8.0 aarch64 [upgradable from: 1.7.1]
termux-tools version:
0.187
Android version:
12
Kernel build information:
Linux localhost 4.19.113-lineageos-g9eb2570ef9f4 #1 SMP PREEMPT Sat Jun 4 08:33:08 UTC 2022 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
POCO F2 Pro

@kxxt
Copy link

kxxt commented Jun 18, 2022

I got this error while running make.

make[4]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src/library/tools'
make[4]: Entering directory '/data/data/com.termux/files/home/R-4.2.0/src/library/tools'
installing 'sysdata.rda'
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/home/R-4.2.0/bin/exec/R": invalid ELF file "/data/data/com.termux/files/usr/lib/gcc/aarch64-linux-android/10.3.0/libm.so" load segment[4]: p_offset (0x5000) + p_filesz (0x0) ( = 0x5000) past end of file (0x4540)
make[4]: *** [../../../share/make/basepkg.mk:151: sysdata] Error 1
make[4]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src/library/tools'
make[3]: *** [Makefile:36: all] Error 2
make[3]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src/library/tools'
make[2]: *** [Makefile:37: R] Error 1
make[2]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src/library'
make[1]: *** [Makefile:28: R] Error 1
make[1]: Leaving directory '/data/data/com.termux/files/home/R-4.2.0/src'
make: *** [Makefile:61: R] Error 1
termux-info
Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://grimler.se/termux-packages-24/ stable main
# sources.list.d/pointless.list
deb https://its-pointless.github.io/files/24 termux extras
# root-repo (sources.list.d/root.list)
deb https://packages.termux.org/apt/termux-root root stable
# x11-repo (sources.list.d/x11.list)
deb https://packages.termux.org/apt/termux-x11 x11 main
Updatable packages:
ffmpeg/stable 5.0.1-2 aarch64 [upgradable from: 5.0.1-1]
htop/stable 3.2.0-1 aarch64 [upgradable from: 3.2.0]
libvpx/stable 1.12.0-rc1-0 aarch64 [upgradable from: 1.11.0]
starship/stable 1.8.0 aarch64 [upgradable from: 1.7.1]
termux-tools version:
0.187
Android version:
12
Kernel build information:
Linux localhost 4.19.113-lineageos-g9eb2570ef9f4 #1 SMP PREEMPT Sat Jun 4 08:33:08 UTC 2022 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
POCO F2 Pro

I get rid of this issue by upgrading gcc to 11.

pkg in libgomp-11 gcc-11
termux-setupgcc-11
termux-setupclang-gfort-11
make clean
./configure --enable-R-shlib --prefix=$PREFIX/local/R-4.2.0
make -j8

For those who don't want to compile R from source, I've built it for you. It's available here: https://github.com/kxxt/termux#r

@rrodrigueznt
Copy link

./configure --enable-R-shlib --prefix=$PREFIX/local/R-4.1.2

I'm getting:

checking if libcurl is version 7 and >= 7.28.0... no configure: error: libcurl >= 7.28.0 library and headers are required with support for https

How can I install libcurl headers? Installed libcurl is 8.0.1. Thanks!

@rrodrigueznt
Copy link

apt-get install libxml2-dev libssl-dev libpng-devel

It worked great! Thanks! Just a minor, probably, typo: libpng-devel doesn't exist in Ubuntu repositories. I installed libpng-dev instead.

@rrodrigueznt
Copy link

termux is not native linux system , it's hard to install some packages, like shiny. i really like run shiny in my android table, Most R packages i used could install in termux. the good news is the R-project in termux could be shared by ubuntu, run shiny in ubuntu not in termux.

By running R in Ubuntu, I can enjoy almost everything I need to complete my workflow. But at least one piece fails: to access our cooperative database over a VPN. I can ssh our server from Termux, but trying to connect from Ubuntu gives a timeout.

I know that this question is beyond the scope of this thread, but as it deals to some extent with running a native Linux system, could you point me in the right direction? Do you know if I can connect to our VPN from Ubuntu running in Termux? If yes, how? Thanks!

@ronbarhash
Copy link

a lot of time was wasted just because some "smart guy" cut out the default utility "which" from Termux ^) (burn in hell)

@jangorecki
Copy link

so does compiling R in termux works fine already? where is the most recent and complete guide?

@chipschap
Copy link

chipschap commented Nov 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests