When using a patched version of gcc that will build on ARMv6, math/R will not build due to missing libquadmath.
Auto-assigned to maintainer bf@FreeBSD.org
I added the MISSING option to allow R to build itself, which seemed to be progressing very well. It seems to stumble a bit running a test of some sort that I don't understand: # make `libRblas.so' is up to date. /wrkdirs/usr/ports/math/R/work/R-3.0.2/lib/libRblas.so is unchanged `Makedeps' is up to date. `libtre.a' is up to date. `libappl.a' is up to date. `libnmath.a' is up to date. `libunix.a' is up to date. gcc48 -std=gnu99 -I. -I../../src/include -I../../src/include -I/usr/local/include -I/usr/local/include -DLIBICONV_PLUG -DHAVE_CONFIG_H -fopenmp -fpic -O -pipe -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing -DR_HOME='"/wrkdirs/usr/ports/math/R/work/R-3.0.2"' -o Rscript ./Rscript.c /wrkdirs/usr/ports/math/R/work/R-3.0.2/lib/libR.so is unchanged /wrkdirs/usr/ports/math/R/work/R-3.0.2/bin/exec/R is unchanged `internet.so' is up to date. `libRlapack.so' is up to date. /wrkdirs/usr/ports/math/R/work/R-3.0.2/lib/libRlapack.so is unchanged `lapack.so' is up to date. `vfonts.so' is up to date. `R_X11.so' is up to date. `R_de.so' is up to date. /wrkdirs/usr/ports/math/R/work/R-3.0.2/modules/R_X11.so is unchanged /wrkdirs/usr/ports/math/R/work/R-3.0.2/modules/R_de.so is unchanged building system startup profile building package 'translations' building package 'base' all.R is unchanged building package 'tools' all.R is unchanged ../../../../library/tools/libs/tools.so is unchanged Error: Line starting 'Package: tools ...' is malformed! Execution halted *** Error code 1 Stop. make[3]: stopped in /wrkdirs/usr/ports/math/R/work/R-3.0.2/src/library/tools *** Error code 1 Stop. make[2]: stopped in /wrkdirs/usr/ports/math/R/work/R-3.0.2/src/library *** Error code 1 Stop. make[1]: stopped in /wrkdirs/usr/ports/math/R/work/R-3.0.2/src *** Error code 1 Stop. make: stopped in /wrkdirs/usr/ports/math/R/work/R-3.0.2 # uname -a FreeBSD 11armv6-11-armv6-ports 11.0-CURRENT FreeBSD 11.0-CURRENT r277146 arm
seems to be coming from here, which I don't fully understand: root@11armv6-11-armv6-ports:/wrkdirs/usr/ports/math/R/work/R-3.0.2/src/library/tools # sh # echo "tools:::.install_package_description('.', '"../../../library/tools"')" | R_DEFAULT_PACKAGES=NULL ../../../bin/R --vanilla --slave Error: Line starting 'Package: tools ...' is malformed! Execution halted
Created attachment 151907 [details] fix signedness issue on armv6 I think there is a signedness issue in the 'tre' regex library, correct me if I'm wrong: in R-3.0.2/src/extra/tre/tre-internal.h, we have (line 52): typedef wint_t tre_cint_t; (line 53): #define TRE_CHAR_MAX WCHAR_MAX for arm: __WCHAR_MAX == __UINT_MAX == 0xffffffff (see include/_types.h and include/_limits.h) in R-3.0.2/src/extra/tre/tre-parse.c, we have (line 279): tre_cint_t min = 0, max = 0; (line 349): max = TRE_CHAR_MAX; so max is of type tre_cint_t == wint_t == __wint_t == __ct_rune_t == int (see /usr/include/wctype.h and /usr/include/sys/_types.h) at the end: max = -1; A pull request was issued upstream with no follow-up (https://github.com/andreas-schwab/tre/commit/182e1060dc3bfc175490f6e0e961d9330971299c) I don't know if the fix is correct but it allows to build math/R on arm. I think the attached patch can be applied for all arches because on x86, powerpc, sparc64 and powerpc __WCHAR_MAX = __INT_MAX = 0x7fffffff
build logs: http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/R/R-3.0.2_3.log build logs for some R ports: http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/R/R-cran-bdsmatrix-1.3.2_1.log http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/R/R-cran-car-2.0.22.log http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/R/R-cran-ChangeAnomalyDetection-0.1.0_5.log
Created attachment 152769 [details] Include previous patch, add MISSING to default options on ARMv6
A commit references this bug: Author: sbruno Date: Tue Feb 10 22:24:03 UTC 2015 New revision: 378808 URL: https://svnweb.freebsd.org/changeset/ports/378808 Log: Repair overflow condition where WCHAR_MAX != INT_MAX https://github.com/andreas-schwab/tre/commit/182e1060dc3bfc175490f6e0e961d9330971299c Add MISSING option to the default build on armv6. PR: 194183 Submitted by: mikael.urankar@gmail.com, Adreas Schwab Approved by: maintainer timeout (3 months without PR comment) Changes: head/math/R/Makefile head/math/R/files/patch-src_extra_tre_tre-internal.h
Going to run a mips32 and mips64 test just to see if it builds as is suspected. Adding some of the powerpc guys to the list to see if they can test as well. Probably, OPTIONS_DEFAULT_powerpc+= MISSING if there's no libquadmath on these arch's ? Unable to test sparc64, but hopefully someone can test?
oh, math/R depend tree requires a functional lang/gcc This is not available on mips/mips64 at this time.
(In reply to Sean Bruno from comment #8) This should also be done for powerpc and powerpc64. I can open a new bug if you'd like.
(In reply to Justin Hibbits from comment #10) powerpc/powerpc64 done in r378945