You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-17Lines changed: 30 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,43 +26,56 @@ the C (and C++) compiler. Make sure you have installed the command-line utilitie
26
26
27
27
(Note: We assume a recent x64 processor. TestU01, in particular, does not easily build on some ARM-based systems.)
28
28
29
+
## Building
30
+
31
+
We use CMake as our build system. From the project root:
32
+
33
+
```
34
+
cmake -B build
35
+
cmake --build build
36
+
ctest --test-dir build
37
+
```
38
+
39
+
By default, the build compiles in Release mode and builds everything: speed benchmarks, unit tests, PractRand test harnesses, entropy test harnesses, and TestU01 test harnesses. TestU01 is built automatically from the included `testu01/TestU01.zip` archive.
40
+
41
+
### CMake options
42
+
43
+
| Option | Default | Description |
44
+
|--------|---------|-------------|
45
+
|`BUILD_SPEED`| ON | Speed benchmarks |
46
+
|`BUILD_UNIT`| ON | Unit tests |
47
+
|`BUILD_PRACTRAND`| ON | PractRand test harnesses |
48
+
|`BUILD_ENTROPY`| ON | Entropy test harnesses |
49
+
|`BUILD_TESTU01`| ON | TestU01 test harnesses (built from included archive) |
50
+
29
51
## Usage
30
52
31
-
You can run the tests by going to a bash shell (Terminal) and executing a few commands.
53
+
### Speed:
54
+
```
55
+
./build/speed/rng
56
+
```
32
57
33
-
####PractRand:
58
+
### PractRand:
34
59
```
35
60
cd practrand
36
61
./runtests.sh
37
62
```
38
63
39
64
The PractRand benchmark takes some time to complete because we analyze a large volume of random numbers.
40
65
41
-
####TestU01:
66
+
### TestU01:
42
67
```
43
68
cd testu01
44
69
./bigcrushall.sh
45
70
```
46
71
47
72
The TestU01 benchmark "big crush" (``bigcrushall.sh``) might take days. It outputs its results in the current
48
-
directory (``testu1``, but we copied already computed in the ``results`` subdirectory.
73
+
directory (``testu01``), but we copied already computed results in the ``results`` subdirectory.
49
74
A parallel version (``bigcrushallparallel.sh``) will test multiple generators at the same time, up to the number of detected CPU threads.
50
75
51
-
There are also extensive scripts that generate many (100) seeds and test generators, the script take
76
+
There are also extensive scripts that generate many (100) seeds and test generators, the scripts take
52
77
the form ``rand*.sh``, one per generator. They output their results in their ``longresults`` subdirectory.
53
78
54
-
#### Speed:
55
-
It is interesting to assess running speed as well. This can be done quickly:
56
-
57
-
```
58
-
cd speed
59
-
make
60
-
make test
61
-
```
62
-
63
-
Note that the speed tests assume a recent x64 processor (e.g., they would not work
64
-
on ARM processors).
65
-
66
79
## The contenders
67
80
68
81
- splitmix64 is a random number generator in widespread use and part of the standard Java API, we adapted a port to C produced by Vigna. It produces 64-bit numbers.
0 commit comments