aboutsummaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
authorJoseph Mingrone <jrm@FreeBSD.org>2019-09-20 03:55:44 +0800
committerJoseph Mingrone <jrm@FreeBSD.org>2019-09-20 03:55:44 +0800
commitbe67ffd1eb2cf8a2788e6f3badd4e39ab76a6639 (patch)
treee5aaea359efcf54987611df2d2214b2584f1ce68 /math
parenta513da3ae94ba56dc7fa72a699571f5ec5b30293 (diff)
downloadfreebsd-ports-gnome-be67ffd1eb2cf8a2788e6f3badd4e39ab76a6639.tar.gz
freebsd-ports-gnome-be67ffd1eb2cf8a2788e6f3badd4e39ab76a6639.tar.zst
freebsd-ports-gnome-be67ffd1eb2cf8a2788e6f3badd4e39ab76a6639.zip
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
Diffstat (limited to 'math')
-rw-r--r--math/R/Makefile38
1 files changed, 27 insertions, 11 deletions
diff --git a/math/R/Makefile b/math/R/Makefile
index ac7727a8205a..2b59e4dd3b45 100644
--- a/math/R/Makefile
+++ b/math/R/Makefile
@@ -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,17 +121,33 @@ 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:
@${REINPLACE_CMD} -e "s|/usr/local|${LOCALBASE}|g" ${WRKSRC}/configure