%global pkgvers 1 %global scdate0 20220414 %global schash0 6cf549fc6e4905267f336f9689ab72ccb775a6e0 %global branch0 master %global source0 https://github.com/limbo018/DREAMPlace.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: dreamplace Version: 3.0.0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Deep learning toolkit-enabled VLSI placement License: BSD URL: https://github.com/limbo018/DREAMPlace BuildRequires: gcc-c++ cmake git wget bison flex zlib-devel python3-setuptools BuildRequires: ghostscript wget doxygen pkgconfig pybind11-devel cuda-gcc-c++ BuildRequires: python3-devel boost-devel pytorch-devel cairo-devel openblas-devel BuildRequires: coin-or-lemon-devel coin-or-Cbc-devel coin-or-Cgl-devel coin-or-Clp-devel BuildRequires: coin-or-Osi-devel coin-or-CoinUtils-devel python3-devel python3 lpsolve-devel BuildRequires: glog-devel python3-typing-extensions %if 0%{?rhel} BuildRequires: python3-dataclasses %endif %global vcu_maj 11 %global vcu_min 6 %global have_cuda_gcc 1 %if 0%{?fedora} > 34 %if %{have_cuda_gcc} BuildRequires: cuda-gcc-c++ %endif %endif BuildRequires: cuda-nvcc-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-nvtx-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-cudart-devel-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-nvml-devel-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-nvrtc-devel-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-driver-devel-%{vcu_maj}-%{vcu_min} BuildRequires: cuda-nvprof-%{vcu_maj}-%{vcu_min} BuildRequires: libcurand-%{vcu_maj}-%{vcu_min} BuildRequires: libcufft-%{vcu_maj}-%{vcu_min} BuildRequires: libcublas-%{vcu_maj}-%{vcu_min} BuildRequires: nvidia-driver-cuda-libs %global _lto_cflags %{nil} %global __cmake_in_source_build 1 %description Deep learning toolkit-enabled VLSI placement. With the analogy between nonlinear VLSI placement and deep learning training problem, this tool is developed with deep learning toolkit for flexibility and efficiency. %package python3 Summary: %{summary} Requires: %{name} = %{version}-%{release} Provides: dreamplace %description python3 Deep learning toolkit-enabled VLSI placement. With the analogy between nonlinear VLSI placement and deep learning training problem, this tool is developed with deep learning toolkit for flexibility and efficiency. %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 submodule update --init --depth 1 thirdparty/Limbo git submodule update --init --depth 1 thirdparty/pybind11 git submodule update --init --depth 1 thirdparty/munkres-cpp git log --format=fuller %build rm -rf thirdparty/cub #rm -rf thirdparty/pybind11 # ext pybind11 #sed -i '/subdirectory(thirdparty\/pybind11)/d' cmake/TorchExtension.cmake sed -i 's|BISON 3.3 REQUIRED|BISON REQUIRED|' thirdparty/Limbo/CMakeLists.txt # cuda related sed -i 's|PROPAGATE_HOST_FLAGS ON|PROPAGATE_HOST_FLAGS OFF|g' CMakeLists.txt sed -i 's|compiler-options;-fPIC|compiler-options;-fPIC;-Wno-deprecated-gpu-targets;-allow-unsupported-compiler|' CMakeLists.txt %if 0%{?fedora} > 34 %if %{have_cuda_gcc} sed -i 's|compiler-options;-fPIC|compiler-options;-fPIC;-ccbin;%{_bindir}/cuda-g++|' CMakeLists.txt %endif %endif # builtin static thirdparty sed -i '1i set(BUILD_STATIC_LIBS ON)' thirdparty/CMakeLists.txt sed -i '1i set(BUILD_SHARED_LIBS OFF)' thirdparty/CMakeLists.txt mkdir build pushd build export LD_LIBRARY_PATH="/usr/local/cuda-%{vcu_maj}.%{vcu_min}/%{_lib}/" %cmake .. -Wno-dev \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCUDA_FAST_MATH=ON \ -DCUDA_PROPAGATE_HOST_FLAGS=OFF \ -DCUDA_ENABLE_DEPRECATED_GENERATION=ON \ -DCMAKE_CUDA_COMPILER='/usr/local/cuda-%{vcu_maj}.%{vcu_min}/bin/nvcc' \ -DCMAKE_CUDA_FLAGS='-allow-unsupported-compiler --compiler-options -fPIC' make %{?_smp_mflags} popd %install pushd build %cmake_install popd # remove spurious rm -rf %{buildroot}/usr/test rm -rf %{buildroot}/usr/lib/*.a rm -rf %{buildroot}/usr/unittest rm -rf %{buildroot}/usr/include rm -rf %{buildroot}/usr/thirdparty rm -rf %{buildroot}/usr/benchmarks rm -rf %{buildroot}/usr/dreamplace/configure.py mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{python3_sitearch}/%{name}/ops mv -f %{buildroot}/usr/dreamplace/Placer.py %{buildroot}%{_bindir}/ mv -f %{buildroot}/usr/dreamplace/PlaceDB.py %{buildroot}%{_bindir}/ mv -f %{buildroot}/usr/dreamplace/*.py %{buildroot}%{python3_sitearch}/%{name}/ mv -f %{buildroot}/usr/dreamplace/params.json %{buildroot}%{python3_sitearch}/%{name}/ mv -f %{buildroot}/usr/dreamplace/ops %{buildroot}%{python3_sitearch}/%{name}/ %files python3 %license LICENSE %doc README.md %doc test benchmarks %{_bindir}/* %{python3_sitearch}/* %changelog * Thu Dec 23 2021 Cristian Balint - github update releases