There are two ways to use the ParaMonte library from C/C++/Fortran languages on Windows operating systems (OS):
- the fast way: using the prebuilt ParaMonte libraries for Windows, or,
- the long way: building ParaMonte from scratch on your system.
Using the prebuilt ParaMonte library
This is the fast way. Simply download the prebuilt ParaMonte libraries for Windows from the release page of the ParaMonte repository on GitHub for the configuration of your choice. If you are not familiar with the naming convention used for the ParaMonte library files, refer to the pre-installation notes before continuing.
Using the ParaMonte library prebuilt via the Intel compiler suite
If you still do not know which library configuration is the most appropriate for your needs, we recommend downloading and using the ParaMonte libraries prebuilt via the Intel compilers (even if you are using the GNU compilers to build your applications),
for usage from the C programming languages:
libparamonte_c_windows_x64_intel_release_shared_heap for serial simulations.
libparamonte_c_windows_x64_intel_release_shared_heap_impi.zip for MPI-parallel simulations via the Intel MPI library.
for usage from the C++ programming languages:
libparamonte_cpp_windows_x64_intel_release_shared_heap.zip for serial simulations.
libparamonte_cpp_windows_x64_intel_release_shared_heap_impi.zip for MPI-parallel simulations via the Intel MPI library.
for usage from the Fortran programming language:
libparamonte_fortran_windows_x64_intel_release_shared_heap.zip for serial simulations.
libparamonte_fortran_windows_x64_intel_release_shared_heap_impi.zip for MPI-parallel simulations via the Intel MPI library.
Building the ParaMonte library locally on your system
This is the long way. Despite the scary name, the entire build process is super-straightforward and fully-automated. Currently, building the ParaMonte library from scratch minimally requires the Intel Parallel Studio installed on your system.
Steps to build the ParaMonte library on Windows:
Download and install the Intel Parallel Studio 2019 or newer on your system.Note: The Intel Parallel Studio and compilers are available free of charge to all students, teachers, and open-source software developers. Most recently Intel has made its entire suite of HPC compilers freely available to everyone.
Follow the instructions here for a proper installation.
If the installation is done properly, you should be able to find and open the dedicated command-line interface of Intel Parallel Studio from the Windows startup menu, just as shown in the image below, with the only difference that the compiler version will be the version that you have downloaded.
Download the latest source release of the ParaMonte source code from GitHub and unzip it via the Windows Explorer.
- Open the command-line interface of the Intel Parallel Studio as shown in the above figure and change the directory to the folder containing the ParaMonte GitHub repository folder that you just downloaded and unzipped.
Tip: When you open an instance of the command-line, the default directory is on the drive where the software is installed, typically a path like
. If the directory containing the ParaMonte source files is on a drive (e.g.,
D:) other than the software installation drive (e.g.,
C:), you will have to first change the drive letter on the command line and then change the directory to your target folder. For example, to switch from a folder on the
C:drive to a folder on the
D:drive, you have to first change the drive like the following,
> d: D:\>
Call the Batch installation script
install.baton the command-line interface with the desired flags:
To speed up the build, you can specify the type of library you want to build by any of the following flags:
Usage: install.bat --lang <languages> --build <build types> --lib <library types> --par <parallelism types> --mem <array memory allocation choices> --nproc <# of processes> Example: install.bat --lang C/C++/Fortran --build release --lib static/shared --mem heap --par none/mpi --nproc 3 Flag definitions: --build : the ParaMonte library build types. Possible values: release, testing, debug --lang : the ParaMonte library language choices to build for. Possible values (case-insensitive): C/C++/Fortran/MATLAB/Python --lib : the ParaMonte library type. Possible values: static, shared (or equivalently, dynamic) --par : the ParaMonte library parallelism type. Possible values: none mpi cafsingle cafshared --mem : the ParaMonte library memory type for array allocations. Possible values: stack heap --test : the ParaMonte library test type: none, basic, sampler, all If basic, only the auxiliary non-sampler routines will be tested. If sampler, the ParaMonte sampler routines will be tested. If all, then all tests will be performed. The default is none. --exam_enabled : the ParaMonte library example runs enabled? Possible values: true, false. If true, exmaples will be run where possible. --matdram : enables the ParaMonte MatDRAM MATLAB library build. If specified, it will disable all other specified flags. --nproc : the default number of processes on which the ParaMonte examples/tests (if any) will be run. Possible values: positive integers --clean : clean the environmental variables upon exit. Possible values: true, false. Only one can be specified. The default is true. --matdram : build the ParaMonte MatDRAM MATLAB library and do nothing else. --help : help with the script usage NOTE: All flags are optional. NOTE: Use the forward-slash character / to separate multiple values for a single flag. NOTE: Use only one white-space character to separate flags and values from each other. NOTE: For any option that is not specified, the build will be done for all of the possible options of the flag. NOTE: Some values of some of the flags are inconsistent with each other. For example: NOTE: Coarray Fortran parallelism "--par cafsingle/cafshared" cannot be specified along with shared library "--lib shared". NOTE: Coarray Fortran parallelism "--par cafsingle/cafshared" cannot be specified along with C/MATLAB/Python languages "--lang C/MATLAB/Python". NOTE: Heap memory allocation "--mem heap" cannot be specified along with static library "--lib static".Tip: If you are not sure which build would be the most appropriate for your usage, we recommend the following configuration for serial ParaMonte simulations,
install.bat --lang LANGUAGE --build release --lib shared --mem heap --par noneand,
install.bat --lang LANGUAGE --build release --lib shared --mem heap --par mpifor MPI-parallel ParaMonte simulations, wherein both cases, you will have to replace the word LANGUAGE with the programming language of your choice: C (to build the ParaMonte C library), C++ (to build the ParaMonte C++ library), Fortran (to build the ParaMonte Fortran library), MATLAB (to build the ParaMonte MATLAB library), or Python (to build the ParaMonte Python library).
For example, to build the ParaMonte Python library in release mode for both serial and parallel applications, try,
install.bat --lang python --build release --par none/mpi
or, to build the ParaMonte MATLAB library in release mode for both serial and parallel applications, try,
install.bat --lang matlab --build release --par none/mpi
or, to build shared ParaMonte C/C++ libraries in release mode for both serial and MPI-parallel applications, try,
install.bat --lang C --lib shared --mem heap --par none/mpi --build release
or, to build a static ParaMonte Fortran library in both release and debug modes, with Coarray shared-memory parallelism enabled, for both heap and stack memory allocations, try,
install.bat --lang Fortran --lib static --par cafshared --mem stack/heap --build debug/release
or, to build the ParaMonte MatDRAM MATLAB library, try,
install.bat --matdramImportant: Note that multiple values specified for a build flag are always separated by a forward-slash
/character, as in the examples above.
You can also simply try,
to build the ParaMonte library for all possible configurations for all supported languages.Warning: Calling the
install.batscript with no flags will build the entire ParaMonte library for all three build modes (
debug) for all interface languages that are currently supported (
Python, ... ) for all parallelization modes (
cafshared) for the two types of memory allocations (
heap) for the two different library types (
shared). Depending on your system specifications, this can be a very lengthy process, typically taking a few hours or more to finish.Note: If you’d like to see a build flag that is not currently provided in the above list of flags, (for example, the type of or the method of linking against the compiler libraries), please let us know and we will try to add the requested features to the installation scripts in a new release of the ParaMonte library.
install.batscript initiates the build process and generates a folder named
buildin the root directory of the ParaMonte repository which will contain all build files. The final library files together with the example scripts will be installed in a separate folder named
binin the same root directory of the ParaMonte project that you have downloaded from GitHub.
- Congrats! You have now built and (locally) installed the ParaMonte library for the configuration and language(s) of your choice on your system. Check out the two new folders
binthat have been automatically created by the install script in the root directory of the uncompressed ParaMonte repository that you have downloaded. Inside the
bindirectory, you will see all the different build subdirectories corresponding to the different ParaMonte library build configurations. For example,
install.bat --lang C++ --build release --lib shared --mem heap --par mpi -s intel
will generate the following subdirectory,
install.bat --lang C++ --build release --lib shared --mem heap --par mpi -s gnu
will generate either of the following subdirectories,
in the bin directory of the ParaMonte library, depending on the existing MPI library installed on the system (Intel MPI vs. MPICH vs. OpenMPI). Any of these subdirectories contains the ParaMonte library files along with an example simulation source file and a build-script that can build the example to generate the executable, as well as a
README.mdfile explaining how to build the supplied example.