Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ cc_binary(
"//src/sta:opensta_lib",
"//src/utl",
"@boost.stacktrace",
"@com_google_absl//absl/debugging:symbolize",
"@rules_cc//cc/runfiles",
"@tk_tcl//:tcl",
],
Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ if (SWIG_VERSION VERSION_GREATER_EQUAL "4.1.0")
endif()
include(UseSWIG)

find_package(Boost CONFIG REQUIRED)
find_package(Boost CONFIG REQUIRED COMPONENTS iostreams serialization system thread)
message(STATUS "boost: ${Boost_VERSION}")

find_package(absl REQUIRED)

if (ENABLE_TESTS)
find_package(GTest REQUIRED)
message(STATUS "GTest: ${GTest_VERSION}")
Expand Down
4 changes: 4 additions & 0 deletions src/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <string>
#include <system_error>

#include "absl/debugging/symbolize.h"
#include "boost/stacktrace/stacktrace.hpp"
#include "tcl.h"
#ifdef ENABLE_READLINE
Expand Down Expand Up @@ -221,6 +222,9 @@ int main(int argc, char* argv[])
signal(SIGILL, handler);
signal(SIGSEGV, handler);

// Initialize absl's symbolizer
absl::InitializeSymbolizer(argv[0]);

if (argc == 2 && stringEq(argv[1], "-help")) {
showUsage(argv[0], init_filename);
return 0;
Expand Down
2 changes: 0 additions & 2 deletions src/cts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2019-2025, The OpenROAD Authors

find_package(Boost CONFIG REQUIRED)

add_subdirectory(src)
if (ENABLE_TESTS)
add_subdirectory(test)
Expand Down
1 change: 0 additions & 1 deletion src/dft/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ or_integration_tests(
#dft_man_tcl_check
#dft_readme_msgs_check

find_package(Boost CONFIG)
add_subdirectory(cpp)
1 change: 0 additions & 1 deletion src/dpl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

include("openroad")
find_package(TCL)
find_package(Boost CONFIG)
find_package(LEMON NAMES LEMON lemon REQUIRED)
swig_lib(NAME dpl
NAMESPACE dpl
Expand Down
1 change: 0 additions & 1 deletion src/drt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT error)

find_package(Boost CONFIG REQUIRED COMPONENTS serialization)
find_package(OpenMP REQUIRED)
find_package(VTune)

Expand Down
1 change: 0 additions & 1 deletion src/dst/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ project(dst
LANGUAGES CXX
)

find_package(Boost CONFIG REQUIRED COMPONENTS serialization system thread)
swig_lib(NAME dst
NAMESPACE dst
I_FILE src/Distributed.i
Expand Down
73 changes: 68 additions & 5 deletions src/utl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,28 @@ package(
features = ["layering_check"],
)

cc_library(
name = "decode",
srcs = [
"src/decode.cpp",
],
hdrs = [
"include/utl/decode.h",
],
includes = [
"include",
"src",
],
deps = [
"@tk_tcl//:tcl",
],
)

# TODO: the prometheus target should be broken out, and possibly logger.
# However, there are cyclic dependencies currently between all these, which
# need to be taken care of first
cc_library(
name = "utl",
name = "utl_without_decode",
srcs = [
"src/CFileUtils.cpp",
"src/CallBack.cpp",
Expand All @@ -29,7 +46,6 @@ cc_library(
"src/Progress.cpp",
"src/ScopedTemporaryFile.cpp",
"src/SuppressStdout.cpp",
"src/decode.cpp",
"src/histogram.cpp",
"src/mem_stats.cpp",
"src/prometheus/metrics_server.cpp",
Expand All @@ -45,7 +61,6 @@ cc_library(
"include/utl/ScopedTemporaryFile.h",
"include/utl/SuppressStdout.h",
"include/utl/algorithms.h",
"include/utl/decode.h",
"include/utl/deleter.h",
"include/utl/exception.h",
"include/utl/histogram.h",
Expand Down Expand Up @@ -80,16 +95,64 @@ cc_library(
"src",
],
deps = [
"//src/sta:opensta_lib",
"@boost.algorithm",
"@boost.asio",
"@boost.beast",
"@boost.core",
"@boost.iostreams",
"@boost.iterator",
"@boost.random",
"@com_google_absl//absl/debugging:stacktrace",
"@com_google_absl//absl/debugging:symbolize",
"@spdlog",
"@tk_tcl//:tcl",
],
)

cc_library(
name = "utl",
hdrs = [
"include/utl/CFileUtils.h",
"include/utl/CallBack.h",
"include/utl/CallBackHandler.h",
"include/utl/Logger.h",
"include/utl/Metrics.h",
"include/utl/Progress.h",
"include/utl/ScopedTemporaryFile.h",
"include/utl/SuppressStdout.h",
"include/utl/algorithms.h",
"include/utl/decode.h",
"include/utl/deleter.h",
"include/utl/exception.h",
"include/utl/histogram.h",
"include/utl/mem_stats.h",
"include/utl/options.h",
"include/utl/prometheus/atomic_floating.h",
"include/utl/prometheus/benchmark.h",
"include/utl/prometheus/builder.h",
"include/utl/prometheus/ckms_quantiles.h",
"include/utl/prometheus/client_metric.h",
"include/utl/prometheus/collectable.h",
"include/utl/prometheus/counter.h",
"include/utl/prometheus/family.h",
"include/utl/prometheus/gauge.h",
"include/utl/prometheus/hash.h",
"include/utl/prometheus/histogram.h",
"include/utl/prometheus/metric_family.h",
"include/utl/prometheus/metrics_server.h",
"include/utl/prometheus/prometheus_metric.h",
"include/utl/prometheus/registry.h",
"include/utl/prometheus/save_to_file.h",
"include/utl/prometheus/summary.h",
"include/utl/prometheus/text_serializer.h",
"include/utl/prometheus/time_window_quantiles.h",
"include/utl/scope.h",
"include/utl/timer.h",
"include/utl/unique_name.h",
"include/utl/validation.h",
],
deps = [
":decode",
":utl_without_decode",
],
)

Expand Down
49 changes: 41 additions & 8 deletions src/utl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

include("openroad")

find_package(Boost CONFIG 1.78 REQUIRED COMPONENTS iostreams)

swig_lib(NAME utl
NAMESPACE utl
I_FILE src/Logger.i
Expand Down Expand Up @@ -35,7 +33,32 @@ if (Python3_FOUND AND BUILD_PYTHON)
)
endif()

add_library(utl_lib
#
# Isolate TCL dependency to decode
#
add_library(utl_decode
src/decode.cpp
)

target_include_directories(utl_decode
PUBLIC
include
PRIVATE
src
${TCL_INCLUDE_PATH}
)

target_link_libraries(utl_decode
PUBLIC
spdlog::spdlog
PRIVATE
${TCL_LIBRARY}
)

#
# Avoid TCL in the rest of utl
#
add_library(utl_base
src/CallBackHandler.cpp
src/CallBack.cpp
src/Metrics.cpp
Expand All @@ -47,25 +70,34 @@ add_library(utl_lib
src/CommandLineProgress.cpp
src/timer.cpp
src/mem_stats.cpp
src/decode.cpp
src/prometheus/metrics_server.cpp
src/histogram.cpp
)

target_include_directories(utl_lib
target_include_directories(utl_base
PUBLIC
include
PRIVATE
src
${Boost_INCLUDE_DIRS}
${TCL_INCLUDE_PATH}
absl::stacktrace
absl::symbolize
)

target_link_libraries(utl_lib
target_link_libraries(utl_base
PUBLIC
spdlog::spdlog
${TCL_LIBRARY}
${Boost_LIBRARIES}
absl::stacktrace
absl::symbolize
)

add_library(utl_lib INTERFACE)

target_link_libraries(utl_lib
INTERFACE
utl_base
utl_decode
)

target_sources(utl
Expand All @@ -90,6 +122,7 @@ target_compile_definitions(utl
target_link_libraries(utl
PUBLIC
utl_lib
utl_decode
)

messages(
Expand Down
Loading