Skip to content

Instantly share code, notes, and snippets.

Created November 24, 2017 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6dd1054089edb19658d5bfd6a246b370 to your computer and use it in GitHub Desktop.
Save anonymous/6dd1054089edb19658d5bfd6a246b370 to your computer and use it in GitHub Desktop.
Install instructions for GF, MMT and GF-MMT-Bridge for Windows (using WSL)

GF + MMT + GF-MMT-Bridge Install instructions for Windows

  • This document is based on https://fsi.cs.fau.de/forum/post/153663.
  • I personally use and recommend the Chocolatey package manager on Windows. It is in no way required to follow these instructions, though. Just replace every cup <software-name> -y by manually looking up the vendor's site on the Internet, downloading the installer and running it.

UNRESOLVED PROBLEM: Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpgf in java.library.path


Instructions

Recommended file structure:

your-path
|
|- LBS
|  |-- GF
|  |   |-- ...
|  |
|  |-- GF-Scala   # the GF-MMT bridge
|  |   |-- ...
|  |
|  |-- MMT
|  |   |-- ...
|  |
|  |-- mmt.jar
|  |
  1. Windows subsystem for Linux (= WSL)

    1. Open the Microsoft Store app and search for "Ubuntu". Install it.
    2. Open Ubuntu from the start menu and choose your username and password.
    3. If you encounter the error 0x8007007e, try one of the following suggestions and retry opening the Ubuntu app thereafter:
      1. Open the start menu and search for "Windows Features". Run it and activate "Windows Subsystem for Linux (Beta)".
        After installing it, restart your PC.

      2. Ensure you have the latest Windows version. This includes Windows Updates and bigger updates such as the Windows 10 Fall Creators Update.
        The latter requires multiple hours to install. Only do it if you know what you are doing and have backups ready at your finger tips!

      3. If none of the things mentioned above works, you might want to start investigating from these links:

  2. Install/upgrade JDK 8: cup jdk8 -y.
    Verify that java -version returns the new version in your console if the command above updated it. If the old version still appears, you might want to try Chocolatey's command refreshenv in your console.

  3. Install/upgrade Git: cup git -y.

  4. jEdit

    1. Install jEdit: http://jedit.org/index.php?page=download. [Chocolatey package exists, but is outdated.]
      You might want to manually create a desktop shortcut linking to C:\Program Files\jEdit x.y.z\jedit.exe as well.

    2. Follow further instructions here: https://uniformal.github.io/doc/setup/jedit.html. (Important: run jEdit at least once before continuing!)

  5. MMT

    1. Download the latest mmt.jar binary and put it into your-path/mmt.jar: https://github.com/UniFormal/MMT/releases/
    2. Create the directory your-path/MMT
    3. Open a console in your-path and run java -jar mmt.jar :setup.
      1. When asked, specify the full path to your-path/MMT as the installation directory.
      2. You might encounter TLS handshake failures when the setup tries to install the jEdit plugin. Ignore them, you can fix them manually by the next step.
      3. Open jEdit, go to Plugins → Plugin Manager and check whether a plugin called MMTPlugin exists and is activated, i.e. checked. If not, check it and wait a little for possible warnings/required dependencies you have to fulfill as well.
  6. GF

    1. Open a console in your-path/LBS and run the following commands:

      git config --global core.autocrlf false
      git clone --depth=1 https://github.com/GrammaticalFramework/GF.git

      The first line forbids Git to convert line endings of cloned files to CRLF on Windows. This is strictly necessary because otherwise autoreconf -i in a later step fails with

      AC_CONFIG_MACRO_DIR([M4]) conflicts with ACLOCAL_AMFLAGS=-I M4".

      TODO Pull Request .gitattributes

    2. Now open an Ubuntu console. All subsequent commands in this block have to be run inside that Ubuntu console unless otherwise noted.

    3. Run the following commands:

      sudo apt-get update
      sudo apt-get install autoconf automake libtool libtool-bin make
    4. cd /mnt/c/your-path/GF/src/runtime/c

    5. Follow the Linux instructions under https://github.com/GrammaticalFramework/GF/blob/master/src/runtime/c/INSTALL
      However, be sure to run make install with sudo, i.e. sudo make install.

    6. sudo apt-get install default-jdk

    7. cd /mnt/c/your-path/GF/src/runtime/java

    8. Again, follow the Linux instructions under https://github.com/GrammaticalFramework/GF/blob/master/src/runtime/java/INSTALL
      However, be sure to run make install with sudo, i.e. sudo make install. That command should also print the final path to jpgf.jar. Verify that it is indeed /usr/local/lib, otherwise some paths below probably need to be adjusted.

  7. GF-MMT bridge (with IntelliJ)

    1. cup intellijidea-ultimate -y (free registration for students)
    2. Run git clone https://github.com/UniFormal/GFScala inside the your-path directory.
    3. Open IntelliJ, choose Create New ProjectScalaIDEA.
      • Choose the path your-path/GFScala.
      • If you could not see Scala, you have to install it from the main screen with ConfigurePluginsInstall JetBrains pluginsScala.
      • Configure your JDK if needed. The path is most probably C:\Program Files\Java\jdk1.8.xyz_uvw.
      • If not available, create a new Scala-SDK with exactly the version 2.11.8.
    4. In the menu choose FileProject StructureModulesDependencies.
    5. With the green plus, add the following dependencies
      • JAR-dependency: your-path/mmt.jar
      • JAR-dependency: C:\Users\Navid\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_xxxxxxxxxxxxx\LocalState\rootfs\usr\local\lib\jpgf.jar
        The exact sequence of x's can probably differ from system to system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment