Skip to content

symbol not found in flat namespace '___kmpc_critical'

1 message · Simon Urbanek

#
Given some of the misinformation in this thread I have to clarify a few things for posterity.

Firstly, the issue was very simple one - the package failed to link the omp library which is required and documented at https://mac.r-project.org/openmp/ -- the required flags are:

PKG_CPPFLAGS='-Xclang -fopenmp'
PKG_LIBS=-lomp

and the latter was missing in the package.

Any code using OpenMP must link to the OpenMP run-time library which provides the actual implementation, otherwise it doesn't work.

Second, there are no special compilers required, but the Apple driver don't accept the -fopenmp flag so it has to be specified as above, essentially working around the driver removing it - which is why this is considered experimental.

Finally, the only officially supported way is to use OpenMP flags provided by R. However, the macOS R releases are not built with OpenMP support, because the run-time is not part of macOS and current R doesn't know about the work-arounds. That said, in order to prepare for a possible OpenMP support on macOS, the R 4.3.0 release includes the LLVM OpenMP run-time compatible with Xcode 14.2. This is intended as a stepping stone where the possibly of OpenMP support using Apple compilers is can be tested. R itself currently does not have a provision to leverage this "non-standard" support, but it could be added in the future.

Cheers,
Simon