Skip to content

Commit

Permalink
Cleanup lint, fix prompting, fix FreeBSD 12 issues
Browse files Browse the repository at this point in the history
Ran portlint, portclippy and portfmt.
Recreated patches with make makepatch
Add additional required pre-build downloads from github
Add OpenCL Sycl support
Use memory usage reducing flags for bazel. They are all to do with
reducing the time taken for incremental builds, which is not relevant
when building ports.
Add TF_NEED_MPT=0 to stop prompting
Add -march=native -Wno-sign-compare flags for CC
  • Loading branch information
psa committed Jun 7, 2022
1 parent 851be66 commit 8c2b777
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 76 deletions.
180 changes: 119 additions & 61 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,84 +1,136 @@
PORTNAME= libtensorflow1
DISTVERSIONPREFIX= v
DISTVERSION= 1.15.5
PORTNAME= libtensorflow1
DISTVERSIONPREFIX= v
DISTVERSION= 1.15.5
DISTVERSIONSUFFIX=
CATEGORIES= science
CATEGORIES= science

MAINTAINER= freebsd-ports@otoh.org
COMMENT= C API for TensorFlow, an open source platform for machine learning
MAINTAINER= freebsd-ports@otoh.org
COMMENT= C API for TensorFlow, an open source platform for machine learning

LICENSE= APACHE20 THIRD_PARTY_TF_C_LICENSES
LICENSE_COMB= multi
LICENSE_NAME_THIRD_PARTY_TF_C_LICENSES= Third-Party TensorFlow C Licenses
LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE
LICENSE_FILE_THIRD_PARTY_TF_C_LICENSES= ${WRKDIR}/THIRD_PARTY_TF_C_LICENSES
LICENSE_PERMS_THIRD_PARTY_TF_C_LICENSES= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
LICENSE= APACHE20 THIRD_PARTY_TF_C_LICENSES
LICENSE_COMB= multi
LICENSE_NAME_THIRD_PARTY_TF_C_LICENSES= Third-Party TensorFlow C Licenses
LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE
LICENSE_FILE_THIRD_PARTY_TF_C_LICENSES= ${WRKDIR}/THIRD_PARTY_TF_C_LICENSES
LICENSE_PERMS_THIRD_PARTY_TF_C_LICENSES= dist-mirror dist-sell \
pkg-mirror pkg-sell auto-accept

CONFLICTS_INSTALL= science/libtensorflow2
ONLY_FOR_ARCHS= amd64

ONLY_FOR_ARCHS= amd64

BUILD_DEPENDS= bash:shells/bash \
BUILD_DEPENDS= bash:shells/bash \
bazel:devel/bazel029 \
git:devel/git

USES= gmake python:3.7-3.9,build
BINARY_ALIAS= python3=${PYTHON_CMD}
BINARY_ALIAS+= python=${PYTHON_CMD}

USE_GITHUB= yes
GH_ACCOUNT= tensorflow
GH_PROJECT= tensorflow

USE_LDCONFIG= yes

OPTIONS_DEFINE= CUDA ROCM XLA

OPTIONS_SINGLE= CPUFEATURE
OPTIONS_SINGLE_CPUFEATURE= NOAVX AVX AVX2

NOAVX_DESC= Disable Advanced Vector Extensions
AVX_DESC= Enable Advanced Vector Extensions (AVX)
AVX2_DESC= Enable Advanced Vector Extensions v2 (AVX2)

NOAVX_VARS= BAZEL_ARGS=""
AVX_VARS= BAZEL_ARGS="--copt=-march=core-avx-i --host_copt=-march=core-avx-i"
AVX2_VARS= BAZEL_ARGS="--copt=-march=core-avx2 --host_copt=-march=core-avx2"

CUDA_DESC= Enable Compute Unified Device Architecture (CUDA) for Nvidia GPUs
CUDA_VARS= TF_ENABLE_CUDA=1
CUDA_VARS_OFF= TF_ENABLE_CUDA=0

ROCM_DESC= Enable Radeon Open Computer (ROCm) for AMD GPUs
ROCM_VARS= TF_ENABLE_ROCM=1
ROCM_VARS_OFF= TF_ENABLE_ROCM=0

XLA_DESC= Enable Accelerated Linear Algebra (XLA)
XLA_VARS= TF_ENABLE_XLA=1
XLA_VARS_OFF= TF_ENABLE_XLA=0

OPTIONS_DEFAULT= AVX

BAZEL_OPTS= --output_user_root=${WRKDIR}/bazel_out
CC?= clang
git:devel/git

USES= gmake python:3.7-3.9,build

USE_GITHUB= yes
GH_ACCOUNT= tensorflow
GH_PROJECT= tensorflow
GH_TUPLE= bazelbuild:rules_closure:308b05b2:bazelbuild_rules_closure \
intel:mkl-dnn:v0.20.6:intel_mkl_dnn_0 \
intel:mkl-dnn:v1.0-pc2:intel_mkl_dnn_1 \
abseil:abseil-cpp:43ef2148c0936ebf7cb4be6b19927a9d9d145b8f:abseil_abseil_cpp \
rvagg:rpi-newer-crosstools:eb68350c5c8ec1663b7fe52c742ac4271e3217c5:rvagg_rpi_newer_crosstools \
hfp:libxsmm:1.11:hfp_libxsmm \
google:re2:506cfa4bffd060c06ec338ce50ea3468daa6c814:google_re2 \
googleapis:google-cloud-cpp:v0.10.0:googleapis_google_cloud_cpp \
googleapis:googleapis:f81082ea1e2f85c43649bee26e0d9871d4b41cdb:googleapis_googleapis \
google:gemmlowp:12fed0cd7cfcd9e169bf1925bc3a7a58725fdcc3:google_gemmlowp \
google:farmhash:816a4ae622e964763ca0862d9dbd19324a1eaf45:google_farmhash \
glennrp:libpng:v1.6.37:glennrp_libpng \
abseil:abseil-py:pypi-v0.7.1:abseil_abseil_py \
protocolbuffers:protobuf:310ba5ee72661c081129eb878c1bbcec936b20f0:protocolbuffers_protobuf \
google:nsync:1.22.0:google_nsync \
google:googletest:b6cd405286ed8635ece71c72f118e659f4ade3fb:google_googletest \
gflags:gflags:v2.2.1:gflags_gflags \
grpc:grpc:4566c2a29ebec0835643b972eb99f4306c4234a3:grpc_grpc \
nanopb:nanopb:f8ac463766281625ad710900479130c7fcb4d63b:nanopb_nanopb \
antirez:linenoise:c894b9e59f02203dbe4e2be657572cf88c4230c3:antirez_linenoise \
llvm-mirror:llvm:7a7e03f906aada0cf4b749b51213fe5784eeff84:llvm_mirror_llvm \
LMDB:lmdb:LMDB_0.9.22:LMDB_lmdb \
open-source-parsers:jsoncpp:1.8.4:open_source_parsers_jsoncpp \
google:boringssl:7f634429a04abc48e2eb041c81c5235816c96514:google_boringssl \
google:snappy:1.1.7:google_snappy \
nvidia:nccl:0ceaec9cee96ae7658aa45686853286651f36384:nvidia_nccl \
edenhill:librdkafka:v0.11.5:edenhill_librdkafka \
google:pprof:c0fb62ec88c411cc91194465e54db2632845b650:google_pprof \
NVlabs:cub:1.8.0:NVlabs_cub \
ROCmSoftwarePlatform:rocPRIM:4a33d328f8352df1654271939da66914f2334424:ROCmSoftwarePlatform_rocPRIM \
cython:cython:0.28.4:cython_cython \
intel:ARM_NEON_2_x86_SSE:1200fe90bb174a6224a525ee60148671a786a71f:intel_ARM_NEON_2_x86_SSE \
google:double-conversion:3992066a95b823efc8ccc1baf82a1cfc73f6e9b8:google_double_conversion \
bazelbuild:rules_android:v0.1.1:bazelbuild_rules_android \
01org:tbb:2019_U1:01org_tbb \
NervanaSystems:ngraph:v0.11.0:NervanaSystems_ngraph \
nlohmann:json:v3.4.0:nlohmann_json \
NervanaSystems:ngraph-tf:v0.9.0:NervanaSystems_ngraph_tf \
pybind:pybind11:v2.3.0:pybind_pybind11 \
GrahamDumpleton:wrapt:1.11.1:GrahamDumpleton_wrapt

