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

llc exectuable not found at `/b/s/w/ir/k/install/fastcomp/bin/llc` #260

Closed
guest271314 opened this issue Jun 3, 2019 · 12 comments

Comments

@guest271314
Copy link

commented Jun 3, 2019

Trying to port mkvmerge https://gitlab.com/mbunkus/mkvtoolnix to JavaScript.

Downloaded the SDK, followed instructions at https://emscripten.org/docs/building_from_source/building_emscripten_from_source_on_linux.html#building-emscripten-on-linux https://gitlab.com/mbunkus/mkvtoolnix getting error at terminal when trying to test

~/emsdk/fastcomp/bin$ ./emcc tests/hello_world.cpp cache:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/path/to/.emscripten_cache/is_vanilla.txt" for subsequent builds) shared:ERROR: llc exectuable not found at /b/s/w/ir/k/install/fastcomp/bin/llc`

@kripken

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

What does the ~/.emscripten file contain?

The output when running with EMCC_DEBUG=1 in the env may be useful.

Those /b/s/w.. paths look very strange. We have similar ones on the build bots, but I'm not sure how that could "leak" into the emsdk.

@guest271314

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

@kripken Began the procedure at https://emscripten.org/docs/getting_started/downloads.html#verifying-the-installation got to Linux section at More detailed instructions on the toolchain are provided in: Manually Building Emscripten on Linux. Navigated to that document and followed instructions, including

  1. Build Fastcomp (LLVM + Clang) from source using these instructions.

Then went back to the first page at

Updating the SDK

and continued to try the test

~/emsdk/fastcomp/bin$ ./emcc tests/hello_world.cpp
cache:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/path/to/.emscripten_cache/is_vanilla.txt" for subsequent builds)
shared:ERROR: llc exectuable not found at `/b/s/w/ir/k/install/fastcomp/bin/llc`

Did fastcomp need to be build separately?

Do you mean emscripten.py in /emsdk/fastcomp/emscripten/?

@guest271314

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

@kripken If you mean .emscripten file

import os
LLVM_ROOT = '/path/to/emsdk/fastcomp/fastcomp/bin'
BINARYEN_ROOT = '/path/to/emsdk/fastcomp'
NODE_JS = '/path/to/emsdk/node/8.9.1_64bit/bin/node' # is this the issue?
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
TEMP_DIR = '/tmp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]

Re the node install the machine is 32-bit, not 64-bit.

@kripken

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

Yes, I meant the .emscripten file. Is the LLVM_ROOT value really /path/to/emsdk/ etc., and not a real path? With a fake path like that I'd expect it to give an error on not finding llvm.

Even odder, I don't see that /b/s/w/ir/k/ path anywhere in the config file.

So I suspect that maybe that .emscripten file is not being used, and another one exists with that /b/s/w/ir/k/ path. Doing a search on your hard drive might help.

Also maybe EMCC_DEBUG=1 logging would help.

@kripken

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

Ah, I missed the comment about 32-bit. All emsdk builds are 64 bit. So on a 32-bit system, an error might occur - I wonder if the /b/s/w/ir/k/ was baked in somehow, and gets reported incorrectly?

Perhaps the emsdk should error if the system is 32 bit? Or only allow building from source.

@guest271314

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

@kripken /path/to/emsdk/ is equivalent to /home/user/emsdk the /home directory at *nix. Noticed the 64-bit parts during installation though since had not used emscripten continued anyway in the prospect that the code would adjust for 32-bit system, evidently not.

Did not notice any prominent note at the documentation that a 32-bit system was required to build and run emscripten.

@guest271314

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

What course do you suggest to proceed? Have not even began trying to extract only mkvmerge out of MKVTookNix.

@kripken

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

I opened #265 to show a proper error for 32-bit OSes now.

On 32 bit you will need to build yourself from source. For the LLVM wasm backend, that's pretty easy, just get the LLVM monorepo and build it using their instructions normally.

@guest271314

This comment has been minimized.

Copy link
Author

commented Jun 5, 2019

@kripken Do you mean download from http://llvm.org/docs/ReleaseNotes.html#introduction ? Are there specific build instructions for *nix at 32 bit?

@kripken

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

@guest271314 I think the main build docs are here: https://llvm.org/docs/CMake.html

@guest271314

This comment has been minimized.

Copy link
Author

commented Jun 9, 2019

@kripken Downloaded and install LLVM. Also downloaded emscipten using apt to try a precompiled package (https://launchpad.net/ubuntu/bionic/i386/emscripten/1.22.1-1build1) where --version outputs

$ emcc --version
ERROR    root: Invoking Process failed: <<< git show >>>
emcc (Emscripten GCC-like replacement) 1.22.1 ((unknown revision))
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Trying the simple examples of code at https://developer.mozilla.org/en-US/docs/WebAssembly/existing_C_to_wasm, https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm, https://www.geeksforgeeks.org/writing-first-c-program-hello-world-example/, https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#calling-compiled-c-functions-from-javascript-using-ccall-cwrap though none of the attempts did not result in some form of error and not the expected WASM and JavaScript files

$ emcc hello.c -s WASM=1 -o hello.html
WARNING  root: Assigning a non-existent settings attribute "WASM"
WARNING  root:  - did you mean one of ASM_JS?
WARNING  root:  - perhaps a typo in emcc's  -s X=Y  notation?
WARNING  root:  - (see src/settings.js for valid values)
/usr/bin/lli: error creating EE: No available targets are compatible with this triple.
FAIL: Running the generated program failed!

$ emcc -03  WASM=1 -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' hello.c
ERROR    root: WASM=1: No such file or directory ("WASM=1" was expected to be an input file, based on the commandline arguments provided)$ emcc hello.c -o function.html -s EXPORTED_FUNCTIONS='["hello"]' -s EXTRA_RUNTIME_METHODS='["ccal","cwrap"]'
WARNING  root: Assigning a non-existent settings attribute "EXTRA_RUNTIME_METHODS"
WARNING  root:  - did you mean one of NO_EXIT_RUNTIME?
WARNING  root:  - perhaps a typo in emcc's  -s X=Y  notation?
WARNING  root:  - (see src/settings.js for valid values)
/usr/bin/lli: error creating EE: No available targets are compatible with this triple.
FAIL: Running the generated program failed!

$ emcc hello.c -o function.html -s EXPORTED_FUNCTIONS='["hello"]' -s EXTRA_RUNTIME_METHODS='["ccal","cwrap"]'
WARNING  root: Assigning a non-existent settings attribute "EXTRA_RUNTIME_METHODS"
WARNING  root:  - did you mean one of NO_EXIT_RUNTIME?
WARNING  root:  - perhaps a typo in emcc's  -s X=Y  notation?
WARNING  root:  - (see src/settings.js for valid values)
/usr/bin/lli: error creating EE: No available targets are compatible with this triple.
FAIL: Running the generated program failed!

$ emcc hello_function.cpp -o function.html
/usr/bin/lli: error creating EE: No available targets are compatible with this triple.
FAIL: Running the generated program failed!

This is the directory (command) am trying to convert to JavaScript https://gitlab.com/mbunkus/mkvtoolnix/tree/master/src/merge. How to proceed using emscipten?

@kripken

This comment has been minimized.

Copy link
Member

commented Jun 9, 2019

1.22.1 is 5 years old. It will probably be very hard to get it to work.

It's best to build LLVM yourself from recent master, or see if your distro or somewhere else offers a recent LLVM build for your platform. Emscripten can use such a build with the llvm wasm backend, just get recent emscripten from github and point it to that llvm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.