Bug 210866

Summary: math/R: Modernize and simplify port
Product: Ports & Packages Reporter: Joseph Mingrone <jrm>
Component: Individual Port(s)Assignee: Thomas Zander <riggs>
Status: Closed FIXED    
Severity: Affects Only Me CC: jwb, rhurlin, riggs, swills, thierry
Priority: --- Keywords: patch, patch-ready
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210983
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210987
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210990
Attachments:
Description Flags
svn diff to clean up math/R
jrm: maintainer-approval+
svn diff to clean up math/R
jrm: maintainer-approval+
svn diff for math/R
jrm: maintainer-approval+
svn diff to clean up math/R
jrm: maintainer-approval+
svn diff to clean up math/R
jrm: maintainer-approval+
svn diff to fix latest issue
jrm: maintainer-approval+
svn diff
jrm: maintainer-approval+
another svn diff jrm: maintainer-approval+

Description Joseph Mingrone freebsd_committer 2016-07-06 05:30:24 UTC
Created attachment 172160 [details]
svn diff to clean up math/R

portlint: OK (spurious warning about install-info)
testport: OK (poudriere: 9.3-RELEASE-p36, i386,  default options) [1]
testport: OK (poudriere: 9.3-RELEASE-p30, amd64, default options) [2]
testport: OK (poudriere: 10.3-RELEASE,    i386,  default options) [3]
testport: OK (poudriere: 10.3-RELEASE,    amd64, default options) [4]

[1]
http://pkg.awarnach.mathstat.dal.ca/data/9i386-default/2016-07-06_02h04m11s/logs/R-3.3.1.log

[2]
http://pkg.awarnach.mathstat.dal.ca/data/9amd64-default/2016-07-06_02h04m19s/logs/R-3.3.1.log

[3]
http://pkg.awarnach.mathstat.dal.ca/data/10i386-default/2016-07-06_02h04m29s/logs/R-3.3.1.log

[4]
http://pkg.awarnach.mathstat.dal.ca/data/10amd64-default/2016-07-06_02h04m34s/logs/R-3.3.1.log

Many other option combinations were tested and poudriere was happy.
stage-qa is complaining about not using USE=tcl, but that is turned on.  I'm still looking into this, but it doesn't seem to be causing any issues.

Since there are many changes, I've copied maintainers of dependent ports.  It would be useful to get confirmation that everything is working for them.

The slave port math/libR will need to be marked as BROKEN.  No other ports currently depend on math/libR, so I will investigate whether that port and math/libRmath (currently marked BROKEN) are ready to be retired.
Comment 1 Mathieu Arnold freebsd_committer 2016-07-06 14:53:00 UTC
There is a:

+TCL_IMPLIES=		X11

I think it should be:

+TCLTK_IMPLIES=		X11
Comment 2 Joseph Mingrone freebsd_committer 2016-07-06 15:13:12 UTC
Created attachment 172173 [details]
svn diff to clean up math/R

Indeed.  Thanks for catching that.

TCL_IMPLIES should have been TCLTK_IMPLIES.  This second, updated patch includes this fix.
Comment 3 Joseph Mingrone freebsd_committer 2016-07-06 16:41:03 UTC
Created attachment 172176 [details]
svn diff for math/R

PORTREVISION was just bumped
Comment 4 Joseph Mingrone freebsd_committer 2016-07-07 07:48:11 UTC
Created attachment 172186 [details]
svn diff to clean up math/R

PORTREVISION was bumped again because the update to devel/icu was reverted.

While here, remove more cruft that is taken care of by autoconf now.  For example, the -fPIC flag is already used when the libR library is built.

New tests:

portlint: OK (spurious warning about install-info)
testport: OK (poudriere: 9.3-RELEASE-p36, i386,  default options) [1]
testport: OK (poudriere: 9.3-RELEASE-p30, amd64, default options) [2]
testport: OK (poudriere: 10.3-RELEASE,    i386,  default options) [3]
testport: OK (poudriere: 10.3-RELEASE,    amd64, default options) [4]

[1]
http://pkg.awarnach.mathstat.dal.ca/data/9i386-default/2016-07-07_04h06m55s/logs/R-3.3.1_2.log

[2]
http://pkg.awarnach.mathstat.dal.ca/data/9amd64-default/2016-07-07_04h06m58s/logs/R-3.3.1_2.log

[3]
http://pkg.awarnach.mathstat.dal.ca/data/10i386-default/2016-07-07_04h07m01s/logs/R-3.3.1_2.log

[4]
http://pkg.awarnach.mathstat.dal.ca/data/10amd64-default/2016-07-07_04h06m25s/logs/R-3.3.1_2.log
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2016-07-07 07:50:57 UTC
Thanks Joseph

For future reference, build log attachments are no longer required, just the QA/testing confirmation summary as you provided in comment 4
Comment 6 Joseph Mingrone freebsd_committer 2016-07-07 19:59:11 UTC
Created attachment 172210 [details]
svn diff to clean up math/R

