box64 icon indicating copy to clipboard operation
box64 copied to clipboard

[Test] Can't run Matlab installer "try to launch natively instead"

Open cmalvi opened this issue 3 years ago • 20 comments

Trying to launch Matlab instaler on MacBook air M1 (Asahi)

Command used: box64 ./install (without box64 Matlab throws an error about missing arm installer directory)

Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:16384 Box64 with Dynarec v0.1.9 a0234ee built on Aug 28 2022 14:14:32 Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/ Using default BOX64_PATH: ./:bin/ Counted 62 Env var Looking for ./install Not an ELF file (sign=#!/b) Error: reading elf header of /home//Downloads/matlab_R2022a_glnxa64/install, try to launch natively instead

cmalvi avatar Sep 07 '22 09:09 cmalvi

try to run x86_64 bash from test folder with box64 tests/bash then launch the install from this session.

ptitSeb avatar Sep 07 '22 09:09 ptitSeb

Same error (even on the lastest build of box64)

cmalvi avatar Sep 07 '22 09:09 cmalvi

can you post the logs?

ptitSeb avatar Sep 07 '22 09:09 ptitSeb

also, just to note, once in x86_64 bash, just use ./install, don't prefix with box64. (use uname -m to see you are in x86_64 world)

ptitSeb avatar Sep 07 '22 09:09 ptitSeb

can you post the logs?

Sure, where is?

cmalvi avatar Sep 07 '22 09:09 cmalvi

also, just to note, once in x86_64 bash, just use ./install, don't prefix with box64. (use uname -m to see you are in x86_64 world)

Mmm ok, in my case I still need to use box64, strange.

But with uname seems I'm in the x86_64 world

cmalvi avatar Sep 07 '22 09:09 cmalvi

what is printed on the console when you just launch ./install from x86_64 bash?

ptitSeb avatar Sep 07 '22 09:09 ptitSeb

what is printed on the console when you just launch ./install from x86_64 bash?

execve("./install", 0x9a4b67d0, 0x9a3d2f90) is x64=0 x86=0 (my_context->envv=0xffff4df46db0, environ=0xffffe3632510 ./install: line 290: /home/<user</Downloads/matlab_R2022a_glnxa64/bin/linux-arm-64/install_unix_legacy: No such file or directory

the last line is the same error

cmalvi avatar Sep 07 '22 10:09 cmalvi

Mmmm, ok, I see. I'll try something, but it will take a bit time.

ptitSeb avatar Sep 07 '22 10:09 ptitSeb

Mmmm, ok, I see. I'll try something, but it will take a bit time.

Thanks, no need to hurry. It was just a test trying to help you.

Feel free to ping me here when you have any news about

cmalvi avatar Sep 07 '22 10:09 cmalvi

in the mean time, you can probably run install script in x86_64 bash using something like box64 ~/box64/tests/bash ./install It might work (you may need to adjust the path of stuffs)

ptitSeb avatar Sep 07 '22 11:09 ptitSeb

in the mean time, you can probably run install script in x86_64 bash using something like box64 ~/box64/tests/bash ./install It might work (you may need to adjust the path of stuffs)

Already tried it before with same result unfortunately

cmalvi avatar Sep 07 '22 11:09 cmalvi

oh, ok.

ptitSeb avatar Sep 07 '22 11:09 ptitSeb

So, I have pushed something, try again, with something like

BOX64_LOG=0 box64 ~/box64/tests/bash ./install

And it should work this time (after updating box64 to latest).

ptitSeb avatar Sep 08 '22 08:09 ptitSeb

So, I have pushed something, try again, with something like


BOX64_LOG=0 box64 ~/box64/tests/bash ./install

And it should work this time (after updating box64 to latest).

Same result, Matlab installer continue to throws errors about missing aarch64 folders and libs

cmalvi avatar Sep 08 '22 08:09 cmalvi

that's odd. I tested this change, but with box86, on a platform that doesn't support binfmt, and it worked.

can you do

BOX64_LOG=2 BOX64_TRACE_FILE=$(pwd)/trace-%pid.txt box64 ~/box64/tests/bash ./install

That will generate a large bunch of trace files. Then do

grep execve trace-*

And copy/paste the result here? also, check that on the 1st trace file (the trace-xxxx with xxxx the lowest) you see "bash detected, disabling banner" in the first few lines. Or just do grep "bash detected" trace-* to see if the line is here. You can delete the trace-* files after that.

ptitSeb avatar Sep 08 '22 08:09 ptitSeb

I tried box64 without binfmt on my side, and the bash method worked fine for a gog installer.

ptitSeb avatar Sep 09 '22 07:09 ptitSeb

Also, I wrote this: https://box86.org/2022/09/running-bash-with-box86-box64/ can the ticket be closed now?

ptitSeb avatar Sep 15 '22 10:09 ptitSeb

Also, I wrote this: https://box86.org/2022/09/running-bash-with-box86-box64/ can the ticket be closed now?

Sorry i've been busy due to exams in these day, tomorrow i'll give it a try and give you a feedback, thanks

cmalvi avatar Sep 16 '22 20:09 cmalvi

Sorry I’ve been busy in the last days due to exams, today or tomorrow I’ll test your suggestion and give you a feedback

On Thu, Sep 15, 2022 at 12:46, ptitSeb @.***> wrote:

Also, I wrote this: https://box86.org/2022/09/running-bash-with-box86-box64/ can the ticket be closed now?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

cmalvi avatar Oct 11 '22 06:10 cmalvi

yeah ptiseb its working on my side as well until it shows this:

Error loading one of needed lib
Error initializing needed lib libmwcommonproductinstalldriver.so
Error loading one of needed lib
Error: loading needed libs in elf /home/radheshg/projects/matlab/bin/glnxa64/MathWorksProductInstaller

keys-i avatar Apr 09 '23 16:04 keys-i

I need more logs, the libmwcommonproductinstalldriver.so probably have some other dependancies

ptitSeb avatar Apr 09 '23 17:04 ptitSeb

how do i get more logs

keys-i avatar Apr 09 '23 21:04 keys-i

here i found some more errors:

 Error loading one of needed lib
Error initializing needed lib libmwinstall_datamodels_common.so
Error loading one of needed lib
Error initializing needed lib libmwinstall_datamodels_product_installer.so

ptiseb, i making a github repo of the matlab folder over at my account you can use that to see the issue

keys-i avatar Apr 09 '23 21:04 keys-i

I'm trying to install matlab too (asahi linux macbook m1)

in .bashrc: export BOX64_BASH=/home/acclaude/Soft/box64/tests/bash

BOX64_LOG=2 BOX64_TRACE_FILE=$(pwd)/trace-%pid.txt box64 ./install

BOX64 Trace redirected to "/home/acclaude/Soft/R2023a/trace-8162.txt" Box64 with Dynarec v0.2.3 6bfeb156 built on Apr 24 2023 20:59:58 BOX64 Trace redirected to "/home/acclaude/Soft/R2023a/trace-8162-1.txt" Box64 with Dynarec v0.2.3 6bfeb156 built on Apr 24 2023 20:59:58 BOX64 Trace redirected to "/home/acclaude/Soft/R2023a/trace-8171.txt" BOX64 Trace redirected to "/home/acclaude/Soft/R2023a/trace-8172.txt" BOX64 Trace redirected to "/home/acclaude/Soft/R2023a/trace-8173.txt" BOX64 Trace redirected to "/home/acclaude/Soft/R2023a/trace-8174.txt" BOX64 Trace redirected to "/home/acclaude/Soft/R2023a/trace-8180.txt" BOX64 Trace redirected to "/home/acclaude/Soft/R2023a/trace-8181.txt" BOX64 Trace redirected to "/home/acclaude/Soft/R2023a/trace-8182.txt" /home/acclaude/Soft/R2023a/install: eval: line 292: unexpected EOF while looking for matching `"' /home/acclaude/Soft/R2023a/install: eval: line 293: syntax error: unexpected end of file

and the line 292 read: eval exec "$thisDir/bin/$ARCH/$targetAppName" $argList

the first lone of install : #!/bin/sh

is it a shell problem ?

Thank you

PS: BOX64_LOG=0 box64 ~/Soft/box64/tests/bash ./install .... Error loading needed lib libpam.so.0 .. Error loading one of needed lib Error initializing needed lib libmwfl.so

... Segmentation fault (core dumped)

acclaude avatar Apr 24 '23 19:04 acclaude

Hi @ptitSeb ! I'm interesting in running MATLAB as well. I can't just test it right now but from what I've seen there are 3 folders with libraries:

./runtime/glnxa64 : libMatlabCppSharedLib.so libMatlabCppSharedLib.so.9.5 libMatlabCppSharedLib.so.9.5.dbg libmwmclmcrrt.so libmwmclmcrrt.so.9.5

./sys/os/glnxa64: libgcc_s.so.1 libgfortran.so.3.0.0 libifport.so.5 libintlc.so.5 libirc.so libquadmath.so.0.0.0 libstdc++.so.6.0.22 README.libstdc++ libgfortran.so.3 libifcore.so.5 libimf.so libiomp5.so libquadmath.so.0 libstdc++.so.6 libsvml.so

There seems to be a specific build of libstdc, wouldn't that be a problem ?

./bin/glnxa64 : where there are most of libs. Including all libQT5 and, libOpenCV, libcuda etc... If you haven't translated those, there's no chance that it would work or did I miss something ?

At last, the "matlab" file is not an executable but a script, in the end it launches what it seems to be a chromium browser (so many dependencies :sob: ?)

_"/.matlab/R2018b/HtmlPanel/glnxa64/chromium/jxbrowser-chromium --enable-npapi --allow-file-access-from-files --lang=en_US"

So I can't see how that could work but if you tell me that it's possible, I can try an install on my phone (I'm using box64 inside termux on Android)

pierreduf avatar Apr 26 '23 06:04 pierreduf

well, the most complicated thing to emulate is the chromium one. Other libs will be emulated as well, including Qt5...

To be safe, you shoud create/modify ~/.box64rc and add:

[jxbrowser-chromium]
BOX64_MALLOC_HACK=2
BOX64_NOSANDBOX=1

That might help.

You need to setup BOX64_BASH to point to an x86_64 bash copy (there is one in tests folder of box64 repo) then you can launch the script file with box64 ./matlab so it should detect an x86_64 architecture and setup LD_LIBRARY_PATH accordingly.

Also, for box64 inside termux, don't forgot to build with BAD_SIGNAL, it might be important.

ptitSeb avatar Apr 26 '23 07:04 ptitSeb

Thx for your answser !

I have a termux prefix with an already built box64 and I'm pretty sure it's built with BAD_SIGNAL. I also have a working "bash".

Just out of curiosity : I thought before, reading previous comments, that you had to to wrap every function calls but I understand now that you only need to do it for "system" libs (like libc & co) but not for the libs shipped with the software we try to emulate (like Qt or OpenCV in Matlab's case etc...). Am I right ?

About the "[jxbrowser-chromium]" in conf file, what are they supposed to do ?

I can't try Matlab just now but I'll keep you posted as soon as I do. I use box64 for other things (games... :)) and that works great. A big thank you for your hard work !!

pierreduf avatar May 03 '23 13:05 pierreduf

Thx for your answser !

I have a termux prefix with an already built box64 and I'm pretty sure it's built with BAD_SIGNAL. I also have a working "bash".

Ok, good

Just out of curiosity : I thought before, reading previous comments, that you had to to wrap every function calls but I understand now that you only need to do it for "system" libs (like libc & co) but not for the libs shipped with the software we try to emulate (like Qt or OpenCV in Matlab's case etc...). Am I right ?

Yep, only "wrapped" libs have special treatment. The emulated libs are just emulated as-is.

About the "[jxbrowser-chromium]" in conf file, what are they supposed to do ?

It allows to setup a specific set of parameters. It can be important for things based on chromium/electron, as they often override "malloc"/"free" libc operator, but that's incompatible with lib wrapping.

I can't try Matlab just now but I'll keep you posted as soon as I do. I use box64 for other things (games... :)) and that works great. A big thank you for your hard work !! Nice :) Enjoy!

ptitSeb avatar May 03 '23 13:05 ptitSeb

Hi @ptitSeb

I landed on this thread after seeing the same issues trying to run MATLAB using box64. In my case I'm attempting to run the MATLAB installer on 64-bit Ubuntu 22.04.2 LTS. I believe the underlying problem is when trying to load the 'libpam.so.0' library, which is required by one of the files called by the installer. Here is a snippet from the output log (3rd line reports the error):

... Using emulated /home/ubuntu/Downloads/matlab_R2023a_glnxa64/bin/glnxa64/libmwinstall_datamodels_login.so Using emulated /home/ubuntu/Downloads/matlab_R2023a_glnxa64/bin/glnxa64/libmwfl.so Error loading needed lib libpam.so.0 Using emulated /home/ubuntu/Downloads/matlab_R2023a_glnxa64/bin/glnxa64/libmwboost_filesystem.so.1.78.0 Using emulated /home/ubuntu/Downloads/matlab_R2023a_glnxa64/bin/glnxa64/libunwind.so.8 Using native(wrapped) libm.so.6 ...

I have traced through the various libraries being called using readelf and to the depth I explored it seems like this is the only library that is leading to the failure to launch (it is called by the libmwfl.so library just above it in the printout above).

I have happened upon some unrelated posts suggesting this type of error might relate to needing a 32-bit version of this library, but I haven't been successful in getting one installed yet. Do you have any thoughts of what I might try or perhaps flags I might use in box64 to obtain more information to debug this?

Thanks in advance for your advice!

rainonatinroof avatar Jun 22 '23 02:06 rainonatinroof