Skip to content

Instantly share code, notes, and snippets.

@zakandrewking
Last active August 29, 2015 13:58
Show Gist options
  • Save zakandrewking/10331064 to your computer and use it in GitHub Desktop.
Save zakandrewking/10331064 to your computer and use it in GitHub Desktop.
Cobra installation on carver

Add the following to ~/.bashrc.ext (or ~/.zshrc.ext if you use zsh):

if [[ $NERSC_HOST == "carver" ]]
then
    module unload python
    module load python/2.7.3
    module load numpy
    module load scipy
    module unload pgi
    module load gcc
    module load tmux
    module swap openmpi openmpi-gcc/1.6
    module unload R
    module load R-tig/2.15.1
    module load git
    export DYLD_LIBRARY_PATH=$HOME/me/env/lib/:$DYLD_LIBRARY_PATH
    export LD_LIBRARY_PATH=$HOME/me/env/lib/:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=/usr/common/tig/R/2.15.1/lib64/R/lib/:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=$HOME/me/Library/soplex-1.6.0/lib/:$LD_LIBRARY_PATH
fi			

Check that python is loaded by opening an interactive session.

create a virtualenv:

http://www.virtualenv.org/en/latest/virtualenv.html#usage

virtualenv env
source env/bin/activate

install glpk in the virtualenv, from source

First install gmp

wget https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.xz
tar -xf gmp-6.0.0a.tar.xz
cd gmp-6.0.0a
./configure --prefix="/global/homes/z/zking1/env"
make
make check

http://www.gnu.org/software/glpk/

Try version 4.39 for pyglpk 0.3

You'll have to do something like this, to get it in the right directory:

./configure --prefix="/global/homes/z/zking1/env" --with-gmp
make
make install

install the following with pip:

pip install cobra
pip install glpk
pip install biopython

try to qsub a simulation

Minimal installation

Start with a virtualenv

virtualenv env --prompt="me> "
source env/bin/activate

install glpk

pip install git+https://github.com/SBRG/cobrapy_internal.git
pip install biopython psycopg2 glpk
# pip install numpy scipy

Install sympy 0.7.1 (newer versions were causing problems)

pip install https://github.com/sympy/sympy/archive/sympy-0.7.1.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment