lunatic icon indicating copy to clipboard operation
lunatic copied to clipboard

How to lunch the app ?

Open parweb opened this issue 5 years ago • 4 comments
trafficstars

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

parweb avatar Nov 20 '20 16:11 parweb

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.

bkolobara avatar Nov 20 '20 19:11 bkolobara

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

parweb avatar Nov 20 '20 21:11 parweb

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

bkolobara avatar Nov 20 '20 22:11 bkolobara

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

parweb avatar Nov 20 '20 22:11 parweb