Closed danielinteractive closed 2 years ago
When running R CMD CHECK on one of our internal systems I got following warning:
* checking whether package ‘mmrm’ can be installed ... WARNING
Found the following significant warnings:
init.h:11:13: warning: ‘run_testthat_tests’ violates the C++ One Definition Rule [-Wodr]
See ‘/tmp/ansible._opQOYbuild/install_rpkgs_with_log/buildfiles/check/mmrm.Rcheck/00install.out’ for details.
It might be good to resolve it before CRAN submission
Interesting thanks @pawelru - did not see that yet
@pawelru if you still have it, can you maybe send me the log file (/tmp/ansible._opQOYbuild/install_rpkgs_with_log/buildfiles/check/mmrm.Rcheck/00install.out
) ? I am having a hard time to reproduce this :-) thx
This file is 4k+ lines long but I think it's this part:
init.h:11:13: warning: ‘run_testthat_tests’ violates the C++ One Definition Rule [-Wodr]
extern SEXP run_testthat_tests();
^
/opt/bee/share/nest-packages/2022_10_13/4.1.1/libs/testthat/include/testthat/testthat.h:165:17: note: type mismatch in parameter 1
extern "C" SEXP run_testthat_tests(SEXP use_xml_sxp) {
^
/opt/bee/share/nest-packages/2022_10_13/4.1.1/libs/testthat/include/testthat/testthat.h:165:17: note: type ‘struct SEXPREC *’ should match type ‘void’
/opt/bee/share/nest-packages/2022_10_13/4.1.1/libs/testthat/include/testthat/testthat.h:165:17: note: ‘run_testthat_tests’ was previously declared here
/usr/bin/nm: /tmp/ansible.CJ24uwbuild/install_rpkgs_with_log/buildfiles/check/mmrm.Rcheck/00_pkg_src/mmrm/src/mmrm.o: plugin needed to handle lto object
/usr/bin/nm: /tmp/ansible.CJ24uwbuild/install_rpkgs_with_log/buildfiles/check/mmrm.Rcheck/00_pkg_src/mmrm/src/test-runner.o: plugin needed to handle lto object
installing to /tmp/ansible.CJ24uwbuild/install_rpkgs_with_log/buildfiles/check/mmrm.Rcheck/00LOCK-mmrm/00new/mmrm/libs
Thanks Pawel, fortunately on CRAN pretest this did not come up ... I guess because LTO checks were not run. Investigating further now.
I think https://github.com/openpharma/mmrm/pull/139 fixes it
To do:
C++ One Definition Rule
- see below - cannot reproduce thisrun_testthat_tests
-> does not workfree_cores()
logic such that when on CRAN checks it always returns 1TMB
version required to1.9.1
(latest on CRAN)R CMD check --as-cran
passes flawlesslyNEWS