- After Obtaining SPRNG source code:
- Change directory to the sprng directory. For example:
- SPRNG organization
- The main SPRNG directory, sprng, contains the following subdirectories:
- SRC contains the source code for the SPRNG libraries. The code for each generator is in a separate subdirectory. Code common to all the generators is in the SRC directory itself.
- EXAMPLES contains example C and FORTRAN programs that demonstrate the use of the SPRNG libraries.
- DOCS contains SPRNG documentations as a compressed tar file of several html documents. Please uncompress and untar them and see the toc.html file for the rest of the links. The SPRNG home page has links to the updated version of this documentation.
- TESTS contains source code for routines that test the quality of the random number generators.
- lib The SPRNG random number libraries will be placed here by default when you compile them.
- include The SPRNG header files are located here.
- Building the SPRNG libraries
- In order to build the SPRNG libraries, the example programs and the executables that test the quality of the random number generators, please edit the file make.CHOICES
The make.CHOICES file looks like this:
#PLAT = CONVEX PLAT = SGI #PLAT = SP2 #PLAT = T3E
If users wish to build SPRNG on the HP/Convex Exemplar, then they should comment out the line specifying the SGI and uncomment the line specifying the CONVEX as follows:
PLAT = CONVEX #PLAT = SGI #PLAT = SP2 #PLAT = T3E
Then, the make command will build the libraries using the compiler options set in the file SRC/make.CONVEX. The user may wish to edit this file if a different compiler or different compiler options are wanted. In particular, if a FORTRAN 77 compiler or ranlib is not available, please set F77 or RANLIB to 'echo' respectively.
Currently SPRNG has been tested on CRAY T3E, HP/CONVEX Exemplar, IBM SP2, SGI-CRAY Origin 2000 and SGI Power Challenge parallel computers. It has also been ported to HP and SUN workstations and PC running Linux. Please read the notes on the makefile to port SPRNG to other machines.
Alternatively, the subdirectories can be built individually by executing the make command in the desired subdirectory.
The compilation process includes a file called make.platform, depending on the platform. We have set certain variables based on their setting on our systems. If they differ on your system, please see our explanation for the makefile and make suitable changes.
By default, the SPRNG libraries are placed in the lib sub-directory. Along with the libraries, certain executables for timing the generators and for checking whether the generators ported correctly placed in the main sprng directory.
- Checking the libraries
- Once the SPRNG library has been built, the user should check that the library has indeed ported correctly. Please execute the following command in the directory sprng:
The output will give the results for the different SPRNG libraries and interfaces. All the tests should be PASSED. If any of the test FAILS, then SPRNG has not ported correctly. Please report this problem to us.
- Timing the libraries
- The user can check the speed of the different SPRNG random number generators by executing the following command in the directory sprng:
The output will give the time taken for generating a million random numbers, and also the number of random numbers generated per second, expressed in MRS (Million Random numbers per Second).