Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 72467501 authored by hhakim's avatar hhakim
Browse files

Add a hint about matlab savepath in install guide.

parent 39b17330
No related branches found
No related tags found
No related merge requests found
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional //EN"> <!doctype html public "-//W3C//DTD HTML 4.0 Transitional //EN">
<html> <html>
<head> <head>
<meta name="GENERATOR" content="mkd2html 2.2.4"> <meta name="GENERATOR" content="mkd2html 2.2.7">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title> <title></title>
</head> </head>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<h3>1.1 For Python</h3> <h3>1.1 For Python</h3>
<p>@note This section treats only of system packages/installers but note that some pip packages are also available and this is in fact the recommended way of installing pyfaust, in particular because of the easier weak dependency management. You might install them in virtual environments: <p>@note This section treats only of system packages/installers but note that some PIP and Anaconda packages are also available. They are recommended way of installing pyfaust, in particular because of the easier weak dependency management. You might install them in virtual environments:
\ref install_pyfaust_in_venv.<br/></p> \ref install_pyfaust_in_venv.<br/></p>
<p>FAµST is designed for the Python ecosystem which as usual relies on the numpy and scipy packages.</p> <p>FAµST is designed for the Python ecosystem which as usual relies on the numpy and scipy packages.</p>
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
# it could be pip3 instead of pip # it could be pip3 instead of pip
</code></pre> </code></pre>
<p>Note that you probably have to install those packages for all versions of Python you want to use (each one have normally its associated pip executable).<br/> <p>Note that you probably have to install those packages for all versions of Python you want to use (each one has normally its associated pip executable).<br/>
Note also that you can rely on your system package manager to install the Python packages (e.g. dnf/yum repositories on Fedora/Centos Linux systems).</p> Note also that you can rely on your system package manager to install the Python packages (e.g. dnf/yum repositories on Fedora/Centos Linux systems).</p>
<p>FAµST supports at least Python 2.7.15 and is also compiled for Python @PY3_VER@.</p> <p>FAµST is compiled for Python @PY3_VER@.</p>
<p>Note that starting from january 2020 python2.7 won&rsquo;t be supported anymore and FAµST newer packages won&rsquo;t deliver any python 2.7 wrapper too. <p>Note that starting from january 2020 python2.7 won&rsquo;t be supported anymore and FAµST newer packages won&rsquo;t deliver any python 2.7 wrapper too.
Anyway, the python 3 versions are more advanced and it&rsquo;s highly recommended to move to these versions.</p> Anyway, the python 3 versions are more advanced and it&rsquo;s highly recommended to move to these versions.</p>
...@@ -69,7 +69,7 @@ Nevertheless, it could be useful to check that it really worked and set the envi ...@@ -69,7 +69,7 @@ Nevertheless, it could be useful to check that it really worked and set the envi
<p>To test whether the FAµST Matlab wrapper auto-setup succeeded at install stage, you can open a terminal and type:</p> <p>To test whether the FAµST Matlab wrapper auto-setup succeeded at install stage, you can open a terminal and type:</p>
<pre><code>matlab -nodisplay -nojvm -r "matfaust.rand(10, 10, 1, 10, .5, 'dense', 'complex')" <pre><code>matlab -nodisplay -nojvm -r "matfaust.rand(10, 10, 'num_factors', 1, 'density', .5, 'fac_type', 'dense', 'field', 'complex')"
</code></pre> </code></pre>
<p>Note: if Matlab is not set in your PATH environment variable you need to replace `matlab' with its full path <p>Note: if Matlab is not set in your PATH environment variable you need to replace `matlab' with its full path
...@@ -79,7 +79,7 @@ Nevertheless, it could be useful to check that it really worked and set the envi ...@@ -79,7 +79,7 @@ Nevertheless, it could be useful to check that it really worked and set the envi
<pre><code>Faust size 10x10, density 0.50, nnz_sum 50, 1 factor(s): <pre><code>Faust size 10x10, density 0.50, nnz_sum 50, 1 factor(s):
- FACTOR 0 (complex) DENSE, size 10x10, density 0.5, nnz 50 - FACTOR 0 (complex) DENSE, size 10x10, density 0.5, nnz 50
&gt;&gt; % other values are possible for density, etc. because of the random generation % other values are possible for density, etc. because of the random generation
</code></pre> </code></pre>
<p>Otherwise it didn&rsquo;t work. So here is how to setup the wrapper manually.</p> <p>Otherwise it didn&rsquo;t work. So here is how to setup the wrapper manually.</p>
...@@ -91,13 +91,25 @@ Nevertheless, it could be useful to check that it really worked and set the envi ...@@ -91,13 +91,25 @@ Nevertheless, it could be useful to check that it really worked and set the envi
<p>Then launch the script that is responsible to add FAµST location in your Matlab path.</p> <p>Then launch the script that is responsible to add FAµST location in your Matlab path.</p>
<pre><code> <pre><code>&gt;&gt; setup_FAUST
&gt;&gt; setup_FAUST
&gt;&gt; % then test again FAµST &gt;&gt; % then test again FAµST
&gt;&gt; matfaust.rand(10, 10, 1, 10, .5, 'dense', 'complex') &gt;&gt; matfaust.rand(10, 10, 'num_factors', 1, 'dim_sizes', 10, 'density', .5, 'fac_type', 'dense', 'field', 'complex')
</code></pre> </code></pre>
<p>For that change to be applied permanently, you need to automatize the `addpath()&lsquo; call made by setup_FAUST.<br/> <h3>3.1.1 Permament path using savepath</h3>
<p>Once matfaust path has been loaded into matlab environment you can save the
configuration for future uses by simply typing:</p>
<pre><code>&gt;&gt; savepath
</code></pre>
<p>The next time you&rsquo;ll run Matlab the matfaust package will be directly
available.</p>
<h3>3.1.2 Permanent path using Matlab&rsquo;s startup.m</h3>
<p>Another way for that change of matlab path to be applied permanently, is to automatize the `addpath()&lsquo; call made by <code>setup_FAUST</code>.<br/>
For that purpose:</p> For that purpose:</p>
<ol> <ol>
...@@ -106,16 +118,16 @@ For that purpose:</p> ...@@ -106,16 +118,16 @@ For that purpose:</p>
<li>Edit the file startup.m by adding the following lines: <li>Edit the file startup.m by adding the following lines:
<pre> <pre>
oldpwd=pwd; oldpwd=pwd;
cd @FAUST_INSTALL_PATH@/matlab; cd @FAUST_INSTALL_PATH@/matlab; % for Windows users this is: C:\Program Files\faust\matlab
setup_FAUST setup_FAUST
cd oldpwd; cd oldpwd;
</pre> </pre>
</ol> </ol>
Finally type <a href="https://fr.mathworks.com/help/matlab/ref/rehash.html#d120e1067468">`rehash toolbox'</a> in your current matlab terminal and restart Matlab in order to verify the configuration is permanent.
<p>Finally type <a href="https://fr.mathworks.com/help/matlab/ref/rehash.html#d120e1067468">`rehash toolbox'</a> in your current matlab terminal and restart Matlab in order to verify the configuration is permanent.</p>
<p>Note: you can also edit a user specific startup.m script instead of system&rsquo;s startup.m. Look the Matlab documentation <a href="https://fr.mathworks.com/help/matlab/matlab_env/startup-options.html">here</a>.</p> <p>Note: you can also edit a user&rsquo;s specific startup.m script instead of system&rsquo;s startup.m. Look the Matlab documentation <a href="https://fr.mathworks.com/help/matlab/matlab_env/startup-options.html">here</a>.</p>
<p>OK! You can follow the <a href="#usage">quick start usage</a> now.</p> <p>OK! You can follow the <a href="#usage">quick start usage</a> now.</p>
...@@ -123,9 +135,9 @@ Finally type <a href="https://fr.mathworks.com/help/matlab/ref/rehash.html#d120e ...@@ -123,9 +135,9 @@ Finally type <a href="https://fr.mathworks.com/help/matlab/ref/rehash.html#d120e
<p>To test whether the FaµST Python wrapper has been setup properly, simply open a terminal and type:</p> <p>To test whether the FaµST Python wrapper has been setup properly, simply open a terminal and type:</p>
<pre><code>python2 -c "import pyfaust; print('It works.')" <pre><code>python3 -c "import pyfaust; print('It works.')"
# it could be python2.7, python3, python@PY3_VER@ or just python, # it could be python@PY3_VER@ or just python,
# depending on your configuration and the python version you want to use # depending on your configuration and the python version you want to use
</code></pre> </code></pre>
...@@ -143,14 +155,14 @@ ModuleNotFoundError: No module named 'pyfaust' ...@@ -143,14 +155,14 @@ ModuleNotFoundError: No module named 'pyfaust'
<ul> <ul>
<li><p>For Linux and macOS in a Bash terminal:</p> <li><p>For Linux and macOS in a Bash terminal:</p>
<p> $ export PYTHONPATH=$PYTHONPATH:@FAUST_INSTALL_PATH@/python <p> $ export PYTHONPATH=$PYTHONPATH:@FAUST_INSTALL_PATH@/python3
# and test again # and test again
$ python2 -c &ldquo;import pyfaust; print(&lsquo;It works.&rsquo;)&rdquo;</p></li> $ python3 -c &ldquo;import pyfaust; print(&lsquo;It works.&rsquo;)&rdquo;</p></li>
<li><p>For Windows in the command prompt:</p> <li><p>For Windows in the command prompt:</p>
<p> set PYTHONPATH=%PYTHONPATH%;@FAUST_INSTALL_PATH@/python <p> set PYTHONPATH=%PYTHONPATH%;@FAUST_INSTALL_PATH@/python"
:: and test again :: and test again
python -c &ldquo;import pyfaust; print(&lsquo;It works.&rsquo;)&rdquo;</p></li> python3 -c &ldquo;import pyfaust; print(&lsquo;It works.&rsquo;)&rdquo;</p></li>
</ul> </ul>
...@@ -225,7 +237,7 @@ Otherwise it works but you&rsquo;ll need to set the `export' command manually in ...@@ -225,7 +237,7 @@ Otherwise it works but you&rsquo;ll need to set the `export' command manually in
<p>In the same spirit than the Matlab tutorial showed in the previous section, you can execute the quick start script for Python.</p> <p>In the same spirit than the Matlab tutorial showed in the previous section, you can execute the quick start script for Python.</p>
<pre><code>$ python2.7 -c "from pyfaust.demo import quickstart; quickstart.run()" <pre><code>$ python3 -c "from pyfaust.demo import quickstart; quickstart.run()"
dimension of the Faust : (1000, 2000) dimension of the Faust : (1000, 2000)
multiplication SPEED-UP using Faust multiplication SPEED-UP using Faust
Faust is 1.83845941093 faster than a full matrix Faust is 1.83845941093 faster than a full matrix
...@@ -239,7 +251,7 @@ end quickstart.py ...@@ -239,7 +251,7 @@ end quickstart.py
<p>You can also go through the Python terminal to build a FAµST product and call its object methods.</p> <p>You can also go through the Python terminal to build a FAµST product and call its object methods.</p>
<pre><code>$ python2.7 <pre><code>$ python3
&gt;&gt;&gt; import pyfaust &gt;&gt;&gt; import pyfaust
&gt;&gt;&gt; A = pyfaust.Faust(filepath='A.mat') # A is the FAµST created through quickstart script &gt;&gt;&gt; A = pyfaust.Faust(filepath='A.mat') # A is the FAµST created through quickstart script
&gt;&gt;&gt; A.rcg() &gt;&gt;&gt; A.rcg()
......
...@@ -80,7 +80,19 @@ Then launch the script that is responsible to add FAµST location in your Matlab ...@@ -80,7 +80,19 @@ Then launch the script that is responsible to add FAµST location in your Matlab
>> % then test again FAµST >> % then test again FAµST
>> matfaust.rand(10, 10, 'num_factors', 1, 'dim_sizes', 10, 'density', .5, 'fac_type', 'dense', 'field', 'complex') >> matfaust.rand(10, 10, 'num_factors', 1, 'dim_sizes', 10, 'density', .5, 'fac_type', 'dense', 'field', 'complex')
For that change to be applied permanently, you need to automatize the `addpath()' call made by setup_FAUST.<br/> ### 3.1.1 Permament path using savepath
Once matfaust path has been loaded into matlab environment you can save the
configuration for future uses by simply typing:
>> savepath
The next time you'll run Matlab the matfaust package will be directly
available.
### 3.1.2 Permanent path using Matlab's startup.m
Another way for that change of matlab path to be applied permanently, is to automatize the `addpath()' call made by ``setup_FAUST``.<br/>
For that purpose: For that purpose:
<ol> <ol>
...@@ -97,7 +109,7 @@ For that purpose: ...@@ -97,7 +109,7 @@ For that purpose:
Finally type <a href="https://fr.mathworks.com/help/matlab/ref/rehash.html#d120e1067468">`rehash toolbox'</a> in your current matlab terminal and restart Matlab in order to verify the configuration is permanent. Finally type <a href="https://fr.mathworks.com/help/matlab/ref/rehash.html#d120e1067468">`rehash toolbox'</a> in your current matlab terminal and restart Matlab in order to verify the configuration is permanent.
Note: you can also edit a user specific startup.m script instead of system's startup.m. Look the Matlab documentation [here](https://fr.mathworks.com/help/matlab/matlab_env/startup-options.html). Note: you can also edit a user's specific startup.m script instead of system's startup.m. Look the Matlab documentation [here](https://fr.mathworks.com/help/matlab/matlab_env/startup-options.html).
OK! You can follow the [quick start usage](#usage) now. OK! You can follow the [quick start usage](#usage) now.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment