Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Sep 2019 19:55:44 +0000 (UTC)
From:      Joseph Mingrone <jrm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r512371 - head/math/R
Message-ID:  <201909191955.x8JJti4R002978@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jrm
Date: Thu Sep 19 19:55:44 2019
New Revision: 512371
URL: https://svnweb.freebsd.org/changeset/ports/512371

Log:
  math/R: Fix dependency condition for devel/openmp
  
  libomp is provided by
    - LLVM, which gets pulled in with FLANG
    - gcc
  
  So, we *must* only depend on devel/openmp when
    - the OPENMP knob is on
    - FLANG is off (guaranteed to be off for all archs except amd64)
    - clang is the C compiler.
  
  But, we cannot modify LIB_DEPENDS after CHOSEN_COMPILER_TYPE is defined, so
  for now, limit the OPENMP knob for i386 and amd64 where clang is the
  default compiler.
  
  This will be moot after 12.1 when openmp will be in base.
  
  PR:		240279
  Reported by:	pkubaj
  Reviewed by:	pkubaj

Modified:
  head/math/R/Makefile   (contents, props changed)

Modified: head/math/R/Makefile
==============================================================================
--- head/math/R/Makefile	Thu Sep 19 19:43:47 2019	(r512370)
+++ head/math/R/Makefile	Thu Sep 19 19:55:44 2019	(r512371)
@@ -38,17 +38,17 @@ GNU_CONFIGURE=	yes
 INSTALL_TARGET=	install-strip
 PLIST_SUB=	LIBVER=${LIBVER}
 
-OPTIONS_DEFINE=		FLANG ICU INFO LDOUBLE LETTER MEMPROF NLS OPENMP RPROF X11
-OPTIONS_EXCLUDE_aarch64=	FLANG OPENMP
-OPTIONS_EXCLUDE_armv6=	FLANG OPENMP
-OPTIONS_EXCLUDE_armv7=	FLANG OPENMP
-OPTIONS_EXCLUDE_i386=	FLANG
+OPTIONS_DEFINE=		ICU INFO LDOUBLE LETTER MEMPROF NLS RPROF X11
+OPTIONS_DEFINE_amd64=	FLANG OPENMP
+OPTIONS_DEFINE_i386=	OPENMP
 OPTIONS_GROUP=		NEEDX11
 OPTIONS_GROUP_NEEDX11=	GHOSTSCRIPT JPEG CAIROPANGO PNG TCLTK TEXDOCS TIFF
 OPTIONS_SINGLE=		BLAS
 OPTIONS_SINGLE_BLAS=	ATLAS OPENBLAS NETLIB RBLAS
-OPTIONS_DEFAULT=	CAIROPANGO GHOSTSCRIPT ICU INFO JPEG LDOUBLE OPENMP PNG \
-			RBLAS RPROF TCLTK TIFF X11
+OPTIONS_DEFAULT=	CAIROPANGO GHOSTSCRIPT ICU INFO JPEG LDOUBLE PNG RBLAS \
+			RPROF TCLTK TIFF X11
+OPTIONS_DEFAULT_amd64=	OPENMP
+OPTIONS_DEFAULT_i386=	OPENMP
 OPTIONS_SUB=		YES
 
 ATLAS_DESC=		ATLAS BLAS implementation
@@ -75,8 +75,8 @@ CAIROPANGO_IMPLIES=	X11
 CAIROPANGO_CONFIGURE_WITH=	cairo
 CAIROPANGO_USES=	gettext gnome jpeg pkgconfig
 CAIROPANGO_USE=		GNOME=pango,cairo
+FLANG_LIB_DEPENDS=	libpgmath.so:math/libpgmath
 FLANG_USES=		fortran:flang
-FLANG_USES_OFF=		fortran
 FLANG_PREVENTS=		ATLAS OPENBLAS NETLIB
 GHOSTSCRIPT_IMPLIES=	X11
 GHOSTSCRIPT_USES=	ghostscript
@@ -121,16 +121,32 @@ TIFF_IMPLIES=		X11
 TIFF_LIB_DEPENDS=	libtiff.so:graphics/tiff
 TIFF_CONFIGURE_WITH=	libtiff
 X11_CONFIGURE_WITH=	x
+X11_USES=		xorg
 X11_USE=		xorg=ice,sm,x11,xext,xmu,xscrnsaver,xt
 
 LIBVER=		${PORTVERSION:R}
 
 .include <bsd.port.options.mk>
 
-# LLVM, which gets pulled in with FLANG, provides libomp.  So, only depend on
-# devel/openmp when GFORTRAN and OPENMP are on.
-.if ! ${PORT_OPTIONS:MFLANG} && ${PORT_OPTIONS:MOPENMP}
+# libomp is provided by
+#  - LLVM, which gets pulled in with FLANG
+#  - gcc
+#
+# So, *must* only depend on devel/openmp when
+#   - the OPENMP knob is on
+#   - FLANG is off (guaranteed to be off for all archs except amd64)
+#   - clang is the C compiler.
+#
+# But, we cannot modify LIB_DEPENDS after CHOSEN_COMPILER_TYPE is defined, so
+# for now, limit the OPENMP knob for i386 and amd64 where clang is the default
+# compiler.
+#
+# This will be moot after 12.1 when openmp will be in base.
+.if ! ${PORT_OPTIONS:MFLANG}
+USES+=	fortran
+.if ${PORT_OPTIONS:MOPENMP}
 LIB_DEPENDS+=	libomp.so:devel/openmp
+.endif
 .endif
 
 post-patch:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909191955.x8JJti4R002978>