OpenROAD icon indicating copy to clipboard operation
OpenROAD copied to clipboard

Add command for displaying all of the options OR was compiled with.

Open AcKoucher opened this issue 1 year ago • 2 comments

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

AcKoucher avatar Jan 18 '24 13:01 AcKoucher

Based on @rovinski 's suggestion.

AcKoucher avatar Jan 18 '24 13:01 AcKoucher

FYI, eqy is an external dependency of ORFS not compiled into OR

maliberty avatar Jan 18 '24 22:01 maliberty

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?

luarss avatar Mar 02 '24 12:03 luarss

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.

maliberty avatar Mar 02 '24 15:03 maliberty

Couldn't this be done like the git describe thing and add a string to the version header file?

gadfort avatar Mar 02 '24 15:03 gadfort

How will that string be generated?

maliberty avatar Mar 02 '24 18:03 maliberty

@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.

gadfort avatar Mar 02 '24 19:03 gadfort

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 ? '+' : '-');

rovinski avatar Mar 02 '24 19:03 rovinski

I would prefer if we don't rely on cmake generated files. It's not easy to replicate with bazel

QuantamHD avatar Mar 02 '24 21:03 QuantamHD

What do you suggest?

maliberty avatar Mar 03 '24 00:03 maliberty

Just the defines and a map of bool based on the defines?

QuantamHD avatar Mar 03 '24 01:03 QuantamHD

@QuantamHD does #4730 work for you? It seems to rely on defines in the c++ code.

maliberty avatar Mar 03 '24 05:03 maliberty