%global pkgvers 0 %global scdate0 20240215 %global schash0 114a83da81cdc6bba88c206da0718254d3f59550 %global branch0 master %global source0 https://github.com/The-OpenROAD-Project/OpenROAD.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} %define ext_abc 1 %define ext_opensta 1 %define with_gui 1 %define with_doc 0 %define with_tst 0 Name: openroad Version: 2.0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: OpenROAD is a chip physical design tool License: GPLv3 URL: https://theopenroadproject.org BuildRequires: cmake gcc-c++ make doxygen flex bison swig git gmock-devel BuildRequires: zlib-devel eigen3-devel tcl tcl-devel tcl-tclreadline-devel gtest-devel BuildRequires: python3-devel readline-devel spdlog-devel coin-or-lemon-devel or-tools-devel BuildRequires: qt5-qtbase-devel libjpeg-turbo-devel fmt-devel libX11-devel libXext-devel BuildRequires: abseil-cpp-devel >= 20230125.0 BuildRequires: abseil-cpp-devel <= 20230125.3 %if %{with_doc} BuildRequires: python3-sphinx tex(tex) tex(latex) config(latexmk) tex(titlesec.sty) BuildRequires: tex(framed.sty) tex(wrapfig.sty) tex(needspace.sty) tex(capt-of.sty) BuildRequires: tex(fncychap.sty) tex(tabulary.sty) tex(upquote.sty) tex(tgtermes.sty) %endif %if 0%{?fedora} %if %{with_gui} BuildRequires: tclx-devel CImg-devel %endif %endif %if 0%{?fedora} > 36 BuildRequires: boost-devel boost-serialization boost-system boost-thread %else BuildRequires: boost1.78-devel boost1.78-serialization boost1.78-system boost1.78-thread %endif %if %{ext_abc} BuildRequires: abc-devel %endif %if %{ext_opensta} BuildRequires: opensta-devel %endif %if 0%{?rhel} == 8 %undefine _annotated_build %endif %ifarch ppc64le %if 0%{?rhel} == 9 %global _lto_cflags %{nil} %endif %endif %global __cmake_in_source_build 1 %description OpenROAD is an integrated chip physical design tool that takes a design from synthesized Verilog to routed layout. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} %if ! %{ext_abc} git submodule update --init --depth 1 third-party/abc %endif %if ! %{ext_opensta} git submodule update --init --depth 1 src/sta %endif git log --format=fuller # broken eigen3 calls %if (0%{?rhel} == 8) || ("%{_arch}" == "ppc64le") sed -i -e 's|Eigen3::Eigen||g' src/gpl/CMakeLists.txt sed -i -e 's|Eigen3::Eigen||g' src/psm/src/CMakeLists.txt sed -i -e 's|-Wredundant-decls|-Wredundant-decls -I/usr/include/eigen3|g' src/CMakeLists.txt %endif %if 0%{?rhel} sed -i 's|${TCL_INCLUDE_PATH}|${TCL_INCLUDE_PATH} ${Boost_INCLUDE_DIRS}|g' src/odb/src/db/CMakeLists.txt %endif # fix swig inc sed -i -e 's|../../src|../../../src|' src/dbSta/src/dbSta.i sed -i -e '/using namespace odb/a using namespace std;' src/ant/src/AntennaChecker-py.i %ifarch aarch64 sed -i -e 's|-m64||' src/par/CMakeLists.txt %endif # gcc13 sed -i -e '1i #include ' include/ord/Design.h sed -i -e '1i #include ' src/odb/include/odb/dbStream.h sed -i -e '1i #include ' src/grt/src/fastroute/include/DataType.h sed -i -e 's|scaleAbreviation|scaleAbbreviation|g' src/gui/src/staGui.cpp sed -i -e 's|scaleAbreviation|scaleAbbreviation|g' src/gui/src/clockWidget.cpp # no test sed -i -e '/add_subdirectory(test)/d' src/gpl/CMakeLists.txt %build %if %{with_doc} # docs %if ! (0%{?rhel} == 9) pushd docs sed -i '/myst_parser/d' conf.py sed -i '/sphinx_external_toc/d' conf.py make latexpdf LATEXMKOPTS="-f -interaction=nonstopmode" popd %endif %endif # build mkdir build pushd build %global optflags %(echo "%{optflags}" -fpermissive -w) %cmake .. -Wno-dev \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DOPENROAD_VERSION="%{version}-%{scdate0}.git%{sshort0}%{?dist}" \ %if 0%{?fedora} %if %{with_gui} -DBUILD_GUI=ON \ -DUSE_CIMG_LIB=ON \ %else -DBUILD_GUI=OFF \ %endif %endif -DUSE_SYSTEM_BOOST=ON \ %if %{ext_abc} -DUSE_SYSTEM_ABC=ON \ %endif %if %{ext_opensta} -DUSE_SYSTEM_OPENSTA=ON \ -DOPENSTA_HOME=/usr/share/opensta \ %endif %if %{with_tst} -DENABLE_TESTS=ON \ %else -DENABLE_TESTS=OFF \ %endif -DALLOW_WARNINGS=ON %cmake_build popd %install pushd build %cmake_install rm -rf %{buildroot}/usr/lib rm -rf %{buildroot}/%{_includedir} popd %check %if %{with_tst} export LD_LIBRARY_PATH=%{buildroot}%{_libdir} pushd test time ./regression || true popd ./build/src/drt/trTest %endif %files %license LICENSE %doc README.md %if %{with_doc} %if ! (0%{?rhel} == 9) %doc docs/build/latex/*.pdf %endif %endif %{_bindir}/* %changelog * Sat Jul 25 2020 Cristian Balint - github build releases