USE_LDCONFIG= yes

CONFLICTS_INSTALL= science/libtensorflow2

CC?= clang

BINARY_ALIAS= python3=${PYTHON_CMD} python=${PYTHON_CMD}

OPTIONS_DEFINE= CUDA OPENCL_SYCL ROCM XLA
OPTIONS_DEFAULT= AVX

OPTIONS_SINGLE= CPUFEATURE
OPTIONS_SINGLE_CPUFEATURE= AVX AVX2 NOAVX

NOAVX_DESC= Disable Advanced Vector Extensions
AVX_DESC= Enable Advanced Vector Extensions (AVX)
AVX2_DESC= Enable Advanced Vector Extensions v2 (AVX2)

NOAVX_VARS= BAZEL_ARGS=""
AVX_VARS= BAZEL_ARGS="--copt=-march=core-avx-i --host_copt=-march=core-avx-i"
AVX2_VARS= BAZEL_ARGS="--copt=-march=core-avx2 --host_copt=-march=core-avx2"

CUDA_DESC= Enable Compute Unified Device Architecture (CUDA) for Nvidia GPUs
CUDA_VARS= TF_ENABLE_CUDA=1
CUDA_VARS_OFF= TF_ENABLE_CUDA=0

OPENCL_SYCL_DESC= Enable OpenCL Sycl
OPENCL_SYCL_VARS= TF_NEED_OPENCL_SYCL=1
OPENCL_SYCL_VARS_OFF= TF_NEED_OPENCL_SYCL=0

ROCM_DESC= Enable Radeon Open Computer (ROCm) for AMD GPUs
ROCM_VARS= TF_ENABLE_ROCM=1
ROCM_VARS_OFF= TF_ENABLE_ROCM=0

XLA_DESC= Enable Accelerated Linear Algebra (XLA)
XLA_VARS= TF_ENABLE_XLA=1
XLA_VARS_OFF= TF_ENABLE_XLA=0

BAZEL_OPTS= --output_user_root=${WRKDIR}/bazel_out

.include <bsd.port.options.mk>
.if ${OPSYS} == FreeBSD && ${OSVERSION} > 1200000 && ${OSVERSION} < 1300000
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-third_party_repo.bzl
.endif

post-extract:
# THIRD_PARTY_TF_C_LICENSES is generated as a Bazel build target (see
# //tensorflow/tools/lib_package:clicenses) and the empty file written
# here will be overwritten. Creation of this file is to satisfy checks.
# THIRD_PARTY_TF_C_LICENSES is generated as a Bazel build target (see
# //tensorflow/tools/lib_package:clicenses) and the empty file written
# here will be overwritten. Creation of this file is to satisfy checks.
@${TOUCH} ${WRKDIR}/THIRD_PARTY_TF_C_LICENSES

