[R-pkg-devel] MacOS flat namespace

Fabio Corradini Santander |@b|o@corr@d|n| @end|ng |rom |n|@@c|
Wed May 6 12:17:41 CEST 2020

Two months ago I released a package I developed in Debian 9 GCC (
https://CRAN.R-project.org/package=uFTIR). The package was accepted on
CRAN, and it can be installed on Windows and Linux machines. However, it is
not working on MacOS. I don't know why. The problem starts after the
installation, as the OS cannot load the compiled code. Cutting the long
paths of CRAN, the problem looks like (for r-oldrel-osx-x86_64):

** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘uFTIR’ in dyn.load(file,
DLLpath = DLLpath, ...):
 unable to load shared object '.../libs/uFTIR.so':
  dlopen(.../libs/uFTIR.so, 6): Symbol not found:
  Referenced from: .../libs/uFTIR.so
  Expected in: flat namespace
 in .../libs/uFTIR.so
Error: loading failed
(The missing symbol for r-release-osx-x86_64 is a different
one: _jpeg_resync_to_restart)

I saw this thread (https://github.com/RcppCore/RcppArmadillo/issues/224)
about Rcpp, but CRAN is not using gcc, but clang, so it is not really the
same... although I was lost when they discussed about libc++ and libstdc++.

I also saw this thread from stackoverflow (
but I don't have a mix between cpp and plain c.

I think that probably has to do with my Makevars file (
maybe I shouldn't use PKG_LIBS and LDLIBS instead? But if I change it, how
will it affect the -already successful- installations on windows and linux?

The Makevars for Mac and Linux is:

PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) `pkg-config --cflags gdal`
`pkg-config --libs gdal`

I will appreciate a hint,



	[[alternative HTML version deleted]]

More information about the R-package-devel mailing list