svn commit: r452962 - head/math/libRmath

Joseph Mingrone jrm at FreeBSD.org
Fri Oct 27 15:24:38 UTC 2017


Tijl Coosemans <tijl at FreeBSD.org> writes:

> On Fri, 27 Oct 2017 00:52:41 +0000 (UTC) Joseph Mingrone <jrm at FreeBSD.org> wrote:
>> Author: jrm
>> Date: Fri Oct 27 00:52:41 2017
>> New Revision: 452962
>> URL: https://svnweb.freebsd.org/changeset/ports/452962

>> Log:
>>   math/libRmath: Update to version 3.4.2 and add an option on amd64 to choose
>>   the fortran compiler.

>> Modified:
>>   head/math/libRmath/Makefile
>>   head/math/libRmath/distinfo

>> Modified: head/math/libRmath/Makefile
>> ==============================================================================
>> --- head/math/libRmath/Makefile	Thu Oct 26 22:56:58 2017	(r452961)
>> +++ head/math/libRmath/Makefile	Fri Oct 27 00:52:41 2017	(r452962)
>> @@ -2,8 +2,7 @@
>>  # $FreeBSD$

>>  PORTNAME=	libRmath
>> -PORTVERSION=	3.4.1
>> -PORTREVISION=	1
>> +PORTVERSION=	3.4.2
>>  CATEGORIES=	math lang
>>  MASTER_SITES=	CRAN/src/base/R-${PORTVERSION:C|\..*||}
>>  DISTNAME=	R-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
>> @@ -13,6 +12,8 @@ COMMENT=	Standalone math library from R

>>  LICENSE=	GPLv2

>> +ONLY_FOR_ARCHS=		aarch64 amd64 i386
>> +
>>  LIB_DEPENDS=	libcurl.so:ftp/curl \
>>  		libpcre.so:devel/pcre

>> @@ -23,11 +24,28 @@ CONFIGURE_ARGS=	--disable-nls --with-ICU=no --with-cai
>>  		--without-libintl-prefix
>>  CONFIGURE_ENV+=	ac_cv_header_iconv_h=no
>>  GNU_CONFIGURE=	yes
>> -RMATH_SOVERSION=3
>> -USES=		fortran localbase
>> +RMATH_SOVERSION=${PORTVERSION:R}
>> +USES=		localbase
>>  USE_LDCONFIG=	yes

>>  PLIST_SUB=	RMATH_SOVERSION="${RMATH_SOVERSION}"
>> +
>> +OPTIONS_SINGLE=		FORTRAN
>> +OPTIONS_SINGLE_FORTRAN=	${OPTIONS_SINGLE_FORTRAN_${MACHINE_ARCH}}
>> +OPTIONS_SINGLE_FORTRAN_amd64=	GFORTRAN FLANG
>> +OPTIONS_DEFAULT_amd64=	FLANG
>> +
>> +FLANG_DESC=		Build Fortran source with flang
>> +GFORTRAN_DESC=		Build Fortran source with gfortran
>> +
>> +GFORTRAN_USES=		fortran:gcc
>> +FLANG_USES=		fortran:flang
>> +
>> +.include <bsd.port.options.mk>
>> +
>> +.if ${ARCH} != amd64
>> +USES+=		fortran:gcc
>> +.endif

> I don't see this approach to support flang work.  Will this have to be
> added to all Fortran ports?  Will you modify all Fortran ports whenever
> flang supports a new architecture?  Will users run into problems when
> they select gfortran in some ports and flang in others?  Will you allow
> port maintainers to set different defaults in their ports?  It all looks
> like high maintenance and highly error prone.  Too many modifiable
> variables in too many places.

> USES arguments are the wrong mechanism for this in my opinion.
> DEFAULT_VERSIONS seems much better to me.  Users can then add
> fortran=gfortran or fortran=flang to DEFAULT_VERSIONS.  fortran.mk would
> look at FORTRAN_DEFAULT to determine the fortran compiler instead of
> fortran_ARGS.  All ports would simply have USES=fortran and no options.
> That's two variables in two locations: the user's DEFAULT_VERSIONS in
> make.conf and the ports tree FORTRAN_DEFAULT in bsd.default-versions.mk
> (which could eventually be set to flang on amd64 if that turns out to be
> a better default).  Advanced users that want to build some ports with
> flang and some with gfortran and think they know what they're doing can
> figure out the if-elseif-else logic needed in their make.conf.  Port
> maintainers/committers should not have to deal with the support requests
> resulting from such mixed configurations which is very likely if you
> add per port options like you do in this commit.

The DEFAULT_VERSIONS solution is cleaner, but switching all Fortran
ports to build with flang would cause breakage and, as you know, flang
is currently only available for amd64.  The current, more complicated,
fine-tuned approach is less drastic.  If port maintainers do not make
any changes, nothing with their port changes.  They have time to test
with flang and make a choice to opt in.  For example, math/R defaults to
flang (on amd64) because we have problems with gfortran [1][2] and a
work-in-progress port for Rstudio [3] only works when math/R uses flang.
Hopefully flang will mature and become supported on more architectures,
port maintainers will put in some work to support flang, and it will be
an obvious choice to move to the DEFAULT_VERSIONS approach.  This is not
a precedent for choosing the compiler as a port option [4].

[1] https://wiki.freebsd.org/libgcc%20problem
[2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220359
[3] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221127
[4] E.G. cad/ghdl games/eduke32 lang/erlang-runtime16 lang/gambit-c
    math/opensolaris-libm multimedia/x264 net-p2p/cpuminer net/asterisk11
    www/mod_spdy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 962 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-ports-all/attachments/20171027/f136a491/attachment.sig>


More information about the svn-ports-all mailing list