Is there an easy way to figure out the compiler used to compile R? Something like
$ R CMD which_compiler_was_used
GCC
Or from inside of R
> Sys.compiler()
[1] "GCC"
I know R CMD SHLIB somehow does the magic...
4.1) helps you to Edit, Run and Share your Rscript Code directly from your browser. This development environment provides you version R v3.
Open command prompt (Type “cmd” in search box). 8. Type “gcc –version” in command prompt to check whether C compiler is installed in your machine. Type “g++ –version” in command prompt to check whether C++ compiler is installed in your machine.
comment section from the binary to find the version string. Use objdump and add --section to specify section name. For example, if your compiled a program named foo in the source dir, you can run the following commands to get GCC's version info: $ objdump -s --section .
I wouldn't say its easy, but you can use the shell function of GNU make to execute a shell command like gcc --version and then use the ifeq conditional expression to check the version number and set your CFLAGS variable appropriately. Save this answer. Show activity on this post. Save this answer.
Try this:
R CMD config CC
When I try it I get this:
gcc -m64
Note: Issue the R CMD config
command without CC
to find out about other information that it can provide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With