%global pkgvers 0 %global scdate0 20241126 %global schash0 accd654da3dbe0074096b503a64e7dca997f0805 %global branch0 main %global source0 https://github.com/facebookincubator/gloo.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} %global vcu_maj 12 %global vcu_min 6 Name: gloo Epoch: 1 Version: %(curl -s https://raw.githubusercontent.com/facebookincubator/gloo/%{schash0}/CMakeLists.txt | grep -e "MAJOR " -e "MINOR " -e "PATCH " | sed 's/[^[:digit:].-]//g' | sed ':a;N;$!ba;s/\n/./g') Release: %{scdate0}.%{pkgvers}.git%{sshort0}.cu%{vcu_maj}_%{vcu_min}%{?dist} Summary: Collective communications library License: BSD URL: https://github.com/facebookincubator/gloo BuildRequires: cmake git hiredis-devel libuv-devel rdma-core-devel %global have_cuda 1 %global have_cuda_gcc 1 %global toolchain gcc %global gpu_target_bin "5.2;6.1;7.5;8.6;9.0" %global gpu_target_ptx "5.2" %bcond_without cuda %if %{without cuda} %global have_cuda 0 %endif %if "%{toolchain}" == "gcc" BuildRequires: gcc-c++ %else BuildRequires: clang %endif %if %{have_cuda} %if 0%{?fedora} || (0%{?rhel} >= 9) %if %{have_cuda_gcc} BuildRequires: cuda-gcc-c++ %endif %endif BuildRequires: cuda-nvcc-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-cudart-devel-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-nvml-devel-%{vcu_maj}-%{vcu_min} BuildRequires: libnccl-devel libnccl Requires: libnccl %endif %global __cmake_in_source_build 1 %description Gloo is a collective communications library. %package devel Summary: Development files Requires: %{name} = %{epoch}:%{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 sed -i 's|30 35|35 80|g' cmake/Cuda.cmake sed -i 's|-std=c++11|-std=c++17|' CMakeLists.txt #sed -i 's|set(CUDA_ARCH_NAME ${__archs_name_default}|set(CUDA_ARCH_NAME "Pascal"|' cmake/Cuda.cmake sed -i 's|DESTINATION lib)|DESTINATION %{_lib})|' CMakeLists.txt sed -i 's|NAMES libuv.a libuv_a.a|NAMES libuv.so|' cmake/Dependencies.cmake sed -i '/set_target_properties(uv/,/)/d' cmake/Dependencies.cmake sed -i 's|/lib)|/%{_lib})|' gloo/CMakeLists.txt sed -i 's|add_library(gloo ${GLOO_STATIC_OR_SHARED} ${GLOO_SRCS})|add_library(gloo ${GLOO_STATIC_OR_SHARED} ${GLOO_SRCS})\nset_target_properties(gloo PROPERTIES SOVERSION 1 VERSION 1.0)|' gloo/CMakeLists.txt sed -i 's|cuda_add_library(gloo_cuda ${GLOO_CUDA_SRCS} ${GLOO_STATIC_OR_SHARED})|cuda_add_library(gloo_cuda ${GLOO_CUDA_SRCS} ${GLOO_STATIC_OR_SHARED})\nset_target_properties(gloo_cuda PROPERTIES SOVERSION 1 VERSION 1.0)|' gloo/CMakeLists.txt sed -i 's|gloo PRIVATE uv_a|gloo PUBLIC uv|' gloo/CMakeLists.txt sed -i 's|"${CMAKE_CURRENT_SOURCE_DIR}/gatherv.cc"|"${CMAKE_CURRENT_SOURCE_DIR}/gatherv.cc"\n "${CMAKE_CURRENT_SOURCE_DIR}/math.cc"|' gloo/CMakeLists.txt sed -i 's|GLOO_USE_AVX ${USE_AVX}|GLOO_USE_AVX 0|g' gloo/CMakeLists.txt sed -i '/cout.*NR_gettid/d' gloo/transport/tcp/buffer.cc %if 0%{?fedora} >= 35 sed -i 's|#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)|#if 0|' gloo/common/linux.cc %endif mkdir build pushd build %cmake .. -Wno-dev \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DUSE_AVX=OFF \ %ifarch x86_64 -DCMAKE_CXX_FLAGS="%{optflags} -mf16c" \ %else -DCMAKE_CXX_FLAGS="%{optflags}" \ %endif -DUSE_REDIS=ON \ -DUSE_RCCL=ON \ -DUSE_IBVERBS=ON \ %if %{have_cuda} -DUSE_CUDA=ON \ -DUSE_NCCL=ON \ -DNVCC_FLAGS_EXTRA="Auto" \ -DCUDA_GENERATION="" \ -DCUDA_ARCH_BIN=%{gpu_target_bin} \ -DCUDA_ARCH_PTX=%{gpu_target_ptx} \ -DCUDA_PROPAGATE_HOST_FLAGS=OFF \ %if 0%{?fedora} %if %{have_cuda_gcc} %if "%{toolchain}" == "gcc" -DCUDA_HOST_COMPILER="%{_bindir}/cuda-gcc" \ %endif %endif %endif -DCUDA_NVCC_FLAGS="-Wno-deprecated-gpu-targets -allow-unsupported-compiler" \ %else -DUSE_CUDA=OFF \ -DUSE_NCCL=OFF \ %endif -DUSE_AVX=ON \ -DUSE_MPI=OFF \ -DUSE_LIBUV=ON \ -DBUILD_TEST=OFF \ -DBUILD_EXAMPLES=OFF \ -DBUILD_BENCHMARK=OFF make %{?_smp_mflags} popd %install rm -rf %{buildroot} pushd build make install DESTDIR=%{buildroot} popd %files %license LICENSE %doc README.md %{_libdir}/*.so.* %files devel %license LICENSE %doc README.md %{_includedir}/* %{_libdir}/*.so %{_datadir}/cmake/* %changelog * Fri Sep 25 2020 Cristian Balint - github upstream release