2016-04-08 03:40:51 -07:00
|
|
|
= Installing OCaml on a Unix(-like) machine =
|
1997-10-24 08:49:12 -07:00
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
== PREREQUISITES
|
1996-06-25 02:27:34 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* The GNU C Compiler (gcc) is recommended, as the bytecode interpreter takes
|
|
|
|
advantage of GCC-specific features to enhance performance. gcc is the standard
|
|
|
|
compiler under Linux, OS X, and many other systems.
|
2000-02-10 06:01:57 -08:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* If you do not have write access to `/tmp`, you should set the environment
|
|
|
|
variable `TMPDIR` to the name of some other temporary directory.
|
2006-01-04 08:55:50 -08:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* Under HP/UX, the GNU C Compiler (gcc), the GNU Assembler (gas), and GNU Make
|
|
|
|
are all *required*. The vendor-provided compiler, assembler and make tools
|
2008-12-03 10:09:09 -08:00
|
|
|
have major problems.
|
|
|
|
|
2016-04-08 03:40:51 -07:00
|
|
|
* Under Cygwin, the `gcc-core` and `make` packages are required. `flexdll` is
|
|
|
|
necessary for shared library support. `libX11-devel` is necessary for graph
|
|
|
|
library support and `libintl-devel` is necessary for the `ocamlobjinfo` tool
|
|
|
|
to be able to process `.cmxs` files. `diffutils` is necessary to run the test
|
|
|
|
suite.
|
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
== INSTALLATION INSTRUCTIONS
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2015-09-22 02:21:31 -07: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
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
2016-04-07 07:16:32 -07:00
|
|
|
This generates the three configuration files `Makefile`, `m.h` and `s.h`
|
|
|
|
in the `config/` subdirectory.
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
|
|
|
The `configure` script accepts the following options:
|
|
|
|
+
|
2016-04-07 07:16:32 -07:00
|
|
|
`-prefix <dir>`:: (default: `/usr/local`)
|
|
|
|
Set the `PREFIX` variable used to define the defaults of the following
|
|
|
|
three options. Must be an absolute path name.
|
2012-02-13 09:47:23 -08:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-bindir <dir>`:: (default: `$(PREFIX)/bin`)
|
|
|
|
Directory where the binaries will be installed. Must be an absolute
|
|
|
|
path name, or start with `$(PREFIX)`.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-libdir <dir>`:: (default: `$(PREFIX)/lib/ocaml`)
|
|
|
|
Directory where the OCaml library will be installed. Must be an
|
|
|
|
absolute path name, or start with `$(PREFIX)`.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-mandir <dir>`:: (default: `$(PREFIX)/man/man1`)
|
|
|
|
Directory where the manual pages will be installed. Must be an absolute
|
|
|
|
path name, or start with `$(PREFIX)`.
|
1999-03-10 01:51:16 -08:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-cc <C compiler and options>`:: (default: `gcc` if found, otherwise `cc`)
|
|
|
|
C compiler to use for building the system.
|
1996-02-13 08:29:09 -08:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-libs <extra libraries>`:: (default: none)
|
|
|
|
Extra libraries to link with the system.
|
1996-02-13 08:29:09 -08:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-no-curses`::
|
2000-10-27 09:17:56 -07:00
|
|
|
Do not use the curses library.
|
2000-10-27 08:18:24 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-host <hosttype>`:: (default: determined automatically)
|
|
|
|
The type of the host machine, in GNU's "configuration name" format
|
|
|
|
(CPU-COMPANY-SYSTEM or CPU-COMPANY-KERNEL-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 GNU Emacs contain a complete list of configuration names.
|
|
|
|
|
|
|
|
`-target <targettype>`:: (default: same as `-host`)
|
|
|
|
The type of the target machine, in GNU's "configuration name" format
|
|
|
|
(CPU-COMPANY-SYSTEM or CPU-COMPANY-KERNEL-SYSTEM). Setting this will
|
|
|
|
setup OCaml as a cross-compiler which runs on `$host` and produces code
|
|
|
|
for `$target`. This requires a C toolchain which also produces code for
|
|
|
|
`$target` and a native OCaml compiler of the exact same version (if you
|
|
|
|
want a cross 4.00.1, you need a native 4.00.1).
|
|
|
|
|
|
|
|
`-x11include <include_dir>`:: (default: determined automatically)
|
|
|
|
`-x11lib <lib_dir>`:: (default: determined automatically)
|
|
|
|
Location of the X11 include directory (e.g. `/usr/X11R6/include`) and
|
|
|
|
the X11 library directory (e.g. `/usr/X11R6/lib`).
|
|
|
|
|
|
|
|
`-no-pthread`::
|
2003-09-12 00:36:15 -07:00
|
|
|
Do not attempt to use POSIX threads.
|
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-with-pthread`::
|
2004-07-13 05:19:15 -07:00
|
|
|
Attempt to use POSIX threads (this is the default).
|
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-no-shared-libs`::
|
|
|
|
Do not configure support for shared libraries.
|
2004-07-13 05:19:15 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-dldefs <cpp flags>`::
|
|
|
|
`-dllibs <flags and libraries>`::
|
|
|
|
These options specify where to find the libraries for dynamic linking
|
|
|
|
(i.e. use of shared libraries). `-dldefs` specifies options for finding
|
|
|
|
the header files, and `-dllibs` for finding the C libraries.
|
2004-07-13 05:19:15 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-as <assembler and options>`:: (default: determined automatically)
|
2007-10-30 05:37:16 -07:00
|
|
|
The assembler to use for assembling ocamlopt-generated code.
|
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-aspp <assembler and options>`:: (default: determined automatically)
|
|
|
|
The assembler to use for assembling the parts of the run-time system
|
|
|
|
manually written in assembly language. This assembler must pre-process
|
|
|
|
its input with the C preprocessor.
|
2004-07-13 05:19:15 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-with-debug-runtime`::
|
|
|
|
Compile and install the debug version of the runtimes, useful for
|
|
|
|
debugging C stubs and other low-level code.
|
2011-03-17 09:18:05 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-with-instrumented-runtime`::
|
|
|
|
Compile and install the instrumented version of the runtimes, useful
|
|
|
|
mainly for fine-tuning the GC. Works only on Linux.
|
2015-11-20 08:54:26 -08:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-verbose`::
|
|
|
|
Verbose output of the configuration tests. Use it if the outcome of
|
|
|
|
`configure` is not what you were expecting.
|
2003-07-22 00:51:43 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-no-debugger`::
|
|
|
|
Do not build `ocamldebug`.
|
2013-07-01 12:28:18 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-no-native-compiler`::
|
2016-03-16 17:44:41 -07:00
|
|
|
Do not build the native compiler -- bytecode compilation only.
|
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-no-ocamldoc`::
|
|
|
|
Do not build `ocamldoc`.
|
2013-07-01 12:28:18 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-no-ocamlbuild`::
|
|
|
|
Deprecated since 4.03.0, as `ocamlbuild` is now distributed separately
|
2015-12-26 07:08:31 -08:00
|
|
|
from the compiler distribution.
|
2013-07-01 12:28:18 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-no-graph`::
|
2012-02-13 09:47:23 -08:00
|
|
|
Do not compile the Graphics library.
|
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-partialld <linker and options>`:: (default: determined automatically)
|
|
|
|
The linker and options to use for producing an object file (rather than
|
|
|
|
an executable) from several other object files.
|
2012-02-13 09:47:23 -08:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
`-no-cfi`::
|
2013-09-04 08:12:37 -07:00
|
|
|
Do not compile support for CFI directives.
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
1996-02-13 08:29:09 -08:00
|
|
|
Examples:
|
2007-10-30 05:37:16 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
* Standard installation in `/usr/{bin,lib,man}` instead of `/usr/local`:
|
2007-10-30 05:37:16 -07:00
|
|
|
./configure -prefix /usr
|
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
* Installation in `/usr`, man pages in section "l":
|
2015-09-22 02:21:31 -07:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
./configure -bindir /usr/bin -libdir /usr/lib/ocaml -mandir /usr/man/manl
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
|
|
|
or:
|
|
|
|
|
2012-02-13 09:47:23 -08:00
|
|
|
./configure -prefix /usr -mandir '$(PREFIX)/man/manl'
|
2007-10-30 05:37:16 -07:00
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
* On a Linux x86-64 host, to build a 32-bit version of OCaml:
|
|
|
|
|
2013-06-15 01:18:50 -07:00
|
|
|
./configure -cc "gcc -m32" -as "as --32" -aspp "gcc -m32 -c" \
|
|
|
|
-host i386-linux -partialld "ld -r -melf_i386"
|
2007-10-30 05:37:16 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
* On a Linux x86-64 host, to build the run-time system in PIC mode, no special
|
|
|
|
options should be required -- the libraries should be built automatically.
|
|
|
|
The old instructions were:
|
2010-03-29 05:14:07 -07:00
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
./configure -cc "gcc -fPIC" -aspp "gcc -c -fPIC"
|
|
|
|
+
|
2016-04-07 07:16:32 -07:00
|
|
|
On a 64-bit POWER architecture host running Linux, OCaml only operates in a
|
|
|
|
32-bit environment. If your system compiler is configured as 32-bit, e.g.
|
|
|
|
Red Hat 5.9, you don't need to do anything special. If that is not the case
|
|
|
|
(e.g. Red Hat 6.4), then IBM's "Advance Toolchain" can be used. For example:
|
2015-09-22 02:21:31 -07:00
|
|
|
|
2015-07-17 07:31:05 -07:00
|
|
|
export PATH=/opt/at7.0/bin:$PATH
|
|
|
|
./configure -cc "gcc -m32" -as "as -a32" -aspp "gcc -m32 -c" \
|
|
|
|
-partialld "ld -r -m elf32ppc"
|
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
* On a OS X 10.5/Intel Core 2 or OS X 10.5/PowerPC host, to build a 64-bit
|
|
|
|
version of OCaml:
|
|
|
|
|
2013-06-15 01:18:50 -07:00
|
|
|
./configure -cc "gcc -m64"
|
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
* On OS X Intel, to build a 32-bit version of OCaml:
|
2015-09-22 02:21:31 -07:00
|
|
|
|
2014-05-30 06:05:01 -07:00
|
|
|
./configure -host "i386-apple-darwin13.2.0" -cc "gcc -arch i386 -m32" \
|
|
|
|
-as "as -arch i386" -aspp "gcc -arch i386 -m32 -c"
|
2013-06-15 01:18:50 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
* For Sun Solaris with the `acc` compiler:
|
2015-09-22 02:21:31 -07:00
|
|
|
|
1996-04-30 07:53:58 -07:00
|
|
|
./configure -cc "acc -fast" -libs "-lucb"
|
2007-10-30 05:37:16 -07:00
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
* For Sun Solaris on Sparc 64bit, to compile natively (32bit only)
|
2012-07-26 12:21:54 -07:00
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
./configure -cc "gcc -m32" -as "as -32" -aspp "gcc -m32 -c"
|
2007-10-30 05:37:16 -07:00
|
|
|
|
2016-04-07 07:16:32 -07:00
|
|
|
* For AIX 4.3 with the IBM compiler `xlc`:
|
1996-02-13 08:29:09 -08:00
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
./configure -cc "xlc_r -D_AIX43 -Wl,-bexpall,-brtl -qmaxmem=8192"
|
|
|
|
+
|
2016-04-07 07:16:32 -07:00
|
|
|
If something goes wrong during the automatic configuration, or if the generated
|
|
|
|
files cause errors later on, then look at the template files:
|
1996-02-13 08:29:09 -08:00
|
|
|
|
|
|
|
config/Makefile-templ
|
|
|
|
config/m-templ.h
|
|
|
|
config/s-templ.h
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
1996-02-13 08:29:09 -08:00
|
|
|
for guidance on how to edit the generated files by hand.
|
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
2. From the top directory, do:
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
make world
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
2016-04-07 07:19:31 -07:00
|
|
|
This builds the OCaml bytecode compiler for the first time. This phase is
|
|
|
|
fairly verbose; consider redirecting the output to a file:
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
make world > log.world 2>&1 # in sh
|
|
|
|
make world >& log.world # in csh
|
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
3. (Optional) To be sure everything works well, you can try to bootstrap the
|
|
|
|
system -- that is, to recompile all OCaml sources with the newly created
|
|
|
|
compiler. From the top directory, do:
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
make bootstrap
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
1995-09-03 08:22:54 -07:00
|
|
|
or, better:
|
|
|
|
|
|
|
|
make bootstrap > log.bootstrap 2>&1 # in sh
|
|
|
|
make bootstrap >& log.bootstrap # in csh
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
2016-04-07 07:19:31 -07:00
|
|
|
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 mean 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 fix-point.
|
|
|
|
|
|
|
|
4. If your platform is supported by the native-code compiler (as reported during
|
|
|
|
the auto-configuration), you can now build the native-code compiler. From
|
|
|
|
the top directory, do:
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
make opt
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
1995-09-03 08:22:54 -07:00
|
|
|
or:
|
2015-09-22 02:21:31 -07:00
|
|
|
|
1995-09-03 08:22:54 -07:00
|
|
|
make opt > log.opt 2>&1 # in sh
|
|
|
|
make opt >& log.opt # in csh
|
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
5. anchor:step-5[] Compile fast versions of the OCaml compilers, by compiling
|
|
|
|
them with the native-code compiler (you will have only compiled them to
|
|
|
|
bytecode in steps 2-4). Just do:
|
1997-11-17 02:39:01 -08:00
|
|
|
|
2003-07-22 00:51:43 -07:00
|
|
|
make opt.opt
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
2016-04-07 07:19:31 -07:00
|
|
|
Later, you can compile your programs to bytecode using ocamlc.opt instead of
|
|
|
|
ocamlc, and to native-code using ocamlopt.opt instead of ocamlopt. The ".opt"
|
|
|
|
compilers should run faster than the normal compilers, especially on large input
|
|
|
|
files, but they may take longer to start due to increased code size. If
|
|
|
|
compilation times are an issue on your programs, try the ".opt" compilers to see
|
|
|
|
if they make a significant difference.
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
2002-06-30 18:21:45 -07:00
|
|
|
An alternative, and faster approach to steps 2 to 5 is
|
|
|
|
|
|
|
|
make world.opt # to build using native-code compilers
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
2016-04-07 07:19:31 -07:00
|
|
|
The result is equivalent to `make world opt opt.opt`, but this may fail if
|
|
|
|
anything goes wrong in native-code generation.
|
1997-11-17 02:39:01 -08:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
6. You can now install the OCaml system. This will create the following commands
|
|
|
|
(in the binary directory selected during autoconfiguration):
|
|
|
|
+
|
|
|
|
[width="70%",frame="topbot",cols="25%,75%"]
|
|
|
|
|===============================================================================
|
|
|
|
| `ocamlc` | the batch bytecode compiler
|
|
|
|
| `ocamlopt` | the batch native-code compiler (if supported)
|
|
|
|
| `ocamlrun` | the runtime system for the bytecode compiler
|
|
|
|
| `ocamlyacc` | the parser generator
|
|
|
|
| `ocamllex` | the lexer generator
|
|
|
|
| `ocaml` | the interactive, toplevel-based system
|
|
|
|
| `ocamlmktop` | a tool to make toplevel systems that integrate user-defined C
|
|
|
|
primitives and OCaml code
|
|
|
|
| `ocamldebug` | the source-level replay debugger
|
|
|
|
| `ocamldep` | generator of "make" dependencies for OCaml sources
|
|
|
|
| `ocamldoc` | the documentation generator
|
|
|
|
| `ocamlprof` | the execution count profiler
|
|
|
|
| `ocamlcp` | the bytecode compiler in profiling mode
|
|
|
|
|===============================================================================
|
|
|
|
+
|
|
|
|
and also, if you built them during <<step-5,step 5>>: `ocamlc.opt`,
|
|
|
|
`ocamlopt.opt`, `ocamllex.opt`, `ocamldep.opt` and `ocamldoc.opt`
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
1996-09-19 06:01:01 -07:00
|
|
|
From the top directory, become superuser and do:
|
|
|
|
|
1997-02-23 08:29:36 -08:00
|
|
|
umask 022 # make sure to give read & execute permission to all
|
1996-09-19 06:01:01 -07:00
|
|
|
make install
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
7. Installation is complete. Time to clean up. From the toplevel directory,
|
|
|
|
do:
|
|
|
|
|
|
|
|
make clean
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
8. (Optional) The `emacs/` subdirectory contains Emacs-Lisp files for an OCaml
|
|
|
|
editing mode and an interface for the debugger. To install these files,
|
|
|
|
change to the `emacs/` subdirectory and do:
|
1997-02-23 08:29:36 -08:00
|
|
|
|
1997-06-12 08:23:31 -07:00
|
|
|
make EMACSDIR=<directory where to install the files> install
|
2015-09-22 02:21:31 -07:00
|
|
|
+
|
1997-02-23 08:29:36 -08:00
|
|
|
or
|
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
make install
|
|
|
|
+
|
1997-02-23 08:29:36 -08:00
|
|
|
In the latter case, the destination directory defaults to the
|
2016-04-07 07:19:31 -07:00
|
|
|
`site-lisp` directory of your Emacs installation.
|
1997-02-23 08:29:36 -08:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
9. After installation, do *not* strip the `ocamldebug` and `ocamlbrowser`
|
|
|
|
executables. These are mixed-mode executables (containing both compiled C
|
|
|
|
code and OCaml bytecode) and stripping erases the bytecode! Other
|
|
|
|
executables such as `ocamlrun` can safely be stripped.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
== IF SOMETHING GOES WRONG
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
Read the "common problems" and "machine-specific hints" section at the end of
|
|
|
|
this file.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
Check the files `m.h` and `s.h` in `config/`. Wrong endian-ness or alignment
|
|
|
|
constraints in `m.h` will immediately crash the bytecode interpreter.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
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 4M.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
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 which can uncover bugs in
|
|
|
|
optimizing compilers. Alternatively, try another C compiler (e.g. `gcc` instead
|
|
|
|
of the vendor-supplied `cc`).
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
You can also build a debug version of the runtime system. Go to the `byterun/`
|
|
|
|
directory and do `make ocamlrund`. Then, copy `ocamlrund` to
|
|
|
|
`../boot/ocamlrun`, and try again. This version of the runtime system contains
|
|
|
|
lots of assertions and sanity checks that could help you pinpoint the problem.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
|
|
|
|
2015-09-22 02:21:31 -07:00
|
|
|
== COMMON PROBLEMS
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* The Makefiles use the `include` directive, which is not supported by all
|
|
|
|
versions of make. Use GNU Make if this is a problem.
|
1995-09-08 01:55:12 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* Solaris make mishandles a space in our Makefiles, so you have to use GNU make
|
|
|
|
to build on Solaris.
|
2014-02-19 07:33:29 -08:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* The Makefiles assume that make executes 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`.
|
1995-09-03 08:22:54 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* On some systems, localization causes build problems. You should try to set
|
|
|
|
the C locale (`export LC_ALL=C`) before compiling if you have strange errors
|
|
|
|
while compiling OCaml.
|
2004-07-13 05:19:15 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* GCC 2.7.2.1 generates incorrect code for the runtime system in `-O` mode on
|
|
|
|
some Intel x86 platforms (e.g. Linux RedHat 4.1 and 4.2). If this causes a
|
|
|
|
problem, the solution is to upgrade to 2.7.2.3 or above.
|
1997-03-21 02:44:35 -08:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* Some versions of GCC 2.96 for the Intel x86 (as found in RedHat 7.2,
|
|
|
|
Mandrake 8.0 and Mandrake 8.1) generate incorrect code for the runtime system.
|
|
|
|
The `configure` script tries to work around this problem.
|
2003-07-22 00:51:43 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* 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`.
|
2013-09-04 08:12:37 -07:00
|
|
|
|
2016-04-07 07:19:31 -07:00
|
|
|
* Under OS X 10.6, with XCode 4.0.2, the `configure` script mistakenly detects
|
|
|
|
support for CFI directives in the assembler. Fix: give the `-no-cfi` option to
|
|
|
|
`configure`.
|