Skip to content

openMP Mac install not working #1692

@bhive01

Description

@bhive01

I've been trying to get timing comparisons of various file IO functions today and managed to get everything working except the OpenMP implementation of fwrite(). When I run fwrite() in my benchmark I get the following:

library(data.table)

set.seed(3-29-16)

rows <- 100000

x <- data.frame(ints = round(runif(rows, -100, 100)), stringsAsFactors = FALSE)
x$floats <- runif(rows, -100, 100)
x$bools <- sample(c(TRUE, FALSE), rows, replace = TRUE)
x$dates <- as.POSIXct(runif(rows, 100000000, 1459293171), origin = "1970-01-01")
x$categories <- as.factor(sample(c(LETTERS, 0:9), rows, replace = TRUE))
x$strings <- replicate(rows, paste0(sample(letters, sample(1:10, 1), replace = TRUE), collapse = ""))

DTCSV =fwrite(x, "x.DT.csv")
#Your platform/environment has not detected OpenMP support. fwrite() will still work, but slower in single threaded mode.

I followed the instructions here: https://github.com/Rdatatable/data.table/wiki/Installation
Created a Makevar file in ~/.R/ with the following flags:

cat ~/.R/Makevars
CC=clang-omp -fopenmp
CXX=clang-omp++ -fopenmp

Running the script above after installation and creation of Makevar file gives the above message.

When I tried to reinstall Rcpp or data.table from source (hoping that it would compile against the OpenMP capable compilier) I get an error.

install.packages("data.table", type = "source",
     repos = "https://Rdatatable.github.io/data.table")

trying URL 'https://Rdatatable.github.io/data.table/src/contrib/data.table_1.9.7.tar.gz'
Content type 'application/octet-stream' length 2721566 bytes (2.6 MB)
==================================================
downloaded 2.6 MB

* installing *source* packagedata.table...
** libs
clang-omp -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c assign.c -o assign.o
In file included from assign.c:1:
In file included from ./data.table.h:1:
/Library/Frameworks/R.framework/Resources/include/R.h:45:12: fatal error: 'stdlib.h' file not found
#  include <stdlib.h> /* Not used by R itself, but widely assumed in packages */
           ^
1 error generated.

The downloaded source packages are in/private/var/folders/zg/hy0k4g312536_4l1qc1w27640000gn/T/RtmpXM09oF/downloaded_packagesmake: *** [assign.o] Error 1
ERROR: compilation failed for packagedata.table* removing/Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table* restoring previous/Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.tableWarning message:
In install.packages("data.table", type = "source", repos = "https://Rdatatable.github.io/data.table") :
  installation of packagedata.tablehad non-zero exit status

#############################
install.packages("Rcpp", type = "source")
trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.12.4.tar.gz'
Content type 'application/x-gzip' length 2402065 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

* installing *source* packageRcpp...
** packageRcppsuccessfully unpacked and MD5 sums checked
** libs
clang-omp++ -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/include/ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c Date.cpp -o Date.o
In file included from Date.cpp:31:
In file included from ../inst/include/Rcpp.h:27:
In file included from ../inst/include/RcppCommon.h:29:
In file included from ../inst/include/Rcpp/r/headers.h:48:
In file included from ../inst/include/Rcpp/platform/compiler.h:100:
/usr/local/Cellar/clang-omp/2015-04-01/libexec/bin/../include/c++/v1/cmath:301:10: fatal error: 'math.h' file not found
#include <math.h>
         ^
1 error generated.
make: *** [Date.o] Error 1
ERROR: compilation failed for packageRcpp* removing/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RcppThe downloaded source packages are in/private/var/folders/zg/hy0k4g312536_4l1qc1w27640000gn/T/RtmpXM09oF/downloaded_packagesWarning message:
In install.packages("Rcpp", type = "source") :
  installation of packageRcpphad non-zero exit status
* restoring previous/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp

I googled around and found that g++-5 on homebrew comes with openMP so I tapped it. Rcpp compiles, but then data.table does not.

cat ~/.R/Makevars
CC=g++-5 -fopenmp
CXX=g++-5 -fopenmp
install.packages("Rcpp", type = "source")
trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.12.4.tar.gz'
Content type 'application/x-gzip' length 2402065 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

