MELTS Software Users

MELTS for Excel, rhyolite-MELTS (GUI) and alphaMELTS => Operating system specific => Windows => Topic started by: Paula on November 17, 2017, 04:08:40 PM

Title: Enabling the Windows Subsystem for Linux and installing the Rhyolite-MELTS GUI
Post by: Paula on November 17, 2017, 04:08:40 PM
Note: this post was first written when Ubuntu 16.04 LTS was the only version available in the Microsoft store. If you have downloaded rhyolite-MELTS from the OFM website and followed the link from there to here, note that Ubuntu 16.04 LTS is no longer available so these instructions will almost certainly not work. We recommend you download the latest rhyolite-MELTS for Linux version (https://magmasource.caltech.edu/gitlist/Rhyolite-MELTS.git/blob/master/rhyolite-MELTS-Ubuntu-18.04-64bit.zip") and use the instructions on the newest version of this post (https://magmasource.caltech.edu/forum/index.php/topic,1057.0.html).

For 64-bit Windows 10 with the Fall Creators update (version 1709; released October 17th, 2017), it is possible to enable the 'Windows Subsystem for Linux' (WSL) and use the latest rhyolite-MELTS version linked on the Linux Download site (http://melts.ofm-research.org/unix.html). Things that you should type at the command line are in bold in quote boxes; names you should substitute are in italics and comments are preceded by ellipsis (...). Note that by 'command line', we mean the Ubuntu bash shell that opens when you click the 'ubuntu 16.04' program and not the Windows Command Prompt (cmd.exe).

Enable the WSL and install ubuntu
Set up the ubuntu command line
Install alphaMELTS (optional)

If you want to install alphaMELTS, then if you do that now it will do the next steps for you. Download the alphamelts_wsl_version.zip file. You should be able to unzip it on Windows. Put the extracted folder in 'Downloads' (or your choice of folder, as long as you have set up a link to it in ubuntu 16.04). Open ubuntu 16.04, if it is not already open. Navigate to the folder where alphamelts_wsl_version.zip is using 'cd' (which stands for 'change directory'). E.g:
Quotecd Downloads
cd alphamelts_

... if you press the 'tab' key at this point it should complete the folder name
... depending how you extracted the files, you may to repeat the previous command to descend into the folder where the .command scripts are
./install.command
Choose the default settings offered by install.command (press 'enter' to each folder suggestion, and then 'y' when it asks whether to continue with the installation). This means it will make a 'bin' folder for you (to put links in), set the Path to include the 'bin' folder, and set up the DISPLAY variable that rhyolite-MELTS will need. Close ubuntu 16.04 (type 'exit' or use the X in the top right hand corner) and open it again.

If you did not install alphaMELTS

This step make a 'bin' folder, which is short for 'binary' and is a folder where we will put a link (shortcut) to rhyolite-MELTS. It will set the Path to include the 'bin' folder,  so that you can run rhyolite-MELTS from anywhere on the system. It also sets up the DISPLAY variable that rhyolite-MELTS will need. Open ubuntu 16.04, if it is not already open:
Quotecd
... this just ensures that you are in your ubuntu home directory
mkdir bin
... which means make a directory called 'bin' (where 'directory' is what is called 'folder' on Windows)
wget magmasource.caltech.edu/gitlist/alphaMELTS.git/raw/master/profile
... this downloads a settings file because going through a Windows-based browser causes problems with line-endings etc.
cat profile
This last command just prints the file we just downloaded, so we can check that it downloaded OK before using it. The output should look like this:
Quote# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
    export PATH
fi

# For the Rhyolite-MELTS graphical user interface on the Windows Subsystem for Linux with Xming
if [[ $(uname -r) =~ Microsoft ]] ; then
   export DISPLAY=:0
fi

# For the Rhyolite-MELTS graphical user interface on Macs, using the 10.8+ or 10.12+ executable:
# If you get "Segmentation fault: 11" (10.8+) or "Illegal instruction: 4" (10.12+)
# then include the following and try the 10.8+ executable.
if [[ $(uname) =~ Darwin ]] ; then
   export DYLD_LIBRARY_PATH=/opt/X11/lib/flat_namespace:$DYLD_LIBRARY_PATH
fi
If it does then type you can continue:
Quotemv profile .profile
... where there is a space before the '.' but not after; a file beginning with with '.' is a hidden file in Linux
exit
... this closes ubuntu 16.04; when you next open it the settings file will be read and acted upon

Download and set up rhyolite-MELTS and some helper software
You will not need to repeat all these steps next time. Just open the ubuntu program, navigate to the folder where your input (.melts) files are, and type 'Melts-rhyolite'.

Any problems, please let me know,
Paula