Index: build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/CMakeLists.txt
===================================================================
--- build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/CMakeLists.txt	(revision c3b2327d867ba1451da79a2e9f5c4f452720a71c)
+++ build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/CMakeLists.txt	(revision c3b2327d867ba1451da79a2e9f5c4f452720a71c)
@@ -0,0 +1,58 @@
+cmake_minimum_required(VERSION 2.6)
+
+# This will install a pyinstaller-generated sasview
+project(sasview C)
+
+# Define the version of sasview being packaged
+option(SAS_VERSION "Define SASView version to package" off)
+
+if (NOT ${SAS_VERSION})
+  message(FATAL_ERROR "SASView version unspecified!\n"
+    "Please use e.g. -DSAS_VERSION=4.1 ")
+endif()
+
+# main install work is done in this function
+macro(installDir path)
+  # Main install location is defined via CMAKE_INSTALL_PREFIX
+  # - what is chosen here is a subdirectory
+  install (
+    DIRECTORY "${path}/"
+    DESTINATION "sasview/${SAS_VERSION}"
+    PATTERN "Makefile*" EXCLUDE  # skip makefiles
+    PATTERN "#*"        EXCLUDE  # skip backup files
+    PATTERN ".*"        EXCLUDE  # skip hidden files
+    PATTERN "*.out"     EXCLUDE  # skip binary files
+    PATTERN "*.*.in"    EXCLUDE  # skip configure processed template files
+    PATTERN "*"
+    PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+    GROUP_EXECUTE GROUP_READ
+    WORLD_EXECUTE WORLD_READ
+  )
+endmacro()
+
+# CPack configuration
+set(CPACK_PACKAGE_NAME          "sasview-${SAS_VERSION}")
+set(CPACK_RESOURCE_FilE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}../../LICENSE.TXT")
+set(CPACK_PACKAGE_CONTACT       "pkwi@fysik.dtu.dk")
+
+set(CPACK_PACKAGE_VERSION       "1.0")
+set(CPACK_PACKAGE_VERSION_MAJOR "1")
+set(CPACK_PACKAGE_VERSION_MINOR "0")
+
+# Have CPack respect install prefix
+set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
+set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
+
+# Avoid e.g. /usr/local being "part" of the RPMs
+set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST
+  ${CMAKE_INSTALL_PREFIX}
+  ${CMAKE_INSTALL_PREFIX}/bin
+  ${CMAKE_INSTALL_PREFIX}/sasview
+  )
+
+installDir("${PROJECT_SOURCE_DIR}/sasview")
+
+execute_process(COMMAND ln -s ${CMAKE_INSTALL_PREFIX}/sasview/${SAS_VERSION}/sasview sasview)
+install(FILES ${CMAKE_BINARY_DIR}/sasview DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/)
+
+include(CPack)
Index: build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/README.md
===================================================================
--- build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/README.md	(revision c3b2327d867ba1451da79a2e9f5c4f452720a71c)
+++ build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/README.md	(revision c3b2327d867ba1451da79a2e9f5c4f452720a71c)
@@ -0,0 +1,18 @@
+Build tools for Debian and RPM
+------------------------------
+
+How-to  build SasView Debian and RPM packages on Ubuntu using Anaconda
+  
+  - Set up conda environment using the environment.yml file
+  - Use pyopencl from conda 
+  - Do not use pyopencl from pip - this will cause pyinstaller to fail finding pyopencl 
+  - Copy CMakelist.txt to the sasview/build_tools folder
+
+
+Known Issues:
+-------------
+  - pyopencl from conda is not the newest version
+  - To bypass one could build new pyopencl package based on the pip pyopencl package 
+  - Windows, OSX, Linux all have different versions of pyopencl available  on conda  
+
+
Index: build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/environment.yml
===================================================================
--- build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/environment.yml	(revision c3b2327d867ba1451da79a2e9f5c4f452720a71c)
+++ build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/environment.yml	(revision c3b2327d867ba1451da79a2e9f5c4f452720a71c)
@@ -0,0 +1,127 @@
+name: sasviewqt_new
+channels: !!python/tuple
+- !!python/unicode
+  'defaults'
+dependencies:
+- anaconda::alabaster=0.7.9=py27_0
+- anaconda::astroid=1.4.7=py27_0
+- anaconda::babel=2.3.4=py27_0
+- anaconda::backports=1.0=py27_0
+- anaconda::backports_abc=0.5=py27_0
+- anaconda::cairo=1.12.18=6
+- anaconda::decorator=4.0.10=py27_1
+- anaconda::docutils=0.12=py27_2
+- anaconda::enum34=1.1.6=py27_0
+- anaconda::fontconfig=2.11.1=6
+- anaconda::freetype=2.5.5=1
+- anaconda::funcsigs=1.0.2=py27_0
+- anaconda::get_terminal_size=1.0.0=py27_0
+- anaconda::glib=2.43.0=1
+- anaconda::harfbuzz=0.9.39=1
+- anaconda::html5lib=0.999=py27_0
+- anaconda::imagesize=0.7.1=py27_0
+- anaconda::ipykernel=4.5.2=py27_0
+- anaconda::ipython=5.1.0=py27_0
+- anaconda::ipython-qtconsole=4.0.1=py27_0
+- anaconda::ipython_genutils=0.1.0=py27_0
+- anaconda::jbig=2.1=0
+- anaconda::jinja2=2.8=py27_1
+- anaconda::jpeg=8d=2
+- anaconda::jupyter_client=4.4.0=py27_0
+- anaconda::jupyter_core=4.2.1=py27_0
+- anaconda::lazy-object-proxy=1.2.1=py27_0
+- anaconda::libffi=3.2.1=0
+- anaconda::libgfortran=3.0.0=1
+- anaconda::libiconv=1.14=0
+- anaconda::libpng=1.6.17=0
+- anaconda::libsodium=1.0.10=0
+- anaconda::libtiff=4.0.6=2
+- anaconda::libxml2=2.9.4=0
+- anaconda::libxslt=1.1.28=0
+- anaconda::lxml=3.6.4=py27_0
+- anaconda::markupsafe=0.23=py27_2
+- anaconda::mkl=11.3.3=0
+- anaconda::mock=2.0.0=py27_0
+- anaconda::openssl=1.0.2j=0
+- anaconda::pango=1.39.0=1
+- anaconda::path.py=8.2.1=py27_0
+- anaconda::pathlib2=2.1.0=py27_0
+- anaconda::pbr=1.10.0=py27_0
+- anaconda::pexpect=4.0.1=py27_0
+- anaconda::pickleshare=0.7.4=py27_0
+- anaconda::pillow=3.4.2=py27_0
+- anaconda::pip=9.0.1=py27_1
+- anaconda::pixman=0.32.6=0
+- anaconda::prompt_toolkit=1.0.9=py27_0
+- anaconda::ptyprocess=0.5.1=py27_0
+- anaconda::py2cairo=1.10.0=py27_2
+- anaconda::pygments=2.1.3=py27_0
+- anaconda::pylint=1.5.4=py27_1
+- anaconda::pyparsing=2.0.3=py27_0
+- anaconda::pyqt=4.11.4=py27_4
+- anaconda::python=2.7.12=1
+- anaconda::python-dateutil=2.4.2=py27_0
+- anaconda::pytz=2016.10=py27_0
+- anaconda::pyzmq=16.0.2=py27_0
+- anaconda::qt=4.8.7=4
+- anaconda::qtconsole=4.2.1=py27_0
+- anaconda::readline=6.2=2
+- anaconda::reportlab=3.3.0=py27_0
+- anaconda::setuptools=19.2=py27_0
+- anaconda::simplegeneric=0.8.1=py27_1
+- anaconda::singledispatch=3.4.0.3=py27_0
+- anaconda::sip=4.18=py27_0
+- anaconda::six=1.10.0=py27_0
+- anaconda::snowballstemmer=1.2.1=py27_0
+- anaconda::sphinx=1.4.8=py27_0
+- anaconda::sqlite=3.13.0=0
+- anaconda::ssl_match_hostname=3.4.0.2=py27_1
+- anaconda::tk=8.5.18=0
+- anaconda::tornado=4.4.2=py27_0
+- anaconda::traitlets=4.3.1=py27_0
+- anaconda::wcwidth=0.1.7=py27_0
+- anaconda::wheel=0.29.0=py27_0
+- anaconda::wrapt=1.10.8=py27_0
+- anaconda::wxpython=3.0.0.0=py27_2
+- anaconda::xz=5.2.2=0
+- anaconda::zeromq=4.1.5=0
+- anaconda::zlib=1.2.8=3
+- h5py=2.5.0=np19py27_3
+- hdf5=1.8.15.1=3
+- matplotlib=1.4.3=np19py27_2
+- numpy=1.9.3=py27_3
+- py=1.4.31=py27_0
+- pytest=3.0.5=py27_0
+- scipy=0.17.1=np19py27_1
+- timrudge::appdirs=1.4.0=py27_0
+- timrudge::mako=1.0.1=py27_0
+- timrudge::pyopencl=2014.1=np19py27_0
+- timrudge::pytools=2014.3.5=py27_0
+- pip:
+  - backports-abc==0.5
+  - backports.shutil-get-terminal-size==1.0.0
+  - backports.ssl-match-hostname==3.4.0.2
+  - bumps==0.7.6
+  - cffi==1.9.1
+  - constantly==15.1.0
+  - incremental==16.10.1
+  - ipython-genutils==0.1.0
+  - jupyter-client==4.4.0
+  - jupyter-core==4.2.1
+  - periodictable==1.4.1
+  - pisa==3.0.33
+  - prompt-toolkit==1.0.9
+  - pycparser==2.17
+  - pyinstaller==3.2
+  - pypdf2==1.26.0
+  - qt4reactor==1.6
+  - sasmodels==0.94
+  - sasview==4.0
+  - stdeb==0.8.5
+  - twisted==16.5.0
+  - unittest-xml-reporting==2.1.0
+  - wxpython-common==3.0.0.0
+  - xhtml2pdf==0.0.6
+  - zope.interface==4.3.2
+prefix: /home/vagrant/miniconda2/envs/sasviewqt_new
+
Index: build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/jenkins_linux_deb_rpm_build.sh
===================================================================
--- build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/jenkins_linux_deb_rpm_build.sh	(revision c3b2327d867ba1451da79a2e9f5c4f452720a71c)
+++ build_tools/Vagrant/Ubuntu1404/Build_deb_rpm/jenkins_linux_deb_rpm_build.sh	(revision c3b2327d867ba1451da79a2e9f5c4f452720a71c)
@@ -0,0 +1,107 @@
+# This build script is tested for Ubuntu build VM
+# This build script generates SasView Debian and RPM packages 
+
+export PATH=$PATH:/usr/local/bin/
+
+PYTHON=${PYTHON:-`which python`}
+EASY_INSTALL=${EASY_INSTALL:-`which easy_install`}
+PYLINT=${PYLINT:-`which pylint`}
+
+export PYTHONPATH=$PYTHONPATH:$WORKSPACE/sasview/utils
+export PYTHONPATH=$PYTHONPATH:$WORKSPACE/sasview/sasview-install
+
+
+cd $WORKSPACE
+
+
+# SET SASVIEW GITHASH
+cd $WORKSPACE
+cd sasview/sasview
+githash=$( git rev-parse HEAD )
+sed -i.bak s/GIT_COMMIT/$githash/g __init__.py
+
+
+# SASMODLES
+cd $WORKSPACE
+cd sasmodels
+
+rm -rf build
+rm -rf dist
+
+$PYTHON setup.py clean
+$PYTHON setup.py build
+
+
+# SASMODLES - BUILD DOCS
+cd  doc
+make html
+
+cd $WORKSPACE
+cd sasmodels
+$PYTHON setup.py bdist_egg
+
+
+# SASVIEW
+cd $WORKSPACE
+cd sasview
+rm -rf sasview-install
+mkdir  sasview-install
+rm -rf utils
+mkdir  utils
+rm -rf dist
+rm -rf build
+
+
+# INSTALL SASMODELS
+cd $WORKSPACE
+cd sasmodels
+cd dist
+$EASY_INSTALL -d $WORKSPACE/sasview/utils sasmodels*.egg
+
+
+# BUILD SASVIEW
+cd $WORKSPACE
+cd sasview
+$PYTHON setup.py clean
+$PYTHON setup.py build docs bdist_egg
+
+
+# INSTALL SASVIEW
+cd $WORKSPACE
+cd sasview
+cd dist
+$EASY_INSTALL -d $WORKSPACE/sasview/sasview-install sasview*.egg
+
+
+# TEST
+cd $WORKSPACE
+cd sasview
+cd test
+$PYTHON utest_sasview.py
+
+## PYLINT
+cd $WORKSPACE
+cd sasview
+$PYLINT --rcfile "build_tools/pylint.rc" -f parseable sasview-install/sasview*.egg/sas sasview | tee  test/sasview.txt
+
+# PYINSTALLER - SASVIEW
+cd $WORKSPACE
+cd sasview
+cd sasview
+pyinstaller ./sasview.spec
+
+# CMake Debian RPM package - SASVIEW
+cd $WORKSPACE
+cd sasview
+cd sasview
+cd dist
+cp $WORKSPACE/sasview/build_tools/CMakeLists.txt . 
+mkdir tmp
+cd tmp
+cmake .. -DSAS_VERSION=4.1 -DCMAKE_INSTALL_PREFIX=/usr/local
+cpack -G DEB
+cpack -G RPM
+
+# Back to WORKSPACE
+cd $WORKSPACE
+
Index: build_tools/Vagrant/Ubuntu1404/README.md
===================================================================
--- build_tools/Vagrant/Ubuntu1404/README.md	(revision 95d32b78ba5ae7c946ddf728c88471627f9095a1)
+++ build_tools/Vagrant/Ubuntu1404/README.md	(revision 95d32b78ba5ae7c946ddf728c88471627f9095a1)
@@ -0,0 +1,51 @@
+Ubuntu Vagrant Setup for SasViewQt 
+----------------------------------
+
+How-to setup VM SasViewQt Ubuntu1404 developer env using Vagrant
+
+A: Provision VM
+---------------
+
+B: Log on to VM - Setup Anaconda
+--------------------------------
+
+1. Install miniconda: $ bash ./Miniconda2-latest-Linux-x86_64.sh
+2. Export miniconda path: $ export PATH=/home/vagrant/miniconda2/bin:$PATH 
+3. Make sasviewqt env in minicona: conda env create -f environment.yml
+
+C: Build SasView
+----------------
+1. clone sasview: git clone https://github.com/SasView/sasview
+2. clone sasmodels: git clone https://github.com/SasView/sasmodels
+3. show sasview branch: git remote show origin
+4. checkout ESS\_GUI: git checkout ESS\_GUI
+5. build sasmodels: python setup.py build
+6. build sasmodels doc: make html
+7. build sasview: python setup.py build
+8. build sasview: python setup.py docs
+9. run sasview: python run.py
+10. cd SasView/sasview/src/sas/qtgui
+11. make gui: ./make_ui.sh
+12. python run.py / python Main\_Window.py depending on on your cloned githash
+
+Tips:
+----
+
+   - $ export PATH=/home/vagrant/miniconda2/bin:$PATH
+   - $ conda env export > environment.yml
+   - $ conda env create -f environment.yml
+
+To activate this environment, use:
+
+   - $ source activate sasviewqt
+
+To deactivate this environment, use:
+
+   - $ source deactivate sasviewqt
+
+
+Known problems:
+---------------
+
+   - libxml2 not installed.
+
Index: build_tools/Vagrant/Ubuntu1404/Vagrantfile
===================================================================
--- build_tools/Vagrant/Ubuntu1404/Vagrantfile	(revision e84ccf57052f81b796f647b3de00d554469a8318)
+++ build_tools/Vagrant/Ubuntu1404/Vagrantfile	(revision e84ccf57052f81b796f647b3de00d554469a8318)
@@ -0,0 +1,48 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+HOST_NAME = "Ub1404-SasViewQt-Ver2"
+
+# All Vagrant configuration is done below. The "2" in Vagrant.configure
+# configures the configuration version (we support older styles for
+# backwards compatibility). Please don't change it unless you know what
+# you're doing.
+Vagrant.configure(2) do |config|
+  # Ubuntu 14.04
+  config.vm.box = "ubuntu/trusty64"
+  config.vm.define HOST_NAME do |h|
+  end
+
+  # This is the hostname that the virtual machine uses internally.
+  config.vm.hostname = HOST_NAME
+
+
+  config.vm.provider "virtualbox" do |vb|
+    # Display the VirtualBox GUI when booting the machine
+    vb.name = HOST_NAME
+    vb.gui = true
+    vb.customize ["modifyvm", :id, "--memory", "8192"]
+    vb.customize ["modifyvm", :id, "--cpus", "4"]
+    vb.customize ["modifyvm", :id, "--graphicscontroller", "vboxvga"]
+    vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
+    vb.customize ["modifyvm", :id, "--ioapic", "on"]
+    vb.customize ["modifyvm", :id, "--vram", "32"]
+    vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
+  end
+
+
+  # Install ubuntu-desktop and virtualbox additions and all of the rest
+  # Take one provision file at the time.
+  # Do the loop:
+  # terminal: vagrant up --provision 
+  # Check install packages
+  # terminal: vagrant halt
+  # Comment in/out the appropriate lines
+
+  # 1.
+  #config.vm.provision "shell", path: "provision/bootstrap.sh"
+  # 2.
+  #config.vm.provision "shell", path: "provision/developer.sh"
+  # 3.
+  config.vm.provision "shell", path: "provision/miniconda.sh"
+end
Index: build_tools/Vagrant/Ubuntu1404/provision/bootstrap.sh
===================================================================
--- build_tools/Vagrant/Ubuntu1404/provision/bootstrap.sh	(revision e84ccf57052f81b796f647b3de00d554469a8318)
+++ build_tools/Vagrant/Ubuntu1404/provision/bootstrap.sh	(revision e84ccf57052f81b796f647b3de00d554469a8318)
@@ -0,0 +1,6 @@
+#! /bin/bash
+
+# Install ubuntu-desktop and virtualbox additions
+sudo apt-get update
+sudo apt-get install -y ubuntu-desktop virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
+
Index: build_tools/Vagrant/Ubuntu1404/provision/developer.sh
===================================================================
--- build_tools/Vagrant/Ubuntu1404/provision/developer.sh	(revision e84ccf57052f81b796f647b3de00d554469a8318)
+++ build_tools/Vagrant/Ubuntu1404/provision/developer.sh	(revision e84ccf57052f81b796f647b3de00d554469a8318)
@@ -0,0 +1,22 @@
+#! /bin/bash
+
+# Install basic developer tools 
+
+sudo apt-get update
+sudo apt-get install -y git
+sudo apt-get install -y vim build-essential
+
+
+sudo apt-get install dpkg-dev fakeroot lintian
+
+# Now with mpistuff 
+sudo apt-get install -y openmpi-bin openmpi-doc libopenmpi-dev
+
+#Install viewer to nexus files 
+sudo apt-get install -y hdfview
+
+# Install PyCharm community edition
+sudo add-apt-repository ppa:mystic-mirage/pycharm
+sudo apt-get update
+sudo apt-get install -y --force-yes pycharm-community 
+
Index: build_tools/Vagrant/Ubuntu1404/provision/environment.yml
===================================================================
--- build_tools/Vagrant/Ubuntu1404/provision/environment.yml	(revision e84ccf57052f81b796f647b3de00d554469a8318)
+++ build_tools/Vagrant/Ubuntu1404/provision/environment.yml	(revision e84ccf57052f81b796f647b3de00d554469a8318)
@@ -0,0 +1,35 @@
+name: sasviewqt
+channels: !!python/tuple
+- !!python/unicode 'defaults'
+dependencies:
+- python=2.7.12
+- anaconda::pyqt=4.11.4
+- anaconda::qt=4.8.7
+- anaconda::wxpython=3.0.0.0
+- html5lib=0.999
+- ipython=5.1.0
+- ipython-qtconsole=4.0.1
+- lxml=3.6.4
+- matplotlib=1.4.3
+- numpy=1.10.4
+- pillow=3.4.2
+- pip=9.0.1
+- pylint=1.5.4
+- pyparsing=2.0.3
+- python-dateutil=2.6.0
+- qtconsole=4.2.1
+- reportlab=3.3.0
+- scipy=0.17.1
+- sphinx=1.4.8
+- h5py=2.6.0
+- pip:
+  - bumps==0.7.6
+  - periodictable==1.4.1
+  - pisa==3.0.33
+  - pypdf2==1.26.0
+  - qt4reactor==1.6
+  - twisted==16.5.0
+  - unittest-xml-reporting==2.1.0
+  - xhtml2pdf==0.0.6
+prefix: /home/vagrant/miniconda2/envs/sasviewqt
+
Index: build_tools/Vagrant/Ubuntu1404/provision/miniconda.sh
===================================================================
--- build_tools/Vagrant/Ubuntu1404/provision/miniconda.sh	(revision e84ccf57052f81b796f647b3de00d554469a8318)
+++ build_tools/Vagrant/Ubuntu1404/provision/miniconda.sh	(revision e84ccf57052f81b796f647b3de00d554469a8318)
@@ -0,0 +1,12 @@
+#! /bin/bash
+
+# Install miniconda
+# download - wget
+wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
+
+# To set up through vagrant provision - seems however to cause read/write sudo issues later when pip or conda install
+#wget https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh
+#chmod +x Anaconda2-4.2.0-Linux-x86_64.sh
+#mv Anaconda2-4.2.0-Linux-x86_64.sh anaconda.sh
+#./anaconda.sh -b -p /home/vagrant/anaconda
+
