its-pointless / gcc_termux

Gcc for termux with fortran scipy etc... Use apt for newest updates instructions in README.txt
463 stars 75 forks source link

R: install.packages("cli") failed #126

Closed knyipab closed 3 years ago

knyipab commented 3 years ago

When installing cli 3.0.0 or above in R with install.packages("cli"), error: use of undeclared identifier 'PTHREAD_CANCEL_ASYNCHRONOUS' will show up. While Android NDK doesn't offer pthread_setcanceltype(), gcc_termux doesn't support the macro PTHREAD_CANCEL_ASYNCHRONOUS. This post (https://lists.gnu.org/archive/html/bug-gnulib/2018-05/msg00062.html) might be relevant.

I am wondering if this is the right place to report the issue. Sorry that I am not very familiar with Termux's typical approach on incompatibilities of this kind, whether through patches, modified termux lib or perhaps package's responsibility to support Termux.

its-pointless commented 3 years ago

this is the right place since R is not supported by official termux-packages.

pthread_setcanceltype the bthread is something i support not termux specifically.

So i might be able to get this to work.

its-pointless commented 3 years ago

download the source package for cli extract it install libbthread apt install bthread What you have to do is edit the file cli/src/thread.c and add

ifdef ANDROID #include #endif

then you have to make sure the library is linked to libbthread.so so set the variable PKG_LIBS export PKG_LIBS="-lbthread"

then from command line R CMD INSTALL cli it should use the cli directory