Closed jangorecki closed 11 months ago
I have some difficulty reading and understanding this and may need more context. The
checking whether we are cross compiling... configure: error: in `/tmp/RtmpH1tiIN/R.INSTALL52ce3d4c4d4a/RcppArmadillo':
configure: error: cannot run C++ compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
ERROR: configuration failed for package ‘RcppArmadillo’
* removing ‘/home/jan/R/x86_64-redhat-linux-gnu-library/4.3/RcppArmadillo’
is very suspicious. Why would it a) test for cross compilation and b) fail? You are on a standard Linux system?
If so, please try the git
repo, re-run autoconf
and see if a newer configure
is better. This is solid 30+ year old technology that is used all over the place so I think something else may be going on. Note that BDR is also very forwaard looking in his use of GNU tools and Fedora itself and would have said something but I am still looking at sunnt skies at CRAN:
Thanks, will try. Yes it is standard Linux. Comparing to CRAN machines, I am on 39, CRAN is on 36. And most likely CRAN runs fedora server (or some other non-workstation flavor). And docker fedora:39 was working fine, so either related to my environment or fedora:39 workstation strictly.
I found same error for another pkg: https://github.com/astamm/nloptr/issues/45
Jan, don't get me wrong but I really think there is a 99.9% chance this is you. We are doing nothing special here.
Unless the gcc
people lost their mind and --host
is now required but then R would be borked, not RcppArmadillo
. We really just call R CMD ...
and friends.
(I had one very recent case of needing --host ...
but that was in an actual cross-compiling situation where @jeroen was doing his webr/wasm magic. For you with Linux-on-Linux this has a strong smell of 'your binary tools are hosed or confused'. But by all means let us try to sort this out. I am also the author of the nloptr
configure snippet so maybe I am behind the eightball and newer autoconf
needs a new variable I need to set?)
OK, I have found the root cause. Makevars
CFLAGS=-O3 -mtune=native
CXXFLAGS=-O3 -mtune=native
Commenting that out makes compilation succeed.
Closing issue then. At least if someone will get same error they will be able to find solution here.
Yeppers. Been there done that myself and now try to keep Makevars
simpler (though still use and love ccache
). So no worries. Glad it is all good now!
(Any idea though why R and gcc/g++ no longer like -mtune=native
?)
Nope
Tried CRAN and master, both got error, using R 4.3.2:
Tried from console and from inside R. In both cases
/tmp/R...
is not existing anymore.config.log
fileDouble checked against
cannot run C++ compiled programs
that I can compile and run cpp hello world.Not able to reproduce via docker fedora:39 (which most likely is no a "workstation" version).