Stan installed but example code fails to run. Something about Rtools?

Hi rstan gurus,

I’m trying to install rstan in a container on a Unix cluster. (I’m a completely naive user – I only learned what containers are today. Someone showed me how to get into a prepackaged container with R 3.5 and Rstudio already installed, and g++ version 5.4.0.)

After fiddling a bunch with the Makevars file, I was able to install the rstan package successfully from source. My Makevars file currently is:
CXX14 = g++ -std=c++1y
CXX14FLAGS = -O3 -Wno-unused-variable -Wno-unused-function -Wno-macro-redefined
CXX14FLAGS += -fPIC

But when I tried to run a test program:

  example(stan_model, run.dontrun = TRUE).

I got many many screenfuls of output, ending with this error message:

Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! file130d471500e0.cpp:6:36: warning: ISO C++11 requires whitespace after the macro name
 #define STAN__SERVICES__COMMAND_HPP#include <boost/integer/integer_log2.hpp>
                                    ^
In file included from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/BH/include/boost/smart_ptr/shared_ptr.hpp:28:0,
                 from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/BH/include/boost/shared_ptr.hpp:17,
                 from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/BH/include/boost/date_time/time_clock.hpp:17,
                 from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/BH/include/boost/date_time/posix_time/posix_time_types.hpp:10,
                 from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/stan_fit.hpp:13,
                 from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/rstaninc.hpp:3,
                 from file130d471500e0.cpp:7:
/

================================================
The whole output was so long that I can’t even scroll up to the beginning of it, in either my teminal or RStudio. At some point, the whole screen was full of really really big numbers (like e+1040). No idea what’s up with that.

In trying to debug this, I checked my C++ Toolchain, using the command
pkgbuild::has_build_tools(debug = TRUE)

This gives really weird results (or maybe not so weird to someone who understands what is actually going on here…) When I execute this command at the beginning of an R session (before trying and failing to run the stan example code), I get:

      Trying to compile a simple C file
      Running /usr/local/lib/R/bin/R CMD SHLIB foo.c
      gcc -I"/usr/local/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -c foo.c -o foo.o
     gcc -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o foo.so foo.o -L/usr/local/lib/R/lib -lR

     [1] TRUE

But when I execute the very same command after trying to compile the example code, I get:

