-
Notifications
You must be signed in to change notification settings - Fork 8
/
INSTALL
106 lines (85 loc) · 3.98 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
2 Installation
**************
QCheck is designed to work with various implementations of Standard ML.
At the time of release, it was built successfully on the following
systems:
* Standard ML of New Jersey v110.79 [built: Sat Nov 21 15:48:37 2015]
* Moscow ML compiler version 2.10
* MLton 20130715 (built Thu Nov 6 11:40:47 CET 2014 on alexander)
* Poly/ML 5.6 Release RTS version: X86_64-5.6
* SML# 3.0.1 (2016-04-04 22:16:17 JST) for x86_64-pc-linux-gnu with
LLVM 3.7.1
Inquiries and recommendations on improving compatibility are welcome.
The following sections provide simple installation instructions for each
system. A different 'Makefile' is supplied for each system, but in all
of them 'make all' will produce the library and/or a test program, while
'make test' will additionally run the test program. There is no 'make
install', you must copy the files to an appropriate location by hand.
All makefiles are currently dependent on GNU make.
2.1 SML/NJ
==========
For Standard ML of New Jersey, the CM library specification 'qcheck.cm'
should be all you need. The default target of 'make -f Makefile.nj'
will ask CM to build and stabilize this library. This creates a file
'.cm/x86-unix/qcheck.cm' (alter the arch/os tag as needed) which may be
copied into the standard CM library path and added to the 'pathconfig'.
If you have multiple installations of SML/NJ, you may specify which
one to use by providing its path on the 'make' command line, like this:
make -f Makefile.nj SML=~/nj49/bin/sml
2.2 Moscow ML
=============
Building for Moscow ML is a little trickier; I benefitted enormously
from the Mosmake system by Henning Makhlom. Typing
make -f Makefile.moscow
will generate a bunch of '.uo' and '.ui' files in the 'src/' directory.
To use them in an interactive setting, give the path as a '-I' argument
to 'mosml', like this:
% mosml -I src
load "QCheck";
-| > val it = () : unit
QCheck.pred;
-| > val 'a it = fn : ('a -> bool) -> 'a prop
Or, copy all the '.uo' and '.ui' files to a different directory, and
load them from there.
Using the library in compiled programs is more complex. Mosmake will
be a big help, but you will still need to figure out the dependencies to
particular modules within QCheck. Moscow ML does not currently have a
way to package together a set of object files into a single library.
In addition to the default target,
make -f Makefile.moscow all
creates a test program called 'compose' in the source directory, and the
'test' target additionally runs the test. You may specify the location
of the 'mosmlc' compiler on the command line, in case the one you want
to use is not first in your path:
make -f Makefile.moscow MOSMLC=~/mosml/bin/mosmlc
2.3 MLton
=========
MLton is a whole-program compiler, so you cannot install QCheck as a
library in the traditional sense. You may, however, compile its source
code along with your own to produce test programs. The QCheck license
(LGPL) permits incorporating the source even into proprietary programs.
The 'qcheck.cm' file is intended to be readable by MLton as well as
SML/NJ.
make -f Makefile.mlton all
will ask MLton to compile a test program called 'tests/tests'. As
always, the 'test' target will run the test program. You may specify
the path to the MLton compiler by setting the 'MLTON' variable on the
command line.
2.4 Poly/ML
===========
QCheck will also work with Poly/ML. In this case, there is nothing to
compile in advance, but 'PolyML.make' will work if run from the 'src/'
directory, like this:
OS.FileSys.chDir "src";
PolyML.make "QCheck";
See also the file 'tests/polytest.sml' for an example of how to use
QCheck from Poly/ML. Running
make -f Makefile.poly test
will execute the unit tests for Poly/ML.
2.5 SML#
========
QCheck will also work with SML#. SML# requires separate compilation
like below:
make -f Makefile.smlsharp
To use QCheck as a library from SML#, add '_require
"/path/to/qcheck.smi"' to your .smi files.