OpenROAD-flow-scripts icon indicating copy to clipboard operation
OpenROAD-flow-scripts copied to clipboard

Unable to complete local installation with MacOS Air M1

Open vijayank88 opened this issue 3 years ago • 9 comments

Subject

[Build] for compilation-related issues.

Describe the bug

While trying install ORFS with --local failed during yosys installation.

Expected Behavior

Complete ORFS installation in MacOS Air M1

Environment

MacOS Air M1
chip Apple M1
Version 12.5

To Reproduce

git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts cd OpenROAD-flow-scripts cd tools/OpenROAD sudo ./etc/DependencyInstaller.sh -run sudo ./etc/DependencyInstaller.sh -dev ./build_openroad.sh --local

Relevant log output

[INFO FLW-0027] Saving logs to build_openroad.log
[INFO FLW-0028] ./build_openroad.sh --local
[INFO FLW-0002] Updating git submodules.
[INFO FLW-0001] Using local build method. This will create binaries at 'tools/install' unless overwritten.
[INFO FLW-0017] Compiling Yosys.
$BREW_PREFIX is [/usr/local/opt]
[100%] Building yosys
ld: warning: ignoring file /usr/local/opt/readline/lib/libreadline.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/libffi/3.3_3/lib/libffi.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/tcl-tk/8.6.13/lib/libtcl8.6.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/tcl-tk/8.6.13/lib/libtclstub8.6.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_Tcl_CreateCommand", referenced from:
      Yosys::yosys_get_tcl_interp() in yosys.o
  "_Tcl_CreateInterp", referenced from:
      Yosys::yosys_get_tcl_interp() in yosys.o
  "_Tcl_DeleteInterp", referenced from:
      Yosys::yosys_shutdown() in yosys.o
  "_Tcl_Eval", referenced from:
      Yosys::tcl_yosys_cmd(void*, Tcl_Interp*, int, char const**) in yosys.o
  "_Tcl_EvalFile", referenced from:
      _main in driver.o
      Yosys::TclPass::execute(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, Yosys::RTLIL::Design*) in yosys.o
  "_Tcl_Finalize", referenced from:
      Yosys::yosys_shutdown() in yosys.o
  "_Tcl_GetCommandInfo", referenced from:
      Yosys::tcl_yosys_cmd(void*, Tcl_Interp*, int, char const**) in yosys.o
  "_Tcl_GetStringResult", referenced from:
      _main in driver.o
      Yosys::TclPass::execute(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, Yosys::RTLIL::Design*) in yosys.o
  "_Tcl_NewIntObj", referenced from:
      Yosys::TclPass::execute(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, Yosys::RTLIL::Design*) in yosys.o
  "_Tcl_NewListObj", referenced from:
      Yosys::TclPass::execute(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, Yosys::RTLIL::Design*) in yosys.o
  "_Tcl_NewStringObj", referenced from:
      Yosys::TclPass::execute(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, Yosys::RTLIL::Design*) in yosys.o
  "_Tcl_ObjSetVar2", referenced from:
      Yosys::TclPass::execute(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, Yosys::RTLIL::Design*) in yosys.o
  "_add_history", referenced from:
      Yosys::shell(Yosys::RTLIL::Design*) in yosys.o
  "_append_history", referenced from:
      yosys_atexit() in driver.o
  "_clear_history", referenced from:
      yosys_atexit() in driver.o
  "_ffi_call", referenced from:
      Yosys::AST::dpi_call(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<Yosys::AST::AstNode*, std::__1::allocator<Yosys::AST::AstNode*> > const&) in dpicall.o
  "_ffi_prep_cif", referenced from:
      Yosys::AST::dpi_call(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<Yosys::AST::AstNode*, std::__1::allocator<Yosys::AST::AstNode*> > const&) in dpicall.o
  "_ffi_type_double", referenced from:
      Yosys::AST::dpi_call(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<Yosys::AST::AstNode*, std::__1::allocator<Yosys::AST::AstNode*> > const&) in dpicall.o
  "_ffi_type_float", referenced from:
      Yosys::AST::dpi_call(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<Yosys::AST::AstNode*, std::__1::allocator<Yosys::AST::AstNode*> > const&) in dpicall.o
  "_ffi_type_pointer", referenced from:
      Yosys::AST::dpi_call(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<Yosys::AST::AstNode*, std::__1::allocator<Yosys::AST::AstNode*> > const&) in dpicall.o
  "_ffi_type_sint32", referenced from:
      Yosys::AST::dpi_call(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<Yosys::AST::AstNode*, std::__1::allocator<Yosys::AST::AstNode*> > const&) in dpicall.o
  "_ffi_type_sint64", referenced from:
      Yosys::AST::dpi_call(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<Yosys::AST::AstNode*, std::__1::allocator<Yosys::AST::AstNode*> > const&) in dpicall.o
  "_history_list", referenced from:
      yosys_atexit() in driver.o
      Yosys::HistoryPass::execute(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, Yosys::RTLIL::Design*) in yosys.o
  "_history_truncate_file", referenced from:
      yosys_atexit() in driver.o
  "_read_history", referenced from:
      _main in driver.o
  "_readline", referenced from:
      Yosys::shell(Yosys::RTLIL::Design*) in yosys.o
      (anonymous namespace)::ShowPass::execute(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, Yosys::RTLIL::Design*) in show.o
  "_rl_attempted_completion_function", referenced from:
      Yosys::shell(Yosys::RTLIL::Design*) in yosys.o
  "_rl_basic_word_break_characters", referenced from:
      Yosys::shell(Yosys::RTLIL::Design*) in yosys.o
  "_rl_completion_matches", referenced from:
      Yosys::readline_completion(char const*, int, int) in yosys.o
  "_rl_line_buffer", referenced from:
      Yosys::readline_completion(char const*, int, int) in yosys.o
  "_rl_readline_name", referenced from:
      Yosys::shell(Yosys::RTLIL::Design*) in yosys.o
  "_where_history", referenced from:
      yosys_atexit() in driver.o
      _main in driver.o
  "_write_history", referenced from:
      yosys_atexit() in driver.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [yosys] Error 1

