tensorflow/tensorflow.spec

104 lines
5.2 KiB
RPMSpec
Raw Permalink Normal View History

%global _empty_manifest_terminate_build 0
2022-06-23 13:28:29 +08:00
Name: tensorflow
2023-09-13 14:32:35 +08:00
Version: 2.12.1
Release: 2
2022-06-23 13:28:29 +08:00
Summary: An Open Source Machine Learning Framework for Everyone
License: Apache License 2.0
URL: https://www.tensorflow.org/
Source0: https://github.com/tensorflow/tensorflow/archive/v%{version}.tar.gz#/tensorflow-%{version}.tar.gz
Source1: external.tar.bz2.partaa
Source2: external.tar.bz2.partab
Source3: external.tar.bz2.partac
Patch0: modify-deps-on-libclang-gcsfs-gast.patch
2023-09-13 14:32:35 +08:00
Patch1: fix-boringssl-compile.patch
%ifarch aarch64
Patch1000: aarch64_external_files.patch
%endif
Requires: python3-future python3-numpy python3-six python3-astunparse python3-google-pasta python3-opt-einsum
Requires: python3-typing-extensions python3-wrapt python3-h5py python3-protobuf python3-grpcio python3-absl-py
Requires: python3-flatbuffers python3-gast
%description
TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML-powered applications.
TensorFlow was originally developed by researchers and engineers working on the Google Brain team within Google's Machine Intelligence Research organization to conduct machine learning and deep neural networks research. The system is general enough to be applicable in a wide variety of other domains, as well.
TensorFlow provides stable Python and C++ APIs, as well as non-guaranteed backward compatible API for other languages.
%package -n python3-tensorflow
2022-06-23 13:28:29 +08:00
Summary: An Open Source Machine Learning Framework for Everyone
Provides: python-tensorflow
Provides: python%{python3_version}dist(tensorflow) = %{version}
2023-09-13 14:32:35 +08:00
BuildRequires: bazel == 5.3.0 gcc gcc-c++ git
BuildRequires: python3-numpy python3-devel python3-Keras-Preprocessing python3-pip python3-wheel python3-packaging python3-requests
%description -n python3-tensorflow
TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML-powered applications.
TensorFlow was originally developed by researchers and engineers working on the Google Brain team within Google's Machine Intelligence Research organization to conduct machine learning and deep neural networks research. The system is general enough to be applicable in a wide variety of other domains, as well.
TensorFlow provides stable Python and C++ APIs, as well as non-guaranteed backward compatible API for other languages.
%prep
%setup -n %{name}-%{version}
%patch 0 -p1
%patch 1 -p1
extdir=$(bazel --output_user_root=`pwd`/../output_user_root info output_base)
mkdir -p ${extdir}
2023-09-13 14:32:35 +08:00
instdir=$(bazel --output_user_root=`pwd`/../output_user_root info install_base)
cat %{SOURCE1} %{SOURCE2} %{SOURCE3} > external.tar.bz2
tar xf external.tar.bz2 -C ${extdir}
2022-08-30 07:23:39 +00:00
%ifarch aarch64
%patch 1000 -p0 -d ${extdir}
%endif
2023-09-13 14:32:35 +08:00
ln -sfn ${instdir}/embedded_tools ${extdir}/external/bazel_tools
for f in $(find $extdir/external -lname "*/external/*"); do OLDLINK=$(readlink $f); echo $OLDLINK; NEWLINK=${extdir}/external/${OLDLINK#*external}; ln -sf $NEWLINK $f-newlink; mv -Tf $f-newlink $f; done
for f in $(find $extdir/external -lname "*/rpmbuild/*"); do OLDLINK=$(readlink $f); echo $OLDLINK; NEWLINK=${HOME}/rpmbuild/${OLDLINK#*rpmbuild}; ln -sf $NEWLINK $f-newlink; mv -Tf $f-newlink $f;done
#rm -rf ${extdir}/external/local_config*
%build
2022-06-23 13:28:29 +08:00
mkdir -p ${HOME}/.local/bin
ln -s -f -T $(command -v python3) ${HOME}/.local/bin/python
export PATH=${HOME}/.local/bin:$PATH
2023-09-13 14:32:35 +08:00
bazel --output_user_root=`pwd`/../output_user_root build --nofetch --host_copt=-Wno-stringop-truncation //tensorflow/tools/pip_package:build_pip_package --verbose_failures --experimental_local_memory_estimate --jobs=16
./bazel-bin/tensorflow/tools/pip_package/build_pip_package dist
%install
%py3_install_wheel *
%files -n python3-tensorflow
%{python3_sitearch}/*
%{_bindir}/*
%changelog
* Fri Jan 03 2025 misaka00251 <liuxin@iscas.ac.cn> - 2.12.1-2
- Use patch macro instead of patch command
* Tue Apr 02 2024 zhangxianting <zhangxianting@unionech.com> - 2.12.1-1
- Increase the upper limit version of typing_extensions to fix install, typing_extensions>=3.6.6,<4.6.0 to typing_extensions>=3.6.6,<=4.10.0
2023-09-13 14:32:35 +08:00
* Wed Sep 13 2023 Jincheng Miao <jincheng.miao@intel.com> - 2.12.1-0
- update version to 2.12.1
* Fri Apr 14 2023 ZhangChao <chaozhangm@isoftstone.com> - 2.10.0-3
- Fix EBS build
* Wed Nov 30 2022 Jincheng Miao <jincheng.miao@intel.com> - 2.10.0-2
- Modify dependency on gast
* Mon Nov 14 2022 Jincheng Miao <jincheng.miao@intel.com> - 2.10.0-1
- update version to 2.10.0 for oneDNN with AMX
* Thu Sep 22 2022 chendexi <chendexi@kylinos.cn> -2.8.2-3
- Add provides and fix build error
2022-08-30 07:23:39 +00:00
* Tue Aug 30 2022 zhangshaoning <zhangshaoning@uniontech.com> -2.8.2-2
- fix packaging issue
2022-06-23 13:28:29 +08:00
* Thu Jun 23 2022 zhangshaoning <zhangshaoning@uniontech.com> -2.8.2-1
- update version to 2.8.2
- fix some cves
* Wed Sep 30 2020 Zhipeng Xie<xiezhipeng1@huawei.com> - 2.3.1-1
- Package init