Repository navigation
Expand file tree
/
Copy pathINSTALL.txt
More file actions
170 lines (122 loc) · 7.1 KB
/
Copy pathINSTALL.txt
File metadata and controls
170 lines (122 loc) · 7.1 KB
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
The purpose of this file is to fully document the installation
procedure for VPython from source on Linux. Specific installers
for Windows and Mac are available at vpython.org.
Windows and Mac builds are now special to them;
see VCBuild/VCBuild.txt and MAC-OSX.txt.
Table of Contents:
I: Prerequisites
II: Troubleshooting
I. Prerequisites:
Most or all of these may be provided by your operating system
distributor. In every case, you must have the "developer" version
of the packages to ensure that the required header files are
available.
GNU g++ version 3.2.x or >= 3.3.1 (3.4.6 reccomended) (gcc.gnu.org).
An implementation of OpenGL.
The Boost C++ libraries
Need Python 2.7.x (www.python.org), including
the development (dev) package.
From a fresh Ubuntu 12.04 this gets needed prerequisites:
sudo apt-get update
sudo apt-get install git
sudo apt-get install libgtk2.0-dev
sudo apt-get install libgtkglextmm-x11-1.2-dev
sudo apt-get install libgtkmm-2.4-dev
sudo apt-get install python-dev
sudo apt-get install python-setuptools
sudo apt-get install python-numpy
sudo apt-get install libboost-python-dev
sudo apt-get install libboost-signals-dev
sudo apt-get install tk
(There is a helper script in src/gtk2 called apt-get-packages:
sudo sh -v src/gtk2/apt-get-packages.sh
that may be convenient for this)
From https://groups.google.com/forum/?fromgroups=&hl=en#!topic/wxpython-users/XWyd995Ci_Q
comes this advice by Patrick Korsnick on how to get prerequisites needed to build wxPython:
opensuse 12.2:
sudo zypper in gtk2-devel freeglut-devel gstreamer-0_10-devel gstreamer-0_10-plugins-base-devel python-devel
Fedora 17:
sudo yum install gtk2-devel freeglut-devel gstreamer-plugins-base-devel python-devel
Ubuntu 12.04 LTS:
sudo apt-get install g++ libgtk2.0-dev freeglut3-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev python-dev
-----------------------------------------------------------
BUILD wxPython
Currently one needs version 2.9.4, at
http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/
On Linux you need to apply a patch before building wxPython.
Here is information about the patch:
https://groups.google.com/forum/?fromgroups=#!topic/wxpython-users/e27JioMs1fs
In this forum post is a link to the patch, located at
http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/wxPython-src-2.9.4.1.patch/download
Suppose you've unpacked the source package from wxpython.org into wxPython-src-2.9.4.0.
Place the patch file in this directory (the directory that contains the README file),
cd to that directory, and execute this in a terminal:
patch -p0 < wxPython-src-2.9.4.1.patch
Next execute this:
cd wxPython-src-2.9.4.0/wxPython
sudo python2.7 build-wxpython.py --build_dir=../bld
If you specify --install in this build, sometimes the build/install fails in odd ways.
So it seems safer to just build without installing, then point to the build files.
At the conclusion of the build you will see something like the following (discussed later):
To use wxPython you may need to execute these statements:
export PYTHONPATH="/home/bruce/Downloads/wxPython-src-2.9.4.0/wxPython"
export LD_LIBRARY_PATH="/home/bruce/Downloads/wxPython-src-2.9.4.0/bld/lib"
NOTE: A user of 32-bit Ubuntu reported that he had to make the following change to build wxPython 2.9.5:
In file ".../wxPython-src-2.9.5.0/build/tools/builder.py", around line 134, make it read like this:
def install(self, dir=None, projectFile=None, options=[]):
if self.isAvailable():
args = [self.getProgramPath()]
args.extend(self.getProjectFileArg(projectFile))
args.append("install")
if options:
args.extend(options)
result = runInDir(args, dir)
return result
return 1
--------------------------------------------------------------
BUILD VPython
You need wxPython (wxpython.org). Currently one needs version 2.9.5.0, but
on Linux you need to apply a patch before building wxPython.
Here is information about the patch:
https://groups.google.com/forum/?fromgroups&hl=en#!topic/wxpython-users/kkdGqQmlWr4
The patch file, wxPython-src-2.9.5.0.patch, is included in the VPython repository.
Suppose you've unpacked the source package from wxpython.org into wxPython-src-2.9.5.0.
Place the patch file at the same level as the wxPython-src-2.9.5.0 directory.
cd to the directory where the patch file is and execute this:
patch -p0 < wxPython-src-2.9.5.0.patch
Next execute this:
cd wxPython-src-2.9.5.0/wxPython
sudo python2.7 build-wxpython.py --build_dir=../bld
If you specify --install in this build, sometimes the build/install fails in odd ways.
So it seems safer to just build without installing, then point to the build files.
At the conclusion of the build you will see something like the following:
To use wxPython you may need to execute these statements:
export PYTHONPATH="/home/bruce/Downloads/wxPython-src-2.9.5.0/wxPython"
export LD_LIBRARY_PATH="/home/bruce/Downloads/wxPython-src-2.9.5.0/bld/lib"
Now you are ready to build VPython. In the VPython repository directory execute
sudo python2.7 setup.py install
(You'll need Python modules Polygon, FontTools, and ttfquery, from pypi.python.org.
The setup.py script will attempt to build/install these if they are not
present, but sometimes it can't find them. If that happens, download the
source for each module, unpack and in a terminal cd to the module folder.
Execute "sudo python2.7 setup.py install" to build and install the module.)
-----------------------------------------------------------------
CREATE VIDLE EDITOR SHORTCUT
Create a file "vidle.sh" containing three statements like the following
(see the final output of the build), execute "chmod a=rwx vidle.sh" to make
the file executable, then doubleclick the file to start the VIDLE editor:
export PYTHONPATH="/home/bruce/Downloads/wxPython-src-2.9.5.0/wxPython"
export LD_LIBRARY_PATH="/home/bruce/Downloads/wxPython-src-2.9.5.0/bld/lib"
python2.7 /usr/local/lib/python2.7/dist-packages/VPython-6.05-py2.7-linux-x86_64.egg/vidle/idle.py
Alternatively you could place the export statements in your .profile or .bashrc files
in which case you wouldn't need them in vidle.sh.
Another option is this: After building wxPython, repeat the operation with install:
sudo python2.7 build-wxpython.py --build_dir=../bld --install
This will place wxPython files into /usr/local/lib/dist-packages, which is on the
Python module search path, and additional files in /usr/local/lib, which is not.
Change the contents of vidle.sh to the following:
export LD_LIBRARY_PATH="/usr/local/lib"
python2.7 /usr/local/lib/python2.7/dist-packages/VPython-6.05-py2.7-linux-x86_64.egg/vidle/idle.py
II: Troubleshooting
From a typescript, the following will print all VPYTHON_NOTEs:
env VPYTHON_DEBUG=1 python test.py