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

How to lunch the app ? #2

Closed
parweb opened this issue Nov 20, 2020 · 4 comments
Closed

How to lunch the app ? #2

parweb opened this issue Nov 20, 2020 · 4 comments

Comments

@parweb
Copy link

parweb commented Nov 20, 2020

Hello,

I try to follow the docs to try lunatic (https://crates.io/crates/lunatic)

here the code I'm working on
https://github.com/parweb/test-lunatic/

I succeed to build the app after adding extern crate lunatic;
cargo build --release --target=wasm32-wasi

But where I find the binary lunatic ? lunatic target/wasm32-wasi/release/<name>.wasm

@bkolobara
Copy link
Contributor

The documentations is a bit rough and I will definitely need to improve it. Especially the getting started part.

Lunatic consists of 2 parts:

  1. Libraries for different languages - This allows you to generate lunatic compatible WASM files. This is the part you did!
  2. The Lunatic runtime - This is the lunatic binary. For now you need to build it yourself. Using rust nightly and doing cargo build --release at the top of this repository should generate it. Don't forget to clone git submodules.

I will also provide pre-built binaries for different operating systems next week when hopefully networking support lands.

@parweb
Copy link
Author

parweb commented Nov 20, 2020

I run

git clone --recurse-submodules https://github.com/lunatic-lang/lunatic/
cargo build --release

but got this error

error[E0425]: cannot find function `available_concurrency` in module `thread`
  --> src/lib.rs:35:24
   |
35 |     let cpus = thread::available_concurrency().unwrap();
   |                        ^^^^^^^^^^^^^^^^^^^^^ not found in `thread`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.
error: could not compile `lunatic-vm`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

@bkolobara
Copy link
Contributor

You will need to use the latest rust nightly. available_concurrency was a recent addition to Rust.

@parweb
Copy link
Author

parweb commented Nov 20, 2020

For other newcomers

rustup update
cargo build --release

then

path/to/lunatic/repo/lunatic/target/release/lunatic-vm target/wasm32-wasi/release/test_lunatic.wasm

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