Tool Configuration

VariaMos runs as a Jar (auto-executable) file and it can be download from here.  VariaMos requires some configurations to support the functionalities that are solver dependent (such as verification, configuration, and simulation).

The steps require the modification of system libraries (only in OSX) and system variables. Please proceed with care, it is suggested that you are familiar with this kind of tasks or ask for help.

Configuration Overview

  1. Verify you have installed the prerequisites according to the target OS.
  2. Download VariaMos program file.
  3. Follow the configuration section according to the target OS (the steps are provided for Win, OSX, and Ubuntu).
  4. Execute the tool according to the steps required for the target OS (In the case of Windows, double click works with the variables defined at the system level after reboot).

Prerequisites:

VariaMos 1.0.1.18+ was tested and support SWIProlog 7.6.3+ (do not support SWIProlog 6.X or older).  Also, VariaMos 1.0.1.20 supports SWIProlog 7.2.3 and 7.4.2.

VariaMos 1.0.1.17 and older versions  were tested only with SWIProlog 6.6.6.

Configuration of Variables for Windows (32 and 64 bits):

    • Verify the correct Java (JRE 8+ o JDK 8+) in the path (in a console run: java -version). If you have more than one java installed, look at the final considerations. The 64 bits version is compulsory if you installed the 64 bits solver (by default, the JRE installs the 32 bits version).
    Depending on your SO level of expertise, follow one of these alternatives:

    • Modify system Variables (Only the first time):
      1. Configure the following system variables (add to any existing variable):
        CLASSPATH=.;C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\lib;
        
        Path=C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\bin;
      2. Restart Windows (Only first time)
      3. Execute VariaMos with double click on the file (.jar).
    • Run VariaMos from a command line with the default Java (Same steps every time):
      1. Define variables for the command line instance or create a .bat file (including both scripts):
        set CLASSPATH=.;C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\lib;%CLASSPATH%
        set Path=C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\bin;%Path%
        
      2. Run VariaMos from the same command line:
        
        java -jar variamos-Last.jar
        
    • Run VariaMos from a command line with a custom Java (Same steps every time):
      1. Define variables for the command line instance or create a .bat file (including both scripts), please modify the path of the three variables with the java installation path  (either jre or jdk are supported):
        set CLASSPATH=.;C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\lib;%CLASSPATH%
        set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05
        set JRE_HOME=C:\Program Files\Java\jdk1.8.0_05
        set Path=C:\Program Files\swipl\lib\jpl.jar;C:\Program Files\swipl\bin;C:\Program Files\Java\jdk1.8.0_05\bin;%Path%
        
      2. Run VariaMos from the same command line window:
        
        java -jar variamos-Last.jar
        
 Preconfiguration for OSX
Depending on your system, you may need to create the folder /usr/local/lib/ and add it to the PATH.
  1.  Verify if the folder exists. If it exists, skip the preconfiguration steps:
    ls /usr/local/lib/
  2. Execute the following steps with a root user (“sudo su” or “su -“):
mkdir /usr/local/
mkdir /usr/local/lib/
export PATH=$PATH:/usr/local/lib/

Configuration of OSX 10.6 – 10.12.1  (MacOS) for VariaMos 1.0.1.18+  with SWI-Prolog 7.6.3 or 7.4.2:

