programming

OpenMP support for TMB on Mac

Problem Up to Mac Catalina, by default, installing R packages with OpenMP support (e.g. data.table, TMB) has been compiled without it. For TMB codes, changes such as use parallel_accumulator() or include OpenMP’s headers and library, and add #pragma openmp parallel for before for loop in the likelihood calculation done after installing TMB from CRAN are not relevant – TMB was already compiled with _OPENMP flag undefined.