APSIMInitiative / ApsimX

ApsimX is the next generation of APSIM
http://www.apsim.info
Other
136 stars 165 forks source link

Doesn't run "out of the box" on Ubuntu 18.04 #2604

Closed zur003 closed 2 years ago

zur003 commented 6 years ago

There are problems with installing Apsim and running the user interface on a "clean" installation of Ubuntu 18.04. Although some of these may reflect problems with the specific version of Mono distributed with that release, we should find fixes or work-arounds.

zur003 commented 6 years ago

Interestingly, it seems to run fine on a system running 18.04 as an upgrade from an earlier install.

zur003 commented 6 years ago

Here's a little more detail. One problem is that the Apsim installer gives libwebkitgtk-1.0-0 as a dependency, but 18.04 appears to no longer provide that package. The only "glue" between GtkSharp and webkit (needed when displaying HTML in the GUI) available in the standard 18.04 packages appears to be set up for Gtk+3 rather than Gtk+2 (I think). We should be able to get around this issue by packaging webkit-sharp.dll and webkit-sharp.dll.config in the installer package for Apsim, and changing the dependency to libwebkitgtk-1.0-0 (which is available).

Another problem is that any attempt to use the MonoDevelop.TextEditor results in a failed assertion. This latter problem appears to be a bug in Mono, but there may be a work-around.

hol430 commented 6 years ago

It would also be good if we didn't have to copy across sgen.exe and create a symbolic link pointing to Models.exe.

zur003 commented 6 years ago

I've fixed the problem with the webkit dependencies, but the problem with MonoDevelop.TextEditor remains. This is a Mono bug described at https://bugzilla.xamarin.com/show_bug.cgi?id=60625, and has been fixed in more recent releases of Mono. There doesn't seem to be any easy work-around.

zur003 commented 6 years ago

Also, libcanberra-gtk-module ought to be included as a dependency. ApsimNG will run without it, but with warnings.

hol430 commented 6 years ago

Models.exe and ApsimNG.exe aren't on the path by default. There is a binary called apsim located at /usr/local/bin which appears to be the same as ApsimNG.exe, but the user has to do something like

export PATH="$PATH:/usr/local/lib/apsim/2018.07.05.2727/Bin/"

in order to be able to use Models easily. It would be good if either the installer did this for us, or if a copy of Models.exe was made available somewhere on path (e.g. next to apsim at /usr/local/bin).

hol430 commented 6 years ago

Another issue is that the user does not by default have write permission for the examples, which prevents the user from running them. Perhaps this is a good thing - the examples probably shouldn't be modified by regular users - but this behaviour is not consistent with the behaviour on Windows systems.

Also, clicking the upgrade button freezes the UI for me - is anyone else experiencing this?

zur003 commented 6 years ago

The upgrade stuff isn't working very well on Linux. It will commonly freeze or crash. I haven't had a chance to look into it.

hol430 commented 5 years ago

Apsim doesn't run out of the box at all on Debian - it's highly unstable, and the file chooser dialog will usually cause a crash. This seems to be caused by the fact that Debian ships with a fairly old version of mono (5.10 - relased Feb 2018). The fix is to follow the instructions on mono's downloads page to add the mono repo to apt and then download the latest version of mono.

Not sure if we want to try and 'fix' our code to support older versions of mono (I'm not sure how to go about doing this), or just update the .deb file's dependency information.

peter-devoil commented 5 years ago

WRT installs, the container build scripts in classic might help: they use shell scripts in /usr/local/bin to set environment variables, and then call the exes in their install paths.

WRT "old" mono version - I'm still recommending 4.8.1 for HPC environments, as the CPU load post 5.x is behaving strangely, often leading to premature termination by the system's job manager. The default version on ubuntu 18 is still languishing at 4.6.