Skip to content

Setup Linux for development

Gabriel Iltis edited this page Apr 22, 2015 · 5 revisions

Setting up linux for NSLS-II development ----

Check your Linux distribution and release with lsb_release -a: :

edill@xf23id1-ws3:~/.ssh$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.5 (wheezy)
Release:    7.5
Codename:   wheezy

Debian 7.5 "Wheezy" ====

  1. Use anaconda to manage python libraries
    1. Download anaconda
      1. I downloaded Anaconda with version=2.0.1-Linux-x86_64
    2. Install anaconda into your home directory: :

      bash Anaconda-[version].sh
    3. Check that your python version is running from ~/anaconda/bin/python :

      edill@xf23id1-ws3:~$ which python
      /home/edill/anaconda/bin/
    4. If which python does not return /home/username/anaconda/bin/, do not go to the next step until it does!!
  2. If you're working at any of the computers at the beamlines, you'll need to export the http_proxy environmental variable which will allow you to use conda search, conda install, etc... :

    export http_proxy=http://proxy:8888
    export https_proxy=http://proxy:8888
  3. Compare the library versions that anaconda installed with our library dependencies located here
    1. conda remove any packages whose versions do not match.
    2. Download any packages that you need
      1. Probably from conda or pypi
      2. cd to your download directory
        1. conda install [package-name] or
        2. pip install [package-name]
  4. Set up development folder tree. Suggestion: :

    ~/dev  
      ∟ my_src/  
        ∟ NSLS2  
        ∟ vistools  
      ∟ python_src/  
        ∟ VisTrails  
        ∟ matplotlib  
        ∟ metadataStore  
  5. Get NSLS-II source code

    1. Fastest way is to run this script in the directory where you want the git repositories cloned
    2. install the packages (vistools and NSLS2):
      1. cd to the top-level directory of each package
      2. python setup.py develop

    This will set up the installed version of the package to track the code as you edit it. Using this nosetest will automatically find the correct version of the code. In a live interpreter you will need to call reload.

  6. Get VisTrails source code
    1. cd ~/dev/my_src/
    2. git clone https://github.com/VisTrails/VisTrails.git
    3. Run VisTrails
      1. python ~/dev/my_src/VisTrails/vistrails/run.py
      2. Look at the command line for any packages it's trying to install.
      3. Manually install those packages from conda or pypi
      4. Once VisTrails starts up with no errors, continue on to the next step
  7. Set up VisTrails to develop modules
    1. make a git repository called 'userpackages'
    2. git clone it into ~/dev/my_src/
    3. delete or move ~/.vistrails/userpackages/ to ~/dev/my_src/userpackages/
    4. make a symbolic link between ~/dev/my_src/userpackages/ and ~/dev/my_src/VTTools/vt_config/NSLS-II
      1. ln -s ~/dev/my_src/VTTools/vt_config/NSLS-II
    5. go to the ~/.vistrails/ directory
      1. cd ~/.vistrails/
    6. make a symbolic link between ~/.vistrails/userpackages/ and ~/dev/my_src/userpackages/
      1. ln -s ~/dev/my_src/userpackages/ userpackages
  8. Get the latest version of matplotlib
    1. go to ~/dev/other_src/
    2. git clone https://github.com/matplotlib/matplotlib.git
    3. pip uninstall matplotlib
    4. pip install ./matplotlib
    5. If the pip install fails, try sudo apt-get build-dep python-matplotlib first and then run the pip install again
  9. If you want to play around with the data broker: Set up the Data Broker