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

openingnow opened this issue Dec 14, 2019 · 2 comments

Emscripten needs Binaryen while compiling to wasm #47869

openingnow opened this issue Dec 14, 2019 · 2 comments


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
HEAD: aeefacc816a345bbf43259b6aff40c035868e8fd
Last commit: 15 hours ago
Core tap ORIGIN:
Core tap HEAD: 680e941d54f3212161e1d5544fb17938bce9690a
Core tap last commit: 8 hours ago
HOMEBREW_CASK_OPTS: --appdir=/Applications --fontdir=/Library/Fonts
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
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
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/?


This comment has been minimized.

Copy link

@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

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
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.