[R-pkg-devel] MacOS flat namespace

Bob Rudis bob @end|ng |rom rud@|@
Wed May 6 17:55:58 CEST 2020


Can you provide a bit more context? I just grabbed the pkg source from CRAN and it builds fine.


$ clang --version
Apple clang version 11.0.3 (clang-1103.0.32.59)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

─ Session info ───────────────────────────────────────────────────────────────────────────

 setting  value                                 
 version  R version 4.0.0 RC (2020-04-21 r78267)
 os       macOS Catalina 10.15.5                
 system   x86_64, darwin17.0                    
 ui       RStudio                               
 language (EN)                                  
 collate  en_US.UTF-8                           
 ctype    en_US.UTF-8                           
 tz       America/New_York                      
 date     2020-05-06                            

─ Packages ───────────────────────────────────────────────────────────────────────────────

 package     * version  date       lib source        
 assertthat    0.2.1    2019-03-21 [1] CRAN (R 4.0.0)
 backports     1.1.6    2020-04-05 [1] CRAN (R 4.0.0)
 bit         * 1.1-15.2 2020-02-10 [1] CRAN (R 4.0.0)
 bit64       * 0.9-7    2017-05-08 [1] CRAN (R 4.0.0)
 callr         3.4.3    2020-03-28 [1] CRAN (R 4.0.0)
 cli           2.0.2    2020-02-28 [1] CRAN (R 4.0.0)
 codetools     0.2-16   2018-12-24 [1] CRAN (R 4.0.0)
 crayon        1.3.4    2017-09-16 [1] CRAN (R 4.0.0)
 desc          1.2.0    2018-05-01 [1] CRAN (R 4.0.0)
 devtools    * 2.2.2    2020-02-17 [1] CRAN (R 4.0.0)
 digest        0.6.25   2020-02-23 [1] CRAN (R 4.0.0)
 ellipsis      0.3.0    2019-09-20 [1] CRAN (R 4.0.0)
 fansi         0.4.1    2020-01-08 [1] CRAN (R 4.0.0)
 fs            1.4.1    2020-04-04 [1] CRAN (R 4.0.0)
 glue          1.4.0    2020-04-03 [1] CRAN (R 4.0.0)
 lattice       0.20-41  2020-04-02 [1] CRAN (R 4.0.0)
 magrittr      1.5      2014-11-22 [1] CRAN (R 4.0.0)
 memoise       1.1.0    2017-04-21 [1] CRAN (R 4.0.0)
 pkgbuild      1.0.6    2019-10-09 [1] CRAN (R 4.0.0)
 pkgload       1.0.2    2018-10-29 [1] CRAN (R 4.0.0)
 prettyunits   1.1.1    2020-01-24 [1] CRAN (R 4.0.0)
 processx      3.4.2    2020-02-09 [1] CRAN (R 4.0.0)
 ps            1.3.2    2020-02-13 [1] CRAN (R 4.0.0)
 R6            2.4.1    2019-11-12 [1] CRAN (R 4.0.0)
 raster        3.1-5    2020-04-19 [1] CRAN (R 4.0.0)
 Rcpp          1.0.4.6  2020-04-09 [1] CRAN (R 4.0.0)
 remotes       2.1.1    2020-02-15 [1] CRAN (R 4.0.0)
 rgdal         1.4-8    2019-11-27 [1] CRAN (R 4.0.0)
 rlang         0.4.5    2020-03-01 [1] CRAN (R 4.0.0)
 rprojroot     1.3-2    2018-01-03 [1] CRAN (R 4.0.0)
 rstudioapi    0.11     2020-02-07 [1] CRAN (R 4.0.0)
 sessioninfo   1.1.1    2018-11-05 [1] CRAN (R 4.0.0)
 sp            1.4-1    2020-02-28 [1] CRAN (R 4.0.0)
 testthat      2.3.2    2020-03-02 [1] CRAN (R 4.0.0)
 uFTIR       * 0.1.1    2020-03-11 [1] CRAN (R 4.0.0)
 usethis     * 1.5.1    2019-07-04 [1] CRAN (R 4.0.0)
 withr         2.2.0    2020-04-20 [1] CRAN (R 4.0.0)

[1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

> On May 6, 2020, at 06:17, Fabio Corradini Santander <fabio.corradini using inia.cl> wrote:
> 
> 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]]
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list