Request: SMath AppImage for Linux - Messages
AppImage is an package format that IMO is really nice for distributing applications on Linux. See more information here https://appimage.org/
The appimage is built with the software and all dependencys inside and is executed just by double clicking on the file. When executed the appimage runs entirely in memory through a squash-fs filesystem.
Since all dependencys are included no libs need to be installed on the host machine, this is good when you dont have root access to the machine.
There seems to exist a way to generate appimage-packages directly with dotnet publish, see https://github.com/AppImage/AppImageKit/wiki/Bundling-Mono-apps#using-dotnet-publish
Quotedotnet publish -r linux-x64 -p:PublishSingleFile=true -c Release
EDIT:
I have also created an appimage of SMath Studio that runs on Ubuntu 18.04 and newer systems (Other Linux dists: GLIBC 2.27 minimum)
Direct link to the latest AppImage -> SMathStudioDesktop.0_99_7822.x86_64.glibc2.27-PreRelease4.AppImage
See also https://github.com/gntech/smath-appimage
WroteWould it be possible to build and distribute an appimage-build of SMath for Linux?
This seemed like a good idea, so here it is.
Tried with a live-cd, look like it works.
Let me know if this work on your system.
There are two version, one with Plugins other with bare.
You can learn your glibc version with `ldd --version`.
Actually you don't have to use Ubuntu even I wrote For Ubuntu next to links.
If output of command above meets with glibc version that should be enough.
In my machine I have glibc_2.32, ubuntu 20.04 version works for me.
Regards
PS: If downloaded appimage doesn't work,
And you use ubuntu/debian based distro,
And you are sure glibc version is matching,
Try to run it with sudo.
SMathStudioDesktop.0_99_7822.Mono-x86_64.tar.gz (3 MiB) downloaded 71 time(s). <---- Mono not Included
SMath_Studio-x86_64-Mono-glibc_2.23.AppImage <--- For Ubuntu 16.04
SMath_Studio-x86_64-Mono-glibc_2.27.AppImage <--- For Ubuntu 18.04
SMath_Studio-x86_64-Mono-glibc_2.31.AppImage <--- For Ubuntu 20.04
SMath_Studio-x86_64-Mono-Plugins-glibc_2.23.AppImage <--- For Ubuntu 16.04 (Plugins Included)
SMath_Studio-x86_64-Mono-Plugins-glibc_2.27.AppImage <--- For Ubuntu 18.04 (Plugins Included)
SMath_Studio-x86_64-Mono-Plugins-glibc_2.31.AppImage <--- For Ubuntu 20.04 (Plugins Included)

It works beautifully!
Some things to consider:
* There is no need to put the appimage in a tar.gz since it is already a compressed file format. It is uncompressed to memory on-the-fly when executed
* Please consider to add mono to the appimage since it is one of the main features of the appimage to be able to run it on a base system without requiring any dependencies or package installs. (It is quite uncommon to have mono installed on a base system.)
Appimage Motivation: https://docs.appimage.org/introduction/motivation.html
Appimage Advantages: https://docs.appimage.org/introduction/advantages.html
Regarding file size:
OpenRA (www.openra.net) is a mono-based application that is distributed for linux as appimage. The file size is 19.5 Mb including all the required mono libraries. To install the mono libraries standalone on my system required 250 Mb.
Here is a database of applications that are distributed as AppImages
https://appimage.github.io/apps/
Smath forum don't accept all filetypes, this is why it is in a tar.gz.
I just wanted to see if it is working. I will add mono libraries and try to add fonts to make a proper smath appimage.
Regards

