Installation¶
MCMCLib is available as a compiled shared library, or as header-only library, for Unix-alike systems only (e.g., popular Linux-based distros, as well as macOS). Note that use of this library with Windows-based systems, with or without MSVC, is not supported.
Requirements¶
MCMCLib requires either the Armadillo or Eigen C++ linear algebra libraries. (Note that Eigen version 3.4.0 requires a C++14-compatible compiler.)
The following options should be declared before including the MCMCLib header files.
OpenMP functionality is enabled by default if the
_OPENMP
macro is detected (e.g., by invoking-fopenmp
with GCC or Clang).To explicitly enable OpenMP features, use:
#define MCMC_USE_OPENMP
To explicitly disable OpenMP functionality, use:
#define MCMC_DONT_USE_OPENMP
To use MCMCLib with Armadillo or Eigen:
#define MCMC_ENABLE_ARMA_WRAPPERS #define MCMC_ENABLE_EIGEN_WRAPPERS
Example:
#define MCMC_ENABLE_EIGEN_WRAPPERS #include "mcmc.hpp"
To use MCMCLib with RcppArmadillo:
#define MCMC_USE_RCPP_ARMADILLO
Example:
#define MCMC_USE_RCPP_ARMADILLO #include "mcmc.hpp"
Installation Method 2: Header-only Library¶
MCMCLib is also available as a header-only library (i.e., without the need to compile a shared library). Simply run configure
with the --header-only-version
option:
./configure --header-only-version
This will create a new directory, header_only_version
, containing a copy of MCMCLib, modified to work on an inline basis.
With this header-only version, simply include the header files (#include "mcmc.hpp
) and set the include path to the head_only_version
directory (e.g.,``-I/path/to/mcmclib/header_only_version``).