do-configure:
@cd ${WRKSRC} && ${SETENV} \
CC_OPT_FLAGS="-I${LOCALBASE}/include" \
CC_OPT_FLAGS="-I${LOCALBASE}/include -march=native -Wno-sign-compare" \
PREFIX="${LOCALBASE}" \
PYTHON_BIN_PATH=${PYTHON_CMD} \
PYTHON_LIB_PATH="${PYTHON_SITELIBDIR}" \
TF_CONFIGURE_IOS=0 \
TF_DOWNLOAD_CLANG=0 \
TF_NEED_OPENCL_SYCL=${TF_NEED_OPENCL_SYCL} \
TF_ENABLE_XLA=${TF_ENABLE_XLA} \
TF_IGNORE_MAX_BAZEL_VERSION=0 \
TF_NEED_CUDA=${TF_ENABLE_CUDA} \
TF_NEED_MPI=0 \
TF_NEED_ROCM=${TF_ENABLE_ROCM} \
TF_NEED_TENSORRT=0 \
TF_SET_ANDROID_WORKSPACE=0 \
Expand All @@ -88,9 +140,12 @@ do-build:
@cd ${WRKSRC} && ${LOCALBASE}/bin/bazel ${BAZEL_OPTS} build \
${BAZEL_ARGS} \
--action_env=PATH=${PATH} \
--discard_analysis_cache \
--local_cpu_resources=${MAKE_JOBS_NUMBER} \
--nokeep_state_after_build \
--noshow_loading_progress \
--noshow_progress \
--notrack_incremental_state \
--subcommands \
--verbose_failures \
//tensorflow/tools/lib_package:clicenses_generate \
Expand All @@ -100,9 +155,12 @@ do-test:
@cd ${WRKSRC} && ${LOCALBASE}/bin/bazel ${BAZEL_OPTS} test \
${BAZEL_ARGS} \
--action_env=PATH=${PATH} \
--discard_analysis_cache \
--local_cpu_resources=${MAKE_JOBS_NUMBER} \
--nokeep_state_after_build \
--noshow_loading_progress \
--noshow_progress \
--notrack_incremental_state \
--subcommands \
--test_env=CC=${CC} \
--verbose_failures \
Expand Down
82 changes: 81 additions & 1 deletion distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
TIMESTAMP = 1640438990
TIMESTAMP = 1653669876
SHA256 (tensorflow-tensorflow-v1.15.5_GH0.tar.gz) = 4c4d23e311093ded2d2e287b18d7c45b07b5984ab88a1d2f91f8f13c886123db
SIZE (tensorflow-tensorflow-v1.15.5_GH0.tar.gz) = 46212258
SHA256 (bazelbuild-rules_closure-308b05b2_GH0.tar.gz) = f86606a15709a381fa85a0ec0fb1a99c28359aa171e3827f071b702fc6c82ef8
SIZE (bazelbuild-rules_closure-308b05b2_GH0.tar.gz) = 465163
SHA256 (intel-mkl-dnn-v0.20.6_GH0.tar.gz) = f1de676fddeb94132c5ae480fb03a64f03deda10b09b3141373f2b2fe5cd031d
SIZE (intel-mkl-dnn-v0.20.6_GH0.tar.gz) = 1680817
SHA256 (intel-mkl-dnn-v1.0-pc2_GH0.tar.gz) = 7ea70b5ec4b1604d494dc28c83f2de62cfbf956c5043d10c853ee7193d0e33bd
SIZE (intel-mkl-dnn-v1.0-pc2_GH0.tar.gz) = 1662300
SHA256 (abseil-abseil-cpp-43ef2148c0936ebf7cb4be6b19927a9d9d145b8f_GH0.tar.gz) = acd93f6baaedc4414ebd08b33bebca7c7a46888916101d8c0b8083573526d070
SIZE (abseil-abseil-cpp-43ef2148c0936ebf7cb4be6b19927a9d9d145b8f_GH0.tar.gz) = 1281523
SHA256 (rvagg-rpi-newer-crosstools-eb68350c5c8ec1663b7fe52c742ac4271e3217c5_GH0.tar.gz) = b9e7d50ffd9996ed18900d041d362c99473b382c0ae049b2fce3290632d2656f
SIZE (rvagg-rpi-newer-crosstools-eb68350c5c8ec1663b7fe52c742ac4271e3217c5_GH0.tar.gz) = 253600426
SHA256 (hfp-libxsmm-1.11_GH0.tar.gz) = 5fc1972471cd8e2b8b64ea017590193739fc88d9818e3d086621e5c08e86ea35
SIZE (hfp-libxsmm-1.11_GH0.tar.gz) = 2931544
SHA256 (google-re2-506cfa4bffd060c06ec338ce50ea3468daa6c814_GH0.tar.gz) = d070e2ffc5476c496a6a872a6f246bfddce8e7797d6ba605a7c8d72866743bf9
SIZE (google-re2-506cfa4bffd060c06ec338ce50ea3468daa6c814_GH0.tar.gz) = 316237
SHA256 (googleapis-google-cloud-cpp-v0.10.0_GH0.tar.gz) = fd0c3e3b50f32af332b53857f8cd1bfa009e33d1eeecabc5c79a4825d906a90c
SIZE (googleapis-google-cloud-cpp-v0.10.0_GH0.tar.gz) = 2189161
SHA256 (googleapis-googleapis-f81082ea1e2f85c43649bee26e0d9871d4b41cdb_GH0.tar.gz) = eca9b62c8571ab251f9b3e8db26d9f48bef3ae714f02371782e872b146cc3b0e
SIZE (googleapis-googleapis-f81082ea1e2f85c43649bee26e0d9871d4b41cdb_GH0.tar.gz) = 692444
SHA256 (google-gemmlowp-12fed0cd7cfcd9e169bf1925bc3a7a58725fdcc3_GH0.tar.gz) = ab3873363ed63cd0090bd4e59dc29e63ecce9d84e66093083e5fda2cac14e74b
SIZE (google-gemmlowp-12fed0cd7cfcd9e169bf1925bc3a7a58725fdcc3_GH0.tar.gz) = 838386
SHA256 (google-farmhash-816a4ae622e964763ca0862d9dbd19324a1eaf45_GH0.tar.gz) = 6560547c63e4af82b0f202cb710ceabb3f21347a4b996db565a411da5b17aba0
SIZE (google-farmhash-816a4ae622e964763ca0862d9dbd19324a1eaf45_GH0.tar.gz) = 467122
SHA256 (glennrp-libpng-v1.6.37_GH0.tar.gz) = ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307
SIZE (glennrp-libpng-v1.6.37_GH0.tar.gz) = 1508805
SHA256 (abseil-abseil-py-pypi-v0.7.1_GH0.tar.gz) = 3d0f39e0920379ff1393de04b573bca3484d82a5f8b939e9e83b20b6106c9bbe
SIZE (abseil-abseil-py-pypi-v0.7.1_GH0.tar.gz) = 215669
SHA256 (protocolbuffers-protobuf-310ba5ee72661c081129eb878c1bbcec936b20f0_GH0.tar.gz) = b9e92f9af8819bbbc514e2902aec860415b70209f31dfc8c4fa72515a5df9d59
SIZE (protocolbuffers-protobuf-310ba5ee72661c081129eb878c1bbcec936b20f0_GH0.tar.gz) = 4939334
SHA256 (google-nsync-1.22.0_GH0.tar.gz) = caf32e6b3d478b78cff6c2ba009c3400f8251f646804bcb65465666a9cea93c4
SIZE (google-nsync-1.22.0_GH0.tar.gz) = 154997
SHA256 (google-googletest-b6cd405286ed8635ece71c72f118e659f4ade3fb_GH0.tar.gz) = 8d9aa381a6885fe480b7d0ce8ef747a0b8c6ee92f99d74ab07e3503434007cb0
SIZE (google-googletest-b6cd405286ed8635ece71c72f118e659f4ade3fb_GH0.tar.gz) = 964196
SHA256 (gflags-gflags-v2.2.1_GH0.tar.gz) = ae27cdbcd6a2f935baa78e4f21f675649271634c092b1be01469440495609d0e
SIZE (gflags-gflags-v2.2.1_GH0.tar.gz) = 96985
SHA256 (grpc-grpc-4566c2a29ebec0835643b972eb99f4306c4234a3_GH0.tar.gz) = 67a6c26db56f345f7cee846e681db2c23f919eba46dd639b09462d1b6203d28c
SIZE (grpc-grpc-4566c2a29ebec0835643b972eb99f4306c4234a3_GH0.tar.gz) = 14793534
SHA256 (nanopb-nanopb-f8ac463766281625ad710900479130c7fcb4d63b_GH0.tar.gz) = 8bbbb1e78d4ddb0a1919276924ab10d11b631df48b657d960e0c795a25515735
SIZE (nanopb-nanopb-f8ac463766281625ad710900479130c7fcb4d63b_GH0.tar.gz) = 223184
SHA256 (antirez-linenoise-c894b9e59f02203dbe4e2be657572cf88c4230c3_GH0.tar.gz) = 7f51f45887a3d31b4ce4fa5965210a5e64637ceac12720cfce7954d6a2e812f7
SIZE (antirez-linenoise-c894b9e59f02203dbe4e2be657572cf88c4230c3_GH0.tar.gz) = 17373
SHA256 (llvm-mirror-llvm-7a7e03f906aada0cf4b749b51213fe5784eeff84_GH0.tar.gz) = 599b89411df88b9e2be40b019e7ab0f7c9c10dd5ab1c948cd22e678cc8f8f352
SIZE (llvm-mirror-llvm-7a7e03f906aada0cf4b749b51213fe5784eeff84_GH0.tar.gz) = 50144723
SHA256 (LMDB-lmdb-LMDB_0.9.22_GH0.tar.gz) = f3927859882eb608868c8c31586bb7eb84562a40a6bf5cc3e13b6b564641ea28
SIZE (LMDB-lmdb-LMDB_0.9.22_GH0.tar.gz) = 143468
SHA256 (open-source-parsers-jsoncpp-1.8.4_GH0.tar.gz) = c49deac9e0933bcb7044f08516861a2d560988540b23de2ac1ad443b219afdb6
SIZE (open-source-parsers-jsoncpp-1.8.4_GH0.tar.gz) = 200226
SHA256 (google-boringssl-7f634429a04abc48e2eb041c81c5235816c96514_GH0.tar.gz) = 1188e29000013ed6517168600fc35a010d58c5d321846d6a6dfee74e4c788b45
SIZE (google-boringssl-7f634429a04abc48e2eb041c81c5235816c96514_GH0.tar.gz) = 25868122
SHA256 (google-snappy-1.1.7_GH0.tar.gz) = 3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4
SIZE (google-snappy-1.1.7_GH0.tar.gz) = 1090550
SHA256 (nvidia-nccl-0ceaec9cee96ae7658aa45686853286651f36384_GH0.tar.gz) = 9a7633e224982e2b60fa6b397d895d20d6b7498e3e02f46f98a5a4e187c5a44c
SIZE (nvidia-nccl-0ceaec9cee96ae7658aa45686853286651f36384_GH0.tar.gz) = 107044
SHA256 (edenhill-librdkafka-v0.11.5_GH0.tar.gz) = cc6ebbcd0a826eec1b8ce1f625ffe71b53ef3290f8192b6cae38412a958f4fd3
SIZE (edenhill-librdkafka-v0.11.5_GH0.tar.gz) = 1984510
SHA256 (google-pprof-c0fb62ec88c411cc91194465e54db2632845b650_GH0.tar.gz) = e0928ca4aa10ea1e0551e2d7ce4d1d7ea2d84b2abbdef082b0da84268791d0c4
SIZE (google-pprof-c0fb62ec88c411cc91194465e54db2632845b650_GH0.tar.gz) = 176158
SHA256 (NVlabs-cub-1.8.0_GH0.tar.gz) = 025658f4c933cd2aa8cc88a559d013338d68de3fa639cc1f2b12cf61dc759667
SIZE (NVlabs-cub-1.8.0_GH0.tar.gz) = 384644
SHA256 (ROCmSoftwarePlatform-rocPRIM-4a33d328f8352df1654271939da66914f2334424_GH0.tar.gz) = 3c178461ead70ce6adb60c836a35a52564968af31dfa81f4157ab72b5f14d31f
SIZE (ROCmSoftwarePlatform-rocPRIM-4a33d328f8352df1654271939da66914f2334424_GH0.tar.gz) = 402443
SHA256 (cython-cython-0.28.4_GH0.tar.gz) = bccc9aa050ea02595b2440188813b936eaf345e85fb9692790cecfe095cf91aa
SIZE (cython-cython-0.28.4_GH0.tar.gz) = 1904011
SHA256 (intel-ARM_NEON_2_x86_SSE-1200fe90bb174a6224a525ee60148671a786a71f_GH0.tar.gz) = 213733991310b904b11b053ac224fee2d4e0179e46b52fe7f8735b8831e04dcc
SIZE (intel-ARM_NEON_2_x86_SSE-1200fe90bb174a6224a525ee60148671a786a71f_GH0.tar.gz) = 100612
SHA256 (google-double-conversion-3992066a95b823efc8ccc1baf82a1cfc73f6e9b8_GH0.tar.gz) = 8af4baef4c982e4016f5bdcec837c6704c180dc9f520b3c9e5d1e0530225e15a
SIZE (google-double-conversion-3992066a95b823efc8ccc1baf82a1cfc73f6e9b8_GH0.tar.gz) = 7019893
SHA256 (bazelbuild-rules_android-v0.1.1_GH0.tar.gz) = 6461c1c5744442b394f46645957d6bd3420eb1b421908fe63caa03091b1b3655
SIZE (bazelbuild-rules_android-v0.1.1_GH0.tar.gz) = 7076
SHA256 (01org-tbb-2019_U1_GH0.tar.gz) = e6fb8dd1a1ae834b4e5f4ae6c4c87a3362f81a3aaeddfa6325168c6cfee59391
SIZE (01org-tbb-2019_U1_GH0.tar.gz) = 2512568
SHA256 (NervanaSystems-ngraph-v0.11.0_GH0.tar.gz) = a1780f24a1381fc25e323b4b2d08b6ef5129f42e011305b2a34dcf43a48030d5
SIZE (NervanaSystems-ngraph-v0.11.0_GH0.tar.gz) = 9799087
SHA256 (nlohmann-json-v3.4.0_GH0.tar.gz) = c377963a95989270c943d522bfefe7b889ef5ed0e1e15d535fd6f6f16ed70732
SIZE (nlohmann-json-v3.4.0_GH0.tar.gz) = 114639868
SHA256 (NervanaSystems-ngraph-tf-v0.9.0_GH0.tar.gz) = f09474dc9c72b323d058bd99ba856172be81c99b8fdfada6b10cb88debec4205
SIZE (NervanaSystems-ngraph-tf-v0.9.0_GH0.tar.gz) = 208429
SHA256 (pybind-pybind11-v2.3.0_GH0.tar.gz) = 0f34838f2c8024a6765168227ba587b3687729ebf03dc912f88ff75c7aa9cfe8
SIZE (pybind-pybind11-v2.3.0_GH0.tar.gz) = 564520
SHA256 (GrahamDumpleton-wrapt-1.11.1_GH0.tar.gz) = 8a6fb40e8f8b6a66b4ba81a4044c68e6a7b1782f21cfabc06fb765332b4c3e51
SIZE (GrahamDumpleton-wrapt-1.11.1_GH0.tar.gz) = 124773
25 changes: 25 additions & 0 deletions files/extra-patch-third_party_repo.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- third_party/repo.bzl.orig
+++ third_party/repo.bzl
@@ -62,13 +62,15 @@ def _repos_are_siblings():
return Label("@foo//bar").workspace_root.startswith("../")

