Skip to content

DevNotes_DevEnviroment

Jeff Krzywon edited this page May 19, 2021 · 14 revisions

This page covers minimum instructions to setup SasView developers envroment. If you run into and issues please visit this link, which covers quite a few solutions.

Step 1 - Install anaconda

Download the latest 64-Bit Python 3.x Installer from ​https://repo.continuum.io/archive/ (e.g. Anaconda3-2020.11-MacOSX-x86_64.pkg or Anaconda3-2020.11-Windows-x86_64.exe) and run it.

Step 1.2 - Install Microsoft Visual C++ 14 Build Tools (Windows only)

Some Python packages installed later require the Microsoft Visual C++ 14 build tools. If not already installed, e.g. by the complete Visual Studio, use ​this link to download the Visual C++ 2015 Build Tools directly. That will install Visual C++ 14 without installing Visual Studio. Installation requires Administrator permissions and will require a system restart in order to build the models.

Step 2 - Download SasView and sasmodels from github

If you don't have git installed, go to the GIT section below (Step 6) for instructions, otherwise simply run

git clone https://github.com/SasView/sasview.git sasview
git clone https://github.com/SasView/sasmodels.git sasmodels

Step 3 - Install dependencies

Go to folder:

sasview/build_tools/

And create conda enviroment using yml specific for your platform (needs to be run from top-level not within a conda virtual environment)

#Windows
conda env create -f conda_qt5_win.yml

#Mac OSX
conda env create -f  conda_qt5_min_osx.yml

#Linux
conda env create -f conda_qt5_min_ubuntu.yml

Note that in order to build the documentation, you will require a version of GNU Make (make command) (see Step 7).

Step 4 - activate conda enviroment

#Windows
activate qt5_win

else if running from inside a Git Bash shell use: 
source activate qt5_ubuntu

#Mac OSX
conda activate qt5_osx

#Linux
conda activate qt5_ubuntu

Step 5 - run SasView

You should be ready to run sasview. Go to sasview directory and run

python run.py

To build the documentation you will still first need to do:

python setup.py docs 

Step 6 - Install Git (Optional)

Install Git for your platform by following instructions: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

When installing on Windows, it may be worthwhile to make sure "Use Git from the Windows Command Prompt" is selected, rather than "Use Git from Bash only". This way you can use git from the same command line as you will use Anaconda.

Set up your credentials:

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

If you work behind proxy remmeber to configure

e.g. git config --global http.proxy 192.168.1.1:XXXX 

GNU Make Installation (Optional)

On Linux, you can obtain this with your package manager. On Windows 7, activate your new conda environment and run the following:

conda install -c conda-forge make

On Windows 10, you may find that the make command does not work with the above method. You can find a Windows-compatible build of GNU Make here: ​http://gnuwin32.sourceforge.net/packages/make.htm Ensure that you add the install directory to your PATH.

Clone this wiki locally