<div dir="ltr">Hi all,
<div><br></div><div>I tried to compile a script using the code below:</div><div><br></div><div>============================================================</div><div>Rscript compiler.R '/Users/xiaohe/WRScpp/src/test.cpp'<br>

</div><div>============================================================<br></div><div><br></div><div>And I got 7 error messages in total as shown below. I am on a Mac (OX 10.9.4), my R is 3.1.1, and I have the latest Xcode as well as the latest Rcpp and RcppArmadillo installed. </div>

<div><br></div><div>A minimally reproducible script (test.cpp) is here: <a href="https://www.dropbox.com/s/dpipxzmawet0e8y/test.cpp?dl=0">https://www.dropbox.com/s/dpipxzmawet0e8y/test.cpp?dl=0</a></div><div><br></div><div>

And the compiler.R file I used is in this link: <a href="https://www.dropbox.com/s/4vadide49zd6hwi/compiler.R?dl=0">https://www.dropbox.com/s/4vadide49zd6hwi/compiler.R?dl=0</a></div><div><br></div><div>I would be grateful if someone could point me to the right direction regarding the causes of the errors. Thank you in advance!</div>

<div><br></div><div><br></div><div>============================================================<br></div><div><div>Loading required package: RcppArmadillo</div><div>clang++ -I/Library/Frameworks/R.framework/Resources/include -DDEBUG   -I/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include" -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -mtune=core2 -g -O0    -c /Users/xiaohe/WRScpp/src/test.cpp -o /Users/xiaohe/WRScpp/src/test.o</div>

<div>In file included from /Users/xiaohe/WRScpp/src/test.cpp:7:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:30:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:37:</div>

<div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo:131:</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/blas_bones.hpp:62:10: error: conflicting types for 'ddot_'</div>

<div>  double arma_fortran(arma_ddot)(blas_int* n, const double* x, blas_int* incx, const double* y, blas_int* incy);</div><div>         ^</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:36:34: note: expanded from macro 'arma_fortran'</div>

<div>  #define arma_fortran(function) arma_fortran2_noprefix(function)</div><div>                                 ^</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:25:44: note: expanded from macro 'arma_fortran2_noprefix'</div>

<div>  #define arma_fortran2_noprefix(function) function##_</div><div>                                           ^</div><div><scratch space>:539:1: note: expanded from here</div><div>ddot_</div><div>^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/BLAS.h:58:1: note: previous declaration is here</div>

