git: 34ece0398799 - main - science/libtensorflow1: add flavour without AVX
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 12 Jun 2022 08:29:31 UTC
The branch main has been updated by crees:
URL: https://cgit.FreeBSD.org/ports/commit/?id=34ece039879999c9eb41b4d9484ca51451b30fdf
commit 34ece039879999c9eb41b4d9484ca51451b30fdf
Author: Paul Armstrong <freebsd@otoh.org>
AuthorDate: 2022-06-12 08:20:23 +0000
Commit: Chris Rees <crees@FreeBSD.org>
CommitDate: 2022-06-12 08:28:25 +0000
science/libtensorflow1: add flavour without AVX
Not all processors bought these days support AVX, for example Pentium
Gold. People would most likely wish to have a working package in this
case.
While here, remove march=native.
PR: ports/260694
Discussed with: diizzy
Discussed with: William Miur <wamuir@gmail.com>
---
science/libtensorflow1/Makefile | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/science/libtensorflow1/Makefile b/science/libtensorflow1/Makefile
index fa459e4a2bef..e34701ead645 100644
--- a/science/libtensorflow1/Makefile
+++ b/science/libtensorflow1/Makefile
@@ -2,6 +2,7 @@ PORTNAME= libtensorflow1
DISTVERSIONPREFIX= v
DISTVERSION= 1.15.5
DISTVERSIONSUFFIX=
+PORTREVISION= 1
CATEGORIES= science
MAINTAINER= freebsd-ports@otoh.org
@@ -21,6 +22,13 @@ BUILD_DEPENDS= bash:shells/bash \
bazel:devel/bazel029 \
git:devel/git
+FLAVORS= default noavx
+FLAVOR?= ${FLAVORS:[1]}
+noavx_PKGNAMESUFFIX= -noavx
+noavx_CONFLICTS_INSTALL= libtensorflow1
+default_CONFLICTS_INSTALL= libtensorflow1-noavx
+CONFLICTS_INSTALL= science/libtensorflow2
+
USES= gmake python:3.7-3.9,build
USE_GITHUB= yes
@@ -69,8 +77,6 @@ GH_TUPLE= bazelbuild:rules_closure:308b05b2:bazelbuild_rules_closure \
USE_LDCONFIG= yes
-CONFLICTS_INSTALL= science/libtensorflow2
-
CC?= clang
BINARY_ALIAS= python3=${PYTHON_CMD} python=${PYTHON_CMD}
@@ -83,6 +89,11 @@ OPTIONS_DEFAULT= AVX
OPTIONS_SINGLE= CPUFEATURE
OPTIONS_SINGLE_CPUFEATURE= AVX AVX2 NOAVX
+.if ${FLAVOR:U} == noavx
+OPTIONS_EXCLUDE:= ${OPTIONS_SINGLE_CPUFEATURE}
+.endif
+
+CPUFEATURE_DESC= Vector Processing Extensions
NOAVX_DESC= Disable Advanced Vector Extensions
AVX_DESC= Enable Advanced Vector Extensions (AVX)
@@ -128,7 +139,7 @@ post-patch:
do-configure:
@cd ${WRKSRC} && ${SETENV} \
- CC_OPT_FLAGS="-I${LOCALBASE}/include -march=native -Wno-sign-compare" \
+ CC_OPT_FLAGS="-I${LOCALBASE}/include" \
PREFIX="${LOCALBASE}" \
PYTHON_BIN_PATH=${PYTHON_CMD} \
PYTHON_LIB_PATH="${PYTHON_SITELIBDIR}" \