I have made a native build (see https://www.utc.fr/~mottelet/scilab_for_macOS.html) of Scilab for M1 Macs and the application seems to trigger Rosetta2 when launched by double-clicking its icon and as a result its overall environment is erroneously reported as x86_64 instead of arm64. For example, from Scilab command line you can launch shell commands and get the output. For example uname -m
yields
--> unix_g("uname -m")
ans =
"x86_64
when Scilab has been launched from its icon or by using open
from the terminal.
However, when the application main script is directly launched from a terminal, i.e. here by typing
me@mac-M1 ~ % /Applications/scilab-branch-6.1.app/Contents/MacOS/scilab
the same unix command from within Scilab yields the expected result since the application has been compiled for the arm64 architecture:
--> unix_g("uname -m")
ans =
"arm64"
1/6/2021 update:
Running the application always calls the the main scilab
script (which later calls the actual scilab-bin
native binary). When the app has been double-clicked the process list obtained by ps
yields
501 643 ?? 0:00.35 /bin/sh /Users/mottelet/Desktop/scilab-branch-6.1.app/Contents/MacOS/scilab
501 708 ?? 0:04.23 scilab-bin
and the Activity monitor shows the matching processes as:
As you guessed the shell has the wrong architecture. I have tried using
<key>LSRequiresNativeExecution</key>
<true/>
in the Info.plist
but it does not change anything.
How this problem could be debugged ? It is not so easy to provide a more compact example. If some experts among the readers could help me, you just have to download the Scilab arm64 build (see the link above) and get the app from the dmg archive (notarized by Apple). At first run a native Java 8 JRE will be downloaded by Scilab. Thanks for your help and insights !
S.