Screenshots

No response

Additional Context

No response

vijayank88 avatar Jan 11 '23 17:01 vijayank88

Please upload the build_openroad.log file. From the log output posted here, this is not the first time the user is calling the build script. Note that below all of the compilation messages from Yosys are omitted. It is good to make sure the user did not try to create a docker image in the same folder before calling the build script with -local -- this is not currently well supported and has been discussed here #754 and would explain the cryptic building for macOS-arm64 but attempting to link with file built for macOS-x86_64 message.

[INFO FLW-0027] Saving logs to build_openroad.log
[INFO FLW-0028] ./build_openroad.sh --local
[INFO FLW-0002] Updating git submodules.
[INFO FLW-0001] Using local build method. This will create binaries at 'tools/install' unless overwritten.
[INFO FLW-0017] Compiling Yosys.
$BREW_PREFIX is [/usr/local/opt]
[100%] Building yosys

vvbandeira avatar Jan 11 '23 19:01 vvbandeira

@vvbandeira I've used ./etc/DependencyInstaller.sh -local and got quit with below message.

==> Running `brew cleanup spdlog`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /Users/tsao/Library/Caches/Homebrew/spdlog--1.9.2... (328.0KB)
Warning: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK is set: not checking for outdated
dependents or dependents with broken linkage!
--2023-01-16 17:03:14--  https://github.com/google/or-tools/releases/download/v9.5/or-tools_arm64_MacOsX-13.0.1_cpp_v9.5.2237.tar.gz

Resolving github.com (github.com)... 20.27.177.113
Connecting to github.com (github.com)|20.27.177.113|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2023-01-16 17:03:15 ERROR 404: Not Found.

vijayank88 avatar Jan 16 '23 09:01 vijayank88

build_openroad.log

From the log output posted here, this is not the first time the user is calling the build script. Note that there are no compilation messages from Yosys. Please cleanup the workspace or clone the repo again and upload a full log file.

vvbandeira avatar Jan 17 '23 13:01 vvbandeira

One more datapoint:

I've been successfully building OpenRoad on an M1 for a while now. The one thing missing in your steps is adding the following two lines to the ~/.zshrc (not .bashrc as mentioned in the DependencyInstaller).

export PATH="$(brew --prefix bison)/bin:$(brew --prefix flex)/bin:$(brew --prefix tcl-tk)/bin:${PATH}" export CMAKE_PREFIX_PATH=$(brew --prefix or-tools)

stefanottili avatar Feb 01 '23 03:02 stefanottili

Thanks @stefanottili. I will try the same.

vijayank88 avatar Feb 01 '23 05:02 vijayank88

@habibayassin For MacOS unable to create /opt/or-tools currently:

./etc/DependencyInstaller.sh -local

mkdir: /opt/or-tools: Permission denied

If use sudo:

sudo ./etc/DependencyInstaller.sh -local

See error below.

OpenROAD: sudo ./etc/DependencyInstaller.sh -local
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.

vijayank88 avatar Feb 01 '23 07:02 vijayank88

I didn't run the DependencyInstaller or homebrew as sudo. For me or-tools live at /opt/homebrew/share/or-tools. If dependencies change, use ./build_openroad.sh --clean or rm -r OpenROAD-flow-scripts and clone again. Lemon, or-tools, fat and spdr used need some massaging in the past, but as of now, the dependency installer works for me.

To get the latest and greatest use build_openroad.sh --local --latest. This has the drawback that always recompiles sta, even when that didn't change.

stefanottili avatar Feb 01 '23 17:02 stefanottili

@habibayassin For MacOS unable to create /opt/or-tools currently:

./etc/DependencyInstaller.sh -local

mkdir: /opt/or-tools: Permission denied

If use sudo:

sudo ./etc/DependencyInstaller.sh -local

See error below.

OpenROAD: sudo ./etc/DependencyInstaller.sh -local
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.

@vijayank88 the fix for this issue is merged on OpenROAD repo, it will be reflected in ORFS once the submodule is updated.

habibayassin avatar Feb 04 '23 22:02 habibayassin