1995-09-03 08:22:54 -07:00
|
|
|
INSTALLATION INSTRUCTIONS
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
1- Configure the system. From the top directory, do:
|
1995-09-03 08:22:54 -07:00
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
./configure
|
1995-09-03 08:22:54 -07:00
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
This generates the three configuration files "Makefile", "m.h" and "s.h"
|
|
|
|
in the config/ subdirectory.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
The "configure" script accepts the following options:
|
1995-09-03 08:22:54 -07:00
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
-bindir <dir> (default: /usr/local/bin)
|
|
|
|
Directory where the binaries will be installed
|
1995-09-03 08:22:54 -07:00
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
-libdir <dir> (default: /usr/local/lib/camlsl)
|
|
|
|
Directory where the Caml library will be installed
|
1995-09-03 08:22:54 -07:00
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
-mandir <dir> (default: /usr/local/man/man1)
|
|
|
|
Directory where the manual pages will be installed
|
|
|
|
|
|
|
|
-cc <C compiler and options> (default: gcc or cc, depending on availability)
|
|
|
|
C compiler to use for building the system
|
|
|
|
|
|
|
|
-libs <extra libraries> (default: none)
|
|
|
|
Extra libraries to link with the system
|
|
|
|
|
|
|
|
-host <hosttype> (default: determined automatically)
|
|
|
|
The type of the host machine, in GNU's "configuration name"
|
|
|
|
format (CPU-COMPANY-SYSTEM). This info is generally determined
|
|
|
|
automatically by the "configure" script, and rarely ever
|
|
|
|
needs to be provided by hand. The installation instructions
|
|
|
|
for gcc or emacs contain a complete list of configuration names.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
./configure -bindir /usr/bin -libdir /usr/lib/csl -mandir /usr/man/manl
|
|
|
|
./configure -cc "acc -fast" -libs "-lucb"
|
|
|
|
|
|
|
|
If something goes wrong during the automatic configuration, or if the
|
|
|
|
generated files cause errors later on, then look at the template files
|
|
|
|
|
|
|
|
config/Makefile-templ
|
|
|
|
config/m-templ.h
|
|
|
|
config/s-templ.h
|
|
|
|
|
|
|
|
for guidance on how to edit the generated files by hand.
|
|
|
|
|
|
|
|
2- From the top directory, do:
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
make world
|
|
|
|
|
|
|
|
This builds the Caml Special Light bytecode compiler for the first time.
|
|
|
|
This phase is fairly verbose; consider redirecting the output to a file:
|
|
|
|
|
|
|
|
make world > log.world 2>&1 # in sh
|
|
|
|
make world >& log.world # in csh
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
3- To be sure everything works well, you can try to bootstrap the
|
1995-09-03 08:22:54 -07:00
|
|
|
system --- that is, to recompile all Caml Special Light sources with
|
|
|
|
the newly created compiler. From the top directory, do:
|
|
|
|
|
|
|
|
make bootstrap
|
|
|
|
|
|
|
|
or, better:
|
|
|
|
|
|
|
|
make bootstrap > log.bootstrap 2>&1 # in sh
|
|
|
|
make bootstrap >& log.bootstrap # in csh
|
|
|
|
|
|
|
|
The "make bootstrap" checks that the bytecode programs compiled with
|
|
|
|
the new compiler are identical to the bytecode programs compiled with
|
|
|
|
the old compiler. If this is the case, you can be pretty sure the
|
|
|
|
system has been correctly compiled. Otherwise, this does not
|
|
|
|
necessarily means something went wrong. The best thing to do is to try
|
|
|
|
a second bootstrapping phase: just do "make bootstrap" again. It will
|
|
|
|
either crash almost immediately, or re-re-compile everything correctly
|
|
|
|
and reach the fixpoint.
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
4- If your platform is supported by the native-code compiler (as
|
|
|
|
reported during the autoconfiguration), you can now build the
|
|
|
|
native-code compiler. From the top directory, do:
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
make opt
|
|
|
|
or:
|
|
|
|
make opt > log.opt 2>&1 # in sh
|
|
|
|
make opt >& log.opt # in csh
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
5- You can now install the Caml Special Light system. This will create the
|
|
|
|
following commands (in the binary directory selected during autoconfiguration):
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
cslc the batch bytecode compiler
|
|
|
|
cslopt the batch native-code compiler (if supported)
|
|
|
|
cslrun the runtime system for the bytecode compiler
|
|
|
|
cslyacc the parser generator
|
|
|
|
csllex the lexer generator
|
|
|
|
csltop the interactive, toplevel-based system
|
|
|
|
cslmktop a tool to make toplevel systems that integrate
|
1995-09-11 07:57:21 -07:00
|
|
|
user-defined C primitives and Caml code
|
1995-09-03 08:22:54 -07:00
|
|
|
csldep output "make" dependencies for Caml sources
|
1995-11-25 07:36:28 -08:00
|
|
|
cslprof execution count profiler
|
|
|
|
cslcp the bytecode compiler in profiling mode
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
From the top directory, become superuser and do "make install".
|
|
|
|
Also do "make installopt" to install the native-code compiler, if you
|
|
|
|
have compiled it.
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
6- Installation is complete. Time to clean up. From the toplevel
|
1995-09-03 08:22:54 -07:00
|
|
|
directory, do "make realclean".
|
|
|
|
|
|
|
|
|
|
|
|
IF SOMETHING GOES WRONG:
|
|
|
|
|
|
|
|
Read the "common problems" and "machine-specific hints" section at the
|
|
|
|
end of this file.
|
|
|
|
|
|
|
|
Check the files m.h and s.h in config/. Wrong endianness or alignment
|
|
|
|
constraints in m.h will immediately crash the bytecode interpreter.
|
|
|
|
|
|
|
|
If you get a "segmentation violation" signal, check the limits on the
|
|
|
|
stack size and data segment size (type "limit" under csh or
|
|
|
|
"ulimit -a" under bash). Make sure the limit on the stack size is
|
|
|
|
at least 2M.
|
|
|
|
|
|
|
|
Try recompiling the runtime system with optimizations turned off
|
|
|
|
(change CFLAGS in byterun/Makefile and asmrun/Makefile).
|
|
|
|
The runtime system contains some complex, atypical pieces of C code
|
|
|
|
that can uncover bugs in optimizing compilers. Alternatively, try
|
|
|
|
another C compiler (e.g. gcc instead of the vendor-supplied cc).
|
|
|
|
|
|
|
|
You can also build a debug version of the runtime system. Go to the
|
|
|
|
byterun/ directory and do "make camlrund". Then, copy camlrund to
|
|
|
|
../boot/camlrun, and try again. This version of the runtime system
|
|
|
|
contains lots of assertions and sanity checks that could help you
|
|
|
|
pinpoint the problem.
|
|
|
|
|
|
|
|
|
|
|
|
COMMON PROBLEMS:
|
|
|
|
|
1995-09-08 01:55:12 -07:00
|
|
|
* The Makefiles use the "include" directive, which is not supported by
|
1996-01-04 04:48:44 -08:00
|
|
|
all versions of make. Use GNU make instead.
|
1995-09-08 01:55:12 -07:00
|
|
|
|
1995-09-03 08:22:54 -07:00
|
|
|
* The Makefiles assume that make execute commands by calling /bin/sh. They
|
|
|
|
won't work if /bin/csh is called instead. You may have to unset the SHELL
|
|
|
|
environment variable, or set it to /bin/sh.
|
|
|
|
|
|
|
|
* gcc 2.6.0 has been reported to generate incorrect code for the
|
1995-11-25 07:36:28 -08:00
|
|
|
runtime system in -O mode. Upgrade to a newer version.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
MACHINE-SPECIFIC HINTS:
|
|
|
|
|
|
|
|
* On HP 9000/700 machines under HP/UX 9. Some versions of cc are
|
|
|
|
unable to compile correctly the runtime system (wrong code is
|
|
|
|
generated for (x - y) where x is a pointer and y an integer).
|
|
|
|
Fix: use gcc.
|
|
|
|
|