# Rstan installation on MacOS Mojave

**URL:** <https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406>\
**Category:** Interfaces\
**Created:** [November 8, 2018, 6:46am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406 "2018-11-08T06:46:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 6:46am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/1 "2018-11-08T06:46:37Z")

</div>

Operating System: MacOS Mojave (10.14.1)  
Interface Version: 2.18.1  
Compiler/Toolkit: Xcode 10.1

Since I updated my OS to MacOS Mojave, rstan stopped working.

I tried re-installing it from scratch, but I cannot succeed in installing the macOS _R_ toolchain.  
IIn fact, I downloaded the installer from the release page. I tried a few times but kept getting the error.

![04](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/4/4df52fa127489c2e0b2d2cf1a194d6181a8d0b1d.jpeg)

Anyone knows how can I fix it? I was even considering downgrading my OS because none of the fixes suggested around work for me.

Best,  
Marco

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 8, 2018, 6:48am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/2 "2018-11-08T06:48:30Z")

</div>

> [@mtliuzza](#):
>
> I was even considering downgrading my OS because none of the fixes suggested around work for me.

Not necessary to downgrade an OS. If you have Xcode installed, we can get it to work until the macOS toolchain is updated for Mojave.

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 7:04am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/3 "2018-11-08T07:04:09Z")

</div>

I have Xcode 10.1 installed, but the compiler is not working anyway.

Indeed, when I run this codeI fail to get 10:  
`fx &lt;- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , ' return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ; ' ) fx( 2L, 5 ) # should be 10`

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 8, 2018, 7:04am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/4 "2018-11-08T07:04:36Z")

</div>

What do you get?

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 7:05am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/5 "2018-11-08T07:05:28Z")

</div>

This:

> fx ← inline::cxxfunction( signature(x = “integer”, y = “numeric” ) , ’

- return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;
- 

```
                       ' )

```

In file included from file50dd5fdfd554.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/usr/local/clang4/bin/…/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file50dd5fdfd554.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/usr/local/clang4/bin/…/include/c++/v1/cmath:316:9: error: no member named ‘isinf’ in the global namespace  
using ::isinf;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:317:9: error: no member named ‘isnan’ in the global namespace  
using ::isnan;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:318:9: error: no member named ‘isnormal’ in the global namespace  
using ::isnormal;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:319:9: error: no member named ‘isgreater’ in the global namespace  
using ::isgreater;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:320:9: error: no member named ‘isgreaterequal’ in the global namespace  
using ::isgreaterequal;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:321:9: error: no member named ‘isless’ in the global namespace  
using ::isless;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:322:9: error: no member named ‘islessequal’ in the global namespace  
using ::islessequal;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:323:9: error: no member named ‘islessgreater’ in the global namespace  
using ::islessgreater;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:324:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:325:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:557:28: error: expected a qualified name after ‘typename’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:557:37: error: expected ‘;’ at end of declaration  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:557:37: error: expected unqualified-id  
/usr/local/clang4/bin/…/include/c++/v1/cmath:569:39: error: use of undeclared identifier ‘is\_floating\_point’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:569:57: error: ‘\_A1’ does not refer to a value  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:567:17: note: declared here  
template   
^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:569:63: error: definition or redeclaration of ‘value’ cannot name the global scope  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
~~^  
fatal error: too many errors emitted, stopping now [-ferror-limit=]  
20 errors generated.  
make: \*\*\* [file50dd5fdfd554.o] Error 1

ERROR(s) during compilation: source code errors or compiler configuration errors!

Program source:  
1:  
2: // includes from the plugin  
3: #include \<R.h\>  
4: #include \<Rdefines.h\>  
5: #include \<R\_ext/Error.h\>  
6:  
7:  
8: // user includes  
9:  
10:  
11: // declarations  
12: extern “C” {  
13: SEXP file50dd5fdfd554( SEXP x, SEXP y) ;  
14: }  
15:  
16: // definition  
17:  
18: SEXP file50dd5fdfd554( SEXP x, SEXP y ){  
19:  
20: return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;  
21:  
22: Rf\_warning(“your C++ program does not return anything”);  
23: return R\_NilValue ;  
24: }  
25:  
26:  
Error in compileCode(f, code, language = language, verbose = verbose) :  
Compilation ERROR, function(s)/method(s) not created! In file included from file50dd5fdfd554.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/usr/local/clang4/bin/…/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/usr/local/clang4/bin/…/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file50dd5fdfd554.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/usr/local/clang4/bin/…/include/c++/v1/cmath:316:9: error: no member named ‘isinf’ in the glo  
In addition: Warning message:  
In system(cmd, intern = !verbose) :  
running command ‘/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file50dd5fdfd554.cpp 2\> file50dd5fdfd554.cpp.err.txt’ had status 1

> fx( 2L, 5 ) # should be 10  
> Error in fx(2L, 5) : could not find function “fx”

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 8, 2018, 7:07am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/6 "2018-11-08T07:07:58Z")

</div>

OK, that is due to having the pre-Mojave file at ~/.R/Makevars . Try this

```
file.remove("~/.R/Makevars") # we can recreate this if necessary

dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR)) dir.create(dotR)
MAKEVARS <- file.path(dotR, "Makevars")
if (!file.exists(MAKEVARS)) file.create(MAKEVARS)

cat(
  "\nCXX14FLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -Wno-unknown-pragmas",
  "CC=clang",
  "CXX14=clang++ -arch x86_64 -ftemplate-depth-256",
  if (!file.exists("/usr/include/stdlib.h"))
    "CPPFLAGS = -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include",
  file = MAKEVARS, 
  sep = "\n", 
  append = TRUE
)

```

and then again

```
fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
	return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
' )

fx( 2L, 5 ) # should be 10

```

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 7:12am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/7 "2018-11-08T07:12:24Z")

</div>

> [@bgoodri](#):
>
> fx \<- inline::cxxfunction( signature(x = “integer”, y = “numeric” ) , ’ return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ; ’ ) fx( 2L, 5 ) # should be 10

I tried, but I get this:  
In file included from file50dd4115f812.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file50dd4115f812.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:316:9: error: no member named ‘isinf’ in the global namespace  
using ::isinf;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:317:9: error: no member named ‘isnan’ in the global namespace  
using ::isnan;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:318:9: error: no member named ‘isnormal’ in the global namespace  
using ::isnormal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:319:9: error: no member named ‘isgreater’ in the global namespace  
using ::isgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:320:9: error: no member named ‘isgreaterequal’ in the global namespace  
using ::isgreaterequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:321:9: error: no member named ‘isless’ in the global namespace  
using ::isless;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:322:9: error: no member named ‘islessequal’ in the global namespace  
using ::islessequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:323:9: error: no member named ‘islessgreater’ in the global namespace  
using ::islessgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:324:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:325:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:28: error: expected a qualified name after ‘typename’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected ‘;’ at end of declaration  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected unqualified-id  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:39: error: use of undeclared identifier ‘is\_floating\_point’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:57: error: ‘\_A1’ does not refer to a value  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:561:17: note: declared here  
template   
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:63: error: definition or redeclaration of ‘value’ cannot name the global scope  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
~~^  
fatal error: too many errors emitted, stopping now [-ferror-limit=]  
20 errors generated.  
make: \*\*\* [file50dd4115f812.o] Error 1

ERROR(s) during compilation: source code errors or compiler configuration errors!

Program source:  
1:  
2: // includes from the plugin  
3: #include \<R.h\>  
4: #include \<Rdefines.h\>  
5: #include \<R\_ext/Error.h\>  
6:  
7:  
8: // user includes  
9:  
10:  
11: // declarations  
12: extern “C” {  
13: SEXP file50dd4115f812( SEXP x, SEXP y) ;  
14: }  
15:  
16: // definition  
17:  
18: SEXP file50dd4115f812( SEXP x, SEXP y ){  
19:  
20: return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;  
21:  
22: Rf\_warning(“your C++ program does not return anything”);  
23: return R\_NilValue ;  
24: }  
25:  
26:  
Error in compileCode(f, code, language = language, verbose = verbose) :  
Compilation ERROR, function(s)/method(s) not created! In file included from file50dd4115f812.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file50dd4115f812.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c  
In addition: Warning message:  
In system(cmd, intern = !verbose) :  
running command ‘/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file50dd4115f812.cpp 2\> file50dd4115f812.cpp.err.txt’ had status 1

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 8, 2018, 7:14am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/8 "2018-11-08T07:14:01Z")