<div>F77_NAME(ddot)(const int *n, const double *dx, const int *incx,</div><div>^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:86:24: note: expanded from macro 'F77_NAME'</div><div>#define F77_NAME(x)    F77_CALL(x)</div>

<div>                       ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:82:22: note: expanded from macro 'F77_CALL'</div><div># define F77_CALL(x)    x ## _</div><div>                        ^</div>

<div><scratch space>:181:1: note: expanded from here</div><div>ddot_</div><div>^</div><div>In file included from /Users/xiaohe/WRScpp/src/test.cpp:7:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:30:</div>

<div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:37:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo:131:</div>

<div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/blas_bones.hpp:67:8: error: conflicting types for 'zgemv_'</div><div>  void arma_fortran(arma_zgemv)(const char* transA, const blas_int* m, const blas_int* n, const void*   alpha, const void*   A, const blas_int* ldA, const void*   x, const blas_int* incx, con...</div>

<div>       ^</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:36:34: note: expanded from macro 'arma_fortran'</div><div>  #define arma_fortran(function) arma_fortran2_noprefix(function)</div>

<div>                                 ^</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:25:44: note: expanded from macro 'arma_fortran2_noprefix'</div>

<div>  #define arma_fortran2_noprefix(function) function##_</div><div>                                           ^</div><div><scratch space>:539:1: note: expanded from here</div><div>zgemv_</div><div>^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/BLAS.h:287:5: note: previous declaration is here</div>

<div>    F77_NAME(zgemv)(char *trans, int *m, int *n, Rcomplex *alpha,</div><div>    ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:86:24: note: expanded from macro 'F77_NAME'</div><div>
#define F77_NAME(x)    F77_CALL(x)</div>
<div>                       ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:82:22: note: expanded from macro 'F77_CALL'</div><div># define F77_CALL(x)    x ## _</div><div>                        ^</div>

<div><scratch space>:3:1: note: expanded from here</div><div>zgemv_</div><div>^</div><div>In file included from /Users/xiaohe/WRScpp/src/test.cpp:7:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:30:</div>

<div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:37:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo:131:</div>

<div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/blas_bones.hpp:72:8: error: conflicting types for 'zgemm_'</div><div>  void arma_fortran(arma_zgemm)(const char* transA, const char* transB, const blas_int* m, const blas_int* n, const blas_int* k, const void*   alpha, const void*   A, const blas_int* ldA, con...</div>

<div>       ^</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:36:34: note: expanded from macro 'arma_fortran'</div><div>  #define arma_fortran(function) arma_fortran2_noprefix(function)</div>

<div>                                 ^</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:25:44: note: expanded from macro 'arma_fortran2_noprefix'</div>

<div>  #define arma_fortran2_noprefix(function) function##_</div><div>                                           ^</div><div><scratch space>:539:1: note: expanded from here</div><div>zgemm_</div><div>^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/BLAS.h:281:5: note: previous declaration is here</div>

<div>    F77_NAME(zgemm)(const char *transa, const char *transb, const int *m,</div><div>    ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:86:24: note: expanded from macro 'F77_NAME'</div>

<div>#define F77_NAME(x)    F77_CALL(x)</div><div>                       ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:82:22: note: expanded from macro 'F77_CALL'</div><div># define F77_CALL(x)    x ## _</div>

<div>                        ^</div><div><scratch space>:2:1: note: expanded from here</div><div>zgemm_</div><div>^</div><div>In file included from /Users/xiaohe/WRScpp/src/test.cpp:7:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:30:</div>

<div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:37:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo:131:</div>

<div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/blas_bones.hpp:78:8: error: conflicting types for 'zherk_'</div><div>  void arma_fortran(arma_zherk)(const char* uplo, const char* transA, const blas_int* n, const blas_int* k, const double* alpha, const   void* A, const blas_int* ldA, const double* beta,   vo...</div>

<div>       ^</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:36:34: note: expanded from macro 'arma_fortran'</div><div>  #define arma_fortran(function) arma_fortran2_noprefix(function)</div>

<div>                                 ^</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:25:44: note: expanded from macro 'arma_fortran2_noprefix'</div>

<div>  #define arma_fortran2_noprefix(function) function##_</div><div>                                           ^</div><div><scratch space>:539:1: note: expanded from here</div><div>zherk_</div><div>^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/BLAS.h:319:5: note: previous declaration is here</div>

<div>    F77_NAME(zherk)(char *uplo, char *trans, int *n, int *k,</div><div>    ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:86:24: note: expanded from macro 'F77_NAME'</div><div>#define F77_NAME(x)    F77_CALL(x)</div>

<div>                       ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:82:22: note: expanded from macro 'F77_CALL'</div><div># define F77_CALL(x)    x ## _</div><div>                        ^</div>

<div><scratch space>:12:1: note: expanded from here</div><div>zherk_</div><div>^</div><div>In file included from /Users/xiaohe/WRScpp/src/test.cpp:7:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:30:</div>

<div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:37:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo:137:</div>

<div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/blas_wrapper.hpp:46:7: error: no matching function for call to 'zgemv_'</div><div>      arma_fortran(arma_zgemv)(transA, m, n, (const T*)alpha, (const T*)A, ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy);</div>

<div>      ^~~~~~~~~~~~~~~~~~~~~~~~</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:36:34: note: expanded from macro 'arma_fortran'</div>

<div>  #define arma_fortran(function) arma_fortran2_noprefix(function)</div><div>                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:25:44: note: expanded from macro 'arma_fortran2_noprefix'</div>

<div>  #define arma_fortran2_noprefix(function) function##_</div><div>                                           ^~~~~~~~~~~</div><div><scratch space>:25:1: note: expanded from here</div><div>zgemv_</div><div>^~~~~~</div>

<div>/Library/Frameworks/R.framework/Resources/include/R_ext/BLAS.h:287:5: note: candidate function not viable: 1st argument ('const char *') would lose const qualifier</div><div>    F77_NAME(zgemv)(char *trans, int *m, int *n, Rcomplex *alpha,</div>

<div>    ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:86:24: note: expanded from macro 'F77_NAME'</div><div>#define F77_NAME(x)    F77_CALL(x)</div><div>                       ^</div><div>

/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:82:22: note: expanded from macro 'F77_CALL'</div><div># define F77_CALL(x)    x ## _</div><div>                        ^</div><div><scratch space>:3:1: note: expanded from here</div>

<div>zgemv_</div><div>^</div><div>In file included from /Users/xiaohe/WRScpp/src/test.cpp:7:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:30:</div>

<div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:37:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo:137:</div>

<div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/blas_wrapper.hpp:81:7: error: no matching function for call to 'zgemm_'</div><div>      arma_fortran(arma_zgemm)(transA, transB, m, n, k, (const T*)alpha, (const T*)A, ldA, (const T*)B, ldB, (const T*)beta, (T*)C, ldC);</div>

<div>      ^~~~~~~~~~~~~~~~~~~~~~~~</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:36:34: note: expanded from macro 'arma_fortran'</div>

<div>  #define arma_fortran(function) arma_fortran2_noprefix(function)</div><div>                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:25:44: note: expanded from macro 'arma_fortran2_noprefix'</div>

<div>  #define arma_fortran2_noprefix(function) function##_</div><div>                                           ^~~~~~~~~~~</div><div><scratch space>:25:1: note: expanded from here</div><div>zgemm_</div><div>^~~~~~</div>

<div>/Library/Frameworks/R.framework/Resources/include/R_ext/BLAS.h:281:5: note: candidate function not viable: no known conversion from 'const T *' (aka 'const complex<double> *') to 'const Rcomplex *'</div>

<div>      for 6th argument</div><div>    F77_NAME(zgemm)(const char *transa, const char *transb, const int *m,</div><div>    ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:86:24: note: expanded from macro 'F77_NAME'</div>

<div>#define F77_NAME(x)    F77_CALL(x)</div><div>                       ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:82:22: note: expanded from macro 'F77_CALL'</div><div># define F77_CALL(x)    x ## _</div>

<div>                        ^</div><div><scratch space>:2:1: note: expanded from here</div><div>zgemm_</div><div>^</div><div>In file included from /Users/xiaohe/WRScpp/src/test.cpp:7:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:30:</div>

<div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:37:</div><div>In file included from /Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo:137:</div>

<div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/blas_wrapper.hpp:130:7: error: no matching function for call to 'zherk_'</div><div>      arma_fortran(arma_zherk)(uplo, transA, n, k, (const TT*)alpha, (const cx_TT*)A, ldA, (const TT*)beta, (cx_TT*)C, ldC);</div>

<div>      ^~~~~~~~~~~~~~~~~~~~~~~~</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:36:34: note: expanded from macro 'arma_fortran'</div>

<div>  #define arma_fortran(function) arma_fortran2_noprefix(function)</div><div>                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div><div>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:25:44: note: expanded from macro 'arma_fortran2_noprefix'</div>

<div>  #define arma_fortran2_noprefix(function) function##_</div><div>                                           ^~~~~~~~~~~</div><div><scratch space>:25:1: note: expanded from here</div><div>zherk_</div><div>^~~~~~</div>

<div>/Library/Frameworks/R.framework/Resources/include/R_ext/BLAS.h:319:5: note: candidate function not viable: 1st argument ('const char *') would lose const qualifier</div><div>    F77_NAME(zherk)(char *uplo, char *trans, int *n, int *k,</div>

<div>    ^</div><div>/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:86:24: note: expanded from macro 'F77_NAME'</div><div>#define F77_NAME(x)    F77_CALL(x)</div><div>                       ^</div><div>

/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:82:22: note: expanded from macro 'F77_CALL'</div><div># define F77_CALL(x)    x ## _</div><div>                        ^</div><div><scratch space>:12:1: note: expanded from here</div>

<div>zherk_</div><div>^</div><div>7 errors generated.</div><div>make: *** [/Users/xiaohe/WRScpp/src/test.o] Error 1</div></div><div>============================================================<br></div><div><br></div><div>

<br></div><div>Best,</div><div>Xiao</div><div><br></div></div>