The-OpenROAD-Project / OpenROAD

OpenROAD's unified application implementing an RTL-to-GDS Flow. Documentation at https://openroad.readthedocs.io/en/latest/
https://theopenroadproject.org/
BSD 3-Clause "New" or "Revised" License
1.59k stars 552 forks source link

`write_sdc` result is gzipped unprompted #3108

Open donn opened 1 year ago

donn commented 1 year ago

Describe the bug

When attempting to write_sdc, the result appears to be a gzip file:

image

The command is just write_sdc. There's no -gzip command being passed.

Regardless, read_sdc fails on this gzipped file.

Expected Behavior

The file should be plain text, unless we're missing something?

Environment

Git commit: 5d4aeb1c605719de28366908f4fbaae439a57d05
kernel: Linux 6.0.19
os: NixOS 22.11 (Raccoon)
cmake version 3.24.3
-- The CXX compiler identification is Clang 11.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/naqfglx95i283dwna1zzqfrq3zgyfg89-clang-wrapper-11.1.0/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OpenROAD version: v2.0-7456-gd5e88bef0
-- System name: Linux
-- Compiler: Clang 11.1.0
-- Build type: RELEASE
-- Install prefix: /var/empty/local
-- C++ Standard: 17
-- C++ Standard Required: ON
-- C++ Extensions: OFF
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) 
-- The C compiler identification is Clang 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/naqfglx95i283dwna1zzqfrq3zgyfg89-clang-wrapper-11.1.0/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python: /nix/store/65cp4izx3bllnwqn7c7dhrq9h9gmjkal-python3-3.10.9/bin/python3.10 (found version "3.10.9") found components: Interpreter 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test C_COMPILER_SUPPORTS__-Wall
-- Performing Test C_COMPILER_SUPPORTS__-Wall - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wall
-- Performing Test CXX_COMPILER_SUPPORTS__-Wall - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-array-bounds
-- Performing Test C_COMPILER_SUPPORTS__-Wno-array-bounds - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-array-bounds
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-array-bounds - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-nonnull
-- Performing Test C_COMPILER_SUPPORTS__-Wno-nonnull - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-nonnull
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-nonnull - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-maybe-uninitialized
-- Performing Test C_COMPILER_SUPPORTS__-Wno-maybe-uninitialized - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-maybe-uninitialized
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-maybe-uninitialized - Failed
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format-overflow
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format-overflow - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format-overflow
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format-overflow - Failed
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-variable
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-variable - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-variable
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-variable - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-function
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-function - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-function
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-function - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-write-strings
-- Performing Test C_COMPILER_SUPPORTS__-Wno-write-strings - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-write-strings
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-write-strings - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-sign-compare
-- Performing Test C_COMPILER_SUPPORTS__-Wno-sign-compare - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-sign-compare
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-sign-compare - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-deprecated
-- Performing Test C_COMPILER_SUPPORTS__-Wno-deprecated - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-deprecated
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-deprecated - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-c++11-narrowing
-- Performing Test C_COMPILER_SUPPORTS__-Wno-c++11-narrowing - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-c++11-narrowing
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-c++11-narrowing - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-register
-- Performing CMake Warning at src/CMakeLists.txt:226 (message):
  spdlog: SPDLOG_FMT_EXTERNAL=ON

CMake Error at /nix/store/bjnxp0pm2xdgsmv4m8bb2y60bjd1irc2-boost-1.79.0-dev/lib/cmake/Boost-1.79.0/BoostConfig.cmake:141 (find_package):
  Found package configuration file:

    /nix/store/bjnxp0pm2xdgsmv4m8bb2y60bjd1irc2-boost-1.79.0-dev/lib/cmake/boost_serialization-1.79.0/boost_serialization-config.cmake

  but it set boost_serialization_FOUND to FALSE so package
  "boost_serialization" is considered to be NOT FOUND.  Reason given by
  package:

  No suitable build variant has been found.

  The following variants have been tried and rejected:

  * libboost_serialization.so.1.79.0 (shared, Boost_USE_STATIC_LIBS=ON)

Call Stack (most recent call first):
  /nix/store/bjnxp0pm2xdgsmv4m8bb2y60bjd1irc2-boost-1.79.0-dev/lib/cmake/Boost-1.79.0/BoostConfig.cmake:262 (boost_find_component)
  /nix/store/0257lz452871n4sp11afxfhm1g94dj4b-cmake-3.24.3/share/cmake-3.24/Modules/FindBoost.cmake:594 (find_package)
  src/drt/CMakeLists.txt:49 (find_package)

