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

use of undeclared identifier 'timespec_get' in termux R-4.1.2 #161

Open
leechaowen opened this issue Dec 13, 2021 · 0 comments
Open

use of undeclared identifier 'timespec_get' in termux R-4.1.2 #161

leechaowen opened this issue Dec 13, 2021 · 0 comments

Comments

@leechaowen
Copy link

I fail to install later in termux . i took one night to view the exists issues relate the topic timespec, the way is write something in this file Makevars in the path ~/.R

i had tried one by one , not success. Could you hlep me and give some suggestions? Thanks.

termux version:0.117
android version :11
R version: R version 4.1.2 (2021-11-01) Platform: aarch64-unknown-linux-gnu (64-bit)
g++ version : clang version 13.0.0

> install.packages("later")
trying URL 'https://mirrors.ustc.edu.cn/CRAN/src/contrib/later_1.3.0.tar.gz'
Content type 'application/octet-stream' length 63785 bytes (62 KB)
==================================================
downloaded 62 KB

* installing *source* package ‘later’ ...
** package ‘later’ successfully unpacked and MD5 sums checked
** using staged installation
Running configure script
-latomic linker flag not needed.
** libs
g++ -std=gnu++11 -I"/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS  -I'/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/library/Rcpp/include' -I/usr/local/include   -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS  -I'/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/library/Rcpp/include' -I/usr/local/include   -fpic  -g -O2  -c callback_registry.cpp -o callback_registry.o
In file included from callback_registry.cpp:6:
In file included from ./callback_registry.h:10:
./threadutils.h:129:9: error: use of undeclared identifier 'timespec_get'; did you mean 'timespec'?
    if (timespec_get(&ts, TIME_UTC) != TIME_UTC) {
        ^
/data/data/com.termux/files/usr/include/semaphore.h:37:8: note: 'timespec' declared here
struct timespec;
       ^
1 error generated.
make: *** [/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/etc/Makeconf:175: callback_registry.o] Error 1
ERROR: compilation failed for package ‘later’
* removing ‘/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/library/later’

The downloaded source packages are in
        ‘/data/data/com.termux/files/usr/tmp/RtmpZ2DGtQ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("later") :
  installation of package ‘later’ had non-zero exit status
> 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 tools_4.1.2
>

g++ version

~ $ g++ --version
clang version 13.0.0
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin
~ $

termux-info


~ $ 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
~ $

the default Makeconf settings:


.../R/etc $ pwd
/data/data/com.termux/files/usr/local/R-4.1.2/lib/R/etc
.../R/etc $ cat Makeconf
# etc/Makeconf.  Generated from Makeconf.in by configure.
#
# ${R_HOME}/etc/Makeconf
#
# R was configured using the following call
# (not including env. vars and site configuration)
# configure  '--enable-R-shlib' '--prefix=/data/data/com.termux/files/usr/local/R-4.1.2' '--with-x=no'

## This fails if it contains spaces, or if it is quoted
include $(R_SHARE_DIR)/make/vars.mk

AR = ar
BLAS_LIBS = -L"$(R_HOME)/lib$(R_ARCH)" -lRblas
C_VISIBILITY = -fvisibility=hidden
CC = gcc
CFLAGS = -g -O2 $(LTO)
CPICFLAGS = -fpic
CPPFLAGS = -I/usr/local/include
CXX = g++ -std=gnu++14
CXXFLAGS = -g -O2 $(LTO)
CXXPICFLAGS = -fpic
CXX11 = g++
CXX11FLAGS = -g -O2 $(LTO)
CXX11PICFLAGS = -fpic
CXX11STD = -std=gnu++11
CXX14 = g++
CXX14FLAGS = -g -O2 $(LTO)
CXX14PICFLAGS = -fpic
CXX14STD = -std=gnu++14
CXX17 = g++
CXX17FLAGS = -g -O2 $(LTO)
CXX17PICFLAGS = -fpic
CXX17STD = -std=gnu++17
CXX20 = g++
CXX20FLAGS = -g -O2 $(LTO)
CXX20PICFLAGS = -fpic
CXX20STD = -std=gnu++20
CXX_VISIBILITY = -fvisibility=hidden
DYLIB_EXT = .so
DYLIB_LD = $(CC)
DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)
## should be used by packges for dylibs, but at the time of writing was not
DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
F_VISIBILITY = -fvisibility=hidden
## FC is the compiler used for all Fortran as from R 3.6.0
FC = gfortran
FCFLAGS = -g -O2 $(LTO_FC)
## additional libs needed when linking with $(FC), e.g. on some Oracle compilers
FCLIBS_XTRA =
FFLAGS = -g -O2 $(LTO_FC)
FLIBS =  -lgfortran -lm -ldl
FPICFLAGS = -fpic
FOUNDATION_CPPFLAGS =
FOUNDATION_LIBS =
JAR = /data/data/com.termux/files/usr/opt/openjdk/bin/jar
JAVA = /data/data/com.termux/files/usr/opt/openjdk/bin/java
JAVAC = /data/data/com.termux/files/usr/opt/openjdk/bin/javac
JAVAH =
## JAVA_HOME might be used in the next three.
## They are for packages 'JavaGD' and 'rJava'
JAVA_HOME = /data/data/com.termux/files/usr/opt/openjdk
JAVA_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JAVA_LIBS = -L$(JAVA_HOME)/lib/server -ljvm
JAVA_LD_LIBRARY_PATH = $(JAVA_HOME)/lib/server
LAPACK_LIBS = -L"$(R_HOME)/lib$(R_ARCH)" -lRlapack
LDFLAGS = -L/usr/local/lib
## we only need this is if it is external, as otherwise link to R
LIBINTL=
LIBM = -lm
LIBR0 = -L"$(R_HOME)/lib$(R_ARCH)"
LIBR1 = -lR
LIBR = -L"$(R_HOME)/lib$(R_ARCH)" -lR
LIBS = -L/data/data/com.termux/files/usr/lib -lpcre2-8 -llzma -lbz2 -lz -ltirpc -lrt -ldl -lm -liconv -licuuc -licui18n
## needed by R CMD config
LIBnn = lib
LIBTOOL = $(SHELL) "$(R_HOME)/bin/libtool"
## set for --enable-lto, --enable-lto=check
LTO =
LTO_FC =
LTO_LD =
## set for --enable-lto=R, used in INSTALL
LTO_OPT =
LTO_FC_OPT =
## needed to build applications linking to static libR
MAIN_LD = $(CC)
MAIN_LDFLAGS = -Wl,--export-dynamic -fopenmp
MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
MKINSTALLDIRS = "$(R_HOME)/bin/mkinstalldirs"
NM = /data/data/com.termux/files/usr/bin/nm -B
OBJC = gcc
OBJCFLAGS = -g -O2 -fobjc-exceptions $(LTO)
OBJC_LIBS =
OBJCXX =
R_ARCH =
RANLIB = ranlib
SAFE_FFLAGS = -g -O2
SED = /data/data/com.termux/files/usr/bin/sed
SHELL = /bin/sh
SHLIB_CFLAGS =
SHLIB_CXXFLAGS =
SHLIB_CXXLD = $(CXX)
SHLIB_CXXLDFLAGS = -shared# $(CXXFLAGS) $(CXXPICFLAGS) $(LTO_LD)
SHLIB_CXX11LD = $(CXX11) $(CXX11STD)
SHLIB_CXX11LDFLAGS = -shared# $(CXX11FLAGS) $(CXX11PICFLAGS) $(LTO_LD)
SHLIB_CXX14LD = $(CXX14) $(CXX14STD)
SHLIB_CXX14LDFLAGS = -shared# $(CXX14FLAGS) $(CXX14PICFLAGS) $(LTO_LD)
SHLIB_CXX17LD = $(CXX17) $(CXX17STD)
SHLIB_CXX17LDFLAGS = -shared# $(CXX17FLAGS) $(CXX17PICFLAGS) $(LTO_LD)
SHLIB_CXX20LD = $(CXX20) $(CXX20STD)
SHLIB_CXX20LDFLAGS = -shared# $(CXX20FLAGS) $(CXX20PICFLAGS) $(LTO_LD)
SHLIB_EXT = .so
SHLIB_FCLD = $(FC)
SHLIB_FCLDFLAGS = -shared# $(FCFLAGS) $(FPICFLAGS)
SHLIB_FFLAGS =
SHLIB_LD = $(CC)
## used for add-on packages linked by C
SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS) $(LTO_LD)
## used for standard packages
SHLIB_LDFLAGS_R = -shared# $(CFLAGS) $(CPICFLAGS) $(LTO_LD)
SHLIB_LIBADD =
## We want to ensure libR is picked up from $(R_HOME)/lib
## before e.g. /usr/local/lib if a version is already installed.
SHLIB_LINK = $(SHLIB_LD) $(SHLIB_LDFLAGS) $(LIBR0) $(LDFLAGS)
SHLIB_OPENMP_CFLAGS = -fopenmp
SHLIB_OPENMP_CXXFLAGS = -fopenmp
SHLIB_OPENMP_FFLAGS = -fopenmp
STRIP_STATIC_LIB = strip --strip-debug
STRIP_SHARED_LIB = strip --strip-unneeded
TCLTK_CPPFLAGS =
TCLTK_LIBS =
YACC = bison -y

