From ea79e8761b4bdcf0e90c1e57408a0ca6deb10319 Mon Sep 17 00:00:00 2001 From: kungfujam Date: Mon, 28 Sep 2015 12:06:07 +0100 Subject: [PATCH] Updated instructions to reflect what was on the board in class i.e. remove -PREFIX option from virtualenv install, added a variable for the OpenBLAS directory to avoid accidentally making to '/path/to/openblas/...' and enable copy and pasting of code. --- 00_Introduction.ipynb | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/00_Introduction.ipynb b/00_Introduction.ipynb index 5679abb..3b944b9 100644 --- a/00_Introduction.ipynb +++ b/00_Introduction.ipynb @@ -39,10 +39,10 @@ "### Configuring virtual environment (the generic way)\n", "\n", " * `git clone https://github.com/pypa/virtualenv`\n", - " * Enter the cloned repository and type `virtualenv.py --python /usr/bin/python2.7 --no-site-packages --prefix=~/mlpractical`\n", + " * Enter the cloned repository and type `virtualenv.py --python /usr/bin/python2.7 --no-site-packages ~/mlpractical`\n", " * Activate the environment by typing `source ~/mlpractical/bin/activate` (to leave the virtual environment one may type `decativate`). Environments need to be activated every time ones start the new session (unless you do this explicitly in the shell starting scripts, i.e. `~/.bashrc`).\n", "\n", - "### Configuring virtual environment (more comfy DICE wrapper)\n", + "### Configuring virtual environment (more comfy DICE wrapper; ignore if you did the generic way above)\n", "\n", "DICE comes with a handy virtual environment wrapper, called $\\texttt{mkvirtualenv}$, which allows to simplify a bit the above process, to use it:\n", "\n", @@ -50,6 +50,8 @@ " * Then type `mkvirtualenv mlpractical --python /usr/bin/python2.7` (this will create an environment under ~/.virtualenvs/mlpractical)\n", " * To activate the environment you can use `workon` script that comes with the wrapper. Simply type: `workon mlpractical`\n", "\n", + "### Install packages\n", + "\n", "Then, before you follow next, install/upgrade the following packages:\n", "\n", "```\n", @@ -74,19 +76,20 @@ "\n", "#### OpenBlas\n", "\n", - "To install OpenBlas library run:\n", + "To install OpenBlas library run (replace first line to be the path to the directory where you installed OpenBlas):\n", "\n", "```\n", + "OBDir=~/OpenBlas\n", "git clone git://github.com/xianyi/OpenBLAS\n", "cd OpenBLAS\n", "make\n", - "make PREFIX=/path/to/OpenBLAS/lib install\n", + "make PREFIX=$OBDir/lib install\n", "```\n", "\n", "Once OpenBLAS is finished compiling we need to ensure the compiled shared library files in the `lib` subdirectory are available to the shared library loader. This can be done by appending the absolute path to the `lib` subdirectory to the `LD_LIBRARY_PATH` environment variable. To ensure this changes persist we will change the bash start up file `~/.bashrc` by opening it in a text editor and adding the following line\n", "\n", "```\n", - "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/OpenBLAS/lib\n", + "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OBDir/lib\n", "```\n", "\n", "After you have edited `.bashrc` run\n", @@ -107,8 +110,8 @@ "unzip numpy-1.9.2.zip\n", "cd numpy-1.9.2\n", "echo \"[openblas]\" >> site.cfg\n", - "echo \"library_dirs = /path/to/OpenBlas/lib\" >> site.cfg\n", - "echo \"include_dirs = /path/to/OpenBLAS/include\" >> site.cfg\n", + "echo \"library_dirs = $OBDir/lib\" >> site.cfg\n", + "echo \"include_dirs = $OBDir/include\" >> site.cfg\n", "python setup.py build --fcompiler=gnu95\n", "```\n", "\n", @@ -338,7 +341,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", - "version": "2.7.6" + "version": "2.7.5" } }, "nbformat": 4,