SPRNG for Microsoft Windows and NAADSM

The Scalable Parallel Pseudo Random Number Generators Library, or SPRNG, is a random number generator produced by researchers at Florida State University. SPRNG version 2.0a is the random number generator used in NAADSM (NAADSM).

The original source code for SPRNG 2.0a (available at http://sprng.cs.fsu.edu) does not compile under Microsoft Windows, and contains a header file (pmlcg/longlong.h) that causes problems when compiled on at least some Linux distributions. The version of SPRNG built for the NAADSM project corrects (or at least works around) these problems.

Building & installing SPRNG

The "Quick start" installation instructions provided on the SPRNG website apply to the NAADSM version of SPRNG, with a few minor exceptions as noted below.

To build the SPRNG library on Microsoft Windows, use the MinGW implementation of GCC (while a SPRNG library can be built with Cygwin, such a library is incompatible with other Win32 applications). In make.CHOICES, select WINMINGW as the platform.

As an alternative to compiling from source code, you may wish to download a binary version of the SPRNG library for Microsoft Windows. This package includes a dynamically linked version of the library (sprng.dll) with an import file (sprng.lib), a statically linked version (libsprng.a), and all required C header files.

Using the SPRNG library

Please see the SPRNG home page for detailed documentation regarding its use.

Changes to the Microsoft Windows version of SPRNG

MPI (the message passing interface used for parallel processing) is not available with this Windows build of SPRNG: while this would seem to defeat the primary purpose of SPRNG, it does allow identical source code to be used for an application that will run either on Microsoft Windows or in a Linux/UNIX parallel processing environment. (A more enterprising programmer could probably produce a version of SPRNG with parallel processing capabilities for Windows, if it were necessary.)

The option to use the GNU Multiple Precision Arithmetic Library (libgmp.a) is not available in this Windows build. At least one version of libgmp for Windows does exist, but we have so far been unable to produce a working version of SPRNG on Windows that uses it.

One source file had to be changed in order to build SPRNG on Windows: cputime.c includes the header file <sys/resource.h>, which is unavailable in MinGW. If the WINMINGW platform is selected, cputime.c is compiled without this header. It is not entirely clear what effect this has on SPRNG, but it does not seem to affect the tests included with the SPRNG source code (except for the tests of the libgmp-dependent pmlcg generator).