</div>

OK, try first doing

```
Sys.setenv(USE_CXX14 = 1)

```

then again

```
fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
	return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
' )

fx( 2L, 5 ) # should be 10

```

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 7:18am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/9 "2018-11-08T07:18:48Z")

</div>

> [@bgoodri](#):
>
> ```no-highlight
> Sys.setenv(USE_CXX14 = 1)
> 
> ```

I tried, doesn’t work

In file included from file50dd477e4aa7.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file50dd477e4aa7.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:316:9: error: no member named ‘isinf’ in the global namespace  
using ::isinf;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:317:9: error: no member named ‘isnan’ in the global namespace  
using ::isnan;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:318:9: error: no member named ‘isnormal’ in the global namespace  
using ::isnormal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:319:9: error: no member named ‘isgreater’ in the global namespace  
using ::isgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:320:9: error: no member named ‘isgreaterequal’ in the global namespace  
using ::isgreaterequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:321:9: error: no member named ‘isless’ in the global namespace  
using ::isless;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:322:9: error: no member named ‘islessequal’ in the global namespace  
using ::islessequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:323:9: error: no member named ‘islessgreater’ in the global namespace  
using ::islessgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:324:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:325:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:28: error: expected a qualified name after ‘typename’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected ‘;’ at end of declaration  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected unqualified-id  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:39: error: use of undeclared identifier ‘is\_floating\_point’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:57: error: ‘\_A1’ does not refer to a value  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:561:17: note: declared here  
template   
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:63: error: definition or redeclaration of ‘value’ cannot name the global scope  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
~~^  
fatal error: too many errors emitted, stopping now [-ferror-limit=]  
20 errors generated.  
make: \*\*\* [file50dd477e4aa7.o] Error 1

ERROR(s) during compilation: source code errors or compiler configuration errors!

Program source:  
1:  
2: // includes from the plugin  
3: #include \<R.h\>  
4: #include \<Rdefines.h\>  
5: #include \<R\_ext/Error.h\>  
6:  
7:  
8: // user includes  
9:  
10:  
11: // declarations  
12: extern “C” {  
13: SEXP file50dd477e4aa7( SEXP x, SEXP y) ;  
14: }  
15:  
16: // definition  
17:  
18: SEXP file50dd477e4aa7( SEXP x, SEXP y ){  
19:  
20: return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;  
21:  
22: Rf\_warning(“your C++ program does not return anything”);  
23: return R\_NilValue ;  
24: }  
25:  
26:  
Error in compileCode(f, code, language = language, verbose = verbose) :  
Compilation ERROR, function(s)/method(s) not created! In file included from file50dd477e4aa7.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file50dd477e4aa7.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c  
In addition: Warning message:  
In system(cmd, intern = !verbose) :  
running command ‘/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file50dd477e4aa7.cpp 2\> file50dd477e4aa7.cpp.err.txt’ had status 1

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 8, 2018, 7:26am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/10 "2018-11-08T07:26:27Z")

</div>

Interesting. Can you call it with `verbose = TRUE` as in

```
fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
	return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
', verbose = TRUE )

```

I just need to see how it is calling the compiler.

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 7:31am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/11 "2018-11-08T07:31:01Z")

</div>

Hi, this is the output:

> > Program source :

1 :  
2 : // includes from the plugin  
3 : #include \<R.h\>  
4 : #include \<Rdefines.h\>  
5 : #include \<R\_ext/Error.h\>  
6 :  
7 :  
8 : // user includes  
9 :  
10 :  
11 : // declarations  
12 : extern “C” {  
13 : SEXP file2ed5f0b52b6( SEXP x, SEXP y) ;  
14 : }  
15 :  
16 : // definition  
17 :  
18 : SEXP file2ed5f0b52b6( SEXP x, SEXP y ){  
19 :  
20 : return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;  
21 :  
22 : Rf\_warning(“your C++ program does not return anything”);  
23 : return R\_NilValue ;  
24 : }  
25 :  
26 :  
Compilation argument:  
/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file2ed5f0b52b6.cpp 2\> file2ed5f0b52b6.cpp.err.txt  
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -fPIC -Wall -g -O2 -c file2ed5f0b52b6.cpp -o file2ed5f0b52b6.o  
In file included from file2ed5f0b52b6.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file2ed5f0b52b6.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:316:9: error: no member named ‘isinf’ in the global namespace  
using ::isinf;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:317:9: error: no member named ‘isnan’ in the global namespace  
using ::isnan;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:318:9: error: no member named ‘isnormal’ in the global namespace  
using ::isnormal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:319:9: error: no member named ‘isgreater’ in the global namespace  
using ::isgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:320:9: error: no member named ‘isgreaterequal’ in the global namespace  
using ::isgreaterequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:321:9: error: no member named ‘isless’ in the global namespace  
using ::isless;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:322:9: error: no member named ‘islessequal’ in the global namespace  
using ::islessequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:323:9: error: no member named ‘islessgreater’ in the global namespace  
using ::islessgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:324:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:325:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:28: error: expected a qualified name after ‘typename’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected ‘;’ at end of declaration  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected unqualified-id  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:39: error: use of undeclared identifier ‘is\_floating\_point’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:57: error: ‘\_A1’ does not refer to a value  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:561:17: note: declared here  
template   
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:63: error: definition or redeclaration of ‘value’ cannot name the global scope  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
~~^  
fatal error: too many errors emitted, stopping now [-ferror-limit=]  
20 errors generated.  
make: \*\*\* [file2ed5f0b52b6.o] Error 1

ERROR(s) during compilation: source code errors or compiler configuration errors!

Program source:  
1:  
2: // includes from the plugin  
3: #include \<R.h\>  
4: #include \<Rdefines.h\>  
5: #include \<R\_ext/Error.h\>  
6:  
7:  
8: // user includes  
9:  
10:  
11: // declarations  
12: extern “C” {  
13: SEXP file2ed5f0b52b6( SEXP x, SEXP y) ;  
14: }  
15:  
16: // definition  
17:  
18: SEXP file2ed5f0b52b6( SEXP x, SEXP y ){  
19:  
20: return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;  
21:  
22: Rf\_warning(“your C++ program does not return anything”);  
23: return R\_NilValue ;  
24: }  
25:  
26:  
Error in compileCode(f, code, language = language, verbose = verbose) :  
Compilation ERROR, function(s)/method(s) not created! In file included from file2ed5f0b52b6.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file2ed5f0b52b6.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 8, 2018, 7:35am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/12 "2018-11-08T07:35:18Z")

</div>

If in RStudio you do

```
file.edit("~/.R/Makevars")

```

change the line that says

```
CXX14=clang++ -arch x86_64 -ftemplate-depth-256

```

to

```
CXX14=clang++ -arch x86_64 -ftemplate-depth-256 -std=c++1y

```

and then save and call

```
fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
	return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
', verbose = TRUE )

```

again. Now what does it say?

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 7:37am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/13 "2018-11-08T07:37:57Z")

</div>

> [@bgoodri](#):
>
> fx \<- inline::cxxfunction( signature(x = “integer”, y = “numeric” ) , ’ return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ; ', verbose = TRUE )

> > Program source :

1 :  
2 : // includes from the plugin  
3 : #include \<R.h\>  
4 : #include \<Rdefines.h\>  
5 : #include \<R\_ext/Error.h\>  
6 :  
7 :  
8 : // user includes  
9 :  
10 :  
11 : // declarations  
12 : extern “C” {  
13 : SEXP file2ed541644d7( SEXP x, SEXP y) ;  
14 : }  
15 :  
16 : // definition  
17 :  
18 : SEXP file2ed541644d7( SEXP x, SEXP y ){  
19 :  
20 : return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;  
21 :  
22 : Rf\_warning(“your C++ program does not return anything”);  
23 : return R\_NilValue ;  
24 : }  
25 :  
26 :  
Compilation argument:  
/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file2ed541644d7.cpp 2\> file2ed541644d7.cpp.err.txt  
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -fPIC -Wall -g -O2 -c file2ed541644d7.cpp -o file2ed541644d7.o  
In file included from file2ed541644d7.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file2ed541644d7.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:316:9: error: no member named ‘isinf’ in the global namespace  
using ::isinf;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:317:9: error: no member named ‘isnan’ in the global namespace  
using ::isnan;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:318:9: error: no member named ‘isnormal’ in the global namespace  
using ::isnormal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:319:9: error: no member named ‘isgreater’ in the global namespace  
using ::isgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:320:9: error: no member named ‘isgreaterequal’ in the global namespace  
using ::isgreaterequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:321:9: error: no member named ‘isless’ in the global namespace  
using ::isless;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:322:9: error: no member named ‘islessequal’ in the global namespace  
using ::islessequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:323:9: error: no member named ‘islessgreater’ in the global namespace  
using ::islessgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:324:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:325:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:28: error: expected a qualified name after ‘typename’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected ‘;’ at end of declaration  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected unqualified-id  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:39: error: use of undeclared identifier ‘is\_floating\_point’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:57: error: ‘\_A1’ does not refer to a value  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:561:17: note: declared here  
template   
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:63: error: definition or redeclaration of ‘value’ cannot name the global scope  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
~~^  
fatal error: too many errors emitted, stopping now [-ferror-limit=]  
20 errors generated.  
make: \*\*\* [file2ed541644d7.o] Error 1

ERROR(s) during compilation: source code errors or compiler configuration errors!

Program source:  
1:  
2: // includes from the plugin  
3: #include \<R.h\>  
4: #include \<Rdefines.h\>  
5: #include \<R\_ext/Error.h\>  
6:  
7:  
8: // user includes  
9:  
10:  
11: // declarations  
12: extern “C” {  
13: SEXP file2ed541644d7( SEXP x, SEXP y) ;  
14: }  
15:  
16: // definition  
17:  
18: SEXP file2ed541644d7( SEXP x, SEXP y ){  
19:  
20: return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;  
21:  
22: Rf\_warning(“your C++ program does not return anything”);  
23: return R\_NilValue ;  
24: }  
25:  
26:  
Error in compileCode(f, code, language = language, verbose = verbose) :  
Compilation ERROR, function(s)/method(s) not created! In file included from file2ed541644d7.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file2ed541644d7.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 8, 2018, 7:40am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/14 "2018-11-08T07:40:24Z")

</div>

OK, it is definitely failing to pick up on the C++14 standard, which is weird if you did `Sys.setenv(USE_CXX14 = 1)`. Try doing

```
file.edit("~/.R/Makevars")

```

and add a line that says

```
CXX = clang++ -std=c++14

```

and then call

```
fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
	return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
', verbose = TRUE )

```

again.

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 7:42am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/15 "2018-11-08T07:42:23Z")

</div>

Unfortunately, I still get this:

> > Program source :

