OpenROAD icon indicating copy to clipboard operation
OpenROAD copied to clipboard

`src/ant/src/AntennaChecker-py.i` doesn't compile with SWIG 3

Open donn opened this issue 2 years ago • 0 comments

Describe the bug

Fallout from https://github.com/The-OpenROAD-Project/OpenROAD/pull/2914: the removal of using namespace std; causes compilation to fail with these messages:

/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8233:3: error: no template named 'vector'; did you mean 'ant::vector'?
  vector< odb::dbITerm * > *arg2 = (vector< odb::dbITerm * > *) 0 ;
  ^~~~~~
  ant::vector
/Users/donn/efabless/openroad/src/ant/src/../include/ant/AntennaChecker.hh:47:12: note: 'ant::vector' declared here
using std::vector;
           ^
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8233:63: error: expected expression
  vector< odb::dbITerm * > *arg2 = (vector< odb::dbITerm * > *) 0 ;
                                                              ^
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8233:37: error: use of undeclared identifier 'vector'
  vector< odb::dbITerm * > *arg2 = (vector< odb::dbITerm * > *) 0 ;
                                    ^
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8251:28: error: no template named 'vector'; did you mean 'ant::vector'?
  arg2 = reinterpret_cast< vector< odb::dbITerm * > * >(argp2);
                           ^~~~~~
                           ant::vector
/Users/donn/efabless/openroad/src/ant/src/../include/ant/AntennaChecker.hh:47:12: note: 'ant::vector' declared here
using std::vector;
           ^
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8266:3: error: no template named 'vector'; did you mean 'ant::vector'?
  vector< odb::dbITerm * > *result = 0 ;
  ^~~~~~
  ant::vector
/Users/donn/efabless/openroad/src/ant/src/../include/ant/AntennaChecker.hh:47:12: note: 'ant::vector' declared here
using std::vector;
           ^
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8274:39: error: expected expression
  result = (vector< odb::dbITerm * > *)& ((arg1)->gates);
                                      ^
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8274:13: error: use of undeclared identifier 'vector'
  result = (vector< odb::dbITerm * > *)& ((arg1)->gates);
            ^
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8847:21: error: use of undeclared identifier 'vector'
  SwigValueWrapper< vector< ant::Violation > > result;
                    ^
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8888:39: error: no template named 'vector'; did you mean 'ant::vector'?
  resultobj = SWIG_NewPointerObj((new vector< ant::Violation >(static_cast< const vector< ant::Violation >& >(result))), SWIGTYPE_p_vectorT_ant__Violation_t, SWIG_POINTER_OWN |  0 );
                                      ^~~~~~
                                      ant::vector
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:1187:89: note: expanded from macro 'SWIG_NewPointerObj'
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
                                                                                        ^
/Users/donn/efabless/openroad/src/ant/src/../include/ant/AntennaChecker.hh:47:12: note: 'ant::vector' declared here
using std::vector;
           ^
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:8888:83: error: no template named 'vector'; did you mean 'ant::vector'?
  resultobj = SWIG_NewPointerObj((new vector< ant::Violation >(static_cast< const vector< ant::Violation >& >(result))), SWIGTYPE_p_vectorT_ant__Violation_t, SWIG_POINTER_OWN |  0 );
                                                                                  ^~~~~~
                                                                                  ant::vector
/Users/donn/efabless/openroad/build/src/ant/src/CMakeFiles/ant_py.dir/AntennaChecker-pyPYTHON_wrap.cxx:1187:89: note: expanded from macro 'SWIG_NewPointerObj'
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
                                                                                        ^
/Users/donn/efabless/openroad/src/ant/src/../include/ant/AntennaChecker.hh:47:12: note: 'ant::vector' declared here
using std::vector;

This is because SWIG 3 doesn't handle the using std::vector in src/ant/include/ant/AntennaChecker.hh. SWIG 4 however does.

The only reason I mention this is that this is the only SWIG file that is broken on SWIG 3, and it can be fixed quite easily.

Expected Behavior

Adding using std::vector; after using namespace odb; in src/ant/src/AntennaChecker-py.i works, but also, given that SWIG 3 is no longer being actively tested, it may be prudent to just update src/CMakeLists.txt to require SWIG 4 as a minimum.

Environment

Git commit: 75f2f325b7a42e56a92404f33af8e96530d9b202
kernel: Darwin 23.1.0
os: macOS 14.1.1
cmake version 3.27.7
CMake Deprecation Warning at third-party/abc/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Warning:
  Manually-specified variables were not used by the project:

    VERBOSE


