OpenROAD
OpenROAD copied to clipboard
Add command for displaying all of the options OR was compiled with.
Description
It would be nice to have a way to know whether or not we're running with an exclusive feature such as Charts, which is not supported in CentOS 7.
Suggested Solution
OpenROAD v2.0-11454-g34687e2a9
Features included (+) or not (-):
-charts -eqy +GPU +GUI +Python ...
Additional Context
No response
Based on @rovinski 's suggestion.
FYI, eqy is an external dependency of ORFS not compiled into OR
I can take this. We can parse the CMakeCache.txt file assuming it is compiled locally.
BUILD_PYTHON:BOOL=ON
BUILD_GUI:BOOL=ON
GPU:BOOL=OFF
But for Charts
the target seem to be private and unparseable from the file. Any ideas?
I don't think parsing CMakeCache.txt is the right approach. For example charts is defined in ENABLE_CHARTS and you can just write conditional code on that define (#ifdef ENABLE_CHARTS
). Likewise with the other options.
Couldn't this be done like the git describe thing and add a string to the version header file?
How will that string be generated?
@maliberty you could do something like yosys: https://github.com/YosysHQ/yosys/blob/91fbd58980e87ad5dc0a5d37c049ffaf5ab243dd/Makefile#L770 Have cmake build the string and write that into a file like it does with the version.h header.
The variables are already defined in CMake as 1 or 0, right? Why not simply something like
logger->report("Features included (+) or not (-):\n"
"{}Charts {}GUI {}GPU {}Python",
ENABLE_CHARTS ? '+' : '-',
BUILD_GPU ? '+' : '-',
BUILD_GUI ? '+' : '-',
BUILD_PYTHON ? '+' : '-');
I would prefer if we don't rely on cmake generated files. It's not easy to replicate with bazel
What do you suggest?
Just the defines and a map of bool based on the defines?
@QuantamHD does #4730 work for you? It seems to rely on defines in the c++ code.