Append shared library versions (again).  Without them, ldconfig fails to add them to the shared object cache.
Comment 7 Thomas Zander freebsd_committer 2016-07-09 07:12:30 UTC
With these OPTIONS:
===> The following configuration options are available for R-3.3.1_2:
     DOCS=on: Build and/or install documentation
     ICU=on: Unicode support via ICU
     INFO=on: GNU info manuals
     LDOUBLE=on: Enable long double data type
     LETTER=on: US Letter paper
     LIBR=on: Build dynamic (shared) R library
     LTO=on: Try to produce faster code through LTO
     MISSING=off: Use libmissing rather than libquadmath
     NLS=on: Native Language Support
     OPENMP=on: Parallel processing support via OpenMP
     THREADS=on: Threading support
     X11=on: X11 graphics device
====> X11-Implying Options
     GHOSTSCRIPT=on: Graphics Device for Bitmap Files via Ghostscript
     JPEG=on: JPEG graphics device
     CAIROPANGO=on: Cairo graphics device and Pango multi-language text
     PDF=on: PDF manuals (requires TeX)
     PNG=on: PNG graphics device
     TCLTK=on: Tcl/Tk GUI toolkit support
     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=off: OpenBLAS BLAS implementation
     NETLIB=on: Netlib BLAS implementation
     RBLAS=off: Use R-bundled BLAS implementation


there is an issue during install:
===>   Generating temporary packing list
mkdir /wrkdirs/usr/ports/math/R/work/stage/usr/local/lib/R
installing doc ...
mkdir /wrkdirs/usr/ports/math/R/work/stage/usr/local/share/doc/R
install: NEWS.rds: No such file or directory
*** Error code 71

Stop.
make[2]: stopped in /wrkdirs/usr/ports/math/R/work/R-3.3.1/doc
*** Error code 1

Stop.
make[1]: stopped in /wrkdirs/usr/ports/math/R/work/R-3.3.1
*** Error code 1

Stop.
make: stopped in /usr/ports/math/R

Could you take a look? Thanks!
Comment 8 Joseph Mingrone freebsd_committer 2016-07-09 10:46:17 UTC
Created attachment 172280 [details]
svn diff to fix latest issue

