Skip to content

Commit 392505f

Browse files
authored
Merge pull request #317 from proppy/openroad-refresh-patches
pnr/openroad: refresh obsolete patches
2 parents 05065bb + 86a8c60 commit 392505f

6 files changed

+83
-198
lines changed

pnr/openroad/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ cmake -B build -DCMAKE_INSTALL_PREFIX=$PREFIX .
4444
cmake --build build -j $CPU_COUNT --target install
4545

4646
cd $SRC_DIR
47-
cmake -B build -DTCL_LIB_PATHS="$BUILD_PREFIX;$PREFIX" -DCMAKE_FIND_ROOT_PATH="$BUILD_PREFIX;$PREFIX" -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=ONLY -DUSE_SYSTEM_BOOST=ON -DINSTALL_LIBOPENSTA=OFF -DBUILD_MPL2=OFF -DBUILD_PAR=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX .
47+
cmake -B build -DTCL_LIB_PATHS="$BUILD_PREFIX;$PREFIX" -DCMAKE_FIND_ROOT_PATH="$BUILD_PREFIX;$PREFIX" -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=ONLY -DUSE_SYSTEM_BOOST=ON -DINSTALL_LIBOPENSTA=OFF -DBUILD_MPL2=OFF -DBUILD_PAR=OFF -DENABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX .
4848
cmake --build build -j $CPU_COUNT --target install
Lines changed: 27 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
2-
index 293ea212c..d4df13f4a 100755
2+
index 1b51a5a1a..ca6bfd14b 100755
33
--- a/src/CMakeLists.txt
44
+++ b/src/CMakeLists.txt
5-
@@ -168,6 +168,9 @@ message(STATUS "boost: ${Boost_VERSION}")
5+
@@ -169,6 +169,9 @@ message(STATUS "boost: ${Boost_VERSION}")
66
find_package(Python3 COMPONENTS Development REQUIRED)
77
option(BUILD_PYTHON "Build the Python3 interface" ON)
88