## for linking to libR.a
STATIC_LIBR = # -Wl,--whole-archive "$(R_HOME)/lib$(R_ARCH)/libR.a" -Wl,--no-whole-archive $(BLAS_LIBS) $(FLIBS)  $(LIBINTL) -lreadline  $(LIBS)

## These are recorded as macros for legacy use in packages
## set on AIX, formerly for old glibc (-D__NO_MATH_INLINES)
R_XTRA_CFLAGS =
##  was formerly set on HP-UX
R_XTRA_CPPFLAGS =  -I"$(R_INCLUDE_DIR)" -DNDEBUG
## currently unset
R_XTRA_CXXFLAGS =
## used for gfortran in R > 3.6.0
R_XTRA_FFLAGS = -fno-optimize-sibling-calls

## SHLIB_CFLAGS SHLIB_CXXFLAGS SHLIB_FFLAGS are apparently currently unused
## SHLIB_CXXFLAGS is undocumented, there is no SHLIB_FCFLAGS
ALL_CFLAGS =  $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(CFLAGS)
ALL_CPPFLAGS =  -I"$(R_INCLUDE_DIR)" -DNDEBUG $(PKG_CPPFLAGS) $(CLINK_CPPFLAGS) $(CPPFLAGS)
ALL_CXXFLAGS =  $(PKG_CXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(CXXFLAGS)
ALL_OBJCFLAGS = $(PKG_OBJCFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(OBJCFLAGS)
ALL_OBJCXXFLAGS = $(PKG_OBJCXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(OBJCXXFLAGS)
ALL_FFLAGS = -fno-optimize-sibling-calls $(PKG_FFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FFLAGS)
## can be overridden by R CMD SHLIB
P_FCFLAGS = $(PKG_FFLAGS)
ALL_FCFLAGS = -fno-optimize-sibling-calls $(P_FCFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FCFLAGS)
## LIBR here as a couple of packages use this without SHLIB_LINK
ALL_LIBS = $(PKG_LIBS) $(SHLIB_LIBADD) $(LIBR)# $(LIBINTL)

.SUFFIXES:
.SUFFIXES: .c .cc .cpp .d .f .f90 .f95 .m .mm .M .o

.c.o:
        $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@
.c.d:
        @echo "making $@ from $<"
        @$(CC) -MM $(ALL_CPPFLAGS) $< > $@
.cc.o:
        $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
.cpp.o:
        $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
.cc.d:
        @echo "making $@ from $<"
        @$(CXX) -M $(ALL_CPPFLAGS) $< > $@
.cpp.d:
        @echo "making $@ from $<"
        @$(CXX) -M $(ALL_CPPFLAGS) $< > $@
.m.o:
        $(OBJC) $(ALL_CPPFLAGS) $(ALL_OBJCFLAGS) -c $< -o $@
.m.d:
        @echo "making $@ from $<"
        @$(OBJC) -MM $(ALL_CPPFLAGS) $< > $@
.mm.o:
        $(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
.M.o:
        $(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
.f.o:
        $(FC) $(ALL_FFLAGS) -c $< -o $@
.f95.o:
        $(FC) $(ALL_FCFLAGS) -c  $< -o $@
.f90.o:
        $(FC) $(ALL_FCFLAGS) -c  $< -o $@
.../R/etc $

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

1 participant