Closed johebll closed 4 years ago
Strange that this did not upset any of the (700+) test builds, twice, or any of the builds at CRAN. The three lines of which the first is listed above in the error are simply redundant, I will remove them in the next version. You could edit this by hand:
diff --git a/src/RcppArmadillo.cpp b/src/RcppArmadillo.cpp
index 831e6cc..7ed0f6d 100644
--- a/src/RcppArmadillo.cpp
+++ b/src/RcppArmadillo.cpp
@@ -23,10 +23,6 @@
using namespace Rcpp;
-const unsigned int arma::arma_version::major;
-const unsigned int arma::arma_version::minor;
-const unsigned int arma::arma_version::patch;
-
//' Report the version of Armadillo
//'
//' @details The version is defined by Armadillo in the header \code{arma_version.hpp}.
edd@rob:~/git/rcpparmadillo(master)$
You could also use an older version.
I have now fixed this in a commit (plus a minor follow-up clean-up commit for the same source) and placed a new minor revision 0.10.1.0.1 of the package into the Rcpp drat repo so by doing
install.packages("RcppArmadillo", repos="https://rcppcore.github.io/drat")
you get that fixed version that should not upset your (older, I supposed) compiler. Full log below.
edd@rob:~$ Rscript -e 'install.packages("RcppArmadillo", repos="https://rcppcore.github.io/drat")'
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://rcppcore.github.io/drat/src/contrib/RcppArmadillo_0.10.1.0.1.tar.gz'
Content type 'application/gzip' length 1552600 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
* installing *source* package ‘RcppArmadillo’ ...
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether ccache g++-10 accepts -g... yes
checking how to run the C++ preprocessor... ccache g++-10 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether ccache g++-10 accepts -g... (cached) yes
checking whether we have a suitable tempdir... /tmp
checking whether R CMD SHLIB can already compile programs using OpenMP... yes
checking LAPACK_LIBS... system LAPACK found
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
ccache g++-10 -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I../inst/include -fpic -g -O3 -Wall -pipe -Wno-ignored-attributes -Wno-unused -c RcppArmadillo.cpp -o RcppArmadillo.o
ccache g++-10 -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I../inst/include -fpic -g -O3 -Wall -pipe -Wno-ignored-attributes -Wno-unused -c RcppExports.cpp -o RcppExports.o
ccache g++-10 -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I../inst/include -fpic -g -O3 -Wall -pipe -Wno-ignored-attributes -Wno-unused -c fastLm.cpp -o fastLm.o
ccache g++-10 -std=gnu++11 -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs
** R
** inst
** 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 (RcppArmadillo)
The downloaded source packages are in
‘/tmp/RtmpbNVVeQ/downloaded_packages’
edd@rob:~$
Hello Dirk,
thank you a ton for helping so super quick!
Strange that this did not upset any of the (700+) test builds
Exactly, i also stumbled upon this when attempting to google it, with no substantial occurrences :-)
Your fix helped, it just worked for me! Thank you again.
Great. Remind me again what the compiler version on CentOS 7 is?
To me, and hindsight is 20/20 this was both a 'code nuisance' (I won't call it bug because it really just allocated three unused vars) which all other compilers appear to a) ignore and b) not warn about (which is odd, I do turn -Wall -pedantic
and whatnot on). So I am inclined to point fingers at an older g++
version...
CentOS 7 uses gcc 4.8, which is pretty ancient by now. While a vast majority of C++11 code is likely to work with gcc 4.8, support for C++11 in gcc 4.8 is buggy and/or incomplete, resulting in corner cases like this. The minimum recommended version of gcc is 5.4.
More recent versions of gcc can be used on CentOS 7 via Software Collections: https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/
CentOS 7 is overall quite old anyway, so it may be useful to upgrade to CentOS 8 at this stage. Full updates for RHEL 7 and CentOS 7 stopped on 2020-08-06.
I could have sworn it was a newer one than 4.8.* which is indeed "old". We had minimum compiler detection in the configure script too, I am surprised this passed it. Maybe it shouldn't have.
gcc/g++ 4.8.0 to 4.8.5 were released between 2013 and 2015. That is, to be frank, "dark ages" time. Sadly CentOS 7 is still pretty widely used -- but can be used with newer compilers too.
Hello Dirk,
sorry for being late. Can confirm what my predecessors already stated:
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
We have gcc7 installed in parallel, but leave the OS standard as default, ironically for the sake of stability ;-) We are in general on 8, but have to keep this specific (complex) installation on 7 due to dependenicies... EOL CentOS 7: 30 June 2024 ;-) Thank you again!
Thanks for circling back. We still have an explicit test in configure.ac
for an even older version (and it comes from many years ago) but the code got moved around and now the the 'do we have OpenMP or not' test dominates all. And, quite frankly, if I were to be hardnosed and imposed g++-5.*
I suspect I would hear lots of complainst.
But we really do prefer proper C++11 now so a newer compiler may be a good idea. There are some supported 'developer tools' for RH/CentOS with newer compilers (but I can't recall the exact name). Keep that in mind--there are supported alternatives.
I can confirm the issue with the current version on CRAN, and that this solution works. (I have gcc 4.8.5.)
Peter, not sure if you follow the (low-volume) rcpp-devel list but I regularly drop updated 'micro' (i.e. not CRAN) releases of both Rcpp and RcppArmadillo into the RcppCore drat repo so
R> install.packages("RcppArmadillo", repos="https://rcppcore.github.io/drat")
works and gets you 0.10.1.0.2. If you set the repo (and the drat
package has easy helper functions, doing it manually works of course too), then update.packages()
works the same way.
Thanks!
Dirk - thanks for all your work.
We use RcppArmadillo
in production - and are restricted to only being able to communicate with CRAN repos.
I noticed on the devel
list that you mentioned an out-of-order release is not in the works. Any possibility to reconsider this? Our platform is relatively inflexible and turning on enhanced collections or otherwise upgrading the compiler are not really an option, unfortunately.
Thanks again for all your work.
We use RcppArmadillo in production
Somone needs to take better care of the infrastructure at your end. If you want current software from CRAN, use current compilers and tools just like CRAN (and many of us do):
If you are bound by old equipment you could at least test with it. I make CRAN releases available as pre-releases for everybody to look at. And I have made new releases with the fixes. All you need is a one-line addition to your configurations.
PS Someone even came via StackOverflow with an even more ridiciluous example of failing on a cloud instance with R 3.4.* (!!) from 2017: https://stackoverflow.com/questions/64674494/how-to-install-rcpparmadillo-in-aws-emr-version-5-29
Sorry, but that is still a no.
Thanks Dirk:
Appreciate the quick response - sounds like the answer is no
.
Your notes about best practices make sense - we'll look to decoupling from RcppArmadillo.
I never recommend vendoring because I think it is a really bad solution but you could embed an older version of (Rcpp)Armadillo. Then the maintenance burden is yours, you don't get updates or bug fixes but it may work on your 'historic' equipment.
Otherwise: wait for the next release, or, as I suggested multiple times now use RcppArmadillo 0.10.1.0.2 from the drat repo
@detule - A new patch release of Armadillo is in the works, which should eventually be followed with a corresponding RcppArmadillo release.
Older releases are officially available from CRAN: https://cran.r-project.org/src/contrib/Archive/RcppArmadillo/
In your particular case, version 0.9.900.3.0 should work.
@conradsnicta Appreciate the note.
On our end we have built [R] packages that link to the C++ resources provided by RcppArmadillo. As far as I know, base [R]'s install.packages
does not have the facility to automatically reach into a CRAN Archive, even when one tries to limit to a desired version of RcppArmadillo via the "<=" operators in the appropriate fields of the DESCRIPTION fie.
Our users also range from very sophisticated to novice; for some instructions such as "install an older version of RcppArmadillo
form a CRAN Archive" is more than sufficient - for others not so much.
Of course there are many package management options available out there - some more sophisticated that allow for more creative solutions + hosted repositories + package freezing, but our eco system is limited (further complicated by automated deployments to Rstudio Connect, etcetra).
At any rate - I also appreciate your position and where you are coming from.
Thanks for circling back. We still have an explicit test in
configure.ac
for an even older version (and it comes from many years ago) but the code got moved around and now the the 'do we have OpenMP or not' test dominates all. And, quite frankly, if I were to be hardnosed and imposedg++-5.*
I suspect I would hear lots of complainst.But we really do prefer proper C++11 now so a newer compiler may be a good idea. There are some supported 'developer tools' for RH/CentOS with newer compilers (but I can't recall the exact name). Keep that in mind--there are supported alternatives.
@eddelbuettel - I know this issue is resolved, but I had one related question: We are using Centos7 but are using devtoolset-8 (g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3) ), via Makevars.site file but when I try to install it still fails. I think because we are not over writing the OS gcc, just changing it via the Makevars.site it fails. Is it possible to use Makevar.site to select the compiler instead of just using the complier found at command line?
Two things:
R.home("etc/Makeconf")
You need to ensure that variable in the latter reflect the updated values from the former. Maybe you need to add CXX11 alongside an existing CXX. It's been a while since I had the distinct "pleasure" of having to work on CentOS.
And I am going to lock this now. Everything that needed to be said about the non-bug (as far as CRAN is concerned) in RcppArmadillo has been said, and I provided an updated version for "exotic" systems such as CentOS. I don't get paid to support CentOS/RHEL, and get no benefit from it so I stop now.
For the rest there is the rcpp-devel mailing list where you may find other CentOS users.
Hello, i have issues with the installation/compilation of RcppArmadillo, when attempting to install it. Both, from CRAN or via BioCon, with the same error:
My versions are:
Is there any thing i can adjust to make it work?