[Bioc-devel] Problem building package with devtools+Rcpp

Sergi P elpicart at gmail.com
Wed Sep 27 11:56:02 CEST 2017


Hello everyone,

I have been struggling with problems building my package *diffuStats* a
The problem is related to the usage of Rcpp.
In my current machine, I am unable to build the *diffuStats* in the devel
bioconductor:

##############

> build()
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore
--quiet  \
 CMD build '/home/sergi/eraseme3/diffuStats' --no-resave-data --no-manual

* checking for file ‘/home/sergi/eraseme3/diffuStats/DESCRIPTION’ ... OK
* preparing ‘diffuStats’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to build vignettes
     -----------------------------------
* installing *source* package ‘diffuStats’ ...
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG
 -I"/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"
-I"/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/inc
lude"
-I"/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppParallel/include"
   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
-Wdate-time -D_FORTIFY_SOUR
CE=2 -g -c RcppExports.cpp -o RcppExports.o
In file included from
/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/armadillo:52:0,

                from
/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadilloForward.h:46,

                from
/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadillo.h:31,

                from RcppExports.cpp:4:
/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:474:96:
note: #pragma message: WARNING: use of OpenMP disabled; this compiler
doesn't support OpenMP 3.0+
  #pragma message ("WARNING: use of OpenMP disabled; this compiler doesn't
support OpenMP 3.0+")

                        ^

g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG
 -I"/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"
-I"/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/inc
lude"
-I"/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppParallel/include"
   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
-Wdate-time -D_FORTIFY_SOUR
CE=2 -g -c diffuse_parallel.cpp -o diffuse_parallel.o
In file included from
/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/armadillo:52:0,

                from
/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadilloForward.h:46,

                from
/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/RcppArmadillo.h:31,

                from diffuse_parallel.cpp:1:
/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:474:96:
note: #pragma message: WARNING: use of OpenMP disabled; this compiler
doesn't support OpenMP 3.0+
  #pragma message ("WARNING: use of OpenMP disabled; this compiler doesn't
support OpenMP 3.0+")

                        ^

gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG
 -I"/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"
-I"/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/inclu
de" -I"/home/sergi/R/x86_64-pc-linux-gnu-library/3.4/RcppParallel/include"
   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
-Wdate-time -D_FORTIFY_SOURCE
=2 -g  -c init.c -o init.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions
-Wl,-z,relro -o diffuStats.so RcppExports.o diffuse_parallel.o init.o
-L/usr/lib/R/lib -lR
installing to /tmp/RtmpRLy9NN/Rinst4d19c0dca4b/diffuStats/libs
** R
** data
*** moving datasets to lazyload DB
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘diffuStats’ in dyn.load(file,
DLLpath = DLLpath, ...):
unable to load shared object
'/tmp/RtmpRLy9NN/Rinst4d19c0dca4b/diffuStats/libs/diffuStats.so':
 /tmp/RtmpRLy9NN/Rinst4d19c0dca4b/diffuStats/libs/diffuStats.so: undefined
symbol: diffuStats_convertSparse
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/tmp/RtmpRLy9NN/Rinst4d19c0dca4b/diffuStats’
     -----------------------------------
ERROR: package installation failed
Error: Command failed (1)


However, this is successful when build(vignettes=FALSE)

##############

> sessionInfo()

##############

The local installation of Rcpp, RcppParallel, RcppArmadillo or devtools
seems to have something to do with it, because a machine with the following
configuration works just fine:

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS

Matrix products: default
BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0
LAPACK: /usr/lib/atlas-base/atlas/liblapack.so.3.0

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8       LC_NAME=C
[9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

loaded via a namespace (and not attached):
[1] compiler_3.4.1            tools_3.4.1
[3] RcppArmadillo_0.7.960.1.2 withr_2.0.0
[5] Rcpp_0.12.12              memoise_1.1.0
[7] digest_0.6.12             RcppParallel_4.3.20
[9] devtools_1.13.3


##############

If I try other actions, such as devtools::document or load_all:

Error in dyn.load(dllfile) :
 unable to load shared object
'/home/sergi/all/devel/rpackages/diffuStats/src/diffuStats.so':
 /home/sergi/all/devel/rpackages/diffuStats/src/diffuStats.so: undefined
symbol: diffuStats_convertSparse


Where convertSparse is the first function in the exported c++ functions

##############

I have tried addressing the OpenMP 3.0 warning without success.
However, I think the problem lies in the compilation.
I have updated the R version, also re-run

Rcpp::compileAttributes()

And the problem persists whatever I do. I might be missing something
obvious...

Any help will be appreciated,
__________________________________________________
__________________________________________________

	[[alternative HTML version deleted]]



More information about the Bioc-devel mailing list