brianpetro / smart-connect

41 stars 4 forks source link

Maybe consider bundling libonnxruntime.so in AppImage? #11

Open alk0 opened 1 month ago

alk0 commented 1 month ago

Problem: on Linux the AppImage can't work with "bundled" libonxxruntime (the one packed in app.asar), I've no idea why and whether it should. The hack below seems to solve the problem, so, maybe it's worth considering "properly" bundling the required lib when assembling the AppImage. Here's what I did and it worked:

./Smart-Connect-Setup-linux-x86_64.AppImage --appimage-extract
npx @electron/asar extract ./squashfs-root/resources/app.asar ./app.asar.temp
cp ./app.asar.temp/node_modules/onnxruntime-node/bin/napi-v3/linux/x64/libonnxruntime.so.1.14.0 ./squashfs-root/usr/lib/ 

https://github.com/AppImage/AppImageKit/releases/latest

./appimagetool-x86_64.AppImage ./squashfs-root ./Smart-Connect-Mod-Setup-linux-x86_64.AppImage 
ldconfig -p | grep libonnxruntime
locate libonnxruntime
rm -r ./app.asar.temp 
rm -r ./squashfs-root 
brianpetro commented 1 month ago

@alk0 thanks for the helpful instructions.

I'm considering getting a Linux computer, which would enable me to figure out why it isn't being bundled as expected.

But so far, it's only been thanks to helpful people like yourself that the linux version has gotten off the ground, since I can't test it myself. 🌴