This repository has been archived by the owner on Sep 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathINSTALL
212 lines (144 loc) · 7.58 KB
/
INSTALL
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
Building Quick C--
This document describes how to build Quick C-- from source.
Prerequisites
~~~~~~~~~~~~~
The compiler is written in the functional programming language
Objective Caml (http://caml.inria.fr). Most of the source code is
written as a literate program using the Noweb literate programming
tool. The documentation is intended to be formatted with LaTeX.
The build process is controlled by mk, a version of Make. Mk was
originally written by Andrew Hume at Bell Labs, became the build tool
of the Plan 9 operating system, and then was released to the world as
part of Inferno. We provide a version of mk derived from the Inferno
distribution. If you are using old versions of mk from Unix v7 or
similar, you will need to upgrade.
To build the compiler from source code you need:
* Objective Caml version 3.08 (including ocamlyacc and ocamllex)
or higher.
[version 3.07 will work if you change names of external functions]
* Noweb 2.9 or higher
The compiler comes with an interpreter implemented in C. For the
interpreter to compile you need in addition:
* ANSI C Compiler, for example gcc
* Lua 4.0 installed, including library and header files
Some source files are generated by tools that are not included in the
distribution. You can compile the generated sources, but you cannot
change the specification that led to them, For example, the abstract
syntax for C-- is specified in ASDL. We provide the library files in
asdl/ and generated sources in gen/ such that you do not need the ASDL
generator. However, we do not provide the generator which means there is
no way to re-compile the ASDL specification.
Building Mk
~~~~~~~~~~~
Before you can build anything else, you must build mk. You will find
instructions in mk/README. Once you have built mk, put it on your PATH.
Building QC--
~~~~~~~~~~~~~
The recursive build process is controlled by mkfiles for mk(1). All
mkfiles include files from config/ to find tools and libraries. It
should suffice to make changes only here, if at all. The file that most
likely needs some attention is config/lua.mk. It defines the path the
Lua libraries and header files. We provide a configure script that tries
to guess platform-dependent settings such that you hopefully don't need
to edit configuration files manually.
config/ocaml.mk The OCaml compiler suite
config/noweb.mk Noweb literate programming syste,
config/latex.mk LaTeX for documentation
config/man.mk Creating manual pages with perlpod(1)
config/c.mk Compiling C code
config/lua.mk Library and header files for Lua
config/config.mk ./configure-generated file
mkfile top-level mkfile
To compile everything, run configure and mk:
./configure
mk timestamps # needed if direct from CVS repository
mk all all.opt
mk install install.opt
If Objective Caml cannot build a native-code binary on your platform,
you should omit the all.opt and install.opt targets.
If you don't have rights to install into /usr/local, you will need to use
./configure --prefix=...
If ./configure fails it will suggest what to try; it also writes
helpful output into a configure.log file. The file it creates is
config/config.mk. You can create this file manually from
config/config.mk.default.
The invocation of mk starts the compilation process. The first time
through, you will see quite a few warnings of the form
warning: skipping missing include file: DEPEND: No such file or directory
These warnings are normal and should not trouble you.
Mk produces (at least) the following files:
bin/qc-- qc-- byte code code binary
bin/qc--interp qc-- interpreter
man/man1/qc--.1 manual page
man/man1/qc--internals.1 hacker's manual page
There are more binaries and manual pages that are used during
development but they are not important to use qc--.
If the OCaml native-code compiler ocamlopt is supported in your
platform and is installed, we strongly recommend that you create a
native-code binary qc--.opt:
mk all.opt
mk install.opt
To execute the test suite you can also call the test and/oror test.opt
targets:
mk test test.opt
As of November, 2004, you can expect one failure: the 'wf.test' in the
'tiger.x86.tst' suite does not work correctly. We believe this error
indicates a fault in the C-- run-time system, but we have not yet been
able to track it down.
Under '# operator testing on random bits' you can expect such messages as
integer widening not tested
effect of rounding modes not tested
as well as a list of operators not implemented, if any. These
messages are normal and do not indicate a fault.
Problems and Bug Reports
~~~~~~~~~~~~~~~~~~~~~~~~
QC-- was retired in 2007 or thereabouts. If you have trouble building
the compiler or using it, Norman Ramsey probably cannot help, but you
can send email to nr@cs.tufts.edu.
How the Compiler's Source Code is Organized
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can use the compiler without any of the following information, but
if you want to hack on the compiler, this information may help.
The source code of the compiler is split into different directories.
The top level mkfile knows the dependencies between them and makes
them in the right order. Files shared by many directories go into the
lib/ directory which is initially empty. Once all shared files are in
place development can be continued in the sub-directories and the
mkfiles provided there. Refer to the mkfiles for the high level
targets available in each directory. The doc/ directory includes an
overview document index.nw.
In alphabetical order:
asdl/ OCaml sources for the runtime system of AsdlGen
generated code.
aug99/ Sources for an earlier implementation of c--. Not used
and interesting only for historical reasons.
bin/ Initially empty. Contains binary after compilation.
camlburg/ A burg implementation for OCaml; comes with its own
documentation.
cllib/ Library of OCaml modules for pretty printing and
and parsing.
config/ Global rule set for compiling OCaml sources and other
global files.
doc/ Various documents, manual pages, also an overview and design
problems.
examples/ Some c-- sources. Currently empty.
figures/ PostScript figures used for documentation.
gen/ Machine generated files.
interp/ Interpreter for C--.
lib/ Initially empty. Contains library modules during
compilation.
lua/ An interpreter for the embedded script language Lua.
man/ Initially empty. Contains manual page after
compilation.
mk/ C implementation of the make-like tool mk.
rtl/ RTL type definition.
runtime/ The Quick C-- run-time system
specialized/ Partially evaluated compiler sources.
src/ Main sources for the c-- compiler.
tdpe/ Code for partial evaluation of the compiler, see README.
Not yet updated for Ocaml 3.04 label mode. However, this
code is currently by default not compiled and linked.
test2/ Code for testing.
tools/ Small tools: OCamlError, NoFake, Grades.
Directories depend on each other in the following order:
cllib lua asdl rtl gen camlburg tools src runtime test2