A workarround requires to copy SWI-Prolog binaries and variables configuration after installing SWI-Prolog.
Please be aware that you cannot run VariaMos by double click  on the jar file because a special library path value is required (Even if you configured the variables in your system).
Before start: please verify you have the correct Java (JRE 8+ o JDK 8+) in the path (in a terminal run: java -version). If you have more than one java installed, configure the appropriate one in the PATH.
    1. The following libraries must be copied* to the usr local lib (For the first time):
      sudo cp /Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin15.6.0/* /usr/local/lib/

      * To modify system libraries in newer versions of OSX you may require to restart the system in recovery mode and disable the System Integrity Protection (i.e. run “csrutil disable”).

    2. To run VariaMos, assuming it was saved on “user”/Downloads/, open a new terminal and paste the following commands (Same steps are required every time you run the tool):
      cd
      cd Downloads/
      export SWI_HOME_DIR=/Applications/SWI-Prolog.app/Contents/swipl
      export PATH=$PATH:$SWI_HOME_DIR/lib/:$SWI_HOME_DIR/lib/jpl.jar
      export CLASSPATH=$SWI_HOME_DIR/lib/:$SWI_HOME_DIR/lib/jpl.jar
      java -Djava.library.path=$SWI_HOME_DIR:$SWI_HOME_DIR/lib/x86_64-darwin15.6.0/ -jar variamos-Last.jar
      
Configuration of OSX 10.6 – 10.10.5  (MacOS) for VariaMos 1.0.1.18+  with SWI-Prolog 7.2.3:
A workarround requires to copy SWI-Prolog binaries and variables configuration after installing SWI-Prolog.
Please be aware that you cannot run VariaMos by double click  on the jar file because a special library path value is required (Even if you configured the variables in your system).
Before start: please verify you have the correct Java (JRE 8+ o JDK 8+) in the path (in a terminal run: java -version). If you have more than one java installed, configure the appropriate one in the PATH.
    1. The following libraries must be copied* to the usr local lib (For the first time):
      sudo cp /Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.3.0/* /usr/local/lib/

      * To modify system libraries in newer versions of OSX you may require to restart the system in recovery mode and disable the System Integrity Protection (i.e. run “csrutil disable”).

    2. To run VariaMos, assuming it was saved on “user”/Downloads/, open a new terminal and paste the following commands (Same steps are required every time you run the tool):
      cd
      cd Downloads/
      export SWI_HOME_DIR=/Applications/SWI-Prolog.app/Contents/swipl
      export PATH=$PATH:$SWI_HOME_DIR/lib/:$SWI_HOME_DIR/lib/jpl.jar
      export CLASSPATH=$SWI_HOME_DIR/lib/:$SWI_HOME_DIR/lib/jpl.jar
      java -Djava.library.path=$SWI_HOME_DIR:$SWI_HOME_DIR/lib/x86_64-darwin14.3.0/ -jar variamos-1.0.1.19.jar
      
OSX 10.6+ (Mac) for VariaMos 1.0.1.17 or older: SWI-Prolog binaries copy and variables configuration after installing SWI-Prolog
Please be aware that you cannot run VariaMos by double click  on the jar file because a special library path value is required (Even if you configured the variables in your system).
Before start: please verify yo have the correct Java (JRE 8+ o JDK 8+) in the path (in a terminal run: java -version). If you have more than one java installed, configure the appropriate one (JAVA_HOME, JRE_HOME and PATH).
    1. The following libraries must be copied to the usr local lib (For the first time):
      sudo cp /Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.1.0/* /usr/local/lib/
    2. To run VariaMos, assuming it was saved on “user”/Downloads/, open a new terminal and paste the following commands (Same steps are required every time you run the tool):
      cd
      cd Downloads/
      export SWI_HOME_DIR=/Applications/SWI-Prolog.app/Contents/swipl
      export PATH=$PATH:$SWI_HOME_DIR/lib/:$SWI_HOME_DIR/lib/jpl.jar
      export CLASSPATH=$SWI_HOME_DIR/lib/:$SWI_HOME_DIR/lib/jpl.jar
      java -Djava.library.path=$SWI_HOME_DIR:$SWI_HOME_DIR/lib/x86_64-darwin13.1.0/ -jar variamos-1.0.1.17.jar
      

Linux Debian: Prerequisite installation and variable configuration  (tested on Ubuntu 14.04 LTS 01/16 in VariaMos 1.0.1.18+, no longer working with VariaMos 1.0.1.17 or older)

    1. Install java jre:
      sudo apt-get update
      sudo apt-get install default-jre
    2. Install swi-prolog and swi-prolog-java (Instructions from http://www.swi-prolog.org/build/Debian.html):
      sudo apt-add-repository ppa:swi-prolog/stable
      sudo apt-get update
      sudo apt-get install swi-prolog
      sudo apt-get install swi-prolog-java
      • Note: to use VariaMos 1.0.1.17 or older with SWI-Prolog 6.6.6 the ppa must be modified manually (https://launchpad.net/~swi-prolog/+archive/ubuntu/stable)
    3. Execute VariaMos (Follow the same steps every time you run the tool):
      
      cd Downloads/
      export SWI_HOME_DIR=/usr/lib/swi-prolog
      export PATH=$PATH:$SWI_HOME_DIR/lib/:$SWI_HOME_DIR/lib/jpl.jar
      java -jar variamos-1.0.1.19.jar
      

Final considerations:

  • Starting from  1.0 Beta 3, VariaMos verifies the solver configuration (i.e. compatible solver installed and variables configured) and notifies if an error is found (i.e. it is not possible to execute a solver query). This verification is executed when the application starts.
  • If you obtain an error like the following trying to run VariaMos, it is possible you do not have the appropriate java installed (i.e. your java version is too old) or the path is not configured to use the correct java version.
    java.lang.UnsupportedClassVersionError: XXXX :
     Unsupported major.minor version XX.X
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(Unknown Source)
  • To use VariaMos with a non-default Java version you can either follow the mentioned steps for Windows or:
    •  Start VariaMos from the bin folder of the correct Java installation using the full path.
    • Modify the path for the current console instance (using set Path=… or export PATH=…). Finally, execute VariaMos from the console.
    • Example:
      C:
      cd C:\Program Files\Java\jre8\bin
      java -jar c:/Users/<<myself>>/Downloads/variamos-1.0.1.19.jar