From c59f6c75b60b31d2349b35ddb2777d230d02cabe Mon Sep 17 00:00:00 2001 From: Nicolas Benes Date: Sat, 1 Apr 2023 23:28:37 +0200 Subject: [PATCH] openroad: unstable-2022-07-19 -> unstable-2023-03-31 --- .../0001-Fix-string-formatting-in-tests.patch | 53 +++++++++++++++++++ .../0002-Ignore-warning-on-stderr.patch | 41 ++++++++++++++ .../science/electronics/openroad/default.nix | 36 ++++++++++--- 3 files changed, 123 insertions(+), 7 deletions(-) create mode 100644 pkgs/applications/science/electronics/openroad/0001-Fix-string-formatting-in-tests.patch create mode 100644 pkgs/applications/science/electronics/openroad/0002-Ignore-warning-on-stderr.patch diff --git a/pkgs/applications/science/electronics/openroad/0001-Fix-string-formatting-in-tests.patch b/pkgs/applications/science/electronics/openroad/0001-Fix-string-formatting-in-tests.patch new file mode 100644 index 000000000000..0332ade17dc7 --- /dev/null +++ b/pkgs/applications/science/electronics/openroad/0001-Fix-string-formatting-in-tests.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nicolas Benes +Date: Sun, 2 Apr 2023 01:24:51 +0200 +Subject: [PATCH] Fix string formatting in tests + +Hide the decimal point and digits after the decimal point when they are +not needed. + +diff --git a/src/par/test/partition_gcd.ok b/src/par/test/partition_gcd.ok +index 6c40c14..b9a42f6 100644 +--- a/src/par/test/partition_gcd.ok ++++ b/src/par/test/partition_gcd.ok +@@ -9,7 +9,7 @@ + ======================================== + [INFO] Partitioning parameters**** + [PARAM] Number of partitions = 2 +-[PARAM] UBfactor = 1.0 ++[PARAM] UBfactor = 1 + [PARAM] Vertex dimensions = 1 + [PARAM] Hyperedge dimensions = 1 + ======================================== +@@ -118,7 +118,7 @@ After Hyperedge Reduction : num_vertices = 137, num_hyperedges = 251 + [V-Refine] Level 2 :: 207, 301, 154.65254 + [V-Refine] Level 3 :: 312, 370, 154.65254 + [V-Refine] Level 4 :: 469, 451, 154.65254 +-[INFO] V-cycle refinement 1 delta cost 0.0 ++[INFO] V-cycle refinement 1 delta cost 0 + ========================================= + [STATUS] Running FC multilevel coarsening + ========================================= +@@ -133,7 +133,7 @@ After Hyperedge Reduction : num_vertices = 137, num_hyperedges = 251 + [V-Refine] Level 2 :: 207, 301, 154.65254 + [V-Refine] Level 3 :: 312, 370, 154.65254 + [V-Refine] Level 4 :: 469, 451, 154.65254 +-[INFO] V-cycle refinement 2 delta cost 0.0 ++[INFO] V-cycle refinement 2 delta cost 0 + [Cutcost of partition : 154.65254] + [Vertex balance of block_0 : 0.59249 ( 327.17993 ) + [Vertex balance of block_1 : 0.40751 ( 225.03609 ) +diff --git a/src/pdn/test/design_width.ok b/src/pdn/test/design_width.ok +index 381dca1..a102974 100644 +--- a/src/pdn/test/design_width.ok ++++ b/src/pdn/test/design_width.ok +@@ -9,5 +9,5 @@ + [INFO ODB-0130] Created 54 pins. + [INFO ODB-0131] Created 406 components and 1816 component-terminals. + [INFO ODB-0133] Created 361 nets and 1004 connections. +-[ERROR PDN-0185] Insufficient width (14.04 um) to add straps on layer M8 in grid "Core" with total strap width 6.0 um and offset 10.0 um. ++[ERROR PDN-0185] Insufficient width (14.04 um) to add straps on layer M8 in grid "Core" with total strap width 6 um and offset 10 um. + PDN-0185 +-- +2.38.4 + diff --git a/pkgs/applications/science/electronics/openroad/0002-Ignore-warning-on-stderr.patch b/pkgs/applications/science/electronics/openroad/0002-Ignore-warning-on-stderr.patch new file mode 100644 index 000000000000..f0b0666789a7 --- /dev/null +++ b/pkgs/applications/science/electronics/openroad/0002-Ignore-warning-on-stderr.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nicolas Benes +Date: Sun, 2 Apr 2023 04:57:17 +0200 +Subject: [PATCH] Ignore warning on stderr + +The following warning is written to stderr, which causes the overall +test to fail: + +``` +sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) +``` + +diff --git a/src/dst/test/cpp_tests.tcl b/src/dst/test/cpp_tests.tcl +index 9087c2c..63d0cb7 100644 +--- a/src/dst/test/cpp_tests.tcl ++++ b/src/dst/test/cpp_tests.tcl +@@ -4,7 +4,7 @@ set test_dir [pwd] + set openroad_dir [file dirname [file dirname [file dirname $test_dir]]] + set tests_path [file join $openroad_dir "build" "src" "dst" "test" "cpp"] + +-set tests_list [split [exec sh -c "find $tests_path -maxdepth 1 -name 'Test*'"] \n] ++set tests_list [split [exec -ignorestderr sh -c "find $tests_path -maxdepth 1 -name 'Test*'"] \n] + + foreach test $tests_list { + set test_name [file tail $test] +diff --git a/src/odb/test/cpp_tests.tcl b/src/odb/test/cpp_tests.tcl +index 091d576..6811760 100644 +--- a/src/odb/test/cpp_tests.tcl ++++ b/src/odb/test/cpp_tests.tcl +@@ -4,7 +4,7 @@ set test_dir [pwd] + set openroad_dir [file dirname [file dirname [file dirname $test_dir]]] + set tests_path [file join $openroad_dir "build" "src" "odb" "test" "cpp"] + +-set tests_list [split [exec sh -c "find $tests_path -maxdepth 1 -name 'Test*' ! -name '*.cmake'"] \n] ++set tests_list [split [exec -ignorestderr sh -c "find $tests_path -maxdepth 1 -name 'Test*' ! -name '*.cmake'"] \n] + + foreach test $tests_list { + set test_name [file tail $test] +-- +2.38.4 + diff --git a/pkgs/applications/science/electronics/openroad/default.nix b/pkgs/applications/science/electronics/openroad/default.nix index 636caec6902a..68e079e2f89b 100644 --- a/pkgs/applications/science/electronics/openroad/default.nix +++ b/pkgs/applications/science/electronics/openroad/default.nix @@ -9,13 +9,20 @@ , python3 , swig4 , boost17x +, cbc # for clp , cimg +, clp # for or-tools , eigen +, glpk +, gtest , lcov , lemon-graph , libjpeg +, or-tools , pcre +, pkg-config , qtbase +, re2 # for or-tools , readline , spdlog , tcl @@ -27,14 +34,14 @@ mkDerivation rec { pname = "openroad"; - version = "unstable-2022-07-19"; + version = "unstable-2023-03-31"; src = fetchFromGitHub { owner = "The-OpenROAD-Project"; repo = "OpenROAD"; - rev = "2610b3953ef62651825d89fb96917cf5d20af0f1"; + rev = "cd03c5cf8a8eb78c0e07fe33a56b8e9d64672efe"; fetchSubmodules = true; - sha256 = "sha256-BP0JSnxl1XyqHzDY4eITaGHevqd+rbjWZy/LAfDfELs="; + hash = "sha256-BWUvFCuWKWQpifErpak03J+A7ni0jZWIrCMhMdKIbD0="; }; nativeBuildInputs = [ @@ -43,19 +50,25 @@ mkDerivation rec { doxygen flex git + pkg-config swig4 ]; buildInputs = [ boost17x + cbc cimg + clp eigen + glpk lcov lemon-graph libjpeg + or-tools pcre python3 qtbase + re2 readline spdlog tcl @@ -65,6 +78,11 @@ mkDerivation rec { zlib ]; + patches = [ + ./0001-Fix-string-formatting-in-tests.patch + ./0002-Ignore-warning-on-stderr.patch + ]; + postPatch = '' patchShebangs --build etc/find_messages.py ''; @@ -74,18 +92,22 @@ mkDerivation rec { "-DUSE_SYSTEM_BOOST=ON" "-DUSE_CIMG_LIB=ON" "-DOPENROAD_VERSION=${src.rev}" + + # 2023-03-31: see discussion on fmt workaround in + # https://github.com/The-OpenROAD-Project/OpenROAD/pull/2696 + "-DCMAKE_CXX_FLAGS=-DFMT_DEPRECATED_OSTREAM" ]; # Resynthesis needs access to the Yosys binaries. qtWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ yosys ]}" ]; + checkInputs = [ gtest ]; + # Upstream uses vendored package versions for some dependencies, so regression testing is prudent # to see if there are any breaking changes in unstable that should be vendored as well. - doCheck = false; # Disabled pending upstream release with fix for rcx log file creation. + doCheck = true; checkPhase = '' - # Regression tests must be run from the project root not from within the CMake build directory. - cd .. - test/regression + ../test/regression ''; doInstallCheck = true;