From 62aba2ab6b4dd76370487616517d6054e728cf0c56f85e1e04296feae82e3a87 Mon Sep 17 00:00:00 2001 From: Guillaume GARDET Date: Sat, 31 Aug 2024 09:11:26 +0000 Subject: [PATCH] - 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 --- python-torch.changes | 10 ++++++++++ python-torch.spec | 37 ++++++++++++++----------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/python-torch.changes b/python-torch.changes index b65a3dc..56300fe 100644 --- a/python-torch.changes +++ b/python-torch.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Aug 29 04:28:03 UTC 2024 - Guang Yee + +- 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 diff --git a/python-torch.spec b/python-torch.spec index e39c92e..57441bd 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -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 \