Created attachment 184075 [details] Typescript while building math/R, both without and with /usr/local/bin prepended to PATH This probably belongs to lang/gcc5, but building math/R made me aware of this issue. PATH is nominally set to: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin This results in: /usr/local/bin/gcc-ar5 -cr libtre.a regcomp.o regerror.o regexec.o tre-ast.o tre-compile.o tre-match-approx.o tre-match-backtrack.o tre-match-parallel.o tre-mem.o tre-parse.o tre-stack.o xmalloc.o ar: unrecognized option `--plugin' usage: ar -d [-Tjsvz] archive file ... ar -m [-Tjsvz] archive file ... ar -m [-Tabijsvz] position archive file ... ar -p [-Tv] archive [file ...] ar -q [-TcDjsUvz] archive file ... ar -r [-TcDjsUuvz] archive file ... ar -r [-TabcDijsUuvz] position archive file ... ar -s [-jz] archive ar -t [-Tv] archive [file ...] ar -x [-CTouv] archive [file ...] ar -V gmake[6]: *** [Makefile:53: libtre.a] Error 64 gmake[6]: Leaving directory '/usr/ports/workdirs/usr/ports/math/R/work/R-3.4.1/src/extra/tre' In this case it's necessary to prepend /usr/local/bin to PATH. This way /usr/local/bin/gcc-ar5 invokes /usr/local/bin/ar with the required LTO plugin, and not /usr/bin/ar who are unaware of --plugin and LTO in the first place. Maybe /usr/local/bin/gcc-ar5 should be hardcoded to run /usr/local/bin/ar and not look it up using PATH. See attached typescript for further details.
Created attachment 184077 [details] Patch for a short-term solution This patch is only a short-term solution. If other users are affected by the issue, they can easily create math/R/Makefile.local and place the two lines there until a permanent solution exists.
This works in poudriere testport where /usr/local/bin isn't listed before /usr/bin in PATH. Also, with PATH set to /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin, make -C /usr/ports/math/R works here. Could you list the full output of env? Could you list what you have in /etc/make.conf?
(In reply to Joseph Mingrone from comment #2) root@freebsd-11-bios-zfs:/usr/ports/math/R # printenv TERM=xterm-256color BLOCKSIZE=K MAIL=/var/mail/root PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin SHELL=/bin/csh HOME=/root USER=root HOSTTYPE=FreeBSD VENDOR=amd OSTYPE=FreeBSD MACHTYPE=x86_64 SHLVL=1 PWD=/usr/ports/math/R LOGNAME=root GROUP=wheel HOST=freebsd-11-bios-zfs.bsd.net EDITOR=ee PAGER=less VISUAL=ee Here's my /etc/make.conf: #CC=clang #CXX=clang++ #CPP=clang-cpp KERNCONF=VBOX # DTrace for both base and ports. See https://wiki.freebsd.org/DTrace/KernelSupport. STRIP= CFLAGS+=-fno-omit-frame-pointer WITH_CTF=1 WITH_PKGNG=yes WITH_BDB6_PERMITTED=yes WITH_SSP_PORTS=yes WRKDIRPREFIX=/usr/ports/workdirs TEX_DEFAULT=texlive DEFAULT_VERSIONS+=apache=2.4 DEFAULT_VERSIONS+=bdb=6 DEFAULT_VERSIONS+=firebird=2.5 DEFAULT_VERSIONS+=gcc=5 DEFAULT_VERSIONS+=ghostscript=agpl DEFAULT_VERSIONS+=lua=5.2 DEFAULT_VERSIONS+=mysql=5.7 DEFAULT_VERSIONS+=perl5=5.26 DEFAULT_VERSIONS+=pgsql=9.6 DEFAULT_VERSIONS+=php=7.0 DEFAULT_VERSIONS+=python=2.7 DEFAULT_VERSIONS+=python2=2.7 DEFAULT_VERSIONS+=python3=3.6 DEFAULT_VERSIONS+=ruby=2.3 DEFAULT_VERSIONS+=ssl=base DEFAULT_VERSIONS+=tcltk=8.6 # EOF
Thanks. I still can't reproduce this. Could you also show the output of `make -C /usr/ports/math/R shownconfig` and `pkg info`?
(In reply to Joseph Mingrone from comment #4) root@freebsd-11-bios-zfs:~ # make -C /usr/ports/math/R showconfig ===> The following configuration options are available for R-3.4.1_1: ICU=on: Unicode support via ICU INFO=on: GNU info manuals LDOUBLE=off: Long double data type LETTER=off: US letter paper LIBR=on: Shared R library MEMPROF=off: Memory profiling via Rprofmem() and tracemem() NLS=off: Native Language Support RPROF=on: R profiling via Rprof() X11=on: X11 graphics device ====> Require GCC LTO=on: Use Link Time Optimization OPENMP=on: Parallel processing support via OpenMP ====> Require X11 GHOSTSCRIPT=on: Graphics device for bitmap files via Ghostscript JPEG=on: JPEG graphics device CAIROPANGO=on: Cairo graphics device and Pango multi-language text PNG=on: PNG graphics device TCLTK=on: Tcl/Tk GUI toolkit support TEXDOCS=on: Build/Install TeX-dependent documentation files TIFF=on: TIFF image format support ====> Options available for the single BLAS: you have to select exactly one of them ATLAS=off: ATLAS BLAS implementation OPENBLAS=on: OpenBLAS BLAS implementation NETLIB=off: Netlib BLAS implementation RBLAS=off: Use R-bundled BLAS implementation ====> Fortran language support: you have to select exactly one of them GFORTRAN=on: Fortran support via gfortran FLANG=off: Experimental Fortran support via flang ===> Use 'make config' to modify these settings See attachment for pkg info.
Created attachment 184085 [details] List of installed ports
Curiously, I updated math/R to 3.4.1 on another VM running base/head amd64 r320597. The build went fine without the need for prepending /usr/local/bin to PATH. That's a bit strange as in fact all my FreeBSD VMs share, in turn, the same virtual drives for /usr/ports, and /var/db/ports, and a few other miscellaneous filesystems. And they all subscribe to the same local metaport.
Strange indeed. Someone else reported the same issue with the LTO option enabled. Hopefully Gerald, whom I CCed, will have something to say soon. As an aside, I have had better experience with R's internal Blas versus OpenBlas. There were some stability issues in the past with OpenBlas.
FWIW, for my "portmaster" invocations, the $PATH turns out to be: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin, so that would seem to corroborate the initial report here. As noted in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222553, though, I have circumvented the issue by disabling the LTO option.
I hope this issue is now moot with the LTO option removed from 3.4.2. If you think it is, could you close this issue (and re-open if the problem reappears)?
Removal of LTO solved the issue. Users of ports-mgmt/portupgrade, like myself, can work around the previous issue by specifying a custom PATH enviroment variable in /usr/local/etc/pkgtools.conf when upgrading math/R.