diff --git a/gloo.spec b/gloo.spec new file mode 100644 index 0000000000000000000000000000000000000000..2a64e62a48d3a6591da637886477381bcb97e4a3 --- /dev/null +++ b/gloo.spec @@ -0,0 +1,122 @@ +%define anolis_release 1 + +%global githash c6f3a5b +%global gitdate 202306162 +%global have_cuda 1 +%global cu_maj 11 +%global cu_min 4 +%global __cmake_in_source_build 1 +%global gpu_target_bin "5.2;6.1;7.5;8.6" +%global gpu_target_ptx "5.2" + +Name: gloo +Version: 0 +Release: %{gitdate}.git%{githash}.%{anolis_release}%{?dist} +Summary: Collective communications library +License: BSD +URL: https://github.com/facebookincubator/gloo + +Source0: %{name}.tar.xz + +BuildRequires: cmake gcc-c++ hiredis-devel libuv-devel rdma-core-devel + +%if %{have_cuda} +BuildRequires: cuda-nvcc-%{cu_maj}-%{cu_min} +BuildRequires: cuda-cudart-devel-%{cu_maj}-%{cu_min} +BuildRequires: cuda-nvml-devel-%{cu_maj}-%{cu_min} +BuildRequires: libnccl-devel +Requires: libnccl +%endif + + +%description +Gloo is a collective communications library. + +%package devel +Summary: Development files +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains the development files for %{name}. + + +%prep +%setup -q -n %{name} + +%build + +sed -i 's|30 35|35|g' cmake/Cuda.cmake +#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 + +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 \ + -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 +* Mon Jul 31 2023 Chunmei Xu - 0-202306162.gitc6f3a5b.1 +- init commit diff --git a/gloo.tar.xz b/gloo.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..c4f93d260229a96888957cf1394ef73007dfdc91 Binary files /dev/null and b/gloo.tar.xz differ