# Apply a patch_file to the repository root directory
-# Runs 'git apply' on Unix, 'patch -p1' on Windows.
+# Runs 'patch -p1'
def _apply_patch(ctx, patch_file):
- if _is_windows(ctx):
- patch_command = ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)]
- else:
- patch_command = ["git", "apply", "-v", ctx.path(patch_file)]
- cmd = _wrap_bash_cmd(ctx, patch_command)
+ # Don't check patch on Windows, because patch is only available under bash.
+ if not _is_windows(ctx) and not ctx.which("patch"):
+ fail("patch command is not found, please install it")
+ cmd = _wrap_bash_cmd(
+ ctx,
+ ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)],
+ )
_execute_and_check_ret_code(ctx, cmd)

def _apply_delete(ctx, paths):

20 changes: 10 additions & 10 deletions files/patch-.bazelrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
--- .bazelrc.orig 2021-01-04 20:18:42.000000000 +0000
+++ .bazelrc 2021-12-25 17:26:39.181508000 +0000
@@ -195,7 +195,7 @@
--- .bazelrc.orig 2021-01-04 20:18:42 UTC
+++ .bazelrc
@@ -195,7 +195,7 @@ build:c++17 --cxxopt=-stdlib=libc++
build:c++1z --config=c++17

# Default paths for TF_SYSTEM_LIBS
-build --define=PREFIX=/usr
+build --define=PREFIX=/usr/local
build --define=LIBDIR=$(PREFIX)/lib
build --define=INCLUDEDIR=$(PREFIX)/include