Thanks for catching that.  It's fixed in this new patch.
Comment 9 Thomas Zander freebsd_committer 2016-07-09 12:11:28 UTC
(In reply to Joseph Mingrone from comment #8)

Thanks, looks good now!

In the initial submission, you stated that you were waiting for feedback from maintainers of dependent ports.

Did you receive replies? If chances are high that this change causes breakage of many ports, we can request an exp-run. From the plist changes, personally I would expect not much trouble.
Comment 10 Rainer Hurling 2016-07-09 14:43:13 UTC
Hi Joseph,

Many, many thanks for your work on renewing the port, really appreciated!

I think it is also necessary to add 'USES=objc' to the ports Makefile. Otherwise we get a mixture of lang/gcc and gcc from base:


# make configure  [[without USES=objc]]
[-snip----------------------------------------------------]
R is now configured for amd64-portbld-freebsd11.0
  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                gcc48 -std=gnu99  -O2 -pipe  -fno-builtin-erfcl -fno-builtin-powl -fno-builtin-sinhl -fno-builtin-tgammal -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing
  Fortran 77 compiler:       gfortran48  -O -Wl,-rpath=/usr/local/lib/gcc48

  C++ compiler:              g++48  -O2 -pipe -fno-builtin-erfcl -fno-builtin-powl -fno-builtin-sinhl -fno-builtin-tgammal -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing  -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc48
  C++11 compiler:            g++48  -std=c++11 -O2 -pipe -fno-builtin-erfcl -fno-builtin-powl -fno-builtin-sinhl -fno-builtin-tgammal -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing  -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc48
  Fortran 90/95 compiler:    gfortran48 -Wl,-rpath=/usr/local/lib/gcc48
  Obj-C compiler:	     gcc -g -O2 -fobjc-exceptions
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^



# make configure  [[with USES=objc]]
[-snip----------------------------------------------------]
R is now configured for amd64-portbld-freebsd11.0
  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                gcc48 -std=gnu99  -O2 -pipe  -fno-builtin-erfcl -fno-builtin-powl -fno-builtin-sinhl -fno-builtin-tgammal -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing
  Fortran 77 compiler:       gfortran48  -O -Wl,-rpath=/usr/local/lib/gcc48

  C++ compiler:              g++48  -O2 -pipe -fno-builtin-erfcl -fno-builtin-powl -fno-builtin-sinhl -fno-builtin-tgammal -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing  -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc48
  C++11 compiler:            g++48  -std=c++11 -O2 -pipe -fno-builtin-erfcl -fno-builtin-powl -fno-builtin-sinhl -fno-builtin-tgammal -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing  -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc48
  Fortran 90/95 compiler:    gfortran48 -Wl,-rpath=/usr/local/lib/gcc48
  Obj-C compiler:	     gcc48  -O2 -pipe  -fno-builtin-erfcl -fno-builtin-powl -fno-builtin-sinhl -fno-builtin-tgammal -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing -Wno-import -DLIBICONV_PLUG -I/usr/local/include -fobjc-exceptions



And, is 'MAKE_JOBS_UNSAFE=yes' really needed? For me, it also builds fine without.
Comment 11 Joseph Mingrone freebsd_committer 2016-07-09 16:05:13 UTC
Thomas,

The maintainer-feedback flag shoudn't have been set.  I am the maintainer.

The only breakage I expect is with math/libR and math/libRmath, both of which are already broken.  The math/libRmath port is already marked BROKEN.  Can you mark math/libR BROKEN as well?  No other ports depend on either math/libR or math/libRmath, so I feel the fallout will be minimal.  I plan to "unenslave" both in the near future.

Thanks,

Joseph
Comment 12 Joseph Mingrone freebsd_committer 2016-07-09 16:06:38 UTC
Created attachment 172288 [details]
svn diff

Hi Rainer,

Thanks for your feedback.

I don't see any objective-c code in the source tree, other than OS X specific parts.  Are you (or anyone else) confident USES=objc is necessary?

I've removed MAKE_JOBS=unsafe.  Without it, the build was breaking, but something must have changed in the meantime.  I've tested with various options in different versions and the build is successful without out it.  Thanks.
Comment 13 Rainer Hurling 2016-07-09 17:02:29 UTC
(In reply to Joseph Mingrone from comment #12)
To be honest, I am not sure, if 'USES=objc' really improves linkage of libs. I do not remember, but once I heard about some R packages, using Objective-C, linked against the R libs. I think, 'USES=objc' is a step in the right direction ;)

On the other hand, there is something else, at least on CURRENT, which brings in base compiler (here clang, libc++ and libcxxrt). So I get a compiler mixture linked in:

#ldd /usr/local/lib/R/lib/libR.so.1
libR.so.1:
	libRblas.so => /usr/local/lib/R/lib/libRblas.so (0x415d8000)
	libmissing.so.2 => /usr/local/lib/libmissing.so.2 (0x41806000)
	libm.so.5 => /lib/libm.so.5 (0x41a09000)
	libgfortran.so.3 => /usr/local/lib/gcc48/libgfortran.so.3 (0x41c33000)
	libquadmath.so.0 => /usr/local/lib/gcc48/libquadmath.so.0 (0x41f4a000)
	libintl.so.8 => /usr/local/lib/libintl.so.8 (0x42185000)
	libreadline.so.6 => /usr/local/lib/libreadline.so.6 (0x4238f000)
	libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x425db000)
	liblzma.so.5 => /usr/lib/liblzma.so.5 (0x42853000)
	libbz2.so.4 => /usr/lib/libbz2.so.4 (0x42a7c000)
	libz.so.6 => /lib/libz.so.6 (0x42c91000)
	libicuuc.so.55 => /usr/local/lib/libicuuc.so.55 (0x42ea8000)
	libicui18n.so.55 => /usr/local/lib/libicui18n.so.55 (0x43400000)
	libgomp.so.1 => /usr/local/lib/gcc48/libgomp.so.1 (0x438a3000)
	libthr.so.3 => /lib/libthr.so.3 (0x43ab1000)
	libc.so.7 => /lib/libc.so.7 (0x40823000)
	libmpc.so.3 => /usr/local/lib/libmpc.so.3 (0x43cd8000)
	libgcc_s.so.1 => /usr/local/lib/gcc48/libgcc_s.so.1 (0x43eee000)
	libncurses.so.8 => /lib/libncurses.so.8 (0x44104000)
	libicudata.so.55 => /usr/local/lib/libicudata.so.55 (0x44400000)
	libc++.so.1 => /usr/lib/libc++.so.1 (0x45f20000)
	libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x461df000)
	libmpfr.so.4 => /usr/local/lib/libmpfr.so.4 (0x463fd000)
	libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x46663000)
Comment 14 Joseph Mingrone freebsd_committer 2016-07-09 17:39:38 UTC
Created attachment 172290 [details]
another svn diff

Added USES=objc:compiler after conversations with bapt and rhurlin (Rainer) on IRC.

P.S. In my last comment I should have written 'MAKE_JOBS_UNSAFE=yes' and not 'MAKE_JOBS=unsafe'.
Comment 15 commit-hook freebsd_committer 2016-07-09 19:28:35 UTC
A commit references this bug:

Author: riggs
Date: Sat Jul  9 19:28:22 UTC 2016
New revision: 418289
URL: https://svnweb.freebsd.org/changeset/ports/418289

Log:
  Modernize and simplify port

  PR:		210866
  Submitted by:	jrm@ftfl.ca (maintainer)
  Reviewed by:	rhurlin@gwdg.de, bapt, riggs

Changes:
  head/math/R/Makefile
  head/math/R/pkg-plist
Comment 16 commit-hook freebsd_committer 2016-07-09 19:32:38 UTC
A commit references this bug:

Author: riggs
Date: Sat Jul  9 19:32:32 UTC 2016
New revision: 418290
URL: https://svnweb.freebsd.org/changeset/ports/418290

Log:
  Mark broken while restructuring the master port is ongoing

  PR:		210866
  Reported by:	jrm@ftfl.ca (maintainer)

Changes:
  head/math/libR/Makefile