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

t-coffee #79

Open
robertaboukhalil opened this issue Oct 9, 2023 · 4 comments
Open

t-coffee #79

robertaboukhalil opened this issue Oct 9, 2023 · 4 comments

Comments

@robertaboukhalil
Copy link
Member

robertaboukhalil commented Oct 9, 2023

Originally posted by @orangeSi in biowasm/aioli#40 (comment)

          when I use the same way to complie(```emscripten/emsdk:2.0.34```) software ```t_coffee``` (http://tcoffee-packages.s3-website.eu-central-1.amazonaws.com/#Stable/Latest/) to wasm and got ```t_coffee.wasm``` without error, but when run in Chrome get error:
[WebWorker] Executing t_coffee -seq=input.fa -reg    args=null
20b6be06-daba-47f1-bec0-8e1412abe74c:1 RuntimeError: unreachable
    at set_nproc(int) (t_coffee.wasm:0x1689fa)
    at t_coffee_dpa(int, char**) (t_coffee.wasm:0x4735be)
    at batch_main(int, char**) (t_coffee.wasm:0x4538ab)
    at main (t_coffee.wasm:0x44d553)
    at VM13 t_coffee.js:1581:22
    at Object.callMain (VM13 t_coffee.js:5618:15)
    at Object.exec (20b6be06-daba-47f1-bec0-8e1412abe74c:1:5793)
    at i (20b6be06-daba-47f1-bec0-8e1412abe74c:1:1015)

detail of at set_nproc(int) (t_coffee.wasm:0x1689fa) is as below:

  (func $set_nproc(int) (;882;) (param $var0 i32) (result i32)
    (local $var1 i32)
    (local $var2 i32)
    (local $var3 i32)
    (local $var4 i32)
    (local $var5 i32)
    global.get $__stack_pointer
    local.set $var1
    i32.const 16
    local.set $var2
    local.get $var1
    local.get $var2
    i32.sub
    local.set $var3
    local.get $var3
    local.get $var0
    i32.store offset=12
    local.get $var3
    i32.load offset=12
    local.set $var4
    i32.const 0
    local.set $var5
    local.get $var5
    local.get $var4
    i32.store offset=696988
    unreachable
  )

Do you occur the silimar error as above?

t_coffee.wasm and t_coffee.js is in t_coffee.wasm.js.zip

Thanks~
Si

@robertaboukhalil
Copy link
Member Author

@orangeSi I'll take a look, can you share the instructions you used to compile t coffee to WebAssembly?

@orangeSi
Copy link
Contributor

orangeSi commented Oct 9, 2023

ok, the main process is:

## go into docker container of emscripten/emsdk:2.0.34
cd /fsxlustre1/skw/software/biowasm/
wget https://github.com/biowasm/biowasm/archive/refs/heads/main.zip
unzip main.zip
cd biowasm-main
## add t_cofffee to biowasm.json
python3 bin/compile.py  --tools t_coffee --versions 13.46.0
## ok , then got  t_coffee.js and t_coffee.wasm in ./build/t_coffee/13.46.0

## then run it in Chrome, and I removed some thow(e) in  ```t_coffee.js```   to make ```t_coffee -version``` works, 
#### but ```t_coffee iput.fa``` not work and output above raw error!

and the some detail is:

cat tools/t_coffee/compile.sh 
set -eu
cd /fsxlustre1/skw/software/biowasm/biowasm-main/tools/t_coffee
cd tcoffee-Version_13.46.0.919e8c6b/t_coffee/src/
emmake make  t_coffee \
    GPP=emcc CXX=em++ CC=em++ EM_FLAGS="$EM_FLAGS"

the t_coffee source code is in http://tcoffee-packages.s3-website.eu-central-1.amazonaws.com/#Stable/Latest/

FOR reproduce my same error:
The test-biowasm.html + test-biowasm.js + t_coffee.js + t_coffee.wasm which output the raw error can be downlad at
github_debug.zip

@robertaboukhalil
Copy link
Member Author

I get the same error. For some reason it really doesn't like set_nproc, which is weird because all it does is set a variable to a number.

But if I comment that out from t_coffee.c, it keeps going further BUT gives a different error:

Screenshot 2023-10-12 at 9 15 03 PM

Sounds like tcoffee creates a child process to run some other program? That's not supported in WebAssembly. So I don't think tcoffee will be compilable, unless you modify the program to not do any forking.

@orangeSi
Copy link
Contributor

@robertaboukhalil thanks a lot! I will try to give up the t_coffee later~

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

No branches or pull requests

2 participants