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.
This commit is contained in:
parent
beb0cdd0cb
commit
ea79e8761b
@ -39,10 +39,10 @@
|
|||||||
"### Configuring virtual environment (the generic way)\n",
|
"### Configuring virtual environment (the generic way)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" * `git clone https://github.com/pypa/virtualenv`\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",
|
" * 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",
|
"\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",
|
"\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",
|
"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",
|
"\n",
|
||||||
@ -50,6 +50,8 @@
|
|||||||
" * Then type `mkvirtualenv mlpractical --python /usr/bin/python2.7` (this will create an environment under ~/.virtualenvs/mlpractical)\n",
|
" * 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",
|
" * To activate the environment you can use `workon` script that comes with the wrapper. Simply type: `workon mlpractical`\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"### Install packages\n",
|
||||||
|
"\n",
|
||||||
"Then, before you follow next, install/upgrade the following packages:\n",
|
"Then, before you follow next, install/upgrade the following packages:\n",
|
||||||
"\n",
|
"\n",
|
||||||
"```\n",
|
"```\n",
|
||||||
@ -74,19 +76,20 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"#### OpenBlas\n",
|
"#### OpenBlas\n",
|
||||||
"\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",
|
||||||
"```\n",
|
"```\n",
|
||||||
|
"OBDir=~/OpenBlas\n",
|
||||||
"git clone git://github.com/xianyi/OpenBLAS\n",
|
"git clone git://github.com/xianyi/OpenBLAS\n",
|
||||||
"cd OpenBLAS\n",
|
"cd OpenBLAS\n",
|
||||||
"make\n",
|
"make\n",
|
||||||
"make PREFIX=/path/to/OpenBLAS/lib install\n",
|
"make PREFIX=$OBDir/lib install\n",
|
||||||
"```\n",
|
"```\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",
|
"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",
|
||||||
"```\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",
|
||||||
"\n",
|
"\n",
|
||||||
"After you have edited `.bashrc` run\n",
|
"After you have edited `.bashrc` run\n",
|
||||||
@ -107,8 +110,8 @@
|
|||||||
"unzip numpy-1.9.2.zip\n",
|
"unzip numpy-1.9.2.zip\n",
|
||||||
"cd numpy-1.9.2\n",
|
"cd numpy-1.9.2\n",
|
||||||
"echo \"[openblas]\" >> site.cfg\n",
|
"echo \"[openblas]\" >> site.cfg\n",
|
||||||
"echo \"library_dirs = /path/to/OpenBlas/lib\" >> site.cfg\n",
|
"echo \"library_dirs = $OBDir/lib\" >> site.cfg\n",
|
||||||
"echo \"include_dirs = /path/to/OpenBLAS/include\" >> site.cfg\n",
|
"echo \"include_dirs = $OBDir/include\" >> site.cfg\n",
|
||||||
"python setup.py build --fcompiler=gnu95\n",
|
"python setup.py build --fcompiler=gnu95\n",
|
||||||
"```\n",
|
"```\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -338,7 +341,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython2",
|
"pygments_lexer": "ipython2",
|
||||||
"version": "2.7.6"
|
"version": "2.7.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
Loading…
Reference in New Issue
Block a user