- A C library for programming cognitive experiments on Windows
We bundled all the tools (compiler, libraries, editor, custom scripts) that Tscope relies on into one development environment. It can be downloaded here (cygwin4tscope-1.0.9). It is about 42 megabytes.
Tscope itself is not part of Cygwin4tscope, as it is liable to change. After the installation of Cygwin4tscope, you will still need to install Tscope as described in the next section.
Installation goes as follows:
Program Files
directory because of the space in that directory's name. It
will be installed in C:\cygwin
instead. (Actually, Cygwin4tscope will be
installed on the same drive as your Windows system - so if Windows is installed on the D:
drive, Cygwin4tscope will be installed in D:\cygwin
, etc. All further
information on this site assumes Cygwin is installed in C:\cygwin
, but please
notice that on your system this also might be D:\cygwin
or any other
drive).After the installer finishes extracting the files, some post-installation configurations are performed and you will be prompted to reboot your machine. Do that.
After the installation, you will find two new shortcuts on the desktop, and also in the start menu under the Cygwin4tscope heading.
The Crimson editor shortcut will open the editor. Most tasks, like compiling and executing
programs, can be done from within the editor. When you first open the editor, it will show the
files first.c
and second.c
. first.c
is a C program that
only uses standard library functions. It can be compiled by pressing CTRL-F9 and run by
pressing F10. second.c
is a Tscope program, so it cannot be compiled before Tscope
itself is installed. Once Tscope is installed, F9 will be the shortcut for compilation.
The Cygwin bash shell is only needed by advanced users. It provides a powerful command line
interface from where you can compile, edit and run your programs. When you first start it, your
firewall will probably ask whether it can give internet access to bash.exe, hostname.exe and
uname.exe. Give the firewall permission to do so. Depending on your login name, Cygwin will
make a work directory in C:\cygwin\home
(or in the same directory on the D:, E: or
F: drive as mentioned before). Once Tscope is installed, the basic command for compilation will
be tcc
. To execute a program, type ./
followed by your program name.
The editor can be called from the command line with the cedit
command.
Once you're done installing the development tools Tscope can be installed as described in the next section.
Click on the uninstall Cygwin item in the Cygwin4tscope folder of the programs menu. This
will uninstall everything but the files in C:\cygwin\home
.
Every now and then (about once a year, before the start of the experiment programming course at Ghent University) an update of cygwin4tscope is released. It is a good idea to upgrade your installation each time a new version is released.
To avoid problems, uninstall the old version manually before installing the new version.
On Linux, you don't really need to install a development environment (most distributions have the gcc compiler installed by default), but you do need to install some font files that are needed by Tscope, and the allegro, libsndfile and portaudio libraries. Dependent on your Linux distribution, you can either install these libraries using a package management system, or you can compile these from source.
Tscope relies on some font files, that do not come with the Tscope distribution itself. They
are over here. Put them in /usr/local
and run:
cd /usr/local sudo tar -xjf fonts.tar.bz2
Tscope depends on the allegro, libsndfile and portaudio libraries. On Linux, the safest choice is to install these from source. This process is described below.
Download the source distribution of Allegro over here. Make sure you download allegro-4.2.2.tar.gz. That's the latest stable release, in a Linux friendly format. More recent versions are experimental.
To install Allegro, copy the source tarball to /usr/local/src
, and issue the
following commands:
cd /usr/local/src sudo tar -xzf allegro-4.2.2.tar.gz cd allegro-4.2.2
Then, you need to fix src/i386/icpus.s
by changing line 70 from
fnstsv %eaxinto
fnstsv %ax
Then you can configure and make the library:
./configure make sudo make install sudo /sbin/ldconfig
Once allegro is installed properly (test this by running the demo program in
/usr/local/src/allegro/demo/demo
) you can continue installing libsndfile.
Libsndfile can be found over here. Download libsndfile-1.0.21.tar.gz and copy the tarball into
/usr/local/src
. Then you can compile and install it with the following
commands:
cd /usr/local/src sudo tar -xzf libsndfile-1.0.21.tar.gz sudo chmod -R go-w libsndfile-1.0.21 cd libsndfile-1.0.21 ./configure make sudo make install
The last step is installing portaudio. Portaudio can be found over here. Download pa_stable_v19_20071207.tar.gz and
copy the tarball into /usr/local/src
. Then you can compile and install it with the
following commands:
cd /usr/local/src sudo tar -xzf pa_stable_v19_20071207.tar.gz cd portaudio sudo ./configure sudo make sudo make install sudo ldconfig
Now you're ready to install Tscope in the way described below. Linux users will need to install from source.
The developer tools for mac can be downloaded at http://developer.apple.com/tools. Make sure you download a version of Xcode that is compatible with your version of OS X. The installation is straightforward: download the disk image to your desktop or download folder, double-click to mount it and follow the instructions that appear.
Then you will need to install Macports (available at http://www.macports.org/). Again, make sure you download and install the version that is compatible with your version of OS X.
Once you have installed both the apple developer tools and macports, open a terminal and install allegro, cmake, libsndfile and portaudio with the following commands:
sudo port selfupdate sudo port install portaudio +universal sudo port install libsndfile +universal sudo port install cmake +universal sudo port install allegro
This can take a while (about an hour).
Tscope also relies on some font files, that do not come with the Tscope distribution itself. They are over here. They need to be unzipped in a place where Tscope looks for them (e.g. /usr/local/fonts). This can be done with the following commands (replace 'yourname' on line 2 with your login name):
cd /usr/local sudo mv /Users/yourname/Downloads/fonts.tar.bz2 . sudo tar -xjf fonts.tar.bz2
Now you're ready to install Tscope in the way described below. Mac OS X users will need to install from source.