Jetson Nano で enebular editor を動かしてみた (非公式)


はじめに

ビジュアルプログラミングIoTLT vol.7で @jksoft さんのLT発表の中でラズパイ版の enebular editor (デスクトップアプリ) がリリースされたことを知りました。

Jetson Nanoでも動くかどうか試したところインストールは成功しましたが、起動に失敗しました。

公式ドキュメント

インストール手順

$ wget -qO- https://enebular.com/editor-install | sudo -u "$USER" -E bash -s -- --arch=arm
==== Installing arm version ====
enebular editor install location: /home/jetson/Applications/enebular-editor
==== Downloading enebular editor ====
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   394  100   394    0     0   2755      0 --:--:-- --:--:-- --:--:--  2736
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   394  100   394    0     0   3900      0 --:--:-- --:--:-- --:--:--  3900
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 87.5M  100 87.5M    0     0  2836k      0  0:00:31  0:00:31 --:--:-- 2876k
Checksum matched
==== Downloading icon ====
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 39035  100 39035    0     0   226k      0 --:--:-- --:--:-- --:--:--  226k
==== Creating desktop entry ====
==== Starting post install ====
[sudo] password for jetson: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mate-notification-daemon is already the newest version (1.20.0-2).
The following packages were automatically installed and are no longer required:
  apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common kde-window-manager kinit kio kpackagetool5 kwayland-data kwin-common
  kwin-data kwin-x11 libdebian-installer4 libkdecorations2-5v5 libkdecorations2private5v5 libkf5activities5 libkf5attica5 libkf5completion-data libkf5completion5 libkf5declarative-data
  libkf5declarative5 libkf5doctools5 libkf5globalaccel-data libkf5globalaccel5 libkf5globalaccelprivate5 libkf5idletime5 libkf5jobwidgets-data libkf5jobwidgets5 libkf5kcmutils-data libkf5kcmutils5
  libkf5kiocore5 libkf5kiontlm5 libkf5kiowidgets5 libkf5newstuff-data libkf5newstuff5 libkf5newstuffcore5 libkf5package-data libkf5package5 libkf5plasma5 libkf5quickaddons5 libkf5solid5
  libkf5solid5-data libkf5sonnet5-data libkf5sonnetcore5 libkf5sonnetui5 libkf5textwidgets-data libkf5textwidgets5 libkf5waylandclient5 libkf5waylandserver5 libkf5xmlgui-bin libkf5xmlgui-data
  libkf5xmlgui5 libkscreenlocker5 libkwin4-effect-builtins1 libkwineffects11 libkwinglutils11 libkwinxrenderutils11 libqgsttools-p1 libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediaquick-p5
  libqt5multimediawidgets5 libxcb-composite0 libxcb-cursor0 libxcb-damage0 os-prober python3-dbus.mainloop.pyqt5 python3-icu python3-pam python3-pyqt5 python3-pyqt5.qtsvg python3-pyqt5.qtwebkit
  python3-sip qml-module-org-kde-kquickcontrolsaddons qml-module-qtmultimedia qml-module-qtquick2 rdate tasksel tasksel-data
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Post install finished
==========================================================================================================================================================================================================
 enebular editor has been successfully installed ✔
   - Version: 1.1.4
   - Location: /home/jetson/Applications/enebular-editor
==========================================================================================================================================================================================================
See details in full install log file: /tmp/enebular-editor-install-log.QZUUF5

起動に失敗

デスクトップメニューからenebular editorを選択して実行するとエラーが表示されました。

コマンドラインでプログラムを実行するとARM32 (aarch32)アプリケーションであることが判明しました。

$ cd ~/Applications/enebular-editor
$ ./AppRun.AppImage 
-bash: ./AppRun.AppImage: No such file or directory
$ file AppRun.AppImage 
AppRun.AppImage: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=06c350c8c3f914642421ec25cf1bc969ce45b84b, stripped

Jetson NanoはARM64 (aarch64)なのでデフォルトではARM32 (aarch32)プログラムが動かないことが分かりました。

$ uname -a
Linux jetson-desktop 4.9.201-tegra #1 SMP PREEMPT Wed May 5 09:31:36 PDT 2021 aarch64 aarch64 aarch64 GNU/Linux

ARM64 (aarch64) 環境で ARM32 (aarch32) アプリケーションを動かす

以下のサイトを参考にアプリケーションの実行に必要なライブラリを":armhf"付きでインストールし、途中で発生するエラーに対処したところ無事に起動できました。

参考

環境構築手順

ldd コマンドで AppRun.AppImage の実行に必要なライブラリを調査したところ、not a dynamic executable となったため、AppRun.AppImage を実行してエラーで表示されるライブラリを1つ1つインストールしていきました。

最終的に以下のコマンドを実行すれば動作しました。

$ sudo dpkg --add-architecture armhf
$ sudo apt update
$ sudo apt install libc6:armhf libstdc++6:armhf
$ sudo apt install libz-dev:armhf
$ sudo apt install libfuse-dev:armhf
$ sudo apt install libglib2.0-0:armhf
$ sudo apt install libnss3:armhf
$ sudo apt install libatk1.0-0:armhf
$ sudo apt install libatk-bridge2.0-dev:armhf
$ sudo apt install libx11-dev:armhf
$ sudo apt install libx11-xcb-dev:armhf
$ sudo apt install libgdk-pixbuf2.0-0:armhf
$ sudo apt install libgtk-3-dev:armhf

libgtk-3-dev ライブラリのインストールでエラーが発生します。

Selecting previously unselected package libegl-mesa0:armhf.
Preparing to unpack .../109-libegl-mesa0_20.0.8-0ubuntu1~18.04.1_armhf.deb ...
Unpacking libegl-mesa0:armhf (20.0.8-0ubuntu1~18.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-FG5yRS/109-libegl-mesa0_20.0.8-0ubuntu1~18.04.1_armhf.deb (--unpack):
 trying to overwrite shared '/usr/share/glvnd/egl_vendor.d/50_mesa.json', which is different from other instances of package libegl-mesa0:armhf

エラー原因の 50_mesa.json ファイルをリネーム(退避)して、libegl-mesa0 ライブラリを再度インストールします。

$ cd /usr/share/glvnd/egl_vendor.d/
$ sudo mv 50_mesa.json 50_mesa.json_backup
$ sudo apt install libegl-mesa0:armhf

libgtk-3-dev ライブラリを再度インストールして、残りの必要なライブラリをインストールします。

$ sudo apt install libgtk-3-dev:armhf
$ sudo apt install libasound2:armhf

以上で AppRun.AppImage を実行できます。(sandbox エラーが表示されたので、sudo で実行します。)

$ cd ~/Applications/enebular-editor
$ sudo ./AppRun.AppImage 

デスクトップメニューからもenebular editorを選択して実行できます。

まとめ

enebular editor が公式に ARM64 (aarch64) 対応することを期待します!
では、良き enebular ライフを!