- Enable sle15_python_module_pythons.

- GCC 9.3 or newer is required, regardless if CUDA is enabled.
  See https://github.com/pytorch/pytorch/blob/v2.3.1/CMakeLists.txt#L48
  Therefore, for SLE15 we went with GCC 11 as it seems to be the most
  common one.
- Use %gcc_version macro for Tumbleweed.

OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-torch?expand=0&rev=36
This commit is contained in:
Guillaume GARDET 2024-08-31 09:11:26 +00:00 committed by Git OBS Bridge
parent c138972860
commit 62aba2ab6b
2 changed files with 24 additions and 23 deletions

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Aug 29 04:28:03 UTC 2024 - Guang Yee <gyee@suse.com>
- Enable sle15_python_module_pythons.
- GCC 9.3 or newer is required, regardless if CUDA is enabled.
See https://github.com/pytorch/pytorch/blob/v2.3.1/CMakeLists.txt#L48
Therefore, for SLE15 we went with GCC 11 as it seems to be the most
common one.
- Use %gcc_version macro for Tumbleweed.
-------------------------------------------------------------------
Thu Jul 11 09:37:17 UTC 2024 - Christian Goll <cgoll@suse.com>

View File

@ -75,6 +75,7 @@
%define sleef_version e0a003e
%define tensorpipe 52791a2
%{?sle15_python_module_pythons}
Name: python-torch%{?pkg_suffix}
Version: 2.3.1
Release: 0
@ -147,19 +148,17 @@ BuildRequires: %{python_module py-cpuinfo}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing_extensions}
BuildRequires: %{python_module typing}
%if 0%{?suse_version} <= 1500
# Python 3.6 still need dataclasses
BuildRequires: %{python_module dataclasses}
%ifarch aarch64
# XNNPACK uses +dotprod modifier which requires GCC8+
BuildRequires: gcc8
BuildRequires: gcc8-c++
%endif
%endif
BuildRequires: %{python_module dataclasses if %python-base < 3.7}
BuildRequires: cmake >= 3.5
BuildRequires: eigen3-devel
BuildRequires: fdupes
%if 0%{?suse_version} > 1500
BuildRequires: gcc-c++
%else
BuildRequires: gcc11
BuildRequires: gcc11-c++
%endif
BuildRequires: glog-devel
BuildRequires: gtest
BuildRequires: leveldb-devel
@ -182,10 +181,6 @@ BuildRequires: cuda-libraries-dev-%cudaver
BuildRequires: cuda-misc-headers-%cudaver
BuildRequires: cuda-nsight-%cudaver
BuildRequires: cuda-toolkit-%cudaver
%if 0%{?suse_version} > 1500
BuildRequires: gcc7
BuildRequires: gcc7-c++
%endif
BuildRequires: libcudnn7-devel
BuildRequires: libnccl-devel
%endif
@ -253,7 +248,6 @@ Conflicts: %{python_module torch-converters}
Conflicts: %{python_module torch-converters}
%endif
%description converters
Converter from caffe2 to onnx and from caffe2 to onnx formated files.
@ -332,20 +326,17 @@ rmdir tensorpipe/third_party/libnop
export C_INCLUDE_PATH="/usr/local/cuda-10.1/include" \
export LD_LIBRARY_PATH="/usr/local/cuda-10.1/lib" \
export NCCL_INCLUDE_DIR="/usr/include/" \
%if 0%{?suse_version} > 1500 \
export CC=gcc-7 \
export CXX=g++-7 \
%endif \
%else \
%if 0%{?suse_version} <= 1500 \
%ifarch aarch64 \
export CC=gcc-8 \
export CXX=g++-8 \
%endif \
%endif \
export USE_CUDA=OFF \
export USE_CUDNN=OFF \
%endif \
%if 0%{?suse_version} > 1500 \
export CC=gcc-%gcc_version \
export CXX=g++-%gcc_version \
%else \
export CC=gcc-11 \
export CXX=g++-11 \
%endif \
export USE_KINETO=OFF \
export USE_LEVELDB=ON \
export USE_LMDB=ON \