-- The CXX compiler identification is Clang 16.0.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/zh206nri10wwp68g7qf9ccya1irynx5g-clang-wrapper-16.0.6/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OpenROAD version: v2.0-11533-g75f2f325b
-- System name: Darwin
-- Compiler: Clang 16.0.6
-- Build type: RELEASE
-- Install prefix: /var/empty/local
-- C++ Standard: 17
-- C++ Standard Required: ON
-- C++ Extensions: OFF
-- The C compiler identification is Clang 16.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/zh206nri10wwp68g7qf9ccya1irynx5g-clang-wrapper-16.0.6/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- 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 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 - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-but-set-variable
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-but-set-variable - Success
-- TCL library: /nix/store/l1rhkhykl3vzqipkk1c7wm6qanswxnrk-tcl-8.6.13/lib/libtcl.dylib
-- TCL header: /nix/store/l1rhkhykl3vzqipkk1c7wm6qanswxnrk-tcl-8.6.13/include/tcl.h
-- TCL readline library: /nix/store/ajpyasvckmhr4w0jf92hjcqh4wfpy214-tclreadline-2.3.8/lib/libtclreadline.dylib
-- TCL readline header: /nix/store/ajpyasvckmhr4w0jf92hjcqh4wfpy214-tclreadline-2.3.8/include
-- Found SWIG: /nix/store/f0kg0q7y7m9rlfs1skgrqkhhmbhd2slh-swig-3.0.12/bin/swig (found suitable version "3.0.12", minimum required is "3.0")  
-- Found Boost: /nix/store/vf1zzbfy97i3awvva9yb2559vii2vc47-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0")  
-- boost: 1.83.0
-- Found Python3: /nix/store/7b0rz3bnx7msw2wawkv1hhn5lqf1b0wi-python3-3.11.6/include/python3.11 (found version "3.11.6") found components: Development Development.Module Development.Embed 
-- Found ZLIB: /nix/store/a377d66g1rgsd4vkzxdhkza5g55fkmky-zlib-1.3/lib/libz.dylib (found version "1.3")  
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- spdlog: 1.12.0
-- Found BISON: /nix/store/js4fzri749vfnjda5jz73ydclv5dgjan-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: 5b374dd36ad345c9fcd5224e9fc20484393568ab
-- System name: Darwin
-- Compiler: Clang 16.0.6
-- Build type: RELEASE
-- Build CXX_FLAGS: -O3 -DNDEBUG
-- Install prefix: /var/empty/local
-- Found FLEX: /nix/store/4zngv9imr4gii0zz9wmi4am1ijf14xib-flex-2.6.4/bin/flex (found version "2.6.4") 
-- TCL library: /nix/store/l1rhkhykl3vzqipkk1c7wm6qanswxnrk-tcl-8.6.13/lib/libtcl.dylib
-- TCL header: /nix/store/l1rhkhykl3vzqipkk1c7wm6qanswxnrk-tcl-8.6.13/include/tcl.h
-- SSTA: 0
-- STA executable: /Users/donn/efabless/openroad/src/sta/app/sta
-- Found Protobuf: /nix/store/nkrmgb9ikzpdrs5h02jrw7yd69wybwv7-protobuf-21.12/lib/libprotobuf.dylib (found version "3.21.12") 
-- Found re2: /nix/store/hpdlfnhcp4xpc0y2kn2z7644ksy46mz6-re2-2023-11-01-dev/lib/cmake/re2/re2Config.cmake (found version "11.0.0") 
-- Found GLPK: /nix/store/xh65x0zq6ni7dkb1dymdrahxll81ma8m-glpk-5.0/lib/libglpk.dylib  
-- Found OpenMP_CXX: -fopenmp=libomp (found version "5.0") 
-- Found OpenMP: TRUE (found version "5.0")  
-- GPU is not enabled
-- TCL library: /nix/store/l1rhkhykl3vzqipkk1c7wm6qanswxnrk-tcl-8.6.13/lib/libtcl.dylib
-- TCL header: /nix/store/l1rhkhykl3vzqipkk1c7wm6qanswxnrk-tcl-8.6.13/include/tcl.h
-- Found Eigen3: /nix/store/wx9kzvpd6ck59i9n2rg2jgir3km31n8b-eigen-3.4.0/share/eigen3/cmake/Eigen3Config.cmake (found version "3.4.0") 
-- GUI is enabled
-- Charts widget is not enabled
-- Found Boost: /nix/store/vf1zzbfy97i3awvva9yb2559vii2vc47-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0") found components: serialization 
-- Could NOT find VTune (missing: VTune_LIBRARIES VTune_INCLUDE_DIRS) 
-- Found Boost: /nix/store/vf1zzbfy97i3awvva9yb2559vii2vc47-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable version "1.83.0", minimum required is "1.78")  
-- TCL library: /nix/store/l1rhkhykl3vzqipkk1c7wm6qanswxnrk-tcl-8.6.13/lib/libtcl.dylib
-- TCL header: /nix/store/l1rhkhykl3vzqipkk1c7wm6qanswxnrk-tcl-8.6.13/include/tcl.h
-- Found Boost: /nix/store/vf1zzbfy97i3awvva9yb2559vii2vc47-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0") found components: serialization system thread 
-- Removing MPL2 and PAR to avoid run time fatal error.
-- TCL readline enabled
-- Tcl Extended disabled
-- Python3 enabled
-- Removing PAR_PY to avoid run time fatal error.
-- Configuring done (15.1s)
-- Generating done (0.8s)
-- Build files have been written to: /tmp/tmp.bFvsVZtWO2

To Reproduce

Attempt to build OpenROAD with SWIG 3.0.12.

Relevant log output

No response

Screenshots

No response

Additional Context

No response

donn avatar Dec 18 '23 14:12 donn

Could we perhaps just link to the 2.0 milestone and ensure we are marking all our great ideas for 2.0?

ktbarrett avatar Nov 24 '20 04:11 ktbarrett

Yes, that, and we should also link to the deprecations in 2.0 specifically. EDIT: ah, no, that doesn't cut it. Do we need a new label like "🗑️ Removal in 2.0" where we collect all the existing deprecations under, so that type:deprecation is eventually free for the next deprecation cycle, or create a new deprecation label for those?

cmarqu avatar Dec 07 '20 21:12 cmarqu

  • Mention Python 3.6+ being required in 2.0.

cmarqu avatar Jan 18 '21 21:01 cmarqu

I don't think we need to do this since we decided to do a 1.6 release. The 'latest' documentation after release could have a warning on the home page about it being a breaking release, and of course 1.6 will be just be a bunch of warnings about what we have changed.

ktbarrett avatar Jan 25 '21 17:01 ktbarrett

  • We're done with 1.9.
  • I don't see much actionable work here anyways: we do have a deprecations section in the release notes, and users get notified via in-product messages. That's probably good enough, since nobody implemented anything better since this issue was created 4 years ago.

imphil avatar Jul 08 '24 09:07 imphil