Test C_COMPILER_SUPPORTS__-Wno-register - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-register
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-register - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal
-- Performing Test C_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal - Success
-- Performing Test C_COMPILER_SUPPORTS__-fpermissive
-- Performing Test C_COMPILER_SUPPORTS__-fpermissive - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-fpermissive
-- Performing Test CXX_COMPILER_SUPPORTS__-fpermissive - Success
-- Performing Test C_COMPILER_SUPPORTS__-x
-- Performing Test C_COMPILER_SUPPORTS__-x - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-x
-- Performing Test CXX_COMPILER_SUPPORTS__-x - Failed
-- Performing Test C_COMPILER_SUPPORTS__c++
-- Performing Test C_COMPILER_SUPPORTS__c++ - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__c++
-- Performing Test CXX_COMPILER_SUPPORTS__c++ - Failed
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-but-set-variable
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-but-set-variable - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-but-set-variable
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-but-set-variable - Failed
-- TCL library: /nix/store/378rxqdx6lh4swhw49ifbilc6hbk7h2r-tcl-8.6.11/lib/libtcl.so
-- TCL header: /nix/store/378rxqdx6lh4swhw49ifbilc6hbk7h2r-tcl-8.6.11/include/tcl.h
-- TCL readline library: /nix/store/90fgbs1df2m2m7x0p40s35fviz1y3kj4-tclreadline-2.3.8/lib/libtclreadline.so
-- TCL readline header: /nix/store/90fgbs1df2m2m7x0p40s35fviz1y3kj4-tclreadline-2.3.8/include
-- Found SWIG: /nix/store/b31v2mp1mla6qbiwjlgixjnh5x426aw8-swig-3.0.12/bin/swig (found suitable version "3.0.12", minimum required is "3.0")  
-- Found Boost: /nix/store/bjnxp0pm2xdgsmv4m8bb2y60bjd1irc2-boost-1.79.0-dev/lib/cmake/Boost-1.79.0/BoostConfig.cmake (found version "1.79.0")  
-- boost: 1.79.0
-- Found Python3: /nix/store/65cp4izx3bllnwqn7c7dhrq9h9gmjkal-python3-3.10.9/include/python3.10 (found version "3.10.9") found components: Development Development.Module Development.Embed 
-- Found ZLIB: /nix/store/fblaj5ywkgphzpp5kx41av32kls9256y-zlib-1.2.13/lib/libz.so (found version "1.2.13") 
-- spdlog: 1.10.0
-- Found BISON: /nix/store/1gl7s2jiq3hfliz3giv7hwc6gwl8w5p2-bison-3.8.2/bin/bison (found version "3.8.2") 
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- STA version: 2.4.0
-- STA git sha: 20805c83cf4817f6d2ca7867a52dac226515a21e
-- System name: Linux
-- Compiler: Clang 11.1.0
-- Build type: RELEASE
-- Build CXX_FLAGS: -O3 -DNDEBUG
-- Install prefix: /var/empty/local
-- Found FLEX: /nix/store/5lzf74h8ygk5y5r1cn8a6qc9567cwcw1-flex-2.6.4/bin/flex (found version "2.6.4") 
-- TCL library: /nix/store/378rxqdx6lh4swhw49ifbilc6hbk7h2r-tcl-8.6.11/lib/libtcl.so
-- TCL header: /nix/store/378rxqdx6lh4swhw49ifbilc6hbk7h2r-tcl-8.6.11/include/tcl.h
-- SSTA: 0
-- STA executable: /home/donn/efabless/openroad/src/sta/app/sta
-- GPU is not enabled
-- Found Protobuf: /nix/store/lyklcycj3jdbg6bp80n7pjivizzcfr0c-protobuf-3.21.8/lib/libprotobuf.so (found version "3.21.8") 
-- Found re2: /nix/store/7b2zq7xn1yayhxmrwgsxklfckxyzhfqv-re2-2022-06-01-dev/lib/cmake/re2/re2Config.cmake (found version "9.0.0") 
-- Found GLPK: /nix/store/ycwzcwxr4a3ldpa7b19ypp9zpcxx4gql-glpk-5.0/lib/libglpk.so  
-- Found Eigen3: /nix/store/gzbmbqgjgqm91syx80vn8lzj6gmljw5q-eigen-3.4.0/share/eigen3/cmake/Eigen3Config.cmake (found version "3.4.0") 
-- GUI is enabled
-- Configuring incomplete, errors occurred!

To Reproduce

./run.sh

repro.tar.gz

Relevant log output

No response

Screenshots

No response

Additional Context

No response

maliberty commented 1 year ago

Is this really your build configuration: Configuring incomplete, errors occurred!

I ran with the head of OR (d5e88bef0089b8d0525f46ac1e7f74c352b16e26) and ./05-openroad-floorplan/spm.sdc is a plain text file.

donn commented 1 year ago

I define USE_SYSTEM_BOOST, the ./etc/Env.sh script just doesn't account for that.

I'll try again with the commit you've mentioned.

donn commented 1 year ago

Tested- same problem.

Probably either a weird dependency version problem or an environment variable... urgh

donn commented 1 year ago

Ugh, yep, a corner case to end all corner cases.

So write_sdc uses gzopen:

https://github.com/The-OpenROAD-Project/OpenSTA/blob/882681a674e7089e5f02de4ba2050c6be32b6cd1/sdc/WriteSdc.cc#L330

...which in my compiled OR binary is:

https://github.com/The-OpenROAD-Project/abc/blob/95b3543e928640dfa25f9e882e72a090a8883a9c/src/misc/zlib/gzlib.c#L198

as a shim for:

https://github.com/The-OpenROAD-Project/abc/blob/95b3543e928640dfa25f9e882e72a090a8883a9c/src/misc/zlib/gzlib.c#L92

The OpenSTA invocation uses "T", a mode flag that isn't supported by this implementation which it simply silently ignores. My hypothesis currently is that if ABC is built in an environment without a system zlib, it builds the included zlib, which causes this break. Testing further...

donn commented 1 year ago

Yeah, it's because I compile OpenROAD abc standalone then OpenROAD. I opened a PR for abc.

QuantamHD commented 1 year ago

You'll need to email Alan, the abc author, directly. He doesn't often respond to PRs unless pointed at one though email

donn commented 1 year ago

@QuantamHD This is OpenROAD's ABC fork...

QuantamHD commented 1 year ago

Ah you're totally right. I'm not sure we're committing patches to those forks though.