ethanweed

Rstan C++ compilation error stdlib.h

Oct 12th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 2.18 KB | None | 0 0
  1. > system("clang++ -v")
  2. Apple LLVM version 10.0.0 (clang-1000.11.45.2)
  3. Target: x86_64-apple-darwin17.7.0
  4. Thread model: posix
  5. InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  6. > # check toolchain
  7. > fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
  8. +   return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
  9. +                            ' )
  10. In file included from file823bc75ebc.cpp:3:
  11. In file included from /Library/Frameworks/R.framework/Resources/include/R.h:47:
  12. In file included from /usr/local/clang4/bin/../include/c++/v1/cstdlib:86:
  13. /usr/local/clang4/bin/../include/c++/v1/stdlib.h:94:15: fatal error: 'stdlib.h' file not found
  14. #include_next <stdlib.h>
  15.               ^~~~~~~~~~
  16. 1 error generated.
  17. make: *** [file823bc75ebc.o] Error 1
  18.  
  19. ERROR(s) during compilation: source code errors or compiler configuration errors!
  20.  
  21. Program source:
  22.   1:
  23.   2: // includes from the plugin
  24.   3: #include <R.h>
  25.   4: #include <Rdefines.h>
  26.   5: #include <R_ext/Error.h>
  27.   6:
  28.   7:
  29.   8: // user includes
  30.   9:
  31.  10:
  32.  11: // declarations
  33.  12: extern "C" {
  34.  13: SEXP file823bc75ebc( SEXP x, SEXP y) ;
  35.  14: }
  36.  15:
  37.  16: // definition
  38.  17:
  39.  18: SEXP file823bc75ebc( SEXP x, SEXP y ){
  40.  19:
  41.  20:    return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
  42.  21:                            
  43.  22: Rf_warning("your C++ program does not return anything");
  44.  23:  return R_NilValue ;
  45.  24: }
  46.  25:
  47.  26:
  48. Error in compileCode(f, code, language = language, verbose = verbose) :
  49.   Compilation ERROR, function(s)/method(s) not created! In file included from file823bc75ebc.cpp:3:
  50. In file included from /Library/Frameworks/R.framework/Resources/include/R.h:47:
  51. In file included from /usr/local/clang4/bin/../include/c++/v1/cstdlib:86:
  52. /usr/local/clang4/bin/../include/c++/v1/stdlib.h:94:15: fatal error: 'stdlib.h' file not found
  53. #include_next <stdlib.h>
  54.               ^~~~~~~~~~
  55. 1 error generated.
  56. make: *** [file823bc75ebc.o] Error 1
  57. In addition: Warning message:
  58. In system(cmd, intern = !verbose) :
  59.   running command '/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file823bc75ebc.cpp 2> file823bc75ebc.cpp.err.txt' had status 1
  60. >
Add Comment
Please, Sign In to add comment