[R-pkg-devel] Request for assistance: error in installing on Debian (undefined symbol: omp_get_num_procs) and note in checking the HTML versions (no command 'tidy' found, package 'V8' unavailable)
D
A
I
4 messages ·
Dirk Eddelbuettel, Annaig De-Walsche, Ivan Krylov
Dear R-package-devel Community,
I hope this email finds you well. I am reaching out to seek assistance regarding package development in R.
Specifically, I am currently developing an R package for querying composite hypotheses using Rccp. While my package can be installed correctly on my local computer (Windows), I have encountered some issues installing on Debian Linux, R-devel, GCC ASAN/UBSAN. The corresponding error message is below. I have no problems installing on Fedora Linux, R-devel, clang, gfortran or Ubuntu Linux 20.04.1 LTS, R-release, GCC. You will find attached my package.
Additionally, I obtained some notes checking the HTML versions of the manual on all platforms that say:
Skipping checking HTML validation: no command 'tidy' found
Skipping checking math rendering: package 'V8' unavailable
I have searched through the available documentation and resources, but I still need help understanding the error and note messages. Hence, I am turning to this community, hoping that some of you have encountered similar issues.
Thank you very much for considering my request. I would be grateful if anyone could provide me with some help.
Best regards,
Anna?g De Walsche
Quantitative Genetics and Evolution unit of INRAE
Gif-sur-Yvette, France
Installing package into ?/home/docker/R?
(as ?lib? is unspecified)
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cloud.r-project.org
* installing *source* package ?qch? ...
** using staged installation
** libs
using C++ compiler: ?g++ (Debian 13.2.0-7) 13.2.0?
using C++11
g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I'/home/docker/R/Rcpp/include' -I'/home/docker/R/RcppArmadillo/include' -I/usr/local/include -fpic -g -O2 -Wall -pedantic -mtune=native -c RcppExports.cpp -o RcppExports.o
g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I'/home/docker/R/Rcpp/include' -I'/home/docker/R/RcppArmadillo/include' -I/usr/local/include -fpic -g -O2 -Wall -pedantic -mtune=native -c updatePrior_rcpp.cpp -o updatePrior_rcpp.o
updatePrior_rcpp.cpp:55: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
55 | #pragma omp parallel num_threads(threads_nb)
|
updatePrior_rcpp.cpp:65: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
65 | #pragma omp for
|
updatePrior_rcpp.cpp:92: warning: ignoring ?#pragma omp critical? [-Wunknown-pragmas]
92 | #pragma omp critical
|
updatePrior_rcpp.cpp:178: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
178 | #pragma omp parallel num_threads(threads_nb)
|
updatePrior_rcpp.cpp:190: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
190 | #pragma omp for
|
updatePrior_rcpp.cpp:289: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
289 | #pragma omp parallel num_threads(threads_nb)
|
updatePrior_rcpp.cpp:301: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
301 | #pragma omp for
|
updatePrior_rcpp.cpp:341: warning: ignoring ?#pragma omp critical? [-Wunknown-pragmas]
341 | #pragma omp critical
|
updatePrior_rcpp.cpp:409: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
409 | #pragma omp parallel num_threads(threads_nb)
|
updatePrior_rcpp.cpp:423: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
423 | #pragma omp for
|
updatePrior_rcpp.cpp:527: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
527 | #pragma omp parallel num_threads(threads_nb)
|
updatePrior_rcpp.cpp:539: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
539 | #pragma omp for
|
updatePrior_rcpp.cpp:580: warning: ignoring ?#pragma omp critical? [-Wunknown-pragmas]
580 | #pragma omp critical
|
g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o qch.so RcppExports.o updatePrior_rcpp.o -L/usr/local/lib/R/lib -lRlapack -L/usr/local/lib/R/lib -lRblas -lgfortran -lm -lubsan -lquadmath -L/usr/local/lib/R/lib -lR
installing to /home/docker/R/00LOCK-qch/00new/qch/libs
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cloud.r-project.org
Note: wrong number of arguments to '!='
Note: wrong number of arguments to '<'
Note: wrong number of arguments to '>'
** help
*** installing help indices
** building package indices
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cloud.r-project.org
** testing if installed package can be loaded from temporary location
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cloud.r-project.org
Error: package or namespace load failed for ?qch? in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/docker/R/00LOCK-qch/00new/qch/libs/qch.so':
/home/docker/R/00LOCK-qch/00new/qch/libs/qch.so: undefined symbol: omp_get_num_procs
Error: loading failed
Execution halted
ERROR: loading failed
* removing ?/home/docker/R/qch?
Warning message:
In i.p(...) :
installation of package ?/tmp/RtmpKcHSZQ/file1371d2b1944/qch_2.0.2.tar.gz? had non-zero exit status
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cloud.r-project.org
On 21 March 2024 at 09:26, Annaig De-Walsche wrote:
| Dear R-package-devel Community,
|
| I hope this email finds you well. I am reaching out to seek assistance regarding package development in R.
|
| Specifically, I am currently developing an R package for querying composite hypotheses using Rccp.
My preferred typo. The package is actually called Rcpp (pp as in plus-plus).
| Skipping checking HTML validation: no command 'tidy' found
| Skipping checking math rendering: package 'V8' unavailable
|
| I have searched through the available documentation and resources, but I still need help understanding the error and note messages. Hence, I am turning to this community, hoping that some of you have encountered similar issues.
|
| Thank you very much for considering my request. I would be grateful if anyone could provide me with some help.
|
| Best regards,
| Anna?g De Walsche
| Quantitative Genetics and Evolution unit of INRAE
| Gif-sur-Yvette, France
|
Could you share with us which actual Docker container you started?
| Installing package into ?/home/docker/R?
| (as ?lib? is unspecified)
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| * installing *source* package ?qch? ...
| ** using staged installation
| ** libs
| using C++ compiler: ?g++ (Debian 13.2.0-7) 13.2.0?
| using C++11
| g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I'/home/docker/R/Rcpp/include' -I'/home/docker/R/RcppArmadillo/include' -I/usr/local/include -fpic -g -O2 -Wall -pedantic -mtune=native -c RcppExports.cpp -o RcppExports.o
| g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I'/home/docker/R/Rcpp/include' -I'/home/docker/R/RcppArmadillo/include' -I/usr/local/include -fpic -g -O2 -Wall -pedantic -mtune=native -c updatePrior_rcpp.cpp -o updatePrior_rcpp.o
| updatePrior_rcpp.cpp:55: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 55 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:65: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 65 | #pragma omp for
| |
| updatePrior_rcpp.cpp:92: warning: ignoring ?#pragma omp critical? [-Wunknown-pragmas]
| 92 | #pragma omp critical
| |
| updatePrior_rcpp.cpp:178: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 178 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:190: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 190 | #pragma omp for
| |
| updatePrior_rcpp.cpp:289: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 289 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:301: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 301 | #pragma omp for
| |
| updatePrior_rcpp.cpp:341: warning: ignoring ?#pragma omp critical? [-Wunknown-pragmas]
| 341 | #pragma omp critical
| |
| updatePrior_rcpp.cpp:409: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 409 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:423: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 423 | #pragma omp for
| |
| updatePrior_rcpp.cpp:527: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 527 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:539: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 539 | #pragma omp for
| |
| updatePrior_rcpp.cpp:580: warning: ignoring ?#pragma omp critical? [-Wunknown-pragmas]
| 580 | #pragma omp critical
| |
You seem to be using a number of OpenMP directives. That is good and
performant. But OpenMP cannot be assumed as given; some OSs more or less skip
it alltogether, some platforms or compilers may not have it. I ran into the
same issue earlier trying to test something with clang on Linux, it would not
find the OpenMP library gcc happily finds. I moved on in that (local) use case.
In short you probably want to condition your use.
| g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o qch.so RcppExports.o updatePrior_rcpp.o -L/usr/local/lib/R/lib -lRlapack -L/usr/local/lib/R/lib -lRblas -lgfortran -lm -lubsan -lquadmath -L/usr/local/lib/R/lib -lR
| installing to /home/docker/R/00LOCK-qch/00new/qch/libs
| ** R
| ** data
| *** moving datasets to lazyload DB
| ** byte-compile and prepare package for lazy loading
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| Note: wrong number of arguments to '!='
| Note: wrong number of arguments to '<'
| Note: wrong number of arguments to '>'
| ** help
| *** installing help indices
| ** building package indices
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| ** testing if installed package can be loaded from temporary location
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| Error: package or namespace load failed for ?qch? in dyn.load(file, DLLpath = DLLpath, ...):
| unable to load shared object '/home/docker/R/00LOCK-qch/00new/qch/libs/qch.so':
| /home/docker/R/00LOCK-qch/00new/qch/libs/qch.so: undefined symbol: omp_get_num_procs
Related. You query a helper function from OpenMP. You could consider to make this
conditional and just return 1L (i.e. single-threaded) when there is no OpenMP.
In short, this seems to be caused by your package not coping with a more
restricted environment.
Amicalement, Dirk
| Error: loading failed
| Execution halted
| ERROR: loading failed
| * removing ?/home/docker/R/qch?
| Warning message:
| In i.p(...) :
| installation of package ?/tmp/RtmpKcHSZQ/file1371d2b1944/qch_2.0.2.tar.gz? had non-zero exit status
| >
| >
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| > library(qch)
| Error in library(qch) : there is no package called ?qch?
| Execution halted
| Build step 'Execute shell' marked build as failure
| Pinging https://builder.r-hub.io/build/FAILURE/qch_2.0.2.tar.gz-4a652faedad6484c9dcd1f44db057f72/2024-03-20T19:25:45Z
| {"status":"ok"}
| Finished: FAILURE
|
| x[DELETED ATTACHMENT qch_2.0.2.tar.gz, application/x-gzip]
| ______________________________________________
| R-package-devel at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-package-devel
dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
On 21 March 2024 at 09:26, Annaig De-Walsche wrote:
| Dear R-package-devel Community,
|
| I hope this email finds you well. I am reaching out to seek assistance regarding package development in R.
|
| Specifically, I am currently developing an R package for querying composite hypotheses using Rccp.
My preferred typo. The package is actually called Rcpp (pp as in plus-plus).
| Skipping checking HTML validation: no command 'tidy' found
| Skipping checking math rendering: package 'V8' unavailable
|
| I have searched through the available documentation and resources, but I still need help understanding the error and note messages. Hence, I am turning to this community, hoping that some of you have encountered similar issues.
|
| Thank you very much for considering my request. I would be grateful if anyone could provide me with some help.
|
| Best regards,
| Anna?g De Walsche
| Quantitative Genetics and Evolution unit of INRAE
| Gif-sur-Yvette, France
|
Could you share with us which actual Docker container you started?
In fact, I obtain this error message when I am running the rhub::check_for_cran() function. Here is the complete message: https://builder.r-hub.io/status/original/qch_2.0.2.tar.gz-4a652faedad6484c9dcd1f44db057f72
| Installing package into ?/home/docker/R?
| (as ?lib? is unspecified)
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| * installing *source* package ?qch? ...
| ** using staged installation
| ** libs
| using C++ compiler: ?g++ (Debian 13.2.0-7) 13.2.0?
| using C++11
| g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I'/home/docker/R/Rcpp/include' -I'/home/docker/R/RcppArmadillo/include' -I/usr/local/include -fpic -g -O2 -Wall -pedantic -mtune=native -c RcppExports.cpp -o RcppExports.o
| g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I'/home/docker/R/Rcpp/include' -I'/home/docker/R/RcppArmadillo/include' -I/usr/local/include -fpic -g -O2 -Wall -pedantic -mtune=native -c updatePrior_rcpp.cpp -o updatePrior_rcpp.o
| updatePrior_rcpp.cpp:55: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 55 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:65: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 65 | #pragma omp for
| |
| updatePrior_rcpp.cpp:92: warning: ignoring ?#pragma omp critical? [-Wunknown-pragmas]
| 92 | #pragma omp critical
| |
| updatePrior_rcpp.cpp:178: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 178 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:190: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 190 | #pragma omp for
| |
| updatePrior_rcpp.cpp:289: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 289 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:301: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 301 | #pragma omp for
| |
| updatePrior_rcpp.cpp:341: warning: ignoring ?#pragma omp critical? [-Wunknown-pragmas]
| 341 | #pragma omp critical
| |
| updatePrior_rcpp.cpp:409: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 409 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:423: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 423 | #pragma omp for
| |
| updatePrior_rcpp.cpp:527: warning: ignoring ?#pragma omp parallel? [-Wunknown-pragmas]
| 527 | #pragma omp parallel num_threads(threads_nb)
| |
| updatePrior_rcpp.cpp:539: warning: ignoring ?#pragma omp for? [-Wunknown-pragmas]
| 539 | #pragma omp for
| |
| updatePrior_rcpp.cpp:580: warning: ignoring ?#pragma omp critical? [-Wunknown-pragmas]
| 580 | #pragma omp critical
| |
You seem to be using a number of OpenMP directives. That is good and
performant. But OpenMP cannot be assumed as given; some OSs more or less skip
it alltogether, some platforms or compilers may not have it. I ran into the
same issue earlier trying to test something with clang on Linux, it would not
find the OpenMP library gcc happily finds. I moved on in that (local) use case.
In short you probably want to condition your use.
Thank you for the clarification. If ever I condition the use of OpenMD directives, users will indeed be capable of installing the package, but they wont access to a performant version of the code, as it necessitates the use of OpenMD. Is there a method to explicitly express that the use of OpenMD is highly encouraged?
| g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o qch.so RcppExports.o updatePrior_rcpp.o -L/usr/local/lib/R/lib -lRlapack -L/usr/local/lib/R/lib -lRblas -lgfortran -lm -lubsan -lquadmath -L/usr/local/lib/R/lib -lR
| installing to /home/docker/R/00LOCK-qch/00new/qch/libs
| ** R
| ** data
| *** moving datasets to lazyload DB
| ** byte-compile and prepare package for lazy loading
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| Note: wrong number of arguments to '!='
| Note: wrong number of arguments to '<'
| Note: wrong number of arguments to '>'
| ** help
| *** installing help indices
| ** building package indices
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| ** testing if installed package can be loaded from temporary location
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| Error: package or namespace load failed for ?qch? in dyn.load(file, DLLpath = DLLpath, ...):
| unable to load shared object '/home/docker/R/00LOCK-qch/00new/qch/libs/qch.so':
| /home/docker/R/00LOCK-qch/00new/qch/libs/qch.so: undefined symbol: omp_get_num_procs
Related. You query a helper function from OpenMP. You could consider to make this
conditional and just return 1L (i.e. single-threaded) when there is no OpenMP.
In practical, how to know from R code if OpenMP is present or not?
In short, this seems to be caused by your package not coping with a more
restricted environment.
Amicalement, Dirk
Merci encore, amicalement, Anna?g
| Error: loading failed
| Execution halted
| ERROR: loading failed
| * removing ?/home/docker/R/qch?
| Warning message:
| In i.p(...) :
| installation of package ?/tmp/RtmpKcHSZQ/file1371d2b1944/qch_2.0.2.tar.gz? had non-zero exit status
| >
| >
| 'getOption("repos")' replaces Bioconductor standard repositories, see
| 'help("repositories", package = "BiocManager")' for details.
| Replacement repositories:
| CRAN: https://cloud.r-project.org
| > library(qch)
| Error in library(qch) : there is no package called ?qch?
| Execution halted
| Build step 'Execute shell' marked build as failure
| Pinging https://builder.r-hub.io/build/FAILURE/qch_2.0.2.tar.gz-4a652faedad6484c9dcd1f44db057f72/2024-03-20T19:25:45Z
| {"status":"ok"}
| Finished: FAILURE
|
| x[DELETED ATTACHMENT qch_2.0.2.tar.gz, application/x-gzip]
| ______________________________________________
| R-package-devel at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-package-devel
--
dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
? Thu, 21 Mar 2024 18:32:59 +0000
Annaig De-Walsche <annaig.de-walsche at inrae.fr> ?????:
If ever I condition the use of OpenMD directives, users will indeed
be capable of installing the package, but they wont access to a
performant version of the code, as it necessitates the use of OpenMD.
Is there a method to explicitly express that the use of OpenMD is
highly encouraged?
I think the most practical method would be to produce a
packageStartupMessage() from the .onAttach function of your package if
you detect that the package has been compiled without OpenMP support:
https://cran.r-project.org/doc/manuals/R-exts.html#Load-hooks
In practical, how to know from R code if OpenMP is present or not?
Your C code will have to detect it and provide this information to the
R code. WRE 1.6.4 says:
[C]heck carefully that you have followed the advice in the
subsection on OpenMP support [WRE 1.2.1.1]. In particular, any use
of OpenMP in C/C++ code will need to use
#ifdef _OPENMP
# include <omp.h>
#endif
<https://cran.r-project.org/doc/manuals/R-exts.html#Portable-C-and-C_002b_002b-code>
Similarly, any time you use #pragma omp ... or call
omp_set_num_threads(), it needs to be wrapped in #ifdef _OPENMP ...
#endif.
Additionally, it is important to make sure that during tests and
examples, your OpenMP code doesn't use more than two threads:
https://cran.r-project.org/web/packages/policies.html
This is in place because CRAN checks are run in parallel, and a package
that tries to helpfully use all of the processor cores would interfere
with other packages being checked at the same time.
[[alternative HTML version deleted]]
This mailing list removes HTML e-mails. If you compose your messages in
HTML, we only get the plain text version automatically prepared by your
mailer:
https://stat.ethz.ch/pipermail/r-package-devel/2024q1/010595.html
In order to preserve the content and the presentation of your messages,
it's best to compose them in plain text.