forked from psychopy/psychopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildingOnAMac.txt
196 lines (148 loc) · 6.1 KB
/
buildingOnAMac.txt
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
Building on a mac
=================
Standalone PsychoPy is currently built using Framework Python 2.6.6 (not system python or enthought distributions). The following deals with how to set up a complete working python using that distribution under Snow Leopard (10.6). To get PsychoPy working on other python installations see the additional headers below that.
Framework Version
~~~~~~~~~~~~~~~~~~
binary installs
=================
Download double-click installers for these:
- pygame
- numpy
- scipy
- matplotlib
- wxpython
easy_installs
===============
Install setuptools by downloading http://peak.telecommunity.com/dist/ez_setup.py
and running it with::
sudo python ez_setup.py
Then::
sudo easy_install -Z -U setuptools
sudo easy_install -Z -U pyglet
sudo easy_install -Z pyopengl
sudo easy_install -Z pyobjc-core
sudo easy_install -Z pyobjc
sudo easy_install -Z pyobjc-framework-qtkit
sudo easy_install -Z py2app
sudo easy_install -Z bdist_mpkg
STATIC_DEPS=true easy_install -Z lxml
#optional extras for hardware
sudo easy_install -Z pyserial
sudo easy_install -Z parallel
sudo easy_install -Z openpyxl
sudo easy_install -Z ioLabs
sudo easy_install -Z pyxid
#optional, mostly for dev purposes
sudo easy_install -Z ipython
sudo easy_install -Z sphinx
sudo easy_install -Z nose
sudo easy_install cython
If you get build errors trying to easy_install::
cc1: error: unrecognized command line option "-Wno-long-double"
edit the file lib/python2.5/config/Makefile and remove that
flag from the BASECFLAGS. Also in this file set::
MACOSX_DEPLOYMENT_TARGET=10.5 and CC=gcc-4.0 ?
manual installs
===================
Install avbin for movies
labjack (you might prefer to use my fork of that at https://github.com/peircej/LabJackPython so that each file installs under site-packages/labjack)
compiled libs
==================
#hdf5 (needed for pytables or you get errors about symbols not found)
cd hdf5-1.8.9
CFLAGS='-arch i386' LDFLAGS='-arch i386' ./configure --prefix=/usr/local/ make
sudo make install
#ioHub also requires
# greenlet, gevent, msgpack, pyYAML
System python
~~~~~~~~~~~~~~
The following cannot be installed to 64bit python because they use carbon:
- wxpython (cocoa support expected in version 3.0)
- pyglet (cocoa support half-built last JWP looked)
- pygame/SDL
BUT, change to use 32bit python2.6 or 2.5 by adding the following to
bash_profile:
export VERSIONER_PYTHON_VERSION=2.6
export VERSIONER_PYTHON_PREFER_32_BIT=yes
Python should show compiled on GCC4.2 (sys python) and sys.maxint
should be 2147483647 (32bit)
Install these to Framework python (from python.org) and then copy over
=================================================================
- numpy (downloaded from SF)
- scipy (downloaded from SF)
ENTHOUGHT VERSION
~~~~~~~~~~~~~~~~~~
- install EPD version 6.1
- install avbin
- install pygame (see below)
easy_install
=============
sudo easy_install -Z bdist_mpkg
sudo easy_install -Z py2app
sudo easy_install -Z pyobjc
sudo easy_install -Z pyobjc
sudo easy_install -Z pyobjc-framework-qtkit
Note: This approach has worked well to created the manual version but
the standalone app doesn't run on other machines It complains about
numpy/lapack not loading correct object
Problems with installing
~~~~~~~~~~~~~~~~~~~~~~~~~
installing pygame
==================
I downloaded the version for pygame-1.9.1release-py2.6-macosx10.5.
This complains that it can't install on this system. Open the
installed bundle and from Contents/Packages install each of dependent
frameworks:
- pygame-SDL
- pygame-SDL_ttf
- pygame-SDL_mixer
- pygame-SDL_iamge
- pygame-headers
- pygame-smpeg
Then open the contents of bundle
- pygame-platlib
and drag the pygame and egg.info folders to your site packages.
This worked for me on a clean-install (no rosetta) 10.6 using the
EPD6.1
If easy_install is not downloading things check
================================================
1. that your http_proxy is set in .bash_profile
2. that sudo allows http_proxy to be used: type visudo to open the
sudo settings editor add the line (with same formatting as others):
Defaults env_keep += “ftp_proxy http_proxy https_proxy”
Problems building the app
==========================
DistutilsFileError: /Library/Frameworks/Python.framework/Versions
------------------------------------------------------------------
This is caused by py2ap trying to find python2.5/pyconfig.h which may not exist.
Hack: add the following to the begin of py2app/util.py copy_file (around line 100):
if path=="/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h":
path="/Library/Frameworks/Python.framework/Versions/6.1/include/python2.6/pyconfig.h"
You may also get messages about not being able to locate pyconfig.h
during copy_file caused by the fact that py2app thinks that enthought
python(6.1) should be installed
TypeError: 'NoneType' object is unsubscriptable (in modulegraph.find_needed_modules)
-------------------------------------------------------------------------------------
This indicates that one of your required modules couldn't be
found. Check your easy_install.pth to make sure that all the required
modules have their paths there.
To make avbin work from the mac standalone:
--------------------------------------------
In pyglet/lib.py, around line 166, do this:
search_path.append(os.path.join(sys.prefix, '..', 'Frameworks'))
instead (or as well as) of
search_path.append(os.path.join(
os.environ['RESOURCEPATH'],
'..',
'Frameworks',
libname))
To build a 32-bit ffmpeg dylib
--------------------------------
For each codec, download the source and do:
CFLAGS='-arch i386' LDFLAGS='-arch i386' configure --disable-static --enable-shared
make
sudo make install
Then for ffmpeg source do:
configure --disable-static --enable-shared --disable-outdev=sdl --enable-runtime-cpudetect --disable-indev=jack --enable-zlib --enable-libx264 --enable-libxvid --enable-libvorbis --cc="clang -m32" --enable-gpl
make
sudo make install