Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions pytorch-cluster.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Source: git+https://github.com/%{github_user}/pytorch_cluster.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz

BuildRequires: cmake
Requires: pytorch
Requires: pytorch %{!?without_cuda:cuda}
%define build_flags -Wall -Wextra -pedantic %{?arch_build_flags}
%define cuda_arch_float $(echo %{cuda_arch} | tr ' ' '\\n' | sed -E 's|([0-9])$|.\\1|' | tr '\\n' ' ')

Expand All @@ -20,15 +20,15 @@ Requires: pytorch
grep -q 'CMAKE_CXX_STANDARD *14' CMakeLists.txt
sed -i -e 's|CMAKE_CXX_STANDARD *14|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' CMakeLists.txt

%build

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fwyzard , thanks for this fix. yes this section should have been part of %build otherwise USE_CUDA is not set

USE_CUDA=OFF
%if 0%{!?without_cuda:1}
if [ "%{cuda_gcc_support}" = "true" ] ; then
USE_CUDA=ON
fi
%endif

%build

rm -rf ../build && mkdir ../build && cd ../build

cmake ../%{n}-%{realversion} \
Expand All @@ -38,17 +38,13 @@ cmake ../%{n}-%{realversion} \
-DCMAKE_PREFIX_PATH="%{cmake_prefix_path}" \
-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \
-DCMAKE_CXX_FLAGS="%{build_flags}" \
-DBUILD_TEST=OFF \
-DWITH_PYTHON=OFF \
-DWITH_CUDA=OFF \
-DBUILD_TEST=OFF \
%if 0%{!?without_cuda:1}
-DUSE_CUDA=${USE_CUDA} \
-DWITH_CUDA=${USE_CUDA} \
-DTORCH_CUDA_ARCH_LIST="%{cuda_arch_float}" \
%endif
-DBUILD_SHARED_LIBS=ON


make %{makeprocesses} VERBOSE=1

%install
Expand Down
17 changes: 7 additions & 10 deletions pytorch-scatter.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
## INCLUDE compilation_flags
## INCLUDE cpp-standard
## INCLUDE cuda-flags

%define tag c095c62e4334fcd05e4ac3c4bb09d285960d6be6
%define branch master
%define github_user rusty1s

Source: git+https://github.com/%{github_user}/pytorch_scatter.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz

BuildRequires: cmake
Requires: pytorch
Requires: pytorch %{!?without_cuda:cuda}
%define build_flags -Wall -Wextra -pedantic %{?arch_build_flags}
%define cuda_arch_float $(echo %{cuda_arch} | tr ' ' '\\n' | sed -E 's|([0-9])$|.\\1|' | tr '\\n' ' ')

Expand All @@ -19,18 +20,17 @@ Requires: pytorch
grep -q 'CMAKE_CXX_STANDARD *14' CMakeLists.txt
sed -i -e 's|CMAKE_CXX_STANDARD *14|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' CMakeLists.txt

%build

USE_CUDA=OFF
%if "%{cmsos}" != "slc7_aarch64"
%if 0%{!?without_cuda:1}
if [ "%{cuda_gcc_support}" = "true" ] ; then
USE_CUDA=%{!?without_cuda:ON}
USE_CUDA=ON
fi
%endif

%build

rm -rf ../build && mkdir ../build && cd ../build


cmake ../%{n}-%{realversion} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{i} \
Expand All @@ -40,15 +40,12 @@ cmake ../%{n}-%{realversion} \
-DCMAKE_CXX_FLAGS="%{build_flags}" \
-DBUILD_TEST=OFF \
-DWITH_PYTHON=OFF \
-DWITH_CUDA=OFF \
-DBUILD_TEST=OFF \
%if 0%{!?without_cuda:1}
-DUSE_CUDA=${USE_CUDA} \
-DWITH_CUDA=${USE_CUDA} \
-DTORCH_CUDA_ARCH_LIST="%{cuda_arch_float}" \
%endif
-DBUILD_SHARED_LIBS=ON


make %{makeprocesses} VERBOSE=1

%install
Expand Down
12 changes: 4 additions & 8 deletions pytorch-sparse.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Source: git+https://github.com/%{github_user}/pytorch_sparse.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz

BuildRequires: cmake
Requires: pytorch
Requires: pytorch %{!?without_cuda:cuda}
%define build_flags -Wall -Wextra -pedantic %{?arch_build_flags}
%define cuda_arch_float $(echo %{cuda_arch} | tr ' ' '\\n' | sed -E 's|([0-9])$|.\\1|' | tr '\\n' ' ')

Expand All @@ -20,18 +20,17 @@ Requires: pytorch
grep -q 'CMAKE_CXX_STANDARD *14' CMakeLists.txt
sed -i -e 's|CMAKE_CXX_STANDARD *14|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' CMakeLists.txt

%build

USE_CUDA=OFF
%if 0%{!?without_cuda:1}
if [ "%{cuda_gcc_support}" = "true" ] ; then
USE_CUDA=ON
fi
%endif

%build

rm -rf ../build && mkdir ../build && cd ../build


cmake ../%{n}-%{realversion} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{i} \
Expand All @@ -41,15 +40,12 @@ cmake ../%{n}-%{realversion} \
-DCMAKE_CXX_FLAGS="%{build_flags}" \
-DBUILD_TEST=OFF \
-DWITH_PYTHON=OFF \
-DWITH_CUDA=OFF \
-DBUILD_TEST=OFF \
%if 0%{!?without_cuda:1}
-DUSE_CUDA=${USE_CUDA} \
-DWITH_CUDA=${USE_CUDA} \
-DTORCH_CUDA_ARCH_LIST="%{cuda_arch_float}" \
%endif
-DBUILD_SHARED_LIBS=ON


make %{makeprocesses} VERBOSE=1

%install
Expand Down
18 changes: 13 additions & 5 deletions pytorch.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## INCLUDE cuda-flags
## INCLUDE microarch_flags

%define cuda_arch_float $(echo %{cuda_arch} | tr ' ' '\\n' | sed -E 's|([0-9])$|.\\1|' | tr '\\n' ' ')
%define cuda_arch_float $(echo %{cuda_arch} | tr ' ' '\\n' | sed -E 's|([0-9])$|.\\1|' | tr '\\n' ' ' | sed -e's/ *$/+PTX/')

Source: git+https://github.com/pytorch/pytorch.git?obj=main/v%{realversion}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz
Source1: FindEigen3.cmake
Expand Down Expand Up @@ -35,6 +35,8 @@ fi

cmake ../%{n}-%{realversion} \
-G Ninja \
-Wno-dev \
-L \
-DCMAKE_INSTALL_PREFIX=%{i} \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_TEST=OFF \
Expand All @@ -43,14 +45,20 @@ cmake ../%{n}-%{realversion} \
%if 0%{!?without_cuda:1}
-DUSE_CUDA=${USE_CUDA} \
-DTORCH_CUDA_ARCH_LIST="%{cuda_arch_float}" \
-DCUDNN_INCLUDE_DIR=${CUDNN_ROOT}/include \
-DCUDNN_LIBRARY=${CUDNN_ROOT}/lib64/libcudnn.so \
-DUSE_CUDNN=${USE_CUDA} \
-DCUDNN_ROOT=${CUDNN_ROOT} \
%else
-DUSE_CUDA=OFF \
-DUSE_CUDNN=OFF \
%endif
-DUSE_CUSPARSELT=OFF \
-DUSE_CUDSS=OFF \
-DUSE_NCCL=OFF \
-DUSE_ROCM=OFF \
-DUSE_XPU=OFF \
-DUSE_FBGEMM=OFF \
-DUSE_KINETO=OFF \
-DUSE_MAGMA=OFF \
-DUSE_METAL=OFF \
-DUSE_MPS=OFF \
-DUSE_NNPACK=OFF \
-DUSE_QNNPACK=OFF \
Expand Down Expand Up @@ -80,7 +88,7 @@ cmake ../%{n}-%{realversion} \
-DCMAKE_PREFIX_PATH="%{cmake_prefix_path}" \
-DPYTHON_EXECUTABLE=${PYTHON3_ROOT}/bin/python3

ninja -v %{makeprocesses}
ninja -v %{makeprocesses}

%install
cd ../build
Expand Down