mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
Minor clean-ups and fixes for README files.
Documentation/README*:
As above.
This commit is contained in:
@@ -52,12 +52,11 @@ can build programs such as `hello.m` or `calculator.m` in the [samples](samples)
|
|||||||
directory.
|
directory.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cd samples
|
mmc --grade csharp --make hello
|
||||||
$ mmc ---grade csharp --make hello
|
|
||||||
```
|
```
|
||||||
|
|
||||||
When building programs with the `csharp` grade you *must* use `mmc --make`; using
|
When building programs with the `csharp` grade you *must* use `mmc --make`.
|
||||||
`mmake` to build programs using the `csharp` grade is _not_ supported.
|
Using `mmake` to build programs using the `csharp` grade is _not_ supported.
|
||||||
|
|
||||||
Running `csharp` grade programs with Mono
|
Running `csharp` grade programs with Mono
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
@@ -72,7 +71,7 @@ It will then invoke then CLI execution environment on the process assembly.
|
|||||||
You can run the program using wrapper shell script, for example:
|
You can run the program using wrapper shell script, for example:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ ./hello
|
./hello
|
||||||
```
|
```
|
||||||
|
|
||||||
Running `csharp` grade programs on Windows with .NET
|
Running `csharp` grade programs on Windows with .NET
|
||||||
|
|||||||
@@ -58,8 +58,7 @@ build programs such as `hello.m` or `calculator.m` in the [samples](samples)
|
|||||||
directory.
|
directory.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cd samples
|
mmc --grade java --make hello
|
||||||
$ mmc --grade java --make hello
|
|
||||||
```
|
```
|
||||||
|
|
||||||
When building programs with the `java` grade you *must* use `mmc --make`; using
|
When building programs with the `java` grade you *must* use `mmc --make`; using
|
||||||
@@ -71,7 +70,7 @@ Running programs with the `java` grade
|
|||||||
You can run the `hello` program from the previous section by doing:
|
You can run the `hello` program from the previous section by doing:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ ./hello
|
./hello
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that `hello` is a simple shell script generated by the Mercury compiler
|
Note that `hello` is a simple shell script generated by the Mercury compiler
|
||||||
@@ -239,7 +238,7 @@ information. You can include local variable debugging information by specifying
|
|||||||
`--target-debug` when invoking the Mercury compiler. For example:
|
`--target-debug` when invoking the Mercury compiler. For example:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ mmc --grade java --target-debug --make <progname>
|
mmc --grade java --target-debug --make <progname>
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then use the `jdb` debugging tool, which comes as part of the Java SDK
|
You can then use the `jdb` debugging tool, which comes as part of the Java SDK
|
||||||
@@ -269,15 +268,15 @@ However, if you want to give it a try, the required steps are:
|
|||||||
|
|
||||||
4. Build the dependencies using the following command:
|
4. Build the dependencies using the following command:
|
||||||
|
|
||||||
$ mmake --use-mmc-make depend GRADE=java
|
mmake --use-mmc-make depend GRADE=java
|
||||||
|
|
||||||
5. Compile using the following command:
|
5. Compile using the following command:
|
||||||
|
|
||||||
$ mmake --use-mmc-make GRADE=java
|
mmake --use-mmc-make GRADE=java
|
||||||
|
|
||||||
6. To install the Java version of the compiler, do:
|
6. To install the Java version of the compiler, do:
|
||||||
|
|
||||||
$ mmake --use-mmc-make install GRADE=java
|
mmake --use-mmc-make install GRADE=java
|
||||||
|
|
||||||
The Java version of the compiler MUST be built using `mmake`'s `--use-mmc-make`
|
The Java version of the compiler MUST be built using `mmake`'s `--use-mmc-make`
|
||||||
option; the build will not work otherwise. Setting the variable `GRADE` in the
|
option; the build will not work otherwise. Setting the variable `GRADE` in the
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ To build a 32-bit Mercury compiler on 64-bit Linux, follow these steps:
|
|||||||
(2) Ensure that you have a working Mercury compiler in your PATH
|
(2) Ensure that you have a working Mercury compiler in your PATH
|
||||||
to bootstrap from.
|
to bootstrap from.
|
||||||
|
|
||||||
(3) Run aclocal -I m4; autoconf as normal. Then invoke configure
|
(3) Run aclocal -I m4; autoconf as normal. Then invoke configure
|
||||||
as follows:
|
as follows:
|
||||||
|
|
||||||
$ ./configure --host=i686-pc-linux-gnu --with-cc="gcc -m32"
|
$ ./configure --host=i686-pc-linux-gnu --with-cc="gcc -m32"
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ Mercury should build and install "out-of-the-box" on Linux for AArch64.
|
|||||||
Low-level C grades using non-local gotos, i.e. `asm_fast.*`, do not work
|
Low-level C grades using non-local gotos, i.e. `asm_fast.*`, do not work
|
||||||
with GCC 9 or later. Non-PIC (position-independent code) actually does
|
with GCC 9 or later. Non-PIC (position-independent code) actually does
|
||||||
still work, but PIC is commonly the default.
|
still work, but PIC is commonly the default.
|
||||||
If you require a low-level C grade, please use a `reg.*` grade.
|
If you require a low-level C grade, then please use a `reg.*` grade.
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ In either case, to use MSVC as the C compiler with Mercury, invoke `configure`
|
|||||||
as follows:
|
as follows:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ ./configure --with-cc=cl [--with-msvcrt] [<any other options>]
|
./configure --with-cc=cl [--with-msvcrt] [<any other options>]
|
||||||
```
|
```
|
||||||
|
|
||||||
The `--with-msvcrt` flag causes executables built with this install of Mercury
|
The `--with-msvcrt` flag causes executables built with this install of Mercury
|
||||||
@@ -101,20 +101,25 @@ with a drive letter, except that you must use `/` instead of `\` as a directory
|
|||||||
separator. For example, this is acceptable:
|
separator. For example, this is acceptable:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ ./configure --prefix="c:/where/to/install/mercury"
|
./configure --prefix="c:/where/to/install/mercury"
|
||||||
```
|
```
|
||||||
|
|
||||||
but this is not:
|
but this is not:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ ./configure --prefix="c:\where\to\install\mercury"
|
./configure --prefix="c:\where\to\install\mercury"
|
||||||
```
|
```
|
||||||
|
|
||||||
Once `configure` has successfully finished, then you should do
|
Once `configure` has successfully finished, then you should do
|
||||||
|
|
||||||
```
|
```
|
||||||
$ make
|
make
|
||||||
$ make install
|
```
|
||||||
|
|
||||||
|
and then
|
||||||
|
|
||||||
|
```
|
||||||
|
make install
|
||||||
```
|
```
|
||||||
|
|
||||||
as normal.
|
as normal.
|
||||||
@@ -165,7 +170,7 @@ The MSVC port currently has a number of limitations:
|
|||||||
and also enable the commented out definition of `CFLAGS_FOR_DEBUG` in
|
and also enable the commented out definition of `CFLAGS_FOR_DEBUG` in
|
||||||
`configure.ac` (in the `msvc*` case). You will then need to regenerate
|
`configure.ac` (in the `msvc*` case). You will then need to regenerate
|
||||||
the `configure` script and rebuild the Mercury system.
|
the `configure` script and rebuild the Mercury system.
|
||||||
(See [INSTALL.git](Install.git) for details of how to do this.)
|
(See [../INSTALL.git](Install.git) for details of how to do this.)
|
||||||
|
|
||||||
Post-installation configuration
|
Post-installation configuration
|
||||||
-------------------------------
|
-------------------------------
|
||||||
@@ -229,13 +234,13 @@ Then ensure that the directory that you wish to install into is mounted
|
|||||||
somewhere, i.e.
|
somewhere, i.e.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ mount //foo/usr/local /temp_mount_point
|
mount //foo/usr/local /temp_mount_point
|
||||||
```
|
```
|
||||||
|
|
||||||
and then use that mount point as the location to install into
|
and then use that mount point as the location to install into
|
||||||
|
|
||||||
```
|
```
|
||||||
$ make install INSTALL_PREFIX=/temp_mount_point
|
make install INSTALL_PREFIX=/temp_mount_point
|
||||||
```
|
```
|
||||||
|
|
||||||
This avoids the problem that `mkdir -p //foo/usr/local/xxx` fails.
|
This avoids the problem that `mkdir -p //foo/usr/local/xxx` fails.
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Building Mercury for Windows on Linux
|
|||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
Alternatively, you can cross-compile Mercury on Linux with a MinGW
|
Alternatively, you can cross-compile Mercury on Linux with a MinGW
|
||||||
cross-compiler. See [README.cross.md](README.cross.md).
|
cross-compiler. See [README.cross.md](README.cross.md).
|
||||||
|
|
||||||
Using Mercury on Windows
|
Using Mercury on Windows
|
||||||
------------------------
|
------------------------
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ Versions of LLVM (the underlying compiler infrastructure used by `clang`) before
|
|||||||
about version 2.9 contain bugs that require most C compiler optimizations to be
|
about version 2.9 contain bugs that require most C compiler optimizations to be
|
||||||
disabled when compiling Mercury generated C code with `clang` (i.e. the
|
disabled when compiling Mercury generated C code with `clang` (i.e. the
|
||||||
generated C files have to be compiled at `-O0`). If you are using a more recent
|
generated C files have to be compiled at `-O0`). If you are using a more recent
|
||||||
version of LLVM then the `configure` script will automatically enable a higher
|
version of LLVM, then the `configure` script will automatically enable a higher
|
||||||
level of optimization.
|
level of optimization.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Cross-compiling Mercury with GCC or clang
|
Cross-compiling Mercury with GCC or clang
|
||||||
========================================
|
=========================================
|
||||||
|
|
||||||
You can cross-compile the Mercury system with GCC or with clang so that the
|
You can cross-compile the Mercury system with GCC or with clang so that the
|
||||||
Mercury installation will run on a different platform from your host system.
|
Mercury installation will run on a different platform from your host system.
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Macs using macOS 10.9 onwards.
|
|||||||
The `asm_fast*` and `reg*` grades are only available on 64-bit Intel systems
|
The `asm_fast*` and `reg*` grades are only available on 64-bit Intel systems
|
||||||
and only when using GCC version 4.3 or later as the C compiler.
|
and only when using GCC version 4.3 or later as the C compiler.
|
||||||
|
|
||||||
If `clang` is being used as the C compiler then the only low-level C grades
|
If `clang` is being used as the C compiler, then the only low-level C grades
|
||||||
available are the `none*` grades. The high-level C, Java and C# grades
|
available are the `none*` grades. The high-level C, Java and C# grades
|
||||||
all work. The C# grades require the Mono .NET implementation.
|
all work. The C# grades require the Mono .NET implementation.
|
||||||
(See [README.CSharp.md](README.CSharp.md) for further details.)
|
(See [README.CSharp.md](README.CSharp.md) for further details.)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ Tracing Levels
|
|||||||
2. `--ssdb-trace shallow`
|
2. `--ssdb-trace shallow`
|
||||||
|
|
||||||
All the procedures in the interface of the module will generate events
|
All the procedures in the interface of the module will generate events
|
||||||
of trace level `shallow`. Events of trace level `shallow` are only
|
of trace level `shallow`. Events of trace level `shallow` are only
|
||||||
displayed if the parent procedure in the call stack is compiled in
|
displayed if the parent procedure in the call stack is compiled in
|
||||||
trace level `deep`.
|
trace level `deep`.
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ the environment variable `SSDB` beforehand.
|
|||||||
ssdb>
|
ssdb>
|
||||||
```
|
```
|
||||||
|
|
||||||
If you set `SSDB=0` then you will need to explicitly enable the debugger later
|
If you set `SSDB=0`, then you will need to explicitly enable the debugger later
|
||||||
in your code by calling `ssdb.enable_debugging/2`.
|
in your code by calling `ssdb.enable_debugging/2`.
|
||||||
|
|
||||||
As in `mdb`, the three numbers are the event number, call sequence number (CSN)
|
As in `mdb`, the three numbers are the event number, call sequence number (CSN)
|
||||||
@@ -95,7 +95,7 @@ Limitations
|
|||||||
* The `retry` command works by executing forwards until reaching the end of
|
* The `retry` command works by executing forwards until reaching the end of
|
||||||
the call to retry, then recursively calling that procedure. Any side
|
the call to retry, then recursively calling that procedure. Any side
|
||||||
effects of continuing execution will be visible. If it is not possible to
|
effects of continuing execution will be visible. If it is not possible to
|
||||||
reach the end of the procedure to retry, the program will simply keep
|
reach the end of the procedure to retry, then the program will simply keep
|
||||||
executing. Press ^C to get back the debugger prompt.
|
executing. Press ^C to get back the debugger prompt.
|
||||||
|
|
||||||
* When running on Mono 2.8 and earlier, ^C can cause the program to hang.
|
* When running on Mono 2.8 and earlier, ^C can cause the program to hang.
|
||||||
|
|||||||
Reference in New Issue
Block a user