I noticed that the System Requirements text for SMath Studio particulary mentions this Mono-library:
Quotelibmono-winforms-2.0-cil
Perhaps that is the only part of mono that is required?
WroteToday I came across this post since mono crashes every time I try to start smath. The appimage provided above doesn't start as well on my system.
If you are using Ubuntu 20.04 it might be a problem with the mono-libraries from the Ubuntu repos. I noticed a similiar error earlier and found a workaround by installing the latest versions directly from the Mono project website. https://www.mono-project.com/download/stable/#download-lin
Quotesudo apt install gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt upgrade
That solved the problem for me on Ubuntu 20.04 (both with official tar.gz-release and appimage version of SMath) but I agree that an appimage with a working mono-library included would be a much better solution
WroteOkay, nice work to be the first time
I noticed that the System Requirements text for SMath Studio particulary mentions this Mono-library:Quotelibmono-winforms-2.0-cil
Perhaps that is the only part of mono that is required?
Not even close, more library files needed.
I have made the appimage with mono included.
Tried with a non-mono livecd, look like it works.
For some reason plugin download is not working.
Also account login not working too, damn.
Couldn't figure out so added some necessary plugins.
With plugins installed file size is now near 90mb.
Without plugins file size was 15mb with font included.
Link is in the second post.
Regards
Quote./SMath_Studio-x86_64.AppImage --appimage-extract
I then downloaded and extracted the content of OpenRA appimage for comparison which is also Mono-based appimage and noticed that it had a lot less files especially in /usr/lib/mono
So I guess that a lot of unneccassary mono-files are included automatically in the SMath build.
I experimented with stripping out the extensions and a lot of what I assume is unneccassary mono-files then built a new AppImage from the SMath folder using appimagetool
Quote./appimagetool-x86_64.AppImage squashfs-root/ smath.appimage
The resulting smath.appimage was now 12 Mb and did start and run fine. The stripped appimage is attached for reference but more research and experimentation is needed
The problem that you found with the extension manager and account login I have no idea for unfortunately. Perhaps some mono-lib is still missing?
One more thing, I noticed the appimage is built on a system with glibc 2.32. It is recommended that the appimage is built on the oldest supported Ubuntu LTS version (Xenial 16.04). This is to ensure compatibility with as many systems as possible. Your appimage requires a very new linux distribution to run. It is a thing to consider.
(glibc is regarded by appimage as something that exist on all systems but the version is only backwards compatible not forwards. So it is good build on as old system as possible)
Ref:
OpenRA: https://github.com/OpenRA/OpenRA/releases/download/release-20210321/OpenRA-Red-Alert-x86_64.AppImage
appimagetool: https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
SMath_stripped.AppImage.tar.gz (12 MiB) downloaded 60 time(s).
Quotemonodis --assemblyref SMathStudio_Desktop.exe | grep Name
Gives the following output
Quote
Name=mscorlib
Name=System.Windows.Forms
Name=SMath.Manager
Name=SMath.Controls
Name=System
Name=SMath.UI
Name=System.Drawing
Name=SMath.Drawing
Name=System.Xml
Name=SMath.Environment
Name=SMath.Math.Symbolic
Name=SMath.Math.Numeric
I have also found the following script that uses monodis to automatically build an appimage including only the necceassary libraries. It need to be adapted for SMath of course but it is a nice starting point.
https://gist.github.com/darealshinji/13229b256f61c4fc7aa8ec0459779ddc
All my livecds are mine own creation based on void.
I will try to download an old livecd and try on it.
I have also build stripped versions with manually removing everything unnecessary.
As I have said, appimage file without plugins are 20mb more or less.
12mb vs 20mb is not a problem if you ask me.
Real issue is web connection, I couldn't figure how to fix it.
This problem is what it makes appimage larger.
I had to manually install some plugins.
WroteThere exist a tool called monodis that can analyze a mono-based executable to see what dependencies it have.
Quotemonodis --assemblyref SMathStudio_Desktop.exe | grep Name
Gives the following outputQuote
Name=mscorlib
Name=System.Windows.Forms
Name=SMath.Manager
Name=SMath.Controls
Name=System
Name=SMath.UI
Name=System.Drawing
Name=SMath.Drawing
Name=System.Xml
Name=SMath.Environment
Name=SMath.Math.Symbolic
Name=SMath.Math.Numeric
I have also found the following script that uses monodis to automatically build an appimage including only the necceassary libraries. It need to be adapted for SMath of course but it is a nice starting point.
https://gist.github.com/darealshinji/13229b256f61c4fc7aa8ec0459779ddc
I have already previously tried to build with both monodis and that script on github.
That script actually an automation process for monodis and it creates jumbled directories.
Those didn't work for me so I have traced all files on my /opt/smath/smath.exe reach and logged them.
Those are the mono-related files appeared on log file so I manually imported them.
The appimage file is not auto created. I personally placed everything myself.
/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
/usr/lib/mono/gac/System.Windows.Forms/4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
/usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
/usr/lib/mono/gac/Accessibility/4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
/usr/lib/mono/gac/Microsoft.CSharp/4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
/usr/lib/mono/gac/I18N/4.0.0.0__0738eb9f132ed756/I18N.dll
/usr/lib/mono/gac/I18N.West/4.0.0.0__0738eb9f132ed756/I18N.West.dll
/usr/lib/mono/gac/System.Design/4.0.0.0__b03f5f7f11d50a3a/System.Design.dll
/usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
/usr/lib/mono/gac/System.Numerics/4.0.0.0__b77a5c561934e089/System.Numerics.dll
/usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
/usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
/usr/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll
/usr/lib/libmono-btls-shared.so
/usr/lib/libmono-native.so.0.0.0
/usr/lib/libMonoPosixHelper.so
/usr/lib/libMonoSupportW.so
/usr/lib64/libmono-native.so
/usr/lib64/libMonoPosixHelper.so
/usr/lib64/libmono-btls-shared.so
I will also include glibc into appimage and try it with an old linux.
Shall release the final appimage soon.
Final size is 15mb with 3mb Courier font.
Now everything as it should have been.
They have courier fonts bundled.
An extra headache is resolved too.
I have also updated my first post on this subject.
Apps are packed with MONO 6.12.0.122.
Because this is what I have on my system.
You will need glibc 2.32 for them to work.
Next step is to reduce mono version.
I will try to make it work on an old distro, like Ubuntu 16.04.
Regards
PS: For updated links see the second post of this topic

I noticed just one minor thing, libgdiplus seems to be missing from the appimage
QuoteUnhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Drawing.GDIPlus' threw an exception. ---> System.DllNotFoundException: libgdiplus.so.0 assembly:type: member null)
If I installed libgdiplus through the package manager the program started fine. It should probably be added to the appimage

I am thinking about the Courier font though, is it really necessary to include it? On most Linux systems it is not distributed or installed by default due to licensing issues and SMath seems to work good without it. I guess SMath has a mechanism to use some similar font if Courier is not available. Just a thought
Edit: Perhaps Liberation Mono is a suitable alternative
https://en.wikipedia.org/wiki/Liberation_fonts
WroteI downloaded both appimage files with mono included and made them executeable, but none of them started on my system (Ubuntu 20.04). Is there anything else to be done to run the app?
It is probably because the appimage is built from a system that has a newer glibc-version than what is available on Ubuntu 20.04. Start the appimage from a terminal and see if you get an error message regarding glibc-version.
overlord said in a previous post that he will next try to create the appimage on an older system (This will make it compatible with a broader range of linux dists including Ubuntu).
Now I tried to start the appimage on Ubuntu 21.04 and got this error:
Quote[xcb] Too much data requested from _XRead
[xcb] This is most likely caused by a broken X extension library
Interpreting this exceeds my competences. I attach the full output from the terminal, just in case it could help.
2021-06-03_SMATH_appimage_error_Ubuntu21.04.txt (24 KiB) downloaded 82 time(s).
-
New Posts
-
No New Posts