-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md
363 lines (259 loc) · 11.2 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
-*- text -*-
GroovX - A framework for visual experiments
===========================================
Copyright (c) 1998-2004 California Institute of Technology
Copyright (c) 2004-2007 University of Southern California
Rob Peters
README GroovX readme file
-------------------------
See also the TUTORIAL file for more getting-started help.
Table of contents:
- [overview](#1-overview)
- [files](#2-organization-of-the-files)
- [dependencies](#3-dependencies)
- [configuration](#4-configuration)
- [building](#5-building)
- [portability](#6-portability)
-----------------------------------------------------------
1. Overview
-----------
This is a C++ toolkit for writing visual psychophysics
experiments. Various abstractions relating to experiments (visual
objects, trials, observer responses, etc.) are implemented in C++,
and are exposed through a Tcl interface as scriptable objects.
Note that sitting beside this README file is a TUTORIAL
file which should contain some useful examples of how to get
started actually using the program.
-----------------------------------------------------------
2. Organization of the files
----------------------------
The `src/` directory contains subdirectories for each of the various
components of the system. Packages that are configured to be
loadable at run-time are found in `src/pkgs/`.
When the system is built, the object files go into a hierarchy
within `build/obj/` that parallels `src/`. That is, a source file
`src/foo/bar.cc` will be compiled to `build/obj/foo/bar.o`.
-----------------------------------------------------------
3. Dependencies
---------------
- Assume `/path/to/install` is where you will install local packages
- Assume `/path/to/source` is where you unpack and build these packages
This software requires these development packages:
- Tcl/Tk (version 8.5 or later)
- X11 windowing system OR Mac OS X's Aqua windowing system
- OpenGL (3-D graphics library)
- libz (gzip library)
- libexpat (XML parsing library)
The following additional packages are optional. The configure
script should generally be able to detect whether you have them
installed or not and set up the Makefile appropriately.
- libpng (portable network graphics library)
- libjpeg (jpeg image handling library)
- matlab (allows running a matlab engine inside the groovx shell)
- libesd+libaudiofile (for simple sound file playback on Linux)
- Quicktime (for simple sound file playback on Mac OS X)
- libreadline (for command-line editing and history)
The following packages are optional, but are used in some of the
scripts that use the groovx software.
- itcl and itk (itcl3.2.1_src.tgz)
Note that the itcl+itk configure script expects to find the
tcl+tk sources sitting in the location where you built
them... so, don't remove the tcl+tk sources until after you
build and install itcl+itk.
```bash
cd /path/to/source
tar xfz itcl3.2.1_src.tgz
cd itcl3.2.1
./configure --prefix=/path/to/install
make
make install
```
Note, you might need to do this:
```bash
export SHLIB_LDFLAGS=-L/path/to/install/lib
```
before running ./configure so that the configuration script
looks for e.g. libtclstub8.x.a in the install directory rather
than in the tcl's apparent build directory.
- iwidgets (iwidgets4.0.1.tar.gz)
Again, note that iwidgets expects to still be able to find the
source code from the itcl/itk build, so don't remove the
itcl+itk sources until after you've configured and installed
iwidgets.
```bash
cd /path/to/source
tar xfz iwidgets4.0.1.tar.gz
cd iwidgets4.0.1
./configure --prefix=/path/to/install \
--with-itcl=/path/to/source/itcl3.2.1 \
--with-itk=/path/to/source/itcl3.2.1
```
Then, there is no need to do `make` for iwidgets; just do `make
install`:
```bash
make install
```
- Mac OS X Tcl/Tk build notes
Notes for doing a custom Tcl/Tk build for Aqua (i.e. not for
X11 on Mac OS X).
Used the following Makefile fragment for Tcl (in
pathtosrc/tcl/macosx/Makefile):
```bash
DESTDIR ?=
INSTALL_ROOT ?= ${DESTDIR}
BUILD_DIR ?= ${CURDIR}/../../build
SYMROOT ?= ${BUILD_DIR}/${PROJECT}
OBJROOT ?= ${SYMROOT}
EXTRA_CONFIGURE_ARGS ?=
EXTRA_MAKE_ARGS ?=
INSTALL_PATH ?= ${HOME}/Library/Frameworks
PREFIX ?= ${HOME}/local/tcl8.5a1-aqua
BINDIR ?= ${PREFIX}/bin
MANDIR ?= ${PREFIX}/man
```
Used the following Makefile fragment for Tk (in
pathtosrc/tk/macosx/Makefile):
```bash
DESTDIR ?=
INSTALL_ROOT ?= ${DESTDIR}
BUILD_DIR ?= ${CURDIR}/../../build
SYMROOT ?= ${BUILD_DIR}/${PROJECT}
OBJROOT ?= ${SYMROOT}
EXTRA_MAKE_ARGS ?=
INSTALL_PATH ?= ${HOME}/Library/Frameworks
APPLICATION_INSTALL_PATH ?= ${HOME}/Applications/Utilities
PREFIX ?= ${HOME}/local/tcl8.5a1-aqua
BINDIR ?= ${PREFIX}/bin
TCL_FRAMEWORK_DIR ?= ${BUILD_DIR}/tcl
TCLSH_DIR ?= ${TCL_FRAMEWORK_DIR}
```
Problems:
- Tk install requires 'chmod' with '-RH' options. But, the
Fink version of chmod in /sw/bin/chmod doesn't recognize
the '-H' option. So, need to point the installation to
/bin/chmod instead. For now, just put a link from
~/local/bin/chmod to /bin/chmod, since ~/local/bin is
higher in $PATH than is /sw/bin.
- Tk install expects to find 'Wish Shell.app' in
~/Library/Frameworks/Tk.Frame/Versions/8.5/Resources/. But,
the Makefile fragment above puts 'Wish Shell.app' in
~/Applications/Utilities instead. So, for now just do:
```bash
ln -s ~/Applications/Utilities/Wish\ Shell.app \
~/Library/Frameworks/Tk.framework/Versions/8.5/Resources/
```
- Problem with how tk.dylib gets built by default. See http://ewen.mcneill.gen.nz/blog/entry/2012-12-28-os-x-dylib-care-and-feeding/
Need to patch tk's unix/Makefile.in before
building+installing tk like this:
```Diff
--- Makefile.in~ 2016-07-26 07:07:50.000000000 -0700
+++ Makefile.in 2016-10-15 20:59:54.000000000 -0700
@@ -283,7 +283,7 @@
LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@
# support for embedded libraries on Darwin / Mac OS X
-DYLIB_INSTALL_DIR = ${LIB_RUNTIME_DIR}
+DYLIB_INSTALL_DIR = $(libdir)
# support for building the Aqua resource file
TK_RSRC_FILE = @TK_RSRC_FILE@
```
-----------------------------------------------------------
4. Configuration
----------------
Configuration of GroovX is done with a standard autoconf-generated
configure script. To run the script with the default options, just
do:
```bash
./configure
```
To see a description of available configuration options, do:
```bash
./configure --help
```
Some important configuration options:
* --enable-debug={no|yes} [default is yes]
determines whether to include runtime debuggability
into the executable. If 'yes' (the default), then certain
commands will be available in the shell to control debug
verbosity and stack tracing.
* --enable-aqua={no|yes} [default is no]
determines whether to use Aqua windows or X11 windows
on a Mac OS X build; default is X11
* --enable-readline={no|yes} [default is yes]
hether to enable readline support, which allows for
command-line editing and a command history
* --enable-rgba={no|yes} [default is yes]
whether to run OpenGL graphics in rgba true-color mode
(instead of color-index mode)
* --enable-double-buffer={no|yes} [default is yes]
whether to run OpenGL graphics in double-buffered mode
(instead of single-buffer mode); double-buffering allows
for smoother screen redraws with less flicker and "tearing"
* --enable-direct-render={no|yes} [default is yes]
whether to run OpenGL graphics in a direct-rendering
context; this means that 3-D graphics calls will use the
hardware acceleration of the grapics card, if possible
* --enable-werror={no|yes} [default is yes]
whether to force all compiler warnings to be errors
* --with-matlab=/path/to/matlab [default is /usr/local/matlab]
give the location of a matlab installation against
which some matlab interfaces can be built; if no matlab
directory is given, then only stub matlab interfaces will
be set up... the code will compile, but attempts to use a
matlab interface will trigger a run-time error
* --with-html=/path/to/html [default is ~/www/groovx/]
specifies where HTML documentation should be installed
during a "make docs" invocation
-----------------------------------------------------------
5. Building
-----------
Once you have all package dependencies installed, and run the
configure script, just type "make" and everything should build and
install. A short test suite (takes ~10 seconds on a 1GHz Pentium
III Linux machine) is run at the end of every "make" invocation.
- environment variables
* LD_LIBRARY_PATH
On Linux, you need to make sure that your LD_LIBRARY_PATH
environment variable includes the paths to wherever you have
installed the libraries associated with this package; e.g. in
bash:
```bash
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/path/to/install"
```
-----------------------------------------------------------
6. Portability
--------------
This software has been built and run successfully under:
- RedHat Linux 7.x (i686)
- RedHat Linux 8.x (i686)
- RedHat Linux 9.x (i686)
- Fedore Core 1 (i686)
- Fedore Core 2 (i686)
- Fedore Core 3 (i686)
- YellowDog Linux 3.0.1 (ppc)
- Mac OS X 10.1.x
- Mac OS X 10.2.x
- Mac OS X 10.3.x
Note that for Mac OS X, you can build either for X11 (if you are
running an X server such as OroborosX on your OSX box) or for Aqua
(OSX's native windowing system). By default the configure script
will setup for X11, but you can pass the --enable-aqua option to
tell it to set up for Aqua instead.
Earlier versions of the software have been built successfully under
SGI's IRIX6 and HP's HPUX 10.x, but these configurations have not
been tested recently.
The software requires a reasonably C++ std-compliant
compiler. Compilers that have worked successfully in the past
include:
- g++ 2.95.x (linux, Mac OS X)
- g++ 3.0.x (linux)
- g++ 3.1.x (linux, Mac OS X)
- g++ 3.2.x (linux)
- g++ 3.3.x (linux, Mac OS X)
- g++ 3.4.x (linux)
- g++ 4.0-prerelease
- HP's aCC (hpux)
- Intel's icc 6.x/7.x/8.x (linux)
- SGI's MIPSpro (irix6)
but note that the older compilers (especially g++ 2.95.x, HP aCC,
and SGI MIPSpro) haven't been tested lately so it's likely that a
few things will not work out-of-the-box with those compilers.