1 :  
2 : // includes from the plugin  
3 : #include \<R.h\>  
4 : #include \<Rdefines.h\>  
5 : #include \<R\_ext/Error.h\>  
6 :  
7 :  
8 : // user includes  
9 :  
10 :  
11 : // declarations  
12 : extern “C” {  
13 : SEXP file2ed201aa62( SEXP x, SEXP y) ;  
14 : }  
15 :  
16 : // definition  
17 :  
18 : SEXP file2ed201aa62( SEXP x, SEXP y ){  
19 :  
20 : return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;  
21 :  
22 : Rf\_warning(“your C++ program does not return anything”);  
23 : return R\_NilValue ;  
24 : }  
25 :  
26 :  
Compilation argument:  
/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file2ed201aa62.cpp 2\> file2ed201aa62.cpp.err.txt  
clang++ -std=c++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -fPIC -Wall -g -O2 -c file2ed201aa62.cpp -o file2ed201aa62.o  
In file included from file2ed201aa62.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file2ed201aa62.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:316:9: error: no member named ‘isinf’ in the global namespace  
using ::isinf;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:317:9: error: no member named ‘isnan’ in the global namespace  
using ::isnan;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:318:9: error: no member named ‘isnormal’ in the global namespace  
using ::isnormal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:319:9: error: no member named ‘isgreater’ in the global namespace  
using ::isgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:320:9: error: no member named ‘isgreaterequal’ in the global namespace  
using ::isgreaterequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:321:9: error: no member named ‘isless’ in the global namespace  
using ::isless;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:322:9: error: no member named ‘islessequal’ in the global namespace  
using ::islessequal;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:323:9: error: no member named ‘islessgreater’ in the global namespace  
using ::islessgreater;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:324:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:325:9: error: no member named ‘isunordered’ in the global namespace  
using ::isunordered;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:28: error: expected a qualified name after ‘typename’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected ‘;’ at end of declaration  
\_LIBCPP\_CONSTEXPR typename enable\_if\<is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:551:37: error: expected unqualified-id  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:39: error: use of undeclared identifier ‘is\_floating\_point’  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:57: error: ‘\_A1’ does not refer to a value  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:561:17: note: declared here  
template   
^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:563:63: error: definition or redeclaration of ‘value’ cannot name the global scope  
\_LIBCPP\_CONSTEXPR typename enable\_if\<!is\_floating\_point\<\_A1\>::value, bool\>::type  
~~^  
fatal error: too many errors emitted, stopping now [-ferror-limit=]  
20 errors generated.  
make: \*\*\* [file2ed201aa62.o] Error 1

ERROR(s) during compilation: source code errors or compiler configuration errors!

Program source:  
1:  
2: // includes from the plugin  
3: #include \<R.h\>  
4: #include \<Rdefines.h\>  
5: #include \<R\_ext/Error.h\>  
6:  
7:  
8: // user includes  
9:  
10:  
11: // declarations  
12: extern “C” {  
13: SEXP file2ed201aa62( SEXP x, SEXP y) ;  
14: }  
15:  
16: // definition  
17:  
18: SEXP file2ed201aa62( SEXP x, SEXP y ){  
19:  
20: return ScalarReal( INTEGER(x)[0] \* REAL(y)[0] ) ;  
21:  
22: Rf\_warning(“your C++ program does not return anything”);  
23: return R\_NilValue ;  
24: }  
25:  
26:  
Error in compileCode(f, code, language = language, verbose = verbose) :  
Compilation ERROR, function(s)/method(s) not created! In file included from file2ed201aa62.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace  
using ::signbit;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named ‘fpclassify’ in the global namespace  
using ::fpclassify;  
~~^  
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?  
using ::isfinite;  
~~^  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: ‘finite’ declared here  
extern int finite(double)  
^  
In file included from file2ed201aa62.cpp:3:  
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:50:  
/Library/Developer/CommandLineTools/usr/include/c++/v

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 8, 2018, 7:50am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/16 "2018-11-08T07:50:16Z")

</div>

Is there a .pkg at  
`/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14. pkg`  
or perhaps with some minor difference in the numbers in the filename?

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 8:43am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/17 "2018-11-08T08:43:40Z")

</div>

> [@bgoodri](#):
>
> /Library/Developer/CommandLineTools/Packages/

Yes, it has exactly that name

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 11:09am UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/18 "2018-11-08T11:09:24Z")

</div>

Yes, it’s there.

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 8, 2018, 2:28pm UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/19 "2018-11-08T14:28:52Z")

</div>

OK, try double-clicking on that to install the C++ headers to /usr/include and then in

```
file.edit("~/.R/Makevars")

```

delete the part of `CXX14FLAGS` where it says `-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include`.

---

<div class="post-metadata">

**Author:** ![mtliuzza](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mtliuzza/32/3538_2.png) [@mtliuzza](https://discourse.mc-stan.org/u/mtliuzza)\
**Post date:** [November 8, 2018, 3:02pm UTC](https://discourse.mc-stan.org/t/rstan-installation-on-macos-mojave/6406/20 "2018-11-08T15:02:50Z")

</div>

It worked! Thank you so much!
