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

ERROR:root:compiler frontend failed to generate LLVM bitcode, halting #40

Open
ZXMeloman opened this issue Nov 28, 2017 · 4 comments
Open

Comments

@ZXMeloman
Copy link

Hello.
At a stage "Stage 3: Generating Bindings" there is an error: "ERROR:root:compiler frontend failed to generate LLVM bitcode, halting".
Here a broad gull of errors:
`Stage 3: Generating Bindings

../../bindings.cpp:3271:39: error: too many template arguments for class
template 'base'
emscripten::class_<cv::Feature2D ,base<Algorithm ,true>>("Feature2D")
^ ~~~~~~
D:\Work\TEMP_PROJECT\openCVjs\emsdk-portable-64bit\emscripte
n\1.37.22\system\include\emscripten/bind.h:1034:12: note:
template is declared here
struct base {
^
../../bindings.cpp:3271:62: error: expected unqualified-id
emscripten::class_<cv::Feature2D ,base<Algorithm ,true>>("Feature2D")
^
../../bindings.cpp:3271:62: error: expected ')'
../../bindings.cpp:3271:61: note: to match this '('
emscripten::class_<cv::Feature2D ,base<Algorithm ,true>>("Feature2D")
^
3 errors generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
Traceback (most recent call last):
File "make.py", line 183, in
emscripten.Building.emcc('../../bindings.cpp', emcc_binding_args, 'bindings.
bc')
File "D:/Work/TEMP_PROJECT/openCVjs/emsdk-portable-64bit/e
mscripten/1.37.22\tools\shared.py", line 1996, in emcc
assert os.path.exists(output_filename), 'emcc could not create output file:
' + output_filename
AssertionError: emcc could not create output file: bindings.bc`

Here a broad gull from "emsdk list":
`The following precompiled tool packages are available for download:
clang-nightly-e1.37.9-2017_04_19_23_39-64bit
clang-nightly-e1.37.9-2017_04_20_04_06-64bit
clang-e1.30.0-64bit
clang-e1.34.1-64bit
clang-e1.35.0-64bit
clang-e1.37.1-64bit
clang-e1.37.21-64bit
* clang-e1.37.22-64bit INSTALLED
node-4.1.1-32bit
* node-4.1.1-64bit INSTALLED
python-2.7.5.3-32bit
* python-2.7.5.3-64bit INSTALLED
java-7.45-32bit
* java-7.45-64bit INSTALLED
spidermonkey-37.0.1-64bit
spidermonkey-nightly-2015-04-12-64bit
git-1.9.4
emscripten-1.30.0
emscripten-1.34.1
emscripten-1.35.0
emscripten-1.37.1
emscripten-1.37.21
* emscripten-1.37.22 INSTALLED
emscripten-nightly-1.37.9-2017_04_19_23_39
emscripten-nightly-1.37.9-2017_04_20_04_06
* vs-tool-0.9.4 INSTALLED
crunch-1.03
gnu-2.5.4
mingw-7.1.0-64bit

The following tools can be compiled from source:
clang-tag-e1.37.21-32bit
clang-tag-e1.37.22-32bit
clang-tag-e1.37.21-64bit
clang-tag-e1.37.22-64bit
clang-incoming-32bit
clang-incoming-64bit
clang-master-32bit
clang-master-64bit
emscripten-tag-1.37.21-32bit
emscripten-tag-1.37.22-32bit
emscripten-tag-1.37.21-64bit
emscripten-tag-1.37.22-64bit
binaryen-tag-1.37.21-32bit
binaryen-tag-1.37.22-32bit
binaryen-tag-1.37.21-64bit
binaryen-tag-1.37.22-64bit
emscripten-incoming-32bit
emscripten-master-32bit
emscripten-incoming-64bit
emscripten-master-64bit
binaryen-master-32bit
binaryen-master-64bit

The following precompiled SDKs are available for download: (Run "./emsdk update"
to pull in the latest list)
sdk-nightly-1.37.9-2017_04_19_23_39-64bit
sdk-nightly-1.37.9-2017_04_20_04_06-64bit
sdk-1.30.0-64bit
sdk-1.34.1-64bit
sdk-1.35.0-64bit
sdk-1.37.1-64bit
sdk-1.37.21-64bit
* sdk-1.37.22-64bit INSTALLED

The following SDKs can be compiled from source:
sdk-incoming-32bit
sdk-incoming-64bit
sdk-master-32bit
sdk-master-64bit
sdk-tag-1.37.21-32bit
sdk-tag-1.37.22-32bit
sdk-tag-1.37.21-64bit
sdk-tag-1.37.22-64bit

Items marked with * are activated for the current user.

To access the historical archived versions, type 'emsdk list --old'
`
I the beginner in it. I want to expand the experience, having studied this library. But it is impossible to compile.
I will be grateful for any help.

@drhouse82
Copy link

I believe you did not successfully apply the emscripten patch described in the readme. That patch fixes the number of base template arguments.
Alternatively, instead of using this library, you can build from the emscripten project included in opencv itself (https://docs.opencv.org/3.3.1/d5/d10/tutorial_js_root.html). This works without patching emscripten.

@ZXMeloman
Copy link
Author

Thanks, for your answer.
Under the instruction to opencv from docs.opencv.org me it was not possible to promote even on one step. Emscripten has given out the following:

WindowsError: [Error 193] %1 эх  ты хЄё  яЁшыюцхэшхь Win32
Though it also does not concern this branch.

About a patch you are absolutely right, it was not possible to me (I has not understood as) it to apply under windows:
"patch" is not internal or external The command executed by the program or a package file.

I thank for the help.

@drhouse82
Copy link

I agree that compiling under Windows this is a nightmare for a beginner, both the patching as well as the emscripten compilation.
After many hours of failing, I ended up using a virtual machine (virtualbox), I installed Ubuntu 16.04. Then, you can just follow the instructions on the opencv webpage. Moreover, you dont have to build emscripten, which was taking many hours for me, as this is already available in a compiled version for Ubuntu. Installing the virtual machine and compiling opencv took less than one hour, I believe...

@ZXMeloman
Copy link
Author

It is a pity that the question with use Windows was not resolved. But I have a free car with Ubuntu. I will try on it. Thanks for consultation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants