The-OpenROAD-Project / The-OpenROAD-Project/OpenSTA

CMakeFile generates StaConfig.hh in source tree instead of build tree

Open
#264 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Verilog
Stars
619
Forks
270
Avg merge
5d 15h
Merged PRs (30d)
4

Description

The CMake file in sta generates its config in STA_HOME instead of CMAKE_CURRENT_BINARY_DIR.

Because of that, if cmake is run and then bazel is run, the compiler finds the wrong StaConfig.hh and complains about tclreadline not found (because that is not compiled into the bazel build yet). The bazel build generates its own version, but because the cmake configure creates that in the wrong place, it will mess up things.

So what I believe should be done is:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -392,7 +392,7 @@ message(STATUS "SSTA: ${SSTA}")
 
 # configure a header file to pass some of the CMake settings
 configure_file(${STA_HOME}/util/StaConfig.hh.cmake
-  ${STA_HOME}/include/sta/StaConfig.hh
+  ${CMAKE_CURRENT_BINARY_DIR}/include/sta/StaConfig.hh
   )
 
 ###########################################################

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in CMakeLists.txt around the configure_file call near the SSTA status message, and compare the configured header path with CMAKE_CURRENT_BINARY_DIR. Verify that CMake places include/sta/StaConfig.hh in the build tree rather than STA_HOME, then check that running CMake followed by Bazel no longer causes the conflicting header or tclreadline error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.