* installing *source* packageRcpp...
** packageRcppsuccessfully unpacked and MD5 sums checked
** libs
g++-5 -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/include/ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c Date.cpp -o Date.o
g++-5 -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/include/ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c Module.cpp -o Module.o
g++-5 -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/include/ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c Rcpp_init.cpp -o Rcpp_init.o
g++-5 -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/include/ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c api.cpp -o api.o
g++-5 -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/include/ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c attributes.cpp -o attributes.o
g++-5 -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/include/ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c barrier.cpp -o barrier.o
g++-5 -fopenmp -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (Rcpp)

The downloaded source packages are in/private/var/folders/zg/hy0k4g312536_4l1qc1w27640000gn/T/RtmpXM09oF/downloaded_packages############################

install.packages("data.table", type = "source",
     repos = "https://Rdatatable.github.io/data.table")
trying URL 'https://Rdatatable.github.io/data.table/src/contrib/data.table_1.9.7.tar.gz'
Content type 'application/octet-stream' length 2721566 bytes (2.6 MB)
==================================================
downloaded 2.6 MB

* installing *source* packagedata.table...
** libs
g++-5 -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c assign.c -o assign.o
In file included from assign.c:1:0:
data.table.h:73:29: error: two or more data types in declaration of 'parameter'
 SEXP which(SEXP x, Rboolean bool);
                             ^
assign.c: In function 'int _selfrefok(SEXP, Rboolean, Rboolean)':
assign.c:115:26: error: invalid conversion from 'void*' to 'SEXP {aka SEXPREC*}' [-fpermissive]
     p = R_ExternalPtrAddr(v);
                          ^

The downloaded source packages are in/private/var/folders/zg/hy0k4g312536_4l1qc1w27640000gn/T/RtmpXM09oF/downloaded_packagesWarning message:
In install.packages("data.table", type = "source", repos = "https://Rdatatable.github.io/data.table") :
  installation of packagedata.tablehad non-zero exit status
assign.c: In function 'Rboolean selfrefok(SEXP, Rboolean)':
assign.c:137:44: error: cannot convert 'bool' to 'Rboolean' in return
     return(_selfrefok(x, FALSE, verbose)==1);
                                            ^
assign.c: In function 'Rboolean selfrefnamesok(SEXP, Rboolean)':
assign.c:140:43: error: cannot convert 'bool' to 'Rboolean' in return
     return(_selfrefok(x, TRUE, verbose)==1);
                                           ^
assign.c: In function 'SEXPREC* alloccol(SEXP, R_len_t, Rboolean)':
assign.c:195:17: error: expected unqualified-id before 'class'
     SEXP names, class;
                 ^
assign.c:199:5: error: expected primary-expression before 'class'
     class = getAttrib(dt, R_ClassSymbol);
     ^
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c:200:16: error: expected primary-expression before 'class'
     if (isNull(class)) error("dt passed to alloccol has no class attribute. Please report result of traceback() to datatable-help.");
                ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:303:21: note: in definition of macro 'TYPEOF'
 #define TYPEOF(x) ((x)->sxpinfo.type)
                     ^
assign.c:200:9: note: in expansion of macro 'isNull'
     if (isNull(class)) error("dt passed to alloccol has no class attribute. Please report result of traceback() to datatable-help.");
         ^
assign.c:200:16: error: expected ')' before 'class'
     if (isNull(class)) error("dt passed to alloccol has no class attribute. Please report result of traceback() to datatable-help.");
                ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:303:21: note: in definition of macro 'TYPEOF'
 #define TYPEOF(x) ((x)->sxpinfo.type)
                     ^
assign.c:200:9: note: in expansion of macro 'isNull'
     if (isNull(class)) error("dt passed to alloccol has no class attribute. Please report result of traceback() to datatable-help.");
         ^
assign.c:200:133: error: expected ')' before ';' token
     if (isNull(class)) error("dt passed to alloccol has no class attribute. Please report result of traceback() to datatable-help.");
                                                                                                                                     ^
assign.c:200:133: error: expected ')' before ';' token
assign.c:200:133: error: expected ')' before ';' token
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c: In function 'SEXPREC* alloccolwrapper(SEXP, SEXP, SEXP)':
assign.c:227:76: error: invalid conversion from 'int' to 'Rboolean' [-fpermissive]
     SEXP ans = PROTECT(alloccol(dt, INTEGER(newncol)[0], LOGICAL(verbose)[0]));
                                                                            ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:661:31: note: in definition of macro 'PROTECT'
 #define PROTECT(s) Rf_protect(s)
                               ^
