Your code is falling victim to a change in gcc
that turned what had been a warning into an error. In short, you cannot define a global variable in multiple 'compilation units' anymore but have to define it just once and then use extern
to refer to it. (And Brian Ripley, who follows development version of gcc
and clang
had forced all CRAN maintainers with similar setups to make these changes way back in December 2019, several months before gcc-10
was released. We also had a similar need for change in Debian and Ubuntu when the default changed. It is a bit of a pain, but likely worth it...)
Now, there is an override for this: adding -fcommon
should help you here. See this page for details: https://gcc.gnu.org/gcc-10/porting_to.html
Edit: Indeed, quick proof is here:
edd@rob:/tmp/qtlbim(master)$ cat src/Makevars
PKG_CFLAGS = -fcommon
edd@rob:/tmp/qtlbim(master)$ ls -l src/*so
-rwxrwxr-x 1 edd edd 191400 Jan 24 12:09 src/qtlbim.so
edd@rob:/tmp/qtlbim(master)$ lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.10
Release: 20.10
Codename: groovy
edd@rob:/tmp/qtlbim(master)$
The last few lines of R CMD INSTALL .
end in
[... earlier lines and warnings omitted ...]
ccache gcc -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o qtlbim.so GlobalVars.o GlobalVars_SingleTrait.o MatrixUtils.o MultipleTraitsMCMC.o RMultipleTraitsMCMCSetup.o ROutputManager.o RSingleTraitMCMCSetup.o SingleTraitMCMC.o SingleTraitMCMCSamplingRoutines.o StatUtils.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-qtlbim/00new/qtlbim/libs
** R
** data
** demo
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (qtlbim)
edd@rob:/tmp/qtlbim(master)$
(and you can ignore that I use ccache
).
Edit 2: And having come this far I just made a minimal PR at your repo with that change. You may need to the same for src/Makevars.win
and should be able to just copy the file. You can test at win-builder or RHub.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…