Closed barracuda156 closed 4 months ago
One has not needed Rcpp:::LdFlags()
for at least a decade and we deprecated it a long time ago (git blame
says 2018 for this):
You can easily find other references for the deprecation. You should report and/or fix packages that still use it (such as minqa
). They don't need to, and have not for a decade+. I plan to close this.
Also:
Ok, thank you, this is helpful. We can get rid of these locally in the worst case. Let's close the issue, since it must be fixed of packages' side.
Also note that the woes appear to be local to your builds so this may by an X-Y problem in hiding. Under Ubuntu:
edd@rob:~$ Rscript -e 'print(Rcpp:::LdFlags())'
NULL
edd@rob:~$ Rscript --version
Rscript (R) version 4.4.0 (2024-04-24)
edd@rob:~$
Trust me that we would have heard from CRAN if we broke stuff systematically.
@eddelbuettel It returns this for me:
36-170% Rscript -e 'print(Rcpp:::LdFlags())'
WARNING: too small maximum for v(ector heap)size '0' ignored, the current usage 64M is already larger
WARNING: too small maximum for v(ector heap)size '0' ignored, the current usage 64M is already larger
NULL
But this just appeared in R 4.4.0. So pretty likely it is a bug in R
itself. (Of course it is not something we would add from Macports side.)
You may want to look into file R/RcppLdPath.R
and debug a little.
## Provide linker flags -- i.e. -L/path/to/libRcpp -- as well as an
## optional rpath call needed to tell the Linux dynamic linker about the
## location. This is not needed on OS X where we encode this as library
## built time (see src/Makevars) or Windows where we use a static library
## Updated Jan 2010: We now default to static linking but allow the use
## of rpath on Linux if static==FALSE has been chosen
## Note that this is probably being called from LdFlags()
## Updated Nov 2013: We no longer build a library. This should be deprecated.
RcppLdFlags <- function() {
#.Deprecated(msg=paste("This function is now deprecated as it has not",
# "been needed since 2013."))
""
}
#... stuff omitted ...
## LdFlags defaults to static linking on the non-Linux platforms Windows and OS X
LdFlags <- function() {
cat(RcppLdFlags())
}
If these function calls fail you may have other problems. And you don't have to feel obliged to keep me in the loop here.
The warnings originate from here in R-4.4.0/src/main/startup.c
:
static void SetSize(R_size_t vsize, R_size_t nsize)
{
char msg[1024];
Rboolean sml;
/* vsize > 0 to catch long->int overflow */
if (vsize < 1000 && vsize > 0) {
R_ShowMessage("WARNING: vsize ridiculously low, Megabytes assumed\n");
vsize *= (R_size_t) Mega;
}
if((sml = vsize < Min_Vsize) || vsize > Max_Vsize) {
snprintf(msg, 1024,
"WARNING: %s v(ector heap)size '%lu' ignored,"
" using default = %gM\n",
sml ? "too small" : "too large",
(unsigned long) vsize, R_VSIZE / Mega);
R_ShowMessage(msg);
R_VSize = R_VSIZE;
} else
R_VSize = vsize;
if((sml = nsize < Min_Nsize) || nsize > Max_Nsize) {
snprintf(msg, 1024,
"WARNING: %s language heap (n)size '%lu' ignored,"
" using default = %ld\n",
sml ? "too small" : "too large", (unsigned long) nsize, R_NSIZE);
R_ShowMessage(msg);
R_NSize = R_NSIZE;
} else
R_NSize = nsize;
}
static void SetMaxSize(R_size_t vsize, R_size_t nsize)
{
char msg[1024];
if (!R_SetMaxVSize(vsize)) {
/* vsfac is still 1 */
snprintf(msg, 1024,
"WARNING: too small maximum for v(ector heap)size '%lu' ignored,"
" the current usage %gM is already larger\n",
(unsigned long) vsize, R_VSize / Mega);
R_ShowMessage(msg);
}
if (!R_SetMaxNSize(nsize)) {
snprintf(msg, 1024,
"WARNING: too small maximum for language heap (n)size '%lu' ignored,"
" the current usage '%lu' is already larger\n",
(unsigned long) nsize, (unsigned long) R_NSize);
R_ShowMessage(msg);
}
}
f these function calls fail you may have other problems. And you don't have to feel obliged to keep me in the loop here.
Got it. Thank you, your help is appreciated, and I am not commenting here further. We can handle it.
@eddelbuettel Could you please help a bit here? I am not sure it is a bug in
Rcpp
itself, since this issue arose withR
4.4.0. Specifically,$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"
does not work correctly, and adds parts ofR
textual warnings as arguments for the linker, which obviously cannot work. So now packages which rely onRcpp:::LdFlags
fail to build.With gcc:
With clang:
I tried both
Rcpp
1.0.12 and 1.0.11, no change, so it is not introduced recently for sure. However, what changed fromR
side is an introduction of these warnings:While the issue is seen only on 32-bit archs, I think the error has nothing to do with bitness as such, it is just
R
does not generate those warnings on 64-bit. What I do not know is whether it was an implicit issue withRcpp
which never shown up until this change, or a bug in the new release ofR
.Any suggestions are greatly appreciated, I can test on my end. See also: https://trac.macports.org/ticket/69849