diff --git a/pytorch-cluster.spec b/pytorch-cluster.spec index f63e3fcfbcb..17d05fbd1a8 100644 --- a/pytorch-cluster.spec +++ b/pytorch-cluster.spec @@ -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' ' ') @@ -20,6 +20,8 @@ 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 @@ -27,8 +29,6 @@ USE_CUDA=ON fi %endif -%build - rm -rf ../build && mkdir ../build && cd ../build cmake ../%{n}-%{realversion} \ @@ -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 diff --git a/pytorch-scatter.spec b/pytorch-scatter.spec index 5a6939b3a75..c662e6a64bd 100644 --- a/pytorch-scatter.spec +++ b/pytorch-scatter.spec @@ -2,6 +2,7 @@ ## INCLUDE compilation_flags ## INCLUDE cpp-standard ## INCLUDE cuda-flags + %define tag c095c62e4334fcd05e4ac3c4bb09d285960d6be6 %define branch master %define github_user rusty1s @@ -9,7 +10,7 @@ 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' ' ') @@ -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} \ @@ -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 diff --git a/pytorch-sparse.spec b/pytorch-sparse.spec index 6667b6ff48d..bec495571e4 100644 --- a/pytorch-sparse.spec +++ b/pytorch-sparse.spec @@ -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' ' ') @@ -20,6 +20,8 @@ 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 @@ -27,11 +29,8 @@ USE_CUDA=ON fi %endif -%build - rm -rf ../build && mkdir ../build && cd ../build - cmake ../%{n}-%{realversion} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=%{i} \ @@ -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 diff --git a/pytorch.spec b/pytorch.spec index 02ef28f3f6c..6fc5b0efd79 100644 --- a/pytorch.spec +++ b/pytorch.spec @@ -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 @@ -35,6 +35,8 @@ fi cmake ../%{n}-%{realversion} \ -G Ninja \ + -Wno-dev \ + -L \ -DCMAKE_INSTALL_PREFIX=%{i} \ -DCMAKE_INSTALL_LIBDIR=lib \ -DBUILD_TEST=OFF \ @@ -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 \ @@ -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