4400
|
1 The following is my current best set of directions for building Octave |
|
2 from sources on a Windows system using the Cygwin tools. If you |
|
3 already have Cygwin installed, you may need to update your |
|
4 installation of tools to include those mentioned below. |
|
5 |
|
6 Following these steps should give you an Octave installation that |
|
7 includes all the necessary tools for building dynamically linked |
|
8 functions (.oct files). |
3847
|
9 |
|
10 |
4400
|
11 1. Use your favorite browser to view the page http://www.cygwin.com |
|
12 |
|
13 2. Click on the "Install or update now" link. |
|
14 |
|
15 3. A dialog should appear with the option to run the setup program |
|
16 from its current location or save it to disk. Either will work, |
|
17 but I usually choose to save the setup program to disk so that it |
|
18 is possible to run it later to update the installation without |
|
19 having to go back to the web page using a browser. |
|
20 |
|
21 4. Run the setup program. |
|
22 |
|
23 5. Choose "Install from Internet". |
|
24 |
|
25 6. Select a root install directory. You may choose any directory, but |
|
26 it needs to have about 600MB available to install all the |
|
27 necessary Cygwin tools plus build and install Octave from sources. |
|
28 That may seem like a large disk space requirement, but remember |
|
29 that you are getting more than just Octave, you are installing a |
|
30 Unix-like development environment including C, C++, and Fortran |
|
31 compilers as well. Once Octave is installed, you can delete the |
|
32 sources and build directory, freeing up about 250MB. |
3154
|
33 |
4400
|
34 You may choose to install for just you or all users (if you have |
|
35 permission to do so). I would select "Unix" as the default text |
|
36 file type (this option should be the default). |
|
37 |
|
38 7. Select a local package directory. This is a directory that the |
|
39 setup program will use to temporarily store package files before |
|
40 installing them. It should have plenty of space (probably 70MB |
|
41 or more). You may delete this directory once the installation is |
|
42 complete. |
|
43 |
|
44 8. Select your Internet Connection. Probably "Direct Connection" is |
|
45 OK unless you are behind a firewall of some kind that limits your |
|
46 access to the Internet. |
|
47 |
|
48 9. Choose a download site. One that is "near" you on the net is |
|
49 probably best. |
|
50 |
|
51 10. Select packages. The defaults are not enough to build all of |
|
52 Octave from sources. In addition to the default set of packages, |
|
53 you should select the following packages from the following |
|
54 categories: |
|
55 |
|
56 Archive: unzip |
|
57 Devel: autoconf, binutils, bison, cvs, dejagnu, flex, gcc, |
|
58 gperf, make |
|
59 Text: less, tetex, tetex-base |
|
60 Utils: diff, patch |
2587
|
61 |
4400
|
62 Once you have made these selections, click the Next button to |
|
63 download and install all the selected packages. The download and |
|
64 install may take a while depending on the speed of your computer |
|
65 and your connection to the net. |
|
66 |
|
67 11. Once the download and file installation is done, click Finish. I |
|
68 usually choose to create an icon on the desktop and put an icon in |
|
69 the start menu. After you click finish, a series of scripts will |
|
70 run, displaying some output in a terminal window. It will take a |
|
71 few minutes. |
2587
|
72 |
4400
|
73 12. Download and install Gnuplot: |
|
74 |
|
75 a. Use your favorite browser to go to http://www.gnuplot.info and |
|
76 download a binary package of gnuplot for Windows. At the time |
|
77 of this writing, it was available from the gnuplot ftp site in |
|
78 the file gp373w32.zip. |
|
79 |
|
80 b. When you download the zip file, place it in your Cygwin /tmp |
|
81 directory. This directory will be called something like |
|
82 c:\cygwin\tmp in Windows (the precise location depends on where |
|
83 you chose to install Cygwin). |
2587
|
84 |
4400
|
85 c. After downloading the zip file, start Cygwin (actually a bash |
|
86 shell running in a terminal window) by clicking on the Cygwin |
|
87 desktop icon or use the start menu item that you created when |
|
88 you installed Cygwin. |
|
89 |
|
90 d. Run the command |
|
91 |
|
92 unzip /tmp/gp373w32.zip |
|
93 |
|
94 to unpack the zip archive. This command should create a |
|
95 subdirectory called gp373w32 in your Cygwin home directory. |
|
96 |
|
97 e. Move the gnuplot programs and help file to the Cygwin bin |
|
98 directory: |
|
99 |
|
100 mv gp373w32/pgnuplot.exe /usr/local/bin |
|
101 mv gp373w32/wgnupl32.exe /usr/local/bin |
|
102 mv gp373w32/WGNUPLOT.HLP /usr/local/bin |
|
103 |
|
104 Make sure that executable files have execute permissions set: |
|
105 |
|
106 chmod a+rx /usr/local/bin/pgnuplot.exe |
|
107 chmod a+rx /usr/local/bin/wgnupl32.exe |
|
108 |
|
109 f. Test it by typing the command |
|
110 |
|
111 wgnupl32 |
2587
|
112 |
4400
|
113 This command should bring up a gnuplot command window. Try |
|
114 plotting something by typing |
|
115 |
4487
|
116 plot sin(x) |
4400
|
117 |
|
118 at the gnuplot prompt. This command should bring up a plot |
|
119 window displaying a sine wave. |
|
120 |
|
121 g. close gnuplot and start the Octave installation. |
|
122 |
|
123 13. Get the Octave sources, either from a current snapshot |
|
124 distribution or from CVS: |
|
125 |
|
126 Snapshot: |
|
127 |
|
128 a. Download a copy of the current version of Octave from |
|
129 ftp://ftp.octave.org. You may use the command line ftp |
|
130 client in Cygwin or a web browser. You are looking for the |
|
131 most recent version in the pub/octave/bleeding-edge |
|
132 directory. At the time of this writing, it was |
|
133 octave-2.1.46.tar.gz. Save this file to your Cygwin home |
|
134 directory. This directory will usually be called something |
|
135 like c:\cygwin\home\jwe from Windows (the precise location |
|
136 depends on where you chose to install Cygwin). |
2587
|
137 |
4400
|
138 IMPORTANT: If you use the ftp client, be sure to set the |
|
139 binary mode for downloads by typing |
|
140 |
|
141 binary |
|
142 |
|
143 at the ftp prompt. |
|
144 |
|
145 b. Unpack the source files using the command: |
|
146 |
|
147 tar zxf octave-2.1.46.tar.gz |
|
148 |
|
149 in the Cygwin shell. This command will create a subdirectory |
|
150 called octave-2.1.46 in your home directory. |
|
151 |
|
152 c. Change your current working directory to the top-level Octave |
|
153 source directory: |
|
154 |
|
155 cd octave-2.1.46 |
|
156 |
|
157 then continue with step 14 below. |
|
158 |
|
159 CVS: |
|
160 |
|
161 a. Check out a copy of the current sources from the public CVS |
|
162 archive by running the following commands |
3167
|
163 |
4400
|
164 cvs -d :pserver:anoncvs@www.octave.org:/cvs login |
|
165 cvs -z 9 -d :pserver:anoncvs@www.octave.org:/cvs checkout octave |
|
166 |
|
167 in the Cygwin shell. The first command will prompt you for a |
|
168 password; reply with anoncvs. The checkout command will |
|
169 create a subdirectory called octave containing the current |
|
170 CVS version of the Octave sources. |
|
171 |
|
172 b. Change your current working directory to the top-level Octave |
|
173 source directory: |
3167
|
174 |
4400
|
175 cd octave |
|
176 |
|
177 c. Build the configure scripts by running the command |
|
178 |
|
179 ./autogen.sh |
|
180 |
|
181 then continue with step 14 below. |
|
182 |
|
183 |
|
184 14. Configure Octave by running the command |
|
185 |
|
186 ./configure --enable-shared --disable-static |
3167
|
187 |
4400
|
188 This command will take several minutes to run as the configure |
|
189 script determines what features are available on your system. You |
|
190 need the --enable-shared option if you want to build dynamically |
|
191 loaded functions (.oct files) later. You may omit the |
|
192 --disable-static option if you want to build static libraries (.a |
|
193 files) in addition to shared libraries, but the build will take |
|
194 about twice as long to complete. |
|
195 |
|
196 15. Build the Octave binary by running the command |
|
197 |
|
198 make |
3167
|
199 |
4400
|
200 You may see warnings from gcc saying that __cdecl is redefined or |
|
201 that all code is position independent. You may safely ignore |
|
202 these warnings. |
|
203 |
|
204 16. (OPTIONAL) Run Octave's regression test suite by running the |
|
205 command |
|
206 |
|
207 make check |
|
208 |
|
209 Running the tests may take a very long time, so if you are in a |
|
210 hurry, you might want to skip this step. At the time of this |
|
211 writing, there are 4 "expected" failures related to the try-catch |
|
212 and eval commands. You may safely ignore those failures. |
|
213 |
|
214 17. Complete the installation by running the command |
|
215 |
3167
|
216 make install |
|
217 |
4400
|
218 18. Try starting Octave by running the command |
3167
|
219 |
4400
|
220 octave |
3167
|
221 |
4400
|
222 in the cygwin shell and then typing |
3167
|
223 |
4400
|
224 sombrero (41) |
3167
|
225 |
4400
|
226 at the Octave prompt to see if you can create a plot. |
3167
|
227 |
4400
|
228 19. Try to build a .oct file and run it: |
2587
|
229 |
4400
|
230 cd examples |
|
231 mkoctfile hello.cc |
|
232 octave |
|
233 ... |
|
234 octave:1> hello |
|
235 Hello, world! |
3176
|
236 |
|
237 |
2587
|
238 |
|
239 John W. Eaton |
|
240 jwe@bevo.che.wisc.edu |
|
241 University of Wisconsin-Madison |
|
242 Department of Chemical Engineering |
|
243 |
4400
|
244 Wed Apr 30 17:15:32 2003 |