-
Notifications
You must be signed in to change notification settings - Fork 20
/
README.win32
417 lines (290 loc) · 15.3 KB
/
README.win32
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
Release notes on the MS Windows ports of Objective Caml
-------------------------------------------------------
There are no less than four ports of Objective Caml for MS Windows available:
- a native Win32 port, built with the Microsoft development tools;
- a native Win32 port, built with the Cygwin/MinGW development tools;
- a port consisting of the Unix sources compiled under the Cygwin
Unix-like environment for Windows;
- a native Win64 port (64-bit Windows), built with the Microsoft
development tools.
Here is a summary of the main differences between these ports:
Native MS Native MinGW Cygwin
64 bits? Win32 or Win64 Win32 only Win32 only
Third-party software required
- for base bytecode system none none none
- for ocamlc -custom MSVC Cygwin Cygwin
- for native-code generation MSVC+MASM Cygwin Cygwin
Speed of bytecode interpreter 70% 100% 100%
Replay debugger yes (**) yes (**) yes
The Unix library partial partial full
The Threads library yes yes yes
The Graphics library yes yes no
Restrictions on generated executables? none none yes (*)
(*) Cygwin-generated .exe files refer to a DLL that is distributed under
the GPL. Thus, these .exe files can only be distributed under a license
that is compatible with the GPL. Executables generated by MSVC or by
MinGW have no such restrictions.
(**) The debugger is supported but the "replay" functions are not enabled.
Other functions are available (step, goto, run...).
The remainder of this document gives more information on each port.
------------------------------------------------------------------------------
The native Win32 port built with Microsoft Windows SDK
------------------------------------------------------
REQUIREMENTS:
This port runs under MS Windows 7 (32 and 64 bits), Vista, XP, and 2000.
The base bytecode system (ocamlc, ocaml, ocamllex, ocamlyacc, ...)
runs without any additional tools.
The native-code compiler (ocamlopt) requires the Microsoft Windows SDK
(item [1]) and the flexdll tool (item [2]).
Statically linking Caml bytecode with C code (ocamlc -custom) also requires
items [1] and [2].
The LablTk GUI requires Tcl/Tk 8.5 (item [3]).
INSTALLATION:
The binary distribution is a self-installing executable archive.
Just run it and it should install OCaml automatically.
To run programs that use the LablTK GUI, the directory where the
DLLs tk85.dll and tcl85.dll were installed (by the Tcl/Tk
installer) must be added to the PATH environment variable.
To compile programs that use the LablTK GUI, the directory where the
libraries tk85.lib and tcl85.lib were installed (by the Tcl/Tk
installer) must be added to the library search path in the LIB
environment variable. E.g. if Tcl/Tk was installed in C:\Tcl, add
"C:\Tcl\lib" to the LIB environment variable.
THIRD-PARTY SOFTWARE:
[1] Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1.
Can be downloaded for free from
http://www.microsoft.com/downloads/en/default.aspx
under the name "Microsoft Windows 7 SDK".
[2] flexdll version 0.23 or later.
Can be downloaded from http://alain.frisch.fr/flexdll.html
[3] TCL/TK version 8.5. Windows binaries are available as part of the
ActiveTCL distribution at http://www.activestate.com/products/ActiveTcl/
RECOMPILATION FROM THE SOURCES:
The command-line tools can be recompiled from the Unix source
distribution (ocaml-X.YY.Z.tar.gz), which also contains the files modified
for Windows.
You will need the following software components to perform the recompilation:
- Windows NT, 2000, XP, Vista, or 7 (32 or 64 bits).
- Items [1], [2] and [3] from the list of recommended software above.
Make sure to install the 32-bit version of TCL/TK, even if you are
compiling on a 64-bit Windows.
- The Cygwin port of GNU tools, available from http://www.cygwin.com/
Install at least the following packages: diffutils, make, ncurses.
First, you need to set up your cygwin environment for using the MS
tools. The following assumes that you have installed [1], [2], and [3]
in their default directories. If this is not the case, you will need
to adjust the paths accordingly.
Open a Windows Command Prompt and enter the following command:
set PFPATH=C:\Program Files
If you are compiling on the 64-bit version of Windows 7, enter the
following instead:
set PFPATH=C:\Program Files (x86)
Then enter the following commands:
cd "%PFPATH%\Microsoft Visual Studio 9.0\VC\bin"
vcvars32
echo VCPATH="`cygpath -p '%Path%'`" >C:\cygwin\tmp\msenv
echo LIB="%LIB%;C:\Tcl\lib" >>C:\cygwin\tmp\msenv
echo LIBPATH="%LIBPATH%" >>C:\cygwin\tmp\msenv
echo INCLUDE="%INCLUDE%;C:\Tcl\include" >>C:\cygwin\tmp\msenv
echo FLPATH="`cygpath '%PFPATH%\flexdll'`" >>C:\cygwin\tmp\msenv
echo PATH="${VCPATH}:$PATH:${FLPATH}" >>C:\cygwin\tmp\msenv
echo export PATH LIB LIBPATH INCLUDE >>C:\cygwin\tmp\msenv
echo export OCAMLBUILD_FIND=/usr/bin/find >>C:\cygwin\tmp\msenv
Open a Cygwin shell and enter the following commands:
tr -d '\r' </tmp/msenv >.msenv32
echo '. $HOME/.msenv32' >>.bashrc
Now, close the Command Prompt and the shell and you're set up for
using the MS tools under Cygwin.
To recompile OCaml, start a new Cygwin shell and change to the top-level
directory of the OCaml distribution. Then, do
cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h
cp config/Makefile.msvc config/Makefile
Then, edit config/Makefile as needed, following the comments in this file.
Normally, the only variables that need to be changed are
PREFIX where to install everything
TK_ROOT where TCL/TK was installed
Finally, use "make -f Makefile.nt" to build the system, e.g.
make -f Makefile.nt world
make -f Makefile.nt bootstrap
make -f Makefile.nt opt
make -f Makefile.nt opt.opt
make -f Makefile.nt install
NOTES:
* The VC++ compiler does not implement "computed gotos", and therefore
generates inefficient code for byterun/interp.c. Consequently, the
performance of bytecode programs is about 2/3 of that obtained under
Unix/GCC or Cygwin or Mingw on similar hardware.
* Libraries available in this port: "num", "str", "threads", "graphics",
"labltk", and large parts of "unix".
* The replay debugger is partially supported (no reverse execution).
CREDITS:
The initial port of Caml Special Light (the ancestor of Objective Caml)
to Windows NT was done by Kevin Gallo at Microsoft Research, who
kindly contributed his changes to the Caml project.
The graphical user interface for the toplevel was initially developed
by Jacob Navia, then significantly improved by Christopher A. Watford.
------------------------------------------------------------------------------
The native Win32 port built with Mingw
--------------------------------------
NOTE: Due to changes in cygwin's compilers, this port is not available
in OCaml 3.12.1. A patch will be made available soon after the release
of 3.12.1.
REQUIREMENTS:
This port runs under MS Windows Vista, XP, and 2000.
The base bytecode system (ocamlc, ocaml, ocamllex, ocamlyacc, ...)
runs without any additional tools.
The native-code compiler (ocamlopt), as well as static linking of
Caml bytecode with C code (ocamlc -custom), require
the Cygwin development tools, available at
http://www.cygwin.com/
and the flexdll tool, available at
http://alain.frisch.fr/flexdll.html
You will need to install at least the following Cygwin packages (use
the Setup tool from Cygwin):
binutils, gcc-core, gcc-mingw-core, mingw-runtime, w32api.
Do *not* install the Mingw/MSYS development tools from www.mingw.org:
these are not compatible with this Caml port (@responsefile not
recognized on the command line).
The LablTk GUI requires Tcl/Tk 8.5. Windows binaries are available
as part of the ActiveTCL distribution at
http://www.activestate.com/products/ActiveTcl/
Note that you will need to install the 32-bit version of ActiveTCL,
even if you are on a 64-bit version of Windows.
INSTALLATION:
The binary distribution is a self-installing executable archive.
Just run it and it should install OCaml automatically.
To run programs that use the LablTK GUI, the directory where the
DLLs tk85.dll and tcl85.dll were installed (by the Tcl/Tk
installer) must be added to the PATH environment variable.
To compile programs that use the LablTK GUI, the directory where the
libraries tk85.lib and tcl85.lib were installed (by the Tcl/Tk
installer) must be added to the library search path in the LIB
environment variable. E.g. if Tcl/Tk was installed in C:\tcl, add
"C:\tcl\lib" to the LIB environment variable.
RECOMPILATION FROM THE SOURCES:
You will need the following software components to perform the recompilation:
- Windows NT, 2000, XP, or Vista.
- Cygwin: http://sourceware.cygnus.com/cygwin/
Install at least the following packages: binutils, diffutils,
gcc-core, gcc-mingw-core, make, mingw-runtime, ncurses, w32api.
- TCL/TK version 8.5 (see above).
- The flexdll tool (see above).
Do *not* install the standalone distribution of MinGW, nor the
companion MSYS tools: these have problems with long command lines.
Instead, use the version of MinGW provided by Cygwin.
Start a Cygwin shell and unpack the source distribution
(ocaml-X.YY.Z.tar.gz) with "tar xzf". Change to the top-level
directory of the OCaml distribution. Then, do
cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h
cp config/Makefile.mingw config/Makefile
Then, edit config/Makefile as needed, following the comments in this file.
Normally, the only variables that need to be changed are
PREFIX where to install everything
TK_ROOT where TCL/TK was installed
Finally, use "make -f Makefile.nt" to build the system, e.g.
make -f Makefile.nt world
make -f Makefile.nt bootstrap
make -f Makefile.nt opt
make -f Makefile.nt opt.opt
make -f Makefile.nt install
NOTES:
* Libraries available in this port: "num", "str", "threads", "graphics",
"labltk", and large parts of "unix".
* The replay debugger is partially supported (no reverse execution).
------------------------------------------------------------------------------
The Cygwin port of Objective Caml
---------------------------------
REQUIREMENTS:
This port requires the Cygwin environment from Cygnus/RedHat, which
is freely available at:
http://www.cygwin.com/
It also requires the flexdll tool, available at:
http://alain.frisch.fr/flexdll.html
This port runs under all versions of MS Windows supported by Cygwin.
INSTALLATION:
We do not distribute binaries for this port, but they can be found
in the Cygwin distribution (use the Setup tool from Cygwin and select
the OCaml packages). Alternatively, recompile from the source distribution.
RECOMPILATION FROM THE SOURCES:
Just follow the instructions for Unix machines given in the file INSTALL.
NOTES:
The libraries available in this port are "num", "str", "threads",
"unix" and "labltk". "graph" is not available.
The replay debugger is fully supported.
When upgrading from 3.12.0 to 3.12.1, you will need to remove
/usr/local/bin/ocamlmktop.exe before typing "make install".
------------------------------------------------------------------------------
The native Win64 port built with Microsoft Windows SDK
------------------------------------------------------
REQUIREMENTS:
This port runs under MS Windows XP 64, Windows Server 64, and
Windows 7 64 on Intel64/AMD64 machines.
The base bytecode system (ocamlc, ocaml, ocamllex, ocamlyacc, ...)
runs without any additional tools.
Statically linking Caml bytecode with C code (ocamlc -custom) requires the
Microsoft Platform SDK compiler (item [1] in the section
"third-party software" below) and the flexdll tool (item [2]).
The native-code compiler (ocamlopt) requires the Microsoft compiler
and the Microsoft assembler MASM64 (item [1]) and the flexdll tool (item [2]).
The LablTk GUI is not available in this version.
INSTALLATION:
There is no binary distribution yet. Please compile from sources as
described below.
THIRD-PARTY SOFTWARE:
[1] Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1.
Can be downloaded for free from
http://www.microsoft.com/downloads/en/default.aspx
under the name "Microsoft Windows 7 SDK".
[2] flexdll version 0.23 or later.
Can be downloaded from http://alain.frisch.fr/flexdll.html
RECOMPILATION FROM THE SOURCES:
The command-line tools can be recompiled from the Unix source
distribution (ocaml-X.YZ.tar.gz), which also contains the files modified
for Windows.
You will need the following software components to perform the recompilation:
- Windows XP 64, Windows Server 64, or Windows 7 64.
- Items [1] and [2] from the list of recommended software above.
- The Cygwin port of GNU tools, available from http://www.cygwin.com/
Install at least the following packages: diffutils, make, ncurses.
First, you need to set up your cygwin environment for using the MS
tools. The following assumes that you have installed [1] and [2]
in their default directories. If this is not the case, you will need
to adjust the paths accordingly.
Open a Windows Command Prompt and enter the following commands:
set PFPATH=C:\Program Files (x86)
cd "%PFPATH%\Microsoft Visual Studio 9.0\VC\bin"
vcvars64
echo VCPATH="`cygpath -p '%Path%'`" >C:\cygwin\tmp\msenv
echo LIB="%LIB%;C:\Tcl\lib" >>C:\cygwin\tmp\msenv
echo LIBPATH="%LIBPATH%" >>C:\cygwin\tmp\msenv
echo INCLUDE="%INCLUDE%;C:\Tcl\include" >>C:\cygwin\tmp\msenv
echo FLPATH="`cygpath '%PFPATH%\flexdll'`" >>C:\cygwin\tmp\msenv
echo PATH="${VCPATH}:$PATH:${FLPATH}" >>C:\cygwin\tmp\msenv
echo export PATH LIB LIBPATH INCLUDE >>C:\cygwin\tmp\msenv
echo export OCAMLBUILD_FIND=/usr/bin/find >>C:\cygwin\tmp\msenv
Open a Cygwin shell and enter the following commands:
tr -d '\r' </tmp/msenv >.msenv64
echo '. $HOME/.msenv64' >>.bashrc
Now, close the Command Prompt and the shell and you're set up for
using the MS tools under Cygwin.
To recompile OCaml, start a new Cygwin shell and change to the top-level
directory of the OCaml distribution. Then, do
cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h
cp config/Makefile.msvc64 config/Makefile
Then, edit config/Makefile as needed, following the comments in this file.
Normally, the only variable that need to be changed is
PREFIX where to install everything
Finally, use "make -f Makefile.nt" to build the system, e.g.
make -f Makefile.nt world
make -f Makefile.nt bootstrap
make -f Makefile.nt opt
make -f Makefile.nt opt.opt
make -f Makefile.nt install
NOTES:
* Libraries available in this port: "num", "str", "threads", "graphics",
and large parts of "unix".
* The replay debugger is partially supported (no reverse execution).
* The graphical browser ocamlbrowser is not supported.