Skip to content

Commit 449adac

Browse files
committed
add installation
1 parent 8a4043f commit 449adac

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed

docs/source/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@
66
Welcome to CPP_PTB's documentation!
77
===================================
88

9+
This is the Crossmodal Perception and Plasticity lab (CPP) PsychToolBox (PTB)
10+
toolbox.
11+
12+
Those functions are mostly wrappers around some PTB functions to facilitate
13+
their use and their reuse (#DontRepeatYourself)
14+
915
.. toctree::
1016
:maxdepth: 4
1117
:caption: Contents:
1218

1319
function_description
20+
installation
1421

1522
Indices and tables
1623
==================

docs/source/installation.rst

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
************
2+
Installation
3+
************
4+
5+
Requirements
6+
============
7+
8+
Make sure that the following toolboxes are installed and added to the matlab /
9+
octave path.
10+
11+
For instructions see the following links:
12+
13+
| Requirements | Used version |
14+
| -------------------------------------------------------- | ------------ |
15+
| [PsychToolBox](http://psychtoolbox.org/) | >=3.0.14 |
16+
| [Matlab](https://www.mathworks.com/products/matlab.html) | >=2015b |
17+
| or [Octave](https://www.gnu.org/software/octave/) | 4.? |
18+
19+
Tested:
20+
21+
- matlab 2015b or octave 4.2.2 and PTB 3.0.14.
22+
23+
How to install
24+
==============
25+
26+
The easiest way to use this repository is to create a new repository by using
27+
the
28+
[template PTB experiment repository](https://github.com/cpp-lln-lab/template_PTB_experiment):
29+
this creates a new repository on your github account with all the basic folders,
30+
files and submodules already set up. You only have to then clone the repository
31+
and you are good to go.
32+
33+
Download with git
34+
*****************
35+
36+
```bash
37+
cd fullpath_to_directory_where_to_install
38+
# use git to download the code
39+
git clone https://github.com/cpp-lln-lab/CPP_PTB.git
40+
# move into the folder you have just created
41+
cd CPP_PTB
42+
```
43+
44+
Then get the latest commit to stay up to date:
45+
46+
```bash
47+
# from the directory where you downloaded the code
48+
git pull origin master
49+
```
50+
51+
To work with a specific version, create a branch at a specific version tag
52+
number
53+
54+
```bash
55+
# creating and checking out a branch that will be called version1 at the version tag v1.0.0
56+
git checkout -b version1 v1.0.0
57+
```
58+
59+
Add as a submodule
60+
******************
61+
62+
Add it as a submodule in the repo you are working on.
63+
64+
```bash
65+
cd fullpath_to_directory_where_to_install
66+
# use git to download the code
67+
git submodule add https://github.com/cpp-lln-lab/CPP_PTB.git
68+
```
69+
70+
To get the latest commit you then need to update the submodule with the
71+
information on its remote repository and then merge those locally.
72+
73+
```bash
74+
git submodule update --remote --merge
75+
```
76+
77+
Remember that updates to submodules need to be committed as well.
78+
79+
#### Example for submodule usage
80+
81+
So say you want to clone a repo that has some nested submodules, then you would
82+
type this to get the content of all the submodules at once (here with my
83+
experiment repo):
84+
85+
```bash
86+
git clone --recurse-submodules https://github.com/user_name/yourExperiment.git
87+
```
88+
89+
This would be the way to do it "by hand"
90+
91+
```bash
92+
# clone the repo
93+
git clone https://github.com/user_name/yourExperiment.git
94+
95+
# go into the directory
96+
cd yourExperiment
97+
98+
# initialize and get the content of the first level of submodules (CPP_PTB and CPP_BIDS)
99+
git submodule init
100+
git submodule update
101+
102+
# get the nested submodules JSONio and BIDS-matlab for CPP_BIDS
103+
git submodule foreach --recursive 'git submodule init'
104+
git submodule foreach --recursive 'git submodule update'
105+
```
106+
107+
Direct download
108+
***************
109+
110+
Download the code. Unzip. And add to the matlab path.
111+
112+
Pick a specific version from
113+
[here](https://github.com/cpp-lln-lab/CPP_PTB/releases).
114+
115+
Or take
116+
[the latest commit](https://github.com/cpp-lln-lab/CPP_PTB/archive/master.zip) -
117+
NOT RECOMMENDED.
118+
119+
Add CPP_PTB globally to the matlab path
120+
----
121+
122+
This is NOT RECOMMENDED as this might create conflicts if you use different
123+
versions of CPP_PTB as sub-modules.
124+
125+
Also note that this might not work at all if you have not set a command line
126+
alias to start Matlab from a terminal window by just typing `matlab`. :wink:
127+
128+
```bash
129+
# from within the CPP_PTB folder
130+
matlab -nojvm -nosplash -r "addpath(genpath(fullfile(pwd, 'src'))); savepath(); path(); exit();"
131+
```

0 commit comments

Comments
 (0)