assign.c:193:6: note:   initializing argument 3 of 'SEXPREC* alloccol(SEXP, R_len_t, Rboolean)'
 SEXP alloccol(SEXP dt, R_len_t n, Rboolean verbose)
      ^
assign.c: In function 'Rboolean isDatatable(SEXP)':
assign.c:252:10: error: expected primary-expression before 'class'
     SEXP class = getAttrib(x, R_ClassSymbol);
          ^
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c:253:28: error: expected primary-expression before 'class'
     for (int i=0; i<length(class); i++) {
                            ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:1222:30: note: in definition of macro 'length'
 #define length(x)  Rf_length(x)
                              ^
assign.c:254:36: error: expected primary-expression before 'class'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) return(TRUE);
                                    ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:382:41: note: in definition of macro 'DATAPTR'
 #define DATAPTR(x) (((SEXPREC_ALIGN *) (x)) + 1)
                                         ^
assign.c:254:20: note: in expansion of macro 'CHAR'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) return(TRUE);
                    ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:389:35: note: in expansion of macro 'DATAPTR'
 #define STRING_ELT(x,i) ((SEXP *) DATAPTR(x))[i]
                                   ^
assign.c:254:25: note: in expansion of macro 'STRING_ELT'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) return(TRUE);
                         ^
assign.c:254:36: error: expected ')' before 'class'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) return(TRUE);
                                    ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:382:41: note: in definition of macro 'DATAPTR'
 #define DATAPTR(x) (((SEXPREC_ALIGN *) (x)) + 1)
                                         ^
assign.c:254:20: note: in expansion of macro 'CHAR'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) return(TRUE);
                    ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:389:35: note: in expansion of macro 'DATAPTR'
 #define STRING_ELT(x,i) ((SEXP *) DATAPTR(x))[i]
                                   ^
assign.c:254:25: note: in expansion of macro 'STRING_ELT'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) return(TRUE);
                         ^
assign.c:254:80: error: expected ')' before ';' token
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) return(TRUE);
                                                                                ^
assign.c:254:80: error: expected ')' before ';' token
assign.c:254:80: error: expected ')' before ';' token
assign.c:254:80: error: expected ')' before ';' token
assign.c:254:80: error: expected ')' before ';' token
assign.c:254:80: error: expected ')' before ';' token
assign.c:254:80: error: expected ')' before ';' token
assign.c:254:80: error: expected ')' before ';' token
assign.c: In function 'SEXPREC* selfrefokwrapper(SEXP, SEXP)':
assign.c:272:63: error: invalid conversion from 'int' to 'Rboolean' [-fpermissive]
     return ScalarInteger(_selfrefok(x,FALSE,LOGICAL(verbose)[0]));
                                                               ^
assign.c:104:12: note:   initializing argument 3 of 'int _selfrefok(SEXP, Rboolean, Rboolean)'
 static int _selfrefok(SEXP x, Rboolean checkNames, Rboolean verbose) {
            ^
assign.c: In function 'SEXPREC* assign(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP)':
assign.c:285:93: error: expected unqualified-id before 'class'
     SEXP targetcol, RHS, names, nullint, thisvalue, thisv, targetlevels, newcol, s, colnam, class, tmp, colorder, key, index, a;
                                                                                             ^
assign.c:287:39: error: invalid conversion from 'int' to 'Rboolean' [-fpermissive]
     Rboolean verbose = LOGICAL(verb)[0], anytodelete=FALSE, isDataTable=FALSE;
                                       ^
assign.c:297:5: error: expected primary-expression before 'class'
     class = getAttrib(dt, R_ClassSymbol);
     ^
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c:298:16: error: expected primary-expression before 'class'
     if (isNull(class)) error("Input passed to assign has no class attribute. Must be a data.table or data.frame.");
                ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:303:21: note: in definition of macro 'TYPEOF'
 #define TYPEOF(x) ((x)->sxpinfo.type)
                     ^
assign.c:298:9: note: in expansion of macro 'isNull'
     if (isNull(class)) error("Input passed to assign has no class attribute. Must be a data.table or data.frame.");
         ^
assign.c:298:16: error: expected ')' before 'class'
     if (isNull(class)) error("Input passed to assign has no class attribute. Must be a data.table or data.frame.");
                ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:303:21: note: in definition of macro 'TYPEOF'
 #define TYPEOF(x) ((x)->sxpinfo.type)
                     ^
assign.c:298:9: note: in expansion of macro 'isNull'
     if (isNull(class)) error("Input passed to assign has no class attribute. Must be a data.table or data.frame.");
         ^
assign.c:298:115: error: expected ')' before ';' token
     if (isNull(class)) error("Input passed to assign has no class attribute. Must be a data.table or data.frame.");
                                                                                                                   ^
assign.c:298:115: error: expected ')' before ';' token
assign.c:298:115: error: expected ')' before ';' token
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c:303:24: error: expected primary-expression before 'class'
     for (i=0; i<length(class); i++) {   // There doesn't seem to be an R API interface to inherits(), but manually here isn't too bad.
                        ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:1222:30: note: in definition of macro 'length'
 #define length(x)  Rf_length(x)
                              ^
assign.c:304:36: error: expected primary-expression before 'class'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) break;
                                    ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:382:41: note: in definition of macro 'DATAPTR'
 #define DATAPTR(x) (((SEXPREC_ALIGN *) (x)) + 1)
                                         ^
assign.c:304:20: note: in expansion of macro 'CHAR'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) break;
                    ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:389:35: note: in expansion of macro 'DATAPTR'
 #define STRING_ELT(x,i) ((SEXP *) DATAPTR(x))[i]
                                   ^