@@ -12,7 +12,7 @@ index 293ea212c..d4df13f4a 100755
1212
option(ALLOW_WARNINGS "Flag to allow compilation with compiler warnings: on by default" ON)
1313
if (NOT ALLOW_WARNINGS)
1414
add_compile_options(
15-
@@ -250,10 +253,14 @@ add_subdirectory(cts)
15+
@@ -251,10 +254,14 @@ add_subdirectory(cts)
1616
add_subdirectory(grt)
1717
add_subdirectory(tap)
1818
add_subdirectory(mpl)
@@ -22,161 +22,46 @@ index 293ea212c..d4df13f4a 100755
2222
+endif()
2323
add_subdirectory(rcx)
2424
add_subdirectory(psm)
25-
+if (BUILD_PAR)
26-
add_subdirectory(par)
25+
-add_subdirectory(par)
26+
+if ((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND BUILD_PAR)
27+
+ add_subdirectory(par)
2728
+endif()
2829
add_subdirectory(ant)
2930
add_subdirectory(gui)
3031
add_subdirectory(drt)
31-
@@ -319,7 +326,6 @@ target_link_libraries(openroad
32-
mpl
33-
psm
34-
ant
35-
- par
36-
upf
37-
utl
38-
pdn
39-
@@ -329,12 +335,19 @@ target_link_libraries(openroad
32+
@@ -329,15 +336,23 @@ target_link_libraries(openroad
4033
${CMAKE_THREAD_LIBS_INIT}
4134
)
4235

4336
-if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
4437
+if ((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND BUILD_MPL2)
45-
# mpl2 aborts with link error on darwin so do not link it.
46-
target_link_libraries(openroad mpl2)
38+
# mpl2 aborts with link error on darwin and par causes abseil link error at startup on apple silicon so do not link it.
39+
- target_link_libraries(openroad mpl2 par)
40+
+ target_link_libraries(openroad mpl2)
4741
target_compile_definitions(openroad PRIVATE ENABLE_MPL2)
48-
else()
49-
- message(STATUS "Removing MPL2 to avoid run time fatal error.")
50-
+ message(STATUS "MPL2 macro placer disabled.")
42+
+else()
43+
+ message(STATUS "Removing MPL2 to avoid run time fatal error.")
5144
+endif()
5245
+
53-
+if (BUILD_PAR)
46+
+if ((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND BUILD_PAR)
47+
+ # mpl2 aborts with link error on darwin and par causes abseil link error at startup on apple silicon so do not link it.
5448
+ target_link_libraries(openroad par)
55-
+ target_compile_definitions(openroad PRIVATE ENABLE_PAR)
56-
+else()
57-
+ message(STATUS "PAR partitioner disabled.")
49+
target_compile_definitions(openroad PRIVATE ENABLE_PAR)
50+
else()
51+
- message(STATUS "Removing MPL2 and PAR to avoid run time fatal error.")
52+
+ message(STATUS "Removing PAR to avoid run time fatal error.")
5853
endif()
5954

55+
+
6056
# tclReadline
61-
@@ -398,7 +411,6 @@ if (Python3_FOUND AND BUILD_PYTHON)
62-
drt_py
63-
dpo_py
64-
fin_py
65-
- par_py
66-
rcx_py
67-
rmp_py
68-
stt_py
69-
@@ -406,10 +418,17 @@ if (Python3_FOUND AND BUILD_PYTHON)
70-
pdn_py
57+
if (TCL_READLINE_LIBRARY AND TCL_READLINE_H)
58+
target_compile_definitions(openroad PRIVATE ENABLE_READLINE)
59+
@@ -407,7 +422,7 @@ if (Python3_FOUND AND BUILD_PYTHON)
7160
dft_py
7261
)
73-
+ if (BUILD_PAR)
74-
+ target_link_libraries(openroad par_py)
75-
+ else()
76-
+ message(STATUS "PAR partitioner disabled.")
77-
+ endif()
78-
else()
79-
message(STATUS "Python3 disabled")
80-
endif()
81-
82-
+
83-
+
84-
messages(
85-
TARGET openroad
86-
SOURCE_DIR .
87-
diff --git a/src/Main.cc b/src/Main.cc
88-
index 255699ee0..b934b6b1e 100644
89-
--- a/src/Main.cc
90-
+++ b/src/Main.cc
91-
@@ -93,7 +93,6 @@ using std::string;
92-
X(drt) \
93-
X(dpo) \
94-
X(fin) \
95-
- X(par) \
96-
X(rcx) \
97-
X(rmp) \
98-
X(stt) \
99-
@@ -108,6 +107,9 @@ using std::string;
100-
extern "C" {
101-
#define X(name) extern PyObject* PyInit__##name##_py();
102-
FOREACH_TOOL(X)
103-
+#ifdef ENABLE_PAR
104-
+X(par)
105-
+#endif
106-
#undef X
107-
}
108-
#endif
109-
@@ -126,6 +128,9 @@ static void showSplash();
110-
namespace sta {
111-
#define X(name) extern const char* name##_py_python_inits[];
112-
FOREACH_TOOL(X)
113-
+#ifdef ENABLE_PAR
114-
+X(par)
115-
+#endif
116-
#undef X
117-
} // namespace sta
11862

119-
@@ -137,6 +142,9 @@ static void initPython()
120-
exit(1); \
121-
}
122-
FOREACH_TOOL(X)
123-
+#ifdef ENABLE_PAR
124-
+ X(par)
125-
+#endif
126-
#undef X
127-
Py_Initialize();
128-
#define X(name) \
129-
@@ -157,6 +165,9 @@ static void initPython()
130-
delete[] unencoded; \
131-
}
132-
FOREACH_TOOL_WITHOUT_OPENROAD(X)
133-
+#ifdef ENABLE_PAR
134-
+ X(par)
135-
+#endif
136-
#undef X
137-
#undef FOREACH_TOOL
138-
#undef FOREACH_TOOL_WITHOUT_OPENROAD
139-
diff --git a/src/OpenRoad.cc b/src/OpenRoad.cc
140-
index c90e40db9..c8a9a8109 100644
141-
--- a/src/OpenRoad.cc
142-
+++ b/src/OpenRoad.cc
143-
@@ -70,7 +70,9 @@
144-
#include "odb/lefout.h"
145-
#include "ord/InitOpenRoad.hh"
146-
#include "pad/MakeICeWall.h"
147-
+#ifdef ENABLE_PAR
148-
#include "par/MakePartitionMgr.h"
149-
+#endif
150-
#include "pdn/MakePdnGen.hh"
151-
#include "ppl/MakeIoplacer.h"
152-
#include "psm/MakePDNSim.hh"
153-
@@ -175,7 +177,9 @@ OpenRoad::~OpenRoad()
154-
deleteFinale(finale_);
155-
deleteAntennaChecker(antenna_checker_);
156-
odb::dbDatabase::destroy(db_);
157-
+#ifdef ENABLE_PAR
158-
deletePartitionMgr(partitionMgr_);
159-
+#endif
160-
deletePdnGen(pdngen_);
161-
deleteICeWall(icewall_);
162-
deleteDistributed(distributer_);
163-
@@ -231,7 +235,9 @@ void OpenRoad::init(Tcl_Interp* tcl_interp)
164-
replace_ = makeReplace();
165-
pdnsim_ = makePDNSim();
166-
antenna_checker_ = makeAntennaChecker();
167-
+#ifdef ENABLE_PAR
168-
partitionMgr_ = makePartitionMgr();
169-
+#endif
170-
pdngen_ = makePdnGen();
171-
icewall_ = makeICeWall();
172-
distributer_ = makeDistributed();
173-
@@ -270,7 +276,9 @@ void OpenRoad::init(Tcl_Interp* tcl_interp)
174-
initTritonRoute(this);
175-
initPDNSim(this);
176-
initAntennaChecker(this);
177-
+#ifdef ENABLE_PAR
178-
initPartitionMgr(this);
179-
+#endif
180-
initPdnGen(this);
181-
initDistributed(this);
182-
initSteinerTreeBuilder(this);
63+
- if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
64+
+ if ((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND BUILD_PAR)
65+
# par_py causes abseil link error at startup on apple silicon so do not link it.
66+
target_link_libraries(openroad par_py)
67+
else()

pnr/openroad/find-tcl-library.patch

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
diff --git a/src/dpl/CMakeLists.txt b/src/dpl/CMakeLists.txt
2+
index bd2ab1b56..5d7a47b63 100644
3+
--- a/src/dpl/CMakeLists.txt
4+
+++ b/src/dpl/CMakeLists.txt
5+
@@ -37,7 +37,7 @@
6+
###########################################################################
7+
8+
include("openroad")
9+
-
10+
+find_package(TCL)
11+
12+
add_library(dpl_lib
13+
src/Opendp.cpp
14+
@@ -53,7 +53,7 @@ target_link_libraries(dpl_lib
15+
PUBLIC
16+
odb
17+
OpenSTA
18+
- tcl
19+
+ ${TCL_LIBRARY}
20+
PRIVATE
21+
utl
22+
)
23+
diff --git a/src/dst/CMakeLists.txt b/src/dst/CMakeLists.txt
24+
index bbce29086..b3077513e 100644
25+
--- a/src/dst/CMakeLists.txt
26+
+++ b/src/dst/CMakeLists.txt
27+
@@ -34,6 +34,7 @@
28+
###############################################################################
29+
include("openroad")
30+
include(FindZLIB)
31+
+find_package(TCL)
32+
33+
project(dst
34+
LANGUAGES CXX
35+
@@ -64,7 +65,7 @@ target_link_libraries(dst
36+
PUBLIC
37+
utl
38+
OpenSTA
39+
- tcl
40+
+ ${TCL_LIBRARY}
41+
${ZLIB_LIBRARIES}
42+
Boost::serialization
43+
Boost::system

pnr/openroad/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ source:
1010
- git_url: https://github.com/The-OpenROAD-Project/OpenROAD.git
1111
git_rev: master
1212
patches:
13-
- odb-drt-disable-tests.patch # until tests are added to the recope
1413
- sta-add-install-options.patch # to enable sta binary distribution
1514
- disable-mpl2-and-par.patch # until or-tools dep is added
1615
- remove-boost-span-deps.patch # to allow older boost
16+
- find-tcl-library.patch # to find installed tcl library
1717
- url: http://lemon.cs.elte.hu/pub/sources/lemon-{{ lemon_version }}.tar.gz
1818
md5: {{ lemon_md5 }}
1919
folder: third_party/lemon

pnr/openroad/odb-drt-disable-tests.patch

Lines changed: 0 additions & 50 deletions
This file was deleted.

pnr/openroad/remove-boost-span-deps.patch

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/src/odb/test/parseTest.cpp b/src/odb/test/parseTest.cpp
2-
index 38e372a20..08cf44ee8 100644
2+
index f2e7d900d..08cf44ee8 100644
33
--- a/src/odb/test/parseTest.cpp
44
+++ b/src/odb/test/parseTest.cpp
55
@@ -55,36 +55,4 @@ int notice(int code, const char* msg, ...)
@@ -8,11 +8,11 @@ index 38e372a20..08cf44ee8 100644
88

99
-BOOST_AUTO_TEST_CASE(parser_init_and_parse_line_with_integers)
1010
-{
11-
- Ath__parser parser;
11+
- utl::Logger logger;
12+
- Ath__parser parser(&logger);
1213
-
1314
- BOOST_TEST(parser.getLineNum() == 0);
1415
-
15-
- utl::Logger logger;
1616
- utl::ScopedTemporaryFile scoped_temp_file(&logger);
1717
- const std::string kContents = "1 2 3 4";
1818
- boost::span<const uint8_t> contents(
@@ -40,7 +40,7 @@ index 38e372a20..08cf44ee8 100644
4040
-
4141
} // namespace odb
4242
diff --git a/src/utl/CMakeLists.txt b/src/utl/CMakeLists.txt
43-
index a795da4d1..db52c9dd4 100644
43+
index 464e5b3ca..603696be1 100644
4444
--- a/src/utl/CMakeLists.txt
4545
+++ b/src/utl/CMakeLists.txt
4646
@@ -35,7 +35,7 @@
@@ -52,6 +52,13 @@ index a795da4d1..db52c9dd4 100644
5252

5353
swig_lib(NAME utl
5454
NAMESPACE utl
55+
@@ -121,4 +121,4 @@ if(ENABLE_TESTS)
56+
target_link_libraries(CFileUtilsTest
57+
utl
58+
)
59+
-endif()
60+
\ No newline at end of file
61+
+endif()
5562
diff --git a/src/utl/include/utl/CFileUtils.h b/src/utl/include/utl/CFileUtils.h
5663
index a3c6d8024..192b1a89d 100644
5764
--- a/src/utl/include/utl/CFileUtils.h

0 commit comments

Comments
 (0)