[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


Hi,
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:
_H5P_CLS_DATASET_CREATE_ID_g
  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 (
https://stackoverflow.com/questions/40922814/error-in-dyn-loaddllfile-unable-to-load-shared-object-expected-in-flat-na)
but I don't have a mix between cpp and plain c.

I think that probably has to do with my Makevars file (
https://community.rstudio.com/t/error-during-the-installation-of-utf8-package/4005/2)...
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:

CXX_STD = CXX11
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) `pkg-config --cflags gdal`
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
`pkg-config --libs gdal`

I will appreciate a hint,

Fabio.

-- 


	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list