Using Psychophysics Toolbox on Fedora
Install Instructions on 64-bit Linux
modified from UsingPsychtoolboxOnUbuntulinux kernel version:
$ uname -r
2.6.41.1-1.fc15.x86_64
2.6.41.1-1.fc15.x86_64
fedora version:
$ less /etc/fedora-release
Fedora release 15 (Lovelock)
Fedora release 15 (Lovelock)
install matlab 64 bit
- i used 2011b
- alternatively, use octave (everything just works)
- sudo yum install octave
- sudo yum install octave-devel.x86_64 (if you want to make mex files)
- i used latest octave (3.4.3) which PTB warns is "likely not yet compatible", but i haven't found problems
- the PTB installer fails at getting the MAC address and calling fileattrib...
- after downloading matlab, it needs permissions to install in the default location:
$ sudo mkdir -p /usr/local/MATLAB/R2011b/
$ sudo chmod a+w /usr/local/MATLAB/R2011b/
$ sudo chmod a+w /usr/local/MATLAB/R2011b/
- then, when trying to activate matlab:
Error 1,714: Unable to activate your machine. The activation process cannot detect a valid Host ID which utilizes the 'eth' naming convention. Please refer to the following solution ID, to help resolve this issue: 1-661QJD
http://www.mathworks.com/support/solutions/en/data/1-661QJD/index.html?solution=1-661QJD
http://www.mathworks.com/support/solutions/en/data/1-661QJD/index.html?solution=1-661QJD
$ sudo emacs /etc/udev/rules.d/70-persistent-net.rules
change the NAME field to eth0
change the NAME field to eth0
- matlab installs out-of-date libraries that will hide your distro's more up-to-date libraries, which PTB needs. (for details, see http://tech.groups.yahoo.com/group/psychtoolbox/message/12392, http://tech.groups.yahoo.com/group/psychtoolbox/message/12538)
cd $MATLABROOT/sys/os/glnxa64/
sudo mv libstdc++.so.6.0.10 old_libstdc++.so.6.0.10
sudo mv libstdc++.so.6 old_libstdc++.so.6
cd $MATLABROOT/bin/glnxa64/
sudo mv libdc1394.so.22 old_libdc1394.so.22
sudo mv libdc1394.so.22.1.0 old_libdc1394.so.22.1.0
sudo mv libstdc++.so.6.0.10 old_libstdc++.so.6.0.10
sudo mv libstdc++.so.6 old_libstdc++.so.6
cd $MATLABROOT/bin/glnxa64/
sudo mv libdc1394.so.22 old_libdc1394.so.22
sudo mv libdc1394.so.22.1.0 old_libdc1394.so.22.1.0
setenv('LD_LIBRARY_PATH',['/lib64:/usr/lib64:' getenv('LD_LIBRARY_PATH')])
adapted from http://tech.groups.yahoo.com/group/psychtoolbox/message/12405:
[a b]=system(['ldd ' which('Screen')])
...
libmx.so => not found
libmex.so => not found
libmat.so => not found
...
...
libmx.so => not found
libmex.so => not found
libmat.so => not found
...
>> getenv('LD_LIBRARY_PATH')
/usr/local/MATLAB/R2011b/sys/os/glnxa64:
/usr/local/MATLAB/R2011b/bin/glnxa64:
/usr/local/MATLAB/R2011b/extern/lib/glnxa64:
/usr/local/MATLAB/R2011b/runtime/glnxa64:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64/server:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64
>> [a b]=system(['ldd ' which('Screen')])
...
libmx.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmx.so (0x00007f1e5f177000)
libmex.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmex.so (0x00007f1e5ef66000)
libmat.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmat.so (0x00007f1e5ed24000)
...
% which is the same directory as:
libdc1394.so.22 => /usr/local/MATLAB/R2011b/bin/glnxa64/libdc1394.so.22 (0x00007f1e5fe54000)
% so we can't just preserve $MATLABROOT/bin/glnxa64 in LD_LIBRARY_PATH
% note that only:
libstdc++.so.6 => /usr/local/MATLAB/R2011b/sys/os/glnxa64/libstdc++.so.6 (0x00007f1e5ea1d000)
libgcc_s.so.1 => /usr/local/MATLAB/R2011b/sys/os/glnxa64/libgcc_s.so.1 (0x00007f1e5e1e8000)
% so we can preempt $MATLABROOT/sys/os/glnxa64 to solve the c runtime library problem...
/usr/local/MATLAB/R2011b/sys/os/glnxa64:
/usr/local/MATLAB/R2011b/bin/glnxa64:
/usr/local/MATLAB/R2011b/extern/lib/glnxa64:
/usr/local/MATLAB/R2011b/runtime/glnxa64:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64/server:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64
>> [a b]=system(['ldd ' which('Screen')])
...
libmx.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmx.so (0x00007f1e5f177000)
libmex.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmex.so (0x00007f1e5ef66000)
libmat.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmat.so (0x00007f1e5ed24000)
...
% which is the same directory as:
libdc1394.so.22 => /usr/local/MATLAB/R2011b/bin/glnxa64/libdc1394.so.22 (0x00007f1e5fe54000)
% so we can't just preserve $MATLABROOT/bin/glnxa64 in LD_LIBRARY_PATH
% note that only:
libstdc++.so.6 => /usr/local/MATLAB/R2011b/sys/os/glnxa64/libstdc++.so.6 (0x00007f1e5ea1d000)
libgcc_s.so.1 => /usr/local/MATLAB/R2011b/sys/os/glnxa64/libgcc_s.so.1 (0x00007f1e5e1e8000)
% so we can preempt $MATLABROOT/sys/os/glnxa64 to solve the c runtime library problem...
>> setenv('LD_LIBRARY_PATH',['/lib64:/usr/lib64:' getenv('LD_LIBRARY_PATH')])
>> getenv('LD_LIBRARY_PATH')
/lib64:
/usr/lib64:
/usr/local/MATLAB/R2011b/sys/os/glnxa64:
/usr/local/MATLAB/R2011b/bin/glnxa64:
/usr/local/MATLAB/R2011b/extern/lib/glnxa64:
/usr/local/MATLAB/R2011b/runtime/glnxa64:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64/server:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64
>> Screen
Invalid MEX-file '/home/asl/psychtoolbox/Psychtoolbox/PsychBasic/Screen.mexa64': libraw1394.so.8: cannot open shared object file: No such file or directory
>> [a b]=system(['ldd ' which('Screen')])
...
libdc1394.so.22 => /usr/lib64/libdc1394.so.22 (0x00007ffc6f080000)
libraw1394.so.11 => /usr/lib64/libraw1394.so.11 (0x00007ffc6ee72000)
...
libmx.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmx.so (0x00007ffc6e3a3000)
libmex.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmex.so (0x00007ffc6e192000)
libmat.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmat.so (0x00007ffc6df50000)
...
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007ffc6dc48000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ffc6d414000)
>> getenv('LD_LIBRARY_PATH')
/lib64:
/usr/lib64:
/usr/local/MATLAB/R2011b/sys/os/glnxa64:
/usr/local/MATLAB/R2011b/bin/glnxa64:
/usr/local/MATLAB/R2011b/extern/lib/glnxa64:
/usr/local/MATLAB/R2011b/runtime/glnxa64:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64/server:
/usr/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/lib/amd64
>> Screen
Invalid MEX-file '/home/asl/psychtoolbox/Psychtoolbox/PsychBasic/Screen.mexa64': libraw1394.so.8: cannot open shared object file: No such file or directory
>> [a b]=system(['ldd ' which('Screen')])
...
libdc1394.so.22 => /usr/lib64/libdc1394.so.22 (0x00007ffc6f080000)
libraw1394.so.11 => /usr/lib64/libraw1394.so.11 (0x00007ffc6ee72000)
...
libmx.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmx.so (0x00007ffc6e3a3000)
libmex.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmex.so (0x00007ffc6e192000)
libmat.so => /usr/local/MATLAB/R2011b/bin/glnxa64/libmat.so (0x00007ffc6df50000)
...
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007ffc6dc48000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ffc6d414000)
- TODO: how get a clickable icon to launch matlab? (note: PTB often wants you to run matlab as root (sudo matlab) to do fancy driver hacking stuff.
try this: http://bloggezmoy.com/2011/05/17/how-to-add-an-application-to-the-gnome-3-application-launcher/
install PTB
- svn is probably already installed (you could get it with yum).
- contrary to what's claimed at PsychtoolboxDownload, DownloadPsychtoolbox needs a target directory. however, many things go wrong if the target directory uses '~' -- it creates and installs to a directory called '~' at the current working directory, and adding stuff to the path silently fails. then, fileattrib correctly handles '~' and thinks there is 'No such file or directory'.
- so, psychtoolbox should either resolve ~ or check for it and issue an error.
- the PTB installer calls svn from within matlab, which will fail without the libstdc fix above.
- alternatively, build from scratch http://tech.groups.yahoo.com/group/psychtoolbox/message/6170
- the installer lets you know that you need several libraries to use PTB. i seemed to already have all of them, here are the packages that satisfy the dependencies:
$ yum list installed | grep libusb
libusb.x86_64 1:0.1.3-9.fc15 @updates
libusb1.x86_64 1.0.8-7.fc15 @anaconda-InstallationRepo-201105131943.x86_64
$ yum list installed | grep 1394
libavc1394.x86_64 0.5.3-10.fc15 @anaconda-InstallationRepo-201105131943.x86_64
libdc1394.x86_64 2.1.2-3.fc12 @anaconda-InstallationRepo-201105131943.x86_64
libraw1394.x86_64 2.0.7-1.fc15 @updates
$ yum list installed | grep glut
freeglut.x86_64 2.6.0-6.fc15 @fedora
$ yum list installed | grep gstreamer
gstreamer.x86_64 0.10.34-1.fc15 @updates
gstreamer-plugins-bad-free.x86_64 0.10.22-1.fc15 @updates
gstreamer-plugins-base.x86_64 0.10.33-1.fc15 @updates
gstreamer-plugins-good.x86_64 0.10.29-1.fc15 @updates
gstreamer-python.x86_64 0.10.19-2.fc15 @anaconda-InstallationRepo-201105131943.x86_64
gstreamer-rtsp.x86_64 0.10.8-1.fc15 @updates
gstreamer-tools.x86_64 0.10.34-1.fc15 @updates
libusb.x86_64 1:0.1.3-9.fc15 @updates
libusb1.x86_64 1.0.8-7.fc15 @anaconda-InstallationRepo-201105131943.x86_64
$ yum list installed | grep 1394
libavc1394.x86_64 0.5.3-10.fc15 @anaconda-InstallationRepo-201105131943.x86_64
libdc1394.x86_64 2.1.2-3.fc12 @anaconda-InstallationRepo-201105131943.x86_64
libraw1394.x86_64 2.0.7-1.fc15 @updates
$ yum list installed | grep glut
freeglut.x86_64 2.6.0-6.fc15 @fedora
$ yum list installed | grep gstreamer
gstreamer.x86_64 0.10.34-1.fc15 @updates
gstreamer-plugins-bad-free.x86_64 0.10.22-1.fc15 @updates
gstreamer-plugins-base.x86_64 0.10.33-1.fc15 @updates
gstreamer-plugins-good.x86_64 0.10.29-1.fc15 @updates
gstreamer-python.x86_64 0.10.19-2.fc15 @anaconda-InstallationRepo-201105131943.x86_64
gstreamer-rtsp.x86_64 0.10.8-1.fc15 @updates
gstreamer-tools.x86_64 0.10.34-1.fc15 @updates