assign.c:304:25: note: in expansion of macro 'STRING_ELT'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) break;
                         ^
assign.c:304:36: error: expected ')' before 'class'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) break;
                                    ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:382:41: note: in definition of macro 'DATAPTR'
 #define DATAPTR(x) (((SEXPREC_ALIGN *) (x)) + 1)
                                         ^
assign.c:304:20: note: in expansion of macro 'CHAR'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) break;
                    ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:389:35: note: in expansion of macro 'DATAPTR'
 #define STRING_ELT(x,i) ((SEXP *) DATAPTR(x))[i]
                                   ^
assign.c:304:25: note: in expansion of macro 'STRING_ELT'
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) break;
                         ^
assign.c:304:73: error: expected ')' before ';' token
         if (strcmp(CHAR(STRING_ELT(class, i)), "data.table") == 0) break;
                                                                         ^
assign.c:304:73: error: expected ')' before ';' token
assign.c:304:73: error: expected ')' before ';' token
assign.c:304:73: error: expected ')' before ';' token
assign.c:304:73: error: expected ')' before ';' token
assign.c:304:73: error: expected ')' before ';' token
assign.c:304:73: error: expected ')' before ';' token
assign.c:304:73: error: expected ')' before ';' token
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c:306:18: error: expected primary-expression before 'class'
     if (i<length(class))
                  ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:1222:30: note: in definition of macro 'length'
 #define length(x)  Rf_length(x)
                              ^
assign.c:309:28: error: expected primary-expression before 'class'
         for (i=0; i<length(class); i++) {
                            ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:1222:30: note: in definition of macro 'length'
 #define length(x)  Rf_length(x)
                              ^
assign.c:310:40: error: expected primary-expression before 'class'
             if (strcmp(CHAR(STRING_ELT(class, i)), "data.frame") == 0) break;
                                        ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:382:41: note: in definition of macro 'DATAPTR'
 #define DATAPTR(x) (((SEXPREC_ALIGN *) (x)) + 1)
                                         ^
assign.c:310:24: note: in expansion of macro 'CHAR'
             if (strcmp(CHAR(STRING_ELT(class, i)), "data.frame") == 0) break;
                        ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:389:35: note: in expansion of macro 'DATAPTR'
 #define STRING_ELT(x,i) ((SEXP *) DATAPTR(x))[i]
                                   ^
assign.c:310:29: note: in expansion of macro 'STRING_ELT'
             if (strcmp(CHAR(STRING_ELT(class, i)), "data.frame") == 0) break;
                             ^
assign.c:310:40: error: expected ')' before 'class'
             if (strcmp(CHAR(STRING_ELT(class, i)), "data.frame") == 0) break;
                                        ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:382:41: note: in definition of macro 'DATAPTR'
 #define DATAPTR(x) (((SEXPREC_ALIGN *) (x)) + 1)
                                         ^
assign.c:310:24: note: in expansion of macro 'CHAR'
             if (strcmp(CHAR(STRING_ELT(class, i)), "data.frame") == 0) break;
                        ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:389:35: note: in expansion of macro 'DATAPTR'
 #define STRING_ELT(x,i) ((SEXP *) DATAPTR(x))[i]
                                   ^
assign.c:310:29: note: in expansion of macro 'STRING_ELT'
             if (strcmp(CHAR(STRING_ELT(class, i)), "data.frame") == 0) break;
                             ^
assign.c:310:77: error: expected ')' before ';' token
             if (strcmp(CHAR(STRING_ELT(class, i)), "data.frame") == 0) break;
                                                                             ^
assign.c:310:77: error: expected ')' before ';' token
assign.c:310:77: error: expected ')' before ';' token
assign.c:310:77: error: expected ')' before ';' token
assign.c:310:77: error: expected ')' before ';' token
assign.c:310:77: error: expected ')' before ';' token
assign.c:310:77: error: expected ')' before ';' token
assign.c:310:77: error: expected ')' before ';' token
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c:312:25: error: expected primary-expression before 'class'
         if (i == length(class)) error("Input is not a data.table, data.frame or an object that inherits from either.");
                         ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:1222:30: note: in definition of macro 'length'
 #define length(x)  Rf_length(x)
                              ^
assign.c:350:17: error: 'tmp' was not declared in this scope
         PROTECT(tmp = chmatch(cols, names, 0, FALSE));
                 ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:661:31: note: in definition of macro 'PROTECT'
 #define PROTECT(s) Rf_protect(s)
                               ^
assign.c:598:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
                             if (isReal(thisvalue)) s3="; may have truncated precision"; else s3="";
                                                      ^
assign.c:598:96: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
                             if (isReal(thisvalue)) s3="; may have truncated precision"; else s3="";
                                                                                                ^
assign.c:607:5: error: 'key' was not declared in this scope
     key = getAttrib(dt,install("sorted"));
     ^
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c:611:17: error: 'tmp' was not declared in this scope
         PROTECT(tmp = allocVector(STRSXP, LENGTH(cols)));
                 ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:661:31: note: in definition of macro 'PROTECT'
 #define PROTECT(s) Rf_protect(s)
                               ^
assign.c:625:11: error: assignment of function 'char* index(const char*, int)'
     index = getAttrib(dt,install("index"));
           ^
assign.c:625:11: error: cannot convert 'SEXP {aka SEXPREC*}' to 'char*(const char*, int)' in assignment
assign.c:626:18: error: comparison between distinct pointer types 'char* (*)(const char*, int)' and 'SEXP {aka SEXPREC*}' lacks a cast [-fpermissive]
     if (index != R_NilValue) {
                  ^
In file included from data.table.h:3:0,
                 from assign.c:1:
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:300:25: error: request for member 'attrib' in 'index', which is of non-class type 'char*(const char*, int)'
 #define ATTRIB(x) ((x)->attrib)
                         ^
assign.c:627:13: note: in expansion of macro 'ATTRIB'
         s = ATTRIB(index);
             ^
assign.c:629:13: error: 'a' was not declared in this scope
             a = TAG(s);
             ^
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c:666:17: error: 'colorder' was not declared in this scope
         PROTECT(colorder = duplicate(cols));
                 ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:661:31: note: in definition of macro 'PROTECT'
 #define PROTECT(s) Rf_protect(s)
                               ^
assign.c: At global scope:
assign.c:876:42: error: expected ',' or '...' before 'new'
 SEXP setcharvec(SEXP x, SEXP which, SEXP new)
                                          ^
In file included from data.table.h:3:0,
                 from assign.c:1:
assign.c: In function 'SEXPREC* setcharvec(SEXP, SEXP, SEXP)':
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:303:22: error: expected type-specifier before ')' token
 #define TYPEOF(x) ((x)->sxpinfo.type)
                      ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:1374:22: note: in expansion of macro 'TYPEOF'
 #define isString(s) (TYPEOF(s) == STRSXP)
                      ^
assign.c:881:10: note: in expansion of macro 'isString'
     if (!isString(new)) error("'new' must be a character vector");
          ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:338:44: error: expected type-specifier before ')' token
 # define SHORT_VEC_LENGTH(x) (((VECSEXP) (x))->vecsxp.length)
                                            ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:337:26: note: in expansion of macro 'SHORT_VEC_LENGTH'
 # define IS_LONG_VEC(x) (SHORT_VEC_LENGTH(x) == R_LONG_VEC_TOKEN)
                          ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:344:21: note: in expansion of macro 'IS_LONG_VEC'
 # define LENGTH(x) (IS_LONG_VEC(x) ? R_BadLongVector(x, __FILE__, __LINE__) : SHORT_VEC_LENGTH(x))
                     ^
assign.c:882:9: note: in expansion of macro 'LENGTH'
     if (LENGTH(new)!=LENGTH(which)) error("'new' is length %d. Should be the same as length of 'which' (%d)",LENGTH(new),LENGTH(which));
         ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:344:55: error: expected type-specifier before ',' token
 # define LENGTH(x) (IS_LONG_VEC(x) ? R_BadLongVector(x, __FILE__, __LINE__) : SHORT_VEC_LENGTH(x))
                                                       ^
assign.c:882:9: note: in expansion of macro 'LENGTH'
     if (LENGTH(new)!=LENGTH(which)) error("'new' is length %d. Should be the same as length of 'which' (%d)",LENGTH(new),LENGTH(which));
         ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:338:44: error: expected type-specifier before ')' token
 # define SHORT_VEC_LENGTH(x) (((VECSEXP) (x))->vecsxp.length)
                                            ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:344:79: note: in expansion of macro 'SHORT_VEC_LENGTH'
 # define LENGTH(x) (IS_LONG_VEC(x) ? R_BadLongVector(x, __FILE__, __LINE__) : SHORT_VEC_LENGTH(x))
                                                                               ^
assign.c:882:9: note: in expansion of macro 'LENGTH'
     if (LENGTH(new)!=LENGTH(which)) error("'new' is length %d. Should be the same as length of 'which' (%d)",LENGTH(new),LENGTH(which));
         ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:338:44: error: expected type-specifier before ')' token
 # define SHORT_VEC_LENGTH(x) (((VECSEXP) (x))->vecsxp.length)
                                            ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:337:26: note: in expansion of macro 'SHORT_VEC_LENGTH'
 # define IS_LONG_VEC(x) (SHORT_VEC_LENGTH(x) == R_LONG_VEC_TOKEN)
                          ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:344:21: note: in expansion of macro 'IS_LONG_VEC'
 # define LENGTH(x) (IS_LONG_VEC(x) ? R_BadLongVector(x, __FILE__, __LINE__) : SHORT_VEC_LENGTH(x))
                     ^
assign.c:882:110: note: in expansion of macro 'LENGTH'
     if (LENGTH(new)!=LENGTH(which)) error("'new' is length %d. Should be the same as length of 'which' (%d)",LENGTH(new),LENGTH(which));
                                                                                                              ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:344:55: error: expected type-specifier before ',' token
 # define LENGTH(x) (IS_LONG_VEC(x) ? R_BadLongVector(x, __FILE__, __LINE__) : SHORT_VEC_LENGTH(x))
                                                       ^
assign.c:882:110: note: in expansion of macro 'LENGTH'
     if (LENGTH(new)!=LENGTH(which)) error("'new' is length %d. Should be the same as length of 'which' (%d)",LENGTH(new),LENGTH(which));
                                                                                                              ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:338:44: error: expected type-specifier before ')' token
 # define SHORT_VEC_LENGTH(x) (((VECSEXP) (x))->vecsxp.length)
                                            ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:344:79: note: in expansion of macro 'SHORT_VEC_LENGTH'
 # define LENGTH(x) (IS_LONG_VEC(x) ? R_BadLongVector(x, __FILE__, __LINE__) : SHORT_VEC_LENGTH(x))
                                                                               ^
assign.c:882:110: note: in expansion of macro 'LENGTH'
     if (LENGTH(new)!=LENGTH(which)) error("'new' is length %d. Should be the same as length of 'which' (%d)",LENGTH(new),LENGTH(which));
                                                                                                              ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:382:42: error: expected type-specifier before ')' token
 #define DATAPTR(x) (((SEXPREC_ALIGN *) (x)) + 1)
                                          ^
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:389:35: note: in expansion of macro 'DATAPTR'
 #define STRING_ELT(x,i) ((SEXP *) DATAPTR(x))[i]
                                   ^
assign.c:886:32: note: in expansion of macro 'STRING_ELT'
         SET_STRING_ELT(x, w-1, STRING_ELT(new, i));
                                ^
make: *** [assign.o] Error 1
ERROR: compilation failed for packagedata.table* removing/Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table* restoring previous/Library/Frameworks/R.framework/Versions/3.3/Resources/library/data.table

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions