diff --git a/pytorch-cluster.spec b/pytorch-cluster.spec index cd2cec49d4b..a25f9aad7ea 100644 --- a/pytorch-cluster.spec +++ b/pytorch-cluster.spec @@ -1,6 +1,8 @@ ### RPM external pytorch-cluster 1.6.3 ## INCLUDE compilation_flags ## INCLUDE cpp-standard +## INCLUDE cuda-flags + %define tag f2d99195a0003ca2d2ba9ed50d0117e2f23360e0 %define branch master %define github_user rusty1s @@ -9,7 +11,8 @@ Source: git+https://github.com/%{github_user}/pytorch_cluster.git?obj=%{branch}/ BuildRequires: cmake Requires: pytorch -%define build_flags -Wall -Wextra -pedantic %{?arch_build_flags} +%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' ' ') %prep %setup -n %{n}-%{realversion} @@ -17,11 +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 +USE_CUDA=OFF +%if "%{cmsos}" != "slc7_aarch64" +if [ "%{cuda_gcc_support}" = "true" ] ; then +USE_CUDA=%{!?without_cuda:ON} +fi +%endif + %build rm -rf ../build && mkdir ../build && cd ../build - cmake ../%{n}-%{realversion} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=%{i} \ @@ -33,7 +42,11 @@ cmake ../%{n}-%{realversion} \ -DWITH_PYTHON=OFF \ -DWITH_CUDA=OFF \ -DBUILD_TEST=OFF \ - -DBUILD_SHARED_LIBS=ON +%if 0%{!?without_cuda:1} + -DUSE_CUDA=${USE_CUDA} \ + -DTORCH_CUDA_ARCH_LIST="%{cuda_arch_float}" \ +%endif + -DBUILD_SHARED_LIBS=ON make %{makeprocesses} VERBOSE=1 diff --git a/pytorch-scatter.spec b/pytorch-scatter.spec index c79cb4aa513..5a6939b3a75 100644 --- a/pytorch-scatter.spec +++ b/pytorch-scatter.spec @@ -1,6 +1,7 @@ ### RPM external pytorch-scatter 2.1.2 ## INCLUDE compilation_flags ## INCLUDE cpp-standard +## INCLUDE cuda-flags %define tag c095c62e4334fcd05e4ac3c4bb09d285960d6be6 %define branch master %define github_user rusty1s @@ -9,7 +10,8 @@ Source: git+https://github.com/%{github_user}/pytorch_scatter.git?obj=%{branch}/ BuildRequires: cmake Requires: pytorch -%define build_flags -Wall -Wextra -pedantic %{?arch_build_flags} +%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' ' ') %prep %setup -n %{n}-%{realversion} @@ -17,6 +19,13 @@ 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 +USE_CUDA=OFF +%if "%{cmsos}" != "slc7_aarch64" +if [ "%{cuda_gcc_support}" = "true" ] ; then +USE_CUDA=%{!?without_cuda:ON} +fi +%endif + %build rm -rf ../build && mkdir ../build && cd ../build @@ -33,7 +42,11 @@ cmake ../%{n}-%{realversion} \ -DWITH_PYTHON=OFF \ -DWITH_CUDA=OFF \ -DBUILD_TEST=OFF \ - -DBUILD_SHARED_LIBS=ON +%if 0%{!?without_cuda:1} + -DUSE_CUDA=${USE_CUDA} \ + -DTORCH_CUDA_ARCH_LIST="%{cuda_arch_float}" \ +%endif + -DBUILD_SHARED_LIBS=ON make %{makeprocesses} VERBOSE=1 diff --git a/pytorch-sparse.spec b/pytorch-sparse.spec index 36b5f9bce0f..c9b1cd2bd25 100644 --- a/pytorch-sparse.spec +++ b/pytorch-sparse.spec @@ -1,6 +1,8 @@ ### RPM external pytorch-sparse 0.6.18 ## INCLUDE compilation_flags ## INCLUDE cpp-standard +## INCLUDE cuda-flags + %define tag 2d559810c6af7f8b2cf88553dd5a5824a667a07d %define branch master %define github_user rusty1s @@ -9,7 +11,8 @@ Source: git+https://github.com/%{github_user}/pytorch_sparse.git?obj=%{branch}/% BuildRequires: cmake Requires: pytorch -%define build_flags -Wall -Wextra -pedantic %{?arch_build_flags} +%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' ' ') %prep %setup -n %{n}-%{realversion} @@ -17,6 +20,13 @@ 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 +USE_CUDA=OFF +%if "%{cmsos}" != "slc7_aarch64" +if [ "%{cuda_gcc_support}" = "true" ] ; then +USE_CUDA=%{!?without_cuda:ON} +fi +%endif + %build rm -rf ../build && mkdir ../build && cd ../build @@ -33,7 +43,11 @@ cmake ../%{n}-%{realversion} \ -DWITH_PYTHON=OFF \ -DWITH_CUDA=OFF \ -DBUILD_TEST=OFF \ - -DBUILD_SHARED_LIBS=ON +%if 0%{!?without_cuda:1} + -DUSE_CUDA=${USE_CUDA} \ + -DTORCH_CUDA_ARCH_LIST="%{cuda_arch_float}" \ +%endif + -DBUILD_SHARED_LIBS=ON make %{makeprocesses} VERBOSE=1