Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emscripten needs Binaryen while compiling to wasm #47869

Closed
openingnow opened this issue Dec 14, 2019 · 2 comments
Closed

Emscripten needs Binaryen while compiling to wasm #47869

openingnow opened this issue Dec 14, 2019 · 2 comments
Labels

Comments

@openingnow
Copy link

@openingnow openingnow commented Dec 14, 2019

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?
`brew config`, `brew doctor` output
$ brew config
HOMEBREW_VERSION: 2.2.1-21-gaeefacc
ORIGIN: https://github.com/Homebrew/brew
HEAD: aeefacc816a345bbf43259b6aff40c035868e8fd
Last commit: 15 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 680e941d54f3212161e1d5544fb17938bce9690a
Core tap last commit: 8 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: --appdir=/Applications --fontdir=/Library/Fonts
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_GITHUB_API_TOKEN: set
CPU: quad-core 64-bit haswell
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.24.1 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 10.15.2-x86_64
CLT: 11.0.33.8
Xcode: N/A

$ brew doctor
Your system is ready to brew.

What you were trying to do (and why)

Compile simple Hello World program(C++)

#include <iostream>
int main()
{
	std::cout << "Hello Homebrew!\n";
}

What happened (include command output)

after tons of cache:INFO: generating system library: XXX.bc,

$ em++ src.cpp 
shared:ERROR: BINARYEN_ROOT must be set up in .emscripten

What you expected to happen

Compiles without Error

Step-by-step reproduction instructions (by running brew install commands)

After brew install emscripten, homebrew prompts

Manually set LLVM_ROOT to
  /usr/local/opt/emscripten/libexec/llvm/bin
and comment out BINARYEN_ROOT
in ~/.emscripten after running `emcc` for the first time.

which is written in emscripten.rb.

However, emscripten refuses compiling after following that.

I found:

v1.38.44: 09/11/2019
--------------------
- Remove Binaryen from the ports system. This means that emscripten will
   no longer automatically build Binaryen from source. Instead, either use
   the emsdk (binaries are provided automatically, just like for LLVM), or
   build it yourself and point `BINARYEN_ROOT` in .emscripten to it. See #9409

at Emscripten Release Notes

As emscripten-core/emscripten#9409 saying we need BINARYEN_ROOT to be set in ~.emscripten.

My workaroud:

disable wasm output using em++ -s WASM=0 src.cpp

or install brew install binaryen then set BINARYEN_ROOT to /usr/local

Then, why didn't you make a PR?

I found another PR #44846 dealing with all the llvm, binaryen stuff. I'm not sure if my PR conflicts.

Also I don't know what BINARYEN_ROOT should be.. /usr/local or /usr/local/opt/binaryen/?

@dasa

This comment has been minimized.

Copy link
Contributor

@dasa dasa commented Dec 17, 2019

I ran into this issue as well and used BINARYEN_ROOT = '/usr/local/opt/binaryen'

@openingnow openingnow mentioned this issue Dec 18, 2019
0 of 5 tasks complete
@stale

This comment has been minimized.

Copy link

@stale stale bot commented Jan 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jan 24, 2020
@stale stale bot closed this Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.