[R-SIG-Mac] symbol not found in flat namespace '___kmpc_critical'

Sparapani, Rodney r@p@r@p@ @end|ng |rom mcw@edu
Sat Apr 29 23:17:44 CEST 2023


Hi Gang:

After hours of debugging, I�m stuck and hoping that someone has an
idea of what the issue is here.  Any hints/tips/etc. are greatly appreciated!

I�m getting this error from my CRAN package, nftbart.  Right now, I�m
preparing for a new release: v1.6.  However, I�m stumped by this error
message that I get when installing with OpenMP.  Without OpenMP,
everything is fine; however, the package benefits greatly from OpenMP.

I am getting the same results for R 4.2.3 and 4.3.0 RC.  The source code is
on github at https://github.com/rsparapa/bnptools.git

So, to demonstrate, you just need to do something like this�


$ git clone https://github.com/rsparapa/bnptools.git DIR

$ cd DIR

$ R CMD build nftbart

$ R CMD INSTALL nftbart_1.6.tar.gz

* installing to library �/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library�

* installing *source* package �nftbart� ...

** using staged installation

checking whether the C++ compiler works... yes

checking for C++ compiler default output file name... a.out

checking for suffix of executables...

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C++ compiler... yes

checking whether clang++ -arch x86_64 -std=gnu++17 accepts -g... yes

checking for clang++ -arch x86_64 -std=gnu++17 option to support OpenMP... -lomp -Xclang -fopenmp

configure: creating ./config.status

config.status: creating src/Makevars

** libs

using C compiler: �Apple clang version 14.0.3 (clang-1403.0.22.14.1)�

using C++ compiler: �Apple clang version 14.0.3 (clang-1403.0.22.14.1)�

using SDK: ��

clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -lomp -Xclang -fopenmp -I'/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include' -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init.c -o init.o

clang++ -arch x86_64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -lomp -Xclang -fopenmp -I'/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include' -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c nftbart.cpp -o nftbart.o

clang++ -arch x86_64 -std=gnu++17 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o nftbart.so init.o nftbart.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation

installing to /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/00LOCK-nftbart/00new/nftbart/libs

** R

** data

** demo

** byte-compile and prepare package for lazy loading

** help

*** installing help indices

** building package indices

** testing if installed package can be loaded from temporary location

Error: package or namespace load failed for �nftbart� in dyn.load(file, DLLpath = DLLpath, ...):

 unable to load shared object '/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/00LOCK-nftbart/00new/nftbart/libs/nftbart.so':

  dlopen(/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/00LOCK-nftbart/00new/nftbart/libs/nftbart.so, 0x0006): symbol not found in flat namespace '___kmpc_critical'

Error: loading failed

Execution halted

ERROR: loading failed

* removing �/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/nftbart�

* restoring previous �/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/nftbart�

> sessionInfo()
R version 4.3.0 Patched (2023-04-27 r84338)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.2.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Chicago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.3.0
>

OpenMP Build: LLVM 14.0.6

$ codesign -d -vv /usr/local/lib/libomp.dylib

Executable=/usr/local/lib/libomp.dylib

Identifier=libomp

Format=Mach-O universal (x86_64 arm64)

CodeDirectory v=20400 size=6506 flags=0x0(none) hashes=198+2 location=embedded

Signature size=8977

Authority=Developer ID Application: Simon Urbanek (VZLD955F6P)

Authority=Developer ID Certification Authority

Authority=Apple Root CA

Timestamp=Feb 5, 2023 at 4:26:54 PM

Info.plist=not bound

TeamIdentifier=VZLD955F6P

Sealed Resources=none

Internal requirements count=1 size=168

--
Rodney Sparapani, Associate Professor of Biostatistics, He/Him/His
Director, Wisconsin Chapter of the American Statistical Association
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus

	[[alternative HTML version deleted]]



More information about the R-SIG-Mac mailing list