Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:frispete:ML
python-torch
python-torch.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File python-torch.spec of Package python-torch
# # spec file for package python-torch # # Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define srcname pytorch %define skip_python2 1 %define skip_python36 1 %define pname torch %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "standard" %bcond_with cuda %endif %if "%{flavor}" == "cuda-10-2" %bcond_without cuda %define cudaver 10-2 %endif %define gccver %{nil} %if %{with cuda} %if 0%{?suse_version} > 1500 %define gccver 7 %endif %else # non cuda enabled builds %ifarch x86_64 %if 0%{?suse_version} > 1500 # Use GCC10 until fixed - https://github.com/google/XNNPACK/issues/1550 %define gccver 12 %endif %endif %if 0%{?suse_version} <= 1500 %ifarch aarch64 # XNNPACK uses +dotprod modifier which requires GCC8+ %define gccver 8 %endif %endif %endif Name: python-torch Version: 1.13.0 Release: 0 Summary: Deep learning framework aka pytorch/Caffe2 License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND Zlib AND BSL-1.0 Group: Development/Languages/Python URL: https://pytorch.org Source0: https://github.com/pytorch/pytorch/archive/v%{version}.tar.gz#/%{srcname}-v%{version}.tar.gz Source1: releases.html ExcludeArch: %ix86 %{arm} BuildRequires: %{python_module Gloo} %ifarch x86_64 BuildRequires: %{python_module PeachPy} %endif BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module devel} BuildRequires: %{python_module future} BuildRequires: %{python_module hypothesis} BuildRequires: %{python_module leveldb} BuildRequires: %{python_module numpy-devel} BuildRequires: %{python_module opcodes} BuildRequires: %{python_module protobuf} BuildRequires: %{python_module psutil} 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} %endif BuildRequires: cmake >= 3.5 BuildRequires: eigen3-devel BuildRequires: fdupes BuildRequires: gcc%{gccver} BuildRequires: gcc%{gccver}-c++ BuildRequires: glog-devel BuildRequires: gtest BuildRequires: leveldb-devel BuildRequires: libnuma-devel BuildRequires: libopenblas_pthreads-devel BuildRequires: lmdb-devel BuildRequires: ninja BuildRequires: openblas-devel BuildRequires: openssl-devel BuildRequires: protobuf-c BuildRequires: protobuf-devel BuildRequires: python-rpm-macros BuildRequires: snappy-devel %if %{with cuda} BuildRequires: cuda-compiler-%cudaver BuildRequires: cuda-cudart-dev-%cudaver BuildRequires: cuda-libraries-dev-%cudaver BuildRequires: cuda-misc-headers-%cudaver BuildRequires: cuda-nsight-%cudaver BuildRequires: cuda-toolkit-%cudaver BuildRequires: libcudnn7-devel BuildRequires: libnccl-devel %endif Requires: python-future Requires: python-leveldb Requires: python-numpy Requires: python-protobuf Requires: python-six # converter requirements (cannot be split due to python_alternative limitations Requires: python-click Requires: python-onnx Requires: python-pip Requires: python-pname Provides: python-caffe2 = %version Provides: python-pytorch = %version Requires(post): update-alternatives Requires(preun):update-alternatives %if "%flavor" == "" ExclusiveArch: do_not_build %endif %python_subpackages %description PyTorch enables fast, flexible experimentation and efficient production through a hybrid front-end, distributed training, and ecosystem of tools and libraries. The library is developed by Facebook and other groups. PyTorch provides two high-level features: * Tensor computing (like NumPy) with strong acceleration via graphics * processing units (GPU) Deep neural networks built on a tape-based autodiff system %package devel Summary: Headers for C/C++, cmake build description and libraries needed for development Group: Development/Languages/Python Requires: python-torch = %{version} %description devel Although the Python interface is more polished and the primary focus of development, PyTorch also has a C++ frontend. This package contains the header to access the C/C++ interface. %package -n pytorch-examples Summary: Examples which can be used for testing Group: Development/Languages/Python BuildArch: noarch Recommends: python3-lmdb Recommends: python3-networkx %description -n pytorch-examples This example files can be used to start an own pytorch/caffe2 project. %package -n libtorch Summary: Library which used by %{name} Group: Development/Libraries/Python %description -n libtorch Library which is used by %{name} %prep %setup -q -n %{srcname}-v%{version} cp %{S:1} releases.html %autopatch -p 1 cd third_party for pkg in python-peachpy; do rm -r $pkg done %build %define buildvars \ export USE_NNPACK=OFF \ %if %{with cuda} \ export USE_CUDA=ON \ export USE_CUDNN=ON \ export USE_SYSTEM_NCCL=ON \ export PATH="/usr/local/cuda-10.1/bin:$PATH" \ export CPLUS_INCLUDE_PATH="/usr/local/cuda-10.1/include" \ 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/" \ %else \ export USE_CUDA=OFF \ export USE_CUDNN=OFF \ %endif \ %if %{?gccver} \ export CC=gcc-%{gccver} \ export CXX=g++-%{gccver} \ %endif \ export USE_KINETO=OFF \ export USE_DISTRIBUTED=OFF \ export USE_TEST=OFF \ export USE_LEVELDB=ON \ export USE_LMDB=ON \ export USE_FBGEMM=OFF \ export USE_SYSTEM_BENCHMARK=ON \ export USE_SYSTEM_EIGEN_INSTALL=ON \ export USE_TBB=OFF \ export BUILD_CUSTOM_PROTOBUF=OFF \ export BUILD_TEST=OFF \ export MAX_JOBS=%{?jobs} \ %buildvars %python_build %install %buildvars %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %python_clone -a %{buildroot}%{_bindir}/torchrun %python_clone -a %{buildroot}%{_bindir}/convert-caffe2-to-onnx %python_clone -a %{buildroot}%{_bindir}/convert-onnx-to-caffe2 install -m 755 -D caffe2/python/examples/* -t %{buildroot}%{_docdir}/%{name}/ install -m 644 -D %{buildroot}%{python_sitearch}/torch/lib/* %{buildroot}/%{_libdir} %post %python_install_alternative torchrun %python_install_alternative convert-caffe2-to-onnx %python_install_alternative convert-onnx-to-caffe2 %postun %python_uninstall_alternative torchrun %python_uninstall_alternative convert-caffe2-to-onnx %python_uninstall_alternative convert-onnx-to-caffe2 %post -n libtorch -p /sbin/ldconfig %postun -n libtorch -p /sbin/ldconfig %files %{python_files} %defattr(-,root,root) %doc README.md NOTICE releases.html %license LICENSE %{python_sitearch}/caffe2/ %{python_sitearch}/functorch/ %{python_sitearch}/torch/ %{python_sitearch}/torch-*.egg-info/ %{python_sitearch}/torchgen/ %exclude %{python_sitearch}/torch/share %exclude %{python_sitearch}/torch/include %python_alternative %{_bindir}/torchrun %python_alternative %{_bindir}/convert-caffe2-to-onnx %python_alternative %{_bindir}/convert-onnx-to-caffe2 %files %{python_files devel} %{python_sitearch}/torch/share %{python_sitearch}/torch/include %files -n pytorch-examples %{_docdir}/%{name} %files -n libtorch %{_libdir}/*.so* %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor