%global pkgvers 1 %global scdate0 20220513 %global schash0 bb1473a4b38b18268e8693044afdb8635bc8351b %global branch0 main %global source0 https://github.com/pytorch/tensorpipe.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: tensorpipe Version: 0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Tensor-aware channel to transfer License: BSD URL: https://github.com/pytorch/tensorpipe BuildRequires: cmake gcc-c++ git libnop-devel libuv-devel %global vcu_maj 11 %global vcu_min 6 %global gpu_target_arch "3.5+PTX 6.1" %global __cmake_in_source_build 1 BuildRequires: cuda-nvcc-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-cudart-devel-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-nvml-devel-%{vcu_maj}-%{vcu_min} %description The TensorPipe project provides a tensor-aware channel to transfer rich objects from one process to another while using the fastest transport for the tensors contained therein (e.g., CUDA device-to-device copy). %package devel Summary: Development files Requires: %{name} = %{version}-%{release} %description devel This package contains the development files for %{name}. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller %build # remove external rm -rf third_party # soversion sed -i 's|INDEPENDENT_CODE 1|INDEPENDENT_CODE 1 SOVERSION 1 VERSION 1.0|' tensorpipe/CMakeLists.txt # extern pybind11 mkdir -p third_party/pybind11 echo 'find_package(pybind11 REQUIRED)' > third_party/pybind11/CMakeLists.txt mkdir build pushd build %cmake .. \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-%{vcu_maj}.%{vcu_min} \ -DTP_USE_CUDA=ON \ -DTP_BUILD_PYTHON=OFF make %{?_smp_mflags} popd %install rm -rf %{buildroot} pushd build make install DESTDIR=%{buildroot} popd mkdir -p %{buildroot}%{_includedir} install -D -pm 644 build/%{name}/config.h \ %{buildroot}/%{_includedir}/%{name}/config.h for f in `find %{name} -type f -name '*.h'`; do install -D -pm 644 $f %{buildroot}/%{_includedir}/$f done %files %license LICENSE.txt %doc README.md %{_libdir}/lib*.so.* %files devel %license LICENSE.txt %doc README.md %{_includedir}/* %{_libdir}/lib*.so %{_datadir}/cmake/* %changelog * Fri Sep 25 2020 Cristian Balint - github update releases