Trying to compile a simple C file
Running /usr/local/lib/R/bin/R CMD SHLIB foo.c
gcc -I"/usr/local/lib/R/include" -DNDEBUG -I"/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include/" -I"/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include/" -I"/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include/unsupported" -I"/usr/local/lib/R/library/BH/include" -I"/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/src/" -I"/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/" -I"/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/rstan/include" -DEIGEN_NO_DEBUG -D_REENTRANT -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -include stan/math/prim/mat/fun/Eigen.hpp -I/usr/local/include -fpic -g -O2 -c foo.c -o foo.o
In file included from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include/Eigen/Core:88:0,
from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include/Eigen/Dense:1,
from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4,
from :0:
/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include/Eigen/src/Core/util/Macros.h:613:1: error: unknown type name \ufffd\ufffd\ufffdnamespace\ufffd\ufffd\ufffd
namespace Eigen {
^
/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include/Eigen/src/Core/util/Macros.h:613:17: error: expected \ufffd\ufffd\ufffd=\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffd,\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffd;\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffdasm\ufffd\ufffd\ufffd or \ufffd\ufffd\ufffd__attribute__\ufffd\ufffd\ufffd before \ufffd\ufffd\ufffd{\ufffd\ufffd\ufffd token
namespace Eigen {
^
In file included from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include/Eigen/Dense:1:0,
from /home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4,
from :0:
/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include/Eigen/Core:96:19: fatal error: complex: No such file or directory
compilation terminated.
/usr/local/lib/R/etc/Makeconf:159: recipe for target ‘foo.o’ failed
make: *** [foo.o] Error 1
[1] FALSE

Similarly, n Rstudio, when I try to execute the pkgbuild command at the beginning of a session, I just get
[1] TRUE
When I do it after trying and failing to run the stan example code, I get a prompt asking me if I want to install additional tools. I click “yes”, but nothing happens and the output is just [1] FALSE.

So apparently there’s something additional I need, and I can’t get it automatically through Rstudio. But what is it exactly that I need? The Rstan installation instructions explain how to manually get Rtools for Windows and Mac, but not Unix.

Hopefully this is enough information that you can help me figure out what’s going on.

Thanks very much,
Mira

Ugh, really sorry about formatting of the above. I don’t understand why that happened…

How about trying

model_code <-
  '
  functions {
    real standard_normal_rng() {
      return normal_rng(0,1);
   }
  }
'
rstan::expose_stan_functions(stanc(model_code = model_code), verbose = TRUE)

When I did this in Rstudio, it ran for hours (!) outputting lists of big numbers.

When I did this in R, I got more output than I can copy-paste, but here’s the final part:

/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:473:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012975111395684900835),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:473:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012975111395684900835),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:473:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012975111395684900835),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:474:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator"“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012888764187499150078),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:474:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012888764187499150078),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:474:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012888764187499150078),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:474:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012888764187499150078),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:475:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012716644398857307844),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:475:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012716644398857307844),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:475:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012716644398857307844),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:475:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012716644398857307844),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:476:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012459897461364705691),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:476:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012459897461364705691),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:476:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012459897461364705691),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:476:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012459897461364705691),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:477:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012120231988292330388),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:477:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012120231988292330388),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:477:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012120231988292330388),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:477:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012120231988292330388),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:478:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011699908404856841158),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:478:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011699908404856841158),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:478:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011699908404856841158),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:478:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011699908404856841158),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:479:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011201723906897224448),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:479:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011201723906897224448),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:479:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011201723906897224448),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:479:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011201723906897224448),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:480:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.010628993848522759853),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:480:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.010628993848522759853),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:480:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.010628993848522759853),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:480:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.010628993848522759853),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:481:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0099855296835573320047),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:481:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0099855296835573320047),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:481:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0099855296835573320047),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:481:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0099855296835573320047),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:482:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0092756136096132857933),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:482:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0092756136096132857933),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:482:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0092756136096132857933),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:482:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0092756136096132857933),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:483:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0085039700881139589055),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:483:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0085039700881139589055),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:483:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0085039700881139589055),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:483:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0085039700881139589055),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:484:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0076757344408814561254),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:484:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0076757344408814561254),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:484:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0076757344408814561254),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:484:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0076757344408814561254),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:485:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0067964187616556459109),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:485:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0067964187616556459109),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:485:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0067964187616556459109),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:485:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0067964187616556459109),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:486:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.005871875456524750363),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:486:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.005871875456524750363),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:486:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.005871875456524750363),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:486:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.005871875456524750363),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:487:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0049082589542498110071),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:487:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0049082589542498110071),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:487:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0049082589542498110071),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:487:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0049082589542498110071),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:488:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0039119870792519721409),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:488:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0039119870792519721409),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:488:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0039119870792519721409),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:488:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0039119870792519721409),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:489:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0028897090921170700834),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:489:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0028897090921170700834),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:489:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0028897090921170700834),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:489:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0028897090921170700834),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:490:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”“Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0018483371329504443947),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:490:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0018483371329504443947),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:490:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0018483371329504443947),
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:490:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0018483371329504443947),
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:491:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator”"Q\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.00079623320100438873578)
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:491:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.00079623320100438873578)
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:491:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.00079623320100438873578)
^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
#define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:491:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.00079623320100438873578)
^
At global scope:
cc1plus: warning: unrecognized command line option \ufffd\ufffd\ufffd-Wno-macro-redefined\ufffd\ufffd\ufffd
/usr/local/lib/R/etc/Makeconf:168: recipe for target ‘file500170bbae75.o’ failed
make: *** [file500170bbae75.o] Error 1

WARNING: The tools required to build C++ code for R were not found.

Please install GNU development tools including a C++ compiler.

Error: $ operator is invalid for atomic vectors

Thanks so much!
Mira

Do you have some non-ASCII characters in ~/.R/Makevars or /usr/local/lib/R/etc/Makeconf regarding -Wno-macro-redefined?

My Makevars file looks fine. It is:

CXX14 = g++ -std=c++1y
CXX14FLAGS = -O3 -Wno-unused-variable -Wno-unused-function -Wno-macro-redefined
CXX14FLAGS += -fPIC 

My Makeconfig file is:

 # etc/Makeconf.  Generated from Makeconf.in by configure.
#
# ${R_HOME}/etc/Makeconf
#
# R was configured using the following call
# (not including env. vars and site configuration)
# configure  '--enable-R-shlib' '--with-blas' '--with-lapack'

## This fails if it contains spaces, or if it is quoted
include $(R_SHARE_DIR)/make/vars.mk

AR = ar
BLAS_LIBS = -lblas
C_VISIBILITY = -fvisibility=hidden
CC = gcc
CFLAGS = -g -O2 $(LTO)
CPICFLAGS = -fpic
CPPFLAGS = -I/usr/local/include
CXX = g++ 
CXXCPP = $(CXX) -E
CXXFLAGS = -g -O2 $(LTO)
CXXPICFLAGS = -fpic
CXX98 = g++
CXX98FLAGS = -g -O2
CXX98PICFLAGS = -fpic
CXX98STD = -std=gnu++98
CXX11 = g++
CXX11FLAGS = -g -O2
CXX11PICFLAGS = -fpic
CXX11STD = -std=gnu++11
CXX14 = g++
CXX14FLAGS = -g -O2
CXX14PICFLAGS = -fpic
CXX14STD = -std=gnu++14
CXX17 = 
CXX17FLAGS = 
CXX17PICFLAGS = 
CXX17STD = 
DYLIB_EXT = .so
DYLIB_LD = $(CC)
DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)
DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
ECHO = echo
ECHO_C = 
ECHO_N = -n
ECHO_T = 
## NB, set FC before F77 as on Solaris make, setting FC sets F77
FC = gfortran
FCFLAGS = -g -O2 $(LTO)
## additional libs needed when linking with $(FC), e.g. on some Oracle compilers
FCLIBS = 
F77 = f95
F77_VISIBILITY = -fvisibility=hidden
FFLAGS = -g -O2 $(LTO)
FLIBS =  -lgfortran -lm -lquadmath
FCPICFLAGS = -fpic
FPICFLAGS = -fpic
FOUNDATION_CPPFLAGS = 
FOUNDATION_LIBS = 
JAR = /usr/bin/jar
JAVA = /usr/bin/java
JAVAC = /usr/bin/javac
JAVAH = /usr/bin/javah
## JAVA_HOME might be used in the next three.  
## They are for packages 'JavaGD' and 'rJava'
JAVA_HOME = /usr/lib/jvm/java-8-openjdk-amd64/jre
JAVA_CPPFLAGS = -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
JAVA_LIBS = -L$(JAVA_HOME)/lib/amd64/server -ljvm
JAVA_LD_LIBRARY_PATH = $(JAVA_HOME)/lib/amd64/server
LAPACK_LIBS = -llapack
## we only need this is if it is external, as otherwise link to R
LIBINTL= 
LIBM = -lm
LIBR0 = -L"$(R_HOME)/lib$(R_ARCH)"
LIBR1 = -lR
LIBR = -L"$(R_HOME)/lib$(R_ARCH)" -lR
LIBS =  -lpcre -llzma -lbz2 -lz -lrt -ldl -lm
## needed by R CMD config
LIBnn = lib
LIBTOOL = $(SHELL) "$(R_HOME)/bin/libtool"
LDFLAGS = -L/usr/local/lib
LTO = 
## needed to build applications linking to static libR
MAIN_LD = $(CC)
MAIN_LDFLAGS = -Wl,--export-dynamic -fopenmp
MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
MKINSTALLDIRS = "$(R_HOME)/bin/mkinstalldirs"
OBJC = 
OBJCFLAGS =  $(LTO)
OBJC_LIBS = 
OBJCXX = 
R_ARCH = 
RANLIB = ranlib
SAFE_FFLAGS = -g -O2 -msse2 -mfpmath=sse
SED = /bin/sed
SHELL = /bin/bash
SHLIB_CFLAGS = 
SHLIB_CXXFLAGS = 
SHLIB_CXXLD = $(CXX)
SHLIB_CXXLDFLAGS = -shared
SHLIB_CXX98LD = $(CXX98) $(CXX98STD)
SHLIB_CXX98LDFLAGS = -shared
SHLIB_CXX11LD = $(CXX11) $(CXX11STD)
SHLIB_CXX11LDFLAGS = -shared
SHLIB_CXX14LD = $(CXX14) $(CXX14STD)
SHLIB_CXX14LDFLAGS = -shared
SHLIB_CXX17LD = $(CXX17) $(CXX17STD)
SHLIB_CXX17LDFLAGS = -shared
SHLIB_EXT = .so
SHLIB_FCLD = $(FC)
SHLIB_FCLDFLAGS = -shared
SHLIB_FFLAGS = 
SHLIB_LD = $(CC)
SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS)
SHLIB_LIBADD = 
## We want to ensure libR is picked up from $(R_HOME)/lib
## before e.g. /usr/local/lib if a version is already installed.
SHLIB_LINK = $(SHLIB_LD) $(SHLIB_LDFLAGS) $(LIBR0) $(LDFLAGS)
SHLIB_OPENMP_CFLAGS = -fopenmp
SHLIB_OPENMP_CXXFLAGS = -fopenmp
SHLIB_OPENMP_FCFLAGS = -fopenmp
SHLIB_OPENMP_FFLAGS = -fopenmp
STRIP_LIBS = strip --strip-unneeded
STRIP_STATIC_LIBS = strip --strip-debug
TCLTK_CPPFLAGS = -I/usr/include/tcl8.6 -I/usr/include/tcl8.6 
TCLTK_LIBS = -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -L/usr/lib/x86_64-linux-gnu -ltk8.6 
-lX11 -lXss -lXext
YACC = bison -y

## legacy
CXX1X = g++
CXX1XFLAGS = -g -O2
CXX1XPICFLAGS = -fpic
CXX1XSTD = -std=gnu++11
SHLIB_CXX1XLD = $(CXX11) $(CXX11STD)
SHLIB_CXX1XLDFLAGS = -shared


## for linking to libR.a
STATIC_LIBR = # -Wl,--whole-archive "$(R_HOME)/lib$(R_ARCH)/libR.a" -Wl,--no-whole-arc
hive $(BLAS_LIBS) $(FLIBS)  $(LIBINTL) -lreadline  $(LIBS)

R_XTRA_CFLAGS = 
R_XTRA_CPPFLAGS =  -I"$(R_INCLUDE_DIR)" -DNDEBUG
R_XTRA_CXXFLAGS = 
R_XTRA_FFLAGS = 

ALL_CFLAGS = $(R_XTRA_CFLAGS) $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(CFLAGS)
ALL_CPPFLAGS = $(R_XTRA_CPPFLAGS) $(PKG_CPPFLAGS) $(CLINK_CPPFLAGS) $(CPPFLAGS)
ALL_CXXFLAGS = $(R_XTRA_CXXFLAGS) $(PKG_CXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(C
XXFLAGS)
ALL_OBJCFLAGS = $(PKG_OBJCFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(OBJCFLAGS)
ALL_OBJCXXFLAGS = $(PKG_OBJCXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(OBJCXXFLAGS)
ALL_FFLAGS = $(R_XTRA_FFLAGS) $(PKG_FFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FFLAGS)
## LIBR here as a couple of packages use this without SHLIB_LINK
ALL_LIBS = $(PKG_LIBS) $(SHLIB_LIBADD) $(LIBR)# $(LIBINTL)

.SUFFIXES:
.SUFFIXES: .c .cc .cpp .d .f .f90 .f95 .m .mm .M .o

.c.o:
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@
.c.d:
	@echo "making $@ from $<"
	@$(CC) -MM $(ALL_CPPFLAGS) $< > $@
.m.d:
	@echo > $@
.cc.o:
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
.cpp.o:
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
.cc.d:
	@echo "making $@ from $<"
	@$(CXX) -M $(ALL_CPPFLAGS) $< > $@
.cpp.d:
	@echo "making $@ from $<"
	@$(CXX) -M $(ALL_CPPFLAGS) $< > $@
.m.o:
	$(OBJC) $(ALL_CPPFLAGS) $(ALL_OBJCFLAGS) -c $< -o $@
.mm.o:
	$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
.M.o:
	$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
.f.o:
	$(F77) $(ALL_FFLAGS) -c $< -o $@
.f95.o:
	$(FC) $(PKG_FCFLAGS) $(FCPICFLAGS) $(FCFLAGS) -c  $< -o $@
.f90.o:
	$(FC) $(PKG_FCFLAGS) $(FCPICFLAGS) $(FCFLAGS) -c  $< -o $@

There are a bunch of suspicious @ characters there at the end, but I don’t know if that’s junk or if they’re supposed to be there.

Thanks so much for all your help!

Mira

Maybe delete the part of CXX14FLAGS that says -Wno-macro-redefined.

That didn’t help – the error message looks very similar to what it was before. Here’s the last part of it:

/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:474:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012888764187499150078),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:474:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012888764187499150078),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:474:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012888764187499150078),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:474:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012888764187499150078),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:475:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012716644398857307844),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:475:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012716644398857307844),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:475:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012716644398857307844),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:475:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012716644398857307844),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:476:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012459897461364705691),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:476:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012459897461364705691),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:476:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012459897461364705691),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:476:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012459897461364705691),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:477:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012120231988292330388),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:477:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012120231988292330388),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:477:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012120231988292330388),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:477:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012120231988292330388),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:478:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011699908404856841158),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:478:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011699908404856841158),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:478:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011699908404856841158),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:478:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011699908404856841158),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:479:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011201723906897224448),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:479:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011201723906897224448),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:479:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011201723906897224448),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:479:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011201723906897224448),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:480:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.010628993848522759853),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:480:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.010628993848522759853),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:480:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.010628993848522759853),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:480:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.010628993848522759853),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:481:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0099855296835573320047),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:481:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0099855296835573320047),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:481:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0099855296835573320047),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:481:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0099855296835573320047),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:482:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0092756136096132857933),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:482:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0092756136096132857933),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:482:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0092756136096132857933),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:482:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0092756136096132857933),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:483:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0085039700881139589055),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:483:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0085039700881139589055),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:483:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0085039700881139589055),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:483:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0085039700881139589055),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:484:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0076757344408814561254),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:484:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0076757344408814561254),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:484:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0076757344408814561254),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:484:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0076757344408814561254),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:485:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0067964187616556459109),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:485:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0067964187616556459109),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:485:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0067964187616556459109),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:485:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0067964187616556459109),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:486:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.005871875456524750363),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:486:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.005871875456524750363),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:486:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.005871875456524750363),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:486:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.005871875456524750363),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:487:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0049082589542498110071),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:487:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0049082589542498110071),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:487:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0049082589542498110071),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:487:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0049082589542498110071),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:488:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0039119870792519721409),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:488:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0039119870792519721409),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:488:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0039119870792519721409),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:488:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0039119870792519721409),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:489:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0028897090921170700834),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:489:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0028897090921170700834),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:489:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0028897090921170700834),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:489:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0028897090921170700834),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:490:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0018483371329504443947),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:490:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0018483371329504443947),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:490:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0018483371329504443947),
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:490:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0018483371329504443947),
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:491:54: error: unable to find numeric literal operator \ufffd\ufffd\ufffdoperator""Q\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.00079623320100438873578)
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:491:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.00079623320100438873578)
                ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:491:54: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.00079623320100438873578)
                                                      ^
/usr/local/lib/R/library/BH/include/boost/math/tools/big_constant.hpp:25:39: note: in definition of macro \ufffd\ufffd\ufffdBOOST_MATH_LARGEST_FLOAT_C\ufffd\ufffd\ufffd
 #define BOOST_MATH_LARGEST_FLOAT_C(x) x##Q
                                       ^
/usr/local/lib/R/library/BH/include/boost/math/special_functions/owens_t.hpp:491:16: note: in expansion of macro \ufffd\ufffd\ufffdBOOST_MATH_BIG_CONSTANT\ufffd\ufffd\ufffd
                BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.00079623320100438873578)
                ^
/usr/local/lib/R/etc/Makeconf:168: recipe for target 'file55ec4f406cf4.o' failed
make: *** [file55ec4f406cf4.o] Error 1

WARNING: The tools required to build C++ code for R were not found.

Please install GNU development tools including a C++ compiler.

Error: $ operator is invalid for atomic vectors

What is g++ --version?

5.4.0

Thanks so much for all your trouble helping me out!

Mira

Does

example(cxxfunction, package = "inline", run.dontrun = TRUE)

work?

Oh, interesting. Here’s what I get:

cxxfnc> # default plugin
cxxfnc> fx <- cxxfunction( signature(x = "integer", y = "numeric" ) , '
cxxfnc+ 	return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
cxxfnc+ ' )

cxxfnc> fx( 2L, 5 )
[1] 10

cxxfnc> # Rcpp plugin
cxxfnc> if( require( Rcpp ) ){
cxxfnc+ 
cxxfnc+ 	fx <- cxxfunction( signature(x = "integer", y = "numeric" ) , '
cxxfnc+ 		return wrap( as<int>(x) * as<double>(y) ) ;
cxxfnc+ 	', plugin = "Rcpp" )
cxxfnc+ 	fx( 2L, 5 )
cxxfnc+ 
cxxfnc+         ## equivalent shorter form using rcpp()
cxxfnc+ 	fx <- rcpp(signature(x = "integer", y = "numeric"),
cxxfnc+                    ' return wrap( as<int>(x) * as<double>(y) ) ; ')
cxxfnc+ 
cxxfnc+ }
Loading required package: Rcpp

Attaching package: \ufffd\ufffd\ufffdRcpp\ufffd\ufffd\ufffd

The following object is masked from \ufffd\ufffd\ufffdpackage:inline\ufffd\ufffd\ufffd:

    registerPlugin


cxxfnc> # RcppArmadillo plugin
cxxfnc> if( require( RcppArmadillo ) ){
cxxfnc+ 	
cxxfnc+ 	fx <- cxxfunction( signature(x = "integer", y = "numeric" ) , '
cxxfnc+ 		int dim = as<int>( x ) ;
cxxfnc+ 		arma::mat z = as<double>(y) * arma::eye<arma::mat>( dim, dim ) ;
cxxfnc+ 		return wrap( arma::accu(z) ) ;
cxxfnc+ 	', plugin = "RcppArmadillo" )
cxxfnc+ 	fx( 2L, 5 )
cxxfnc+ 	
cxxfnc+ 	
cxxfnc+ }
Loading required package: RcppArmadillo
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called \ufffd\ufffd\ufffdRcppArmadillo\ufffd\ufffd\ufffd

Does that help?

Not much, but it does suggest it is a general problem with R on that machine, rather than a problem specifically with how rstan is calling inline. For some reason, it is trying to use Unicode replacement characters in the file paths, rather than ASCII.

Oh wow, that sounds like basically a hopeless thing to fight against… :(

How confident are you of that diagnosis? Are there any other straightforward checks we could do to confirm that it’s a broader issue with R? (I fear that finding someone to help me update R on this container – or to help me find another container – will not be very straightforward at all…)

Thanks again! I know this is not the most fun way to spend a Sunday afternoon…

Mira

Not hopeless. Compiler errors never are.

Does anything with BH work like

library(Rcpp)
cppFunction("double test(double x) { return boost::math::lgamma(x); }", 
            includes = c("// [[Rcpp::depends(BH)]]", 
                         "#include <boost/math/special_functions.hpp>"), 
            verbose = TRUE)
test(3) # equals lfactorial(2)

That worked!

> cppFunction("double test(double x) { return boost::math::lgamma(x); }", 
+ 
+             includes = c("// [[Rcpp::depends(BH)]]", 
+ 
+                          "#include <boost/math/special_functions.hpp>"), 
+ 
+             verbose = TRUE)

Generated code for function definition: 
--------------------------------------------------------

#include <Rcpp.h>

using namespace Rcpp;

// [[Rcpp::depends(BH)]]
#include <boost/math/special_functions.hpp>
// [[Rcpp::export]]
double test(double x) { return boost::math::lgamma(x); }

Generated extern "C" functions 
--------------------------------------------------------


#include <Rcpp.h>
// test
double test(double x);
RcppExport SEXP sourceCpp_1_test(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(test(x));
    return rcpp_result_gen;
END_RCPP
}

Generated R functions 
-------------------------------------------------------

`.sourceCpp_1_DLLInfo` <- dyn.load('/tmp/Rtmpc1ZywC/sourceCpp-x86_64-pc-linux-gnu-1.0.3/sourcecpp_a09179fb7bd5/sourceCpp_2.so')

test <- Rcpp:::sourceCppFunction(function(x) {}, FALSE, `.sourceCpp_1_DLLInfo`, 'sourceCpp_1_test')

rm(`.sourceCpp_1_DLLInfo`)

Building shared library
--------------------------------------------------------

DIR: /tmp/Rtmpc1ZywC/sourceCpp-x86_64-pc-linux-gnu-1.0.3/sourcecpp_a09179fb7bd5

/usr/local/lib/R/bin/R CMD SHLIB -o 'sourceCpp_2.so'  'filea0914f55627f.cpp'  
g++  -I"/usr/local/lib/R/include" -DNDEBUG   -I"/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I"/usr/local/lib/R/library/BH/include" -I"/tmp/Rtmpc1ZywC/sourceCpp-x86_64-pc-linux-gnu-1.0.3" -I"/home/mbernst/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include   -fpic  -g -O2  -c filea0914f55627f.cpp -o filea0914f55627f.o
g++ -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o sourceCpp_2.so filea0914f55627f.o -L/usr/local/lib/R/lib -lR
> 
> test(3) # equals lfactorial(2)
[1] 0.6931472

What does R.version return?

platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          5.1                         
year           2018                        
month          07                          
day            02                          
svn rev        74947                       
language       R                           
version.string R version 3.5.1 (2018-07-02)
nickname       Feather Spray

According to

the original error might be due to having both -std=c++1y and -std=gnu++1y in the flags somehow. But you probably get around it by adding either -fext-numeric-literals or -DBOOST_MATH_DISABLE_FLOAT128 to CXX14FLAGS in ~/.R/Makevars . Either is fine since Stan does not use _float128 anyway.

Adding -fext-numeric-literals and/or -DBOOST_MATH_DISABLE_FLOAT128 (either one at a time or both together) doesn’t seem to help. I still get the same error on both example(cxxfunction, package = "inline", run.dontrun = TRUE) and the original example(stan_model, run.dontrun = TRUE).

Also, I tried putting CXX14STD = -std=gnu++14 into Makevars (instead of -std=c++1y), to make it consistent with Makeconfig, and that didn’t help either.

:(