Bug 17331 - Inappropriate implicit variable setting in ~/.R/Makevars macOS recommendation within R Installation and Administration Manual
Summary: Inappropriate implicit variable setting in ~/.R/Makevars macOS recommendation...
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Documentation (show other bugs)
Version: R 3.4.1
Hardware: Other OS X El Capitan
: P5 normal
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2017-08-26 15:28 UTC by James J Balamuta
Modified: 2017-08-26 15:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James J Balamuta 2017-08-26 15:28:43 UTC
Within Section 6.3.2: macOS packages of the R Installation and Administration (
https://cran.r-project.org/doc/manuals/r-release/R-admin.html#macOS-packages ), the recommendation is made to use:

```bash
CC = /usr/local/clang4/bin/clang
CXX = /usr/local/clang4/bin/clang++
CFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXXFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXX11 = $CXX
CXX14 = $CXX
CXX17 = $CXX
CXX1X = $CXX
```

However, this will generate the following error:

/bin/sh: XX: command not found
make: *** [file91e37f2852ce.o] Error 127
XX -std=gnu++11

Since the implicit variable $CXX is not able to be set. If one were to switch over to using $(CXX) from $CXX. Another error would be triggered with a more intense error message:

/Users/ronin/.R/Makevars:6: *** Recursive variable `CXX' references itself (eventually).  Stop.

The only way to fix this error is to explicitly list the paths to the compiler for each CXX standard. e.g.


```bash
CC = /usr/local/clang4/bin/clang
CXX = /usr/local/clang4/bin/clang++
CFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXXFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXX11 = /usr/local/clang4/bin/clang++
CXX14 = /usr/local/clang4/bin/clang++
CXX17 = /usr/local/clang4/bin/clang++
CXX1X = /usr/local/clang4/bin/clang++
```