@@ -208,6 +208,9 @@
@@ -208,6 +208,9 @@ build:short_logs --output_filter=DONT_MATCH_ANYTHING
# Instruction set optimizations
# TODO(gunan): Create a feature in toolchains for avx/avx2 to
# avoid having to define linux/win separately.
Expand All @@ -19,10 +19,10 @@
build:avx_linux --copt=-mavx
build:avx2_linux --copt=-mavx2
build:native_arch_linux --copt=-march=native
@@ -295,6 +298,20 @@
@@ -295,6 +298,20 @@ build:rbe_linux_py3 --repo_env=PYTHON_BIN_PATH="/usr/b
build:rbe_linux_py3 --python_path="/usr/bin/python3"
build:rbe_linux_py3 --repo_env=TF_PYTHON_CONFIG_REPO="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/py3"

+build:rbe_cpu_freebsd --config=rbe_cpu_linux
+build:rbe_freebsd_cuda_nvcc --config=rbe_linux_cuda_nvcc
+common:rbe_gpu_freebsd --config=rbe_gpu_linux
Expand All @@ -40,13 +40,13 @@
build:rbe_win --config=rbe
build:rbe_win --crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/win_1803/bazel_026:toolchain"
build:rbe_win --extra_execution_platforms="@org_tensorflow//third_party/toolchains/preconfig/win_1803:rbe_windows_1803"
@@ -334,6 +351,9 @@
@@ -334,6 +351,9 @@ common:tensorflow_testing_rbe_linux --remote_instance_
build:tensorflow_testing_rbe_linux --config=tensorflow_testing_rbe
build:tensorflow_testing_rbe_linux --config=rbe
build:tensorflow_testing_rbe_linux --config=rbe_linux
+
+common:tensorflow_testing_rbe_freebsd --config=tensorflow_testing_rbe_linux
+build:tensorflow_testing_rbe_freebsd --config=tensorflow_testing_rbe_linux

common:tensorflow_testing_rbe_win --remote_instance_name=projects/tensorflow-testing/instances/windows
build:tensorflow_testing_rbe_win --config=tensorflow_testing_rbe
Loading

0 comments on commit 8c2b777

Please sign in to comment.