Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file7978320d1ae5.cpp:8:
In file included from /Users/rchan/Library/R/3.5/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Users/rchan/Library/R/3.5/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Users/rchan/Library/R/3.5/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Users/rchan/Library/R/3.5/library/StanHeaders/include/stan/math/rev/core.hpp:4:
In file included from /Users/rchan/Library/R/3.5/library/StanHeaders/include/stan/math/rev/core/autodiffstackstorage.hpp:4:
In file included from /Users/rchan/Library/R/3.5/library/StanHeaders/include/stan/math/memory/stack_alloc.hpp:8:
In file included from /usr/local/clang4/bin/../include/c++/v1/cstdlib:86:
/usr/local/clang4/bin/../include/c++/v1/stdlib.h:94:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
In addition: Warning message:
In system(cmd, intern = !verbose) :
Error in sink(type = "output") : invalid connection
This is my makevars file in R:
#The following statements are required to use the clang4 binary
CC=/usr/local/clang4/bin/clang
CXX=/usr/local/clang4/bin/clang++
CXX1X=/usr/local/clang4/bin/clang++
CXX98=/usr/local/clang4/bin/clang++
CXX11=/usr/local/clang4/bin/clang++
CXX14=/usr/local/clang4/bin/clang++
CXX17=/usr/local/clang4/bin/clang++
LDFLAGS=-L/usr/local/clang4/lib
# End clang4 inclusion statements
I’ve read other threads on this and I’ve tried to use the following in the terminal
$ xcode-select --install
and got the following
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
And also tried to redownload it from the apple developers website but both failed.