From lorenzo.lucido at asia.bnpparibas.com  Thu Feb 16 00:32:47 2012
From: lorenzo.lucido at asia.bnpparibas.com (Lorenzo)
Date: Wed, 15 Feb 2012 15:32:47 -0800 (PST)
Subject: [Rd] R CMD SHLIB in Windows XP - No output at all
In-Reply-To: <20283.47440.458365.839827@max.nulle.part>
References: <1329178163008-4385797.post@n4.nabble.com>
	<20283.47440.458365.839827@max.nulle.part>
Message-ID: <1329348767349-4392407.post@n4.nabble.com>

Hi Dirk,

Thanks for your suggestion.
Seems that I have the same issue with the inline package, here is my output
:

############ INLINE SIMPLE EXAMPLE 
> library(Rcpp)
> library(inline)
> library(RcppArmadillo)
> foo <- '
+   int i, j, na, nb, nab;
+   double *xa, *xb, *xab;
+   SEXP ab;
+ 
+   PROTECT(a = AS_NUMERIC(a));
+   PROTECT(b = AS_NUMERIC(b));
+   na = LENGTH(a); nb = LENGTH(b); nab = na + nb - 1;
+   PROTECT(ab = NEW_NUMERIC(nab));
+   xa = NUMERIC_POINTER(a); xb = NUMERIC_POINTER(b);
+   xab = NUMERIC_POINTER(ab);
+   for(i = 0; i < nab; i++) xab[i] = 0.0;
+   for(i = 0; i < na; i++)
+     for(j = 0; j < nb; j++) xab[i + j] += xa[i] * xb[j];
+   UNPROTECT(3);
+   return(ab);
+ '
> foo
[1] "\n  int i, j, na, nb, nab;\n  double *xa, *xb, *xab;\n  SEXP ab;\n\n 
PROTECT(a = AS_NUMERIC(a));\n  PROTECT(b = AS_NUMERIC(b));\n  na =
LENGTH(a); nb = LENGTH(b); nab = na + nb - 1;\n  PROTECT(ab =
NEW_NUMERIC(nab));\n  xa = NUMERIC_POINTER(a); xb = NUMERIC_POINTER(b);\n 
xab = NUMERIC_POINTER(ab);\n  for(i = 0; i < nab; i++) xab[i] = 0.0;\n 
for(i = 0; i < na; i++)\n    for(j = 0; j < nb; j++) xab[i + j] += xa[i] *
xb[j];\n  UNPROTECT(3);\n  return(ab);\n"
> funx <- cfunction(signature(a="numeric",b="numeric"), foo, Rcpp=FALSE,
> verbose=FALSE)

ERROR(s) during compilation: source code errors or compiler configuration
errors!

Program source:
  1: #include <R.h>
  2: #include <Rdefines.h>
  3: #include <R_ext/Error.h>
  4: 
  5: 
  6: extern "C" {
  7:   SEXP file48858916c0f ( SEXP a, SEXP b );
  8: }
  9: 
 10: SEXP file48858916c0f ( SEXP a, SEXP b ) {
 11: 
 12:   int i, j, na, nb, nab;
 13:   double *xa, *xb, *xab;
 14:   SEXP ab;
 15: 
 16:   PROTECT(a = AS_NUMERIC(a));
 17:   PROTECT(b = AS_NUMERIC(b));
 18:   na = LENGTH(a); nb = LENGTH(b); nab = na + nb - 1;
 19:   PROTECT(ab = NEW_NUMERIC(nab));
 20:   xa = NUMERIC_POINTER(a); xb = NUMERIC_POINTER(b);
 21:   xab = NUMERIC_POINTER(ab);
 22:   for(i = 0; i < nab; i++) xab[i] = 0.0;
 23:   for(i = 0; i < na; i++)
 24:     for(j = 0; j < nb; j++) xab[i + j] += xa[i] * xb[j];
 25:   UNPROTECT(3);
 26:   return(ab);
 27: 
 28:   warning("your C program does not return anything!");
 29:   return R_NilValue;
 30: }
*Error in compileCode(f, code, language, verbose) : 
  Compilation ERROR, function(s)/method(s) not created! 
In addition: Warning message:
running command 'C:/Trading/R/R-2.14.1/bin/i386/R CMD SHLIB
file48858916c0f.cpp 2> file48858916c0f.cpp.err.txt' had status 1 *
#####################################

Looks like my issue on R CMD SHLIB is causing the compileCode function to
fail.




--
View this message in context: http://r.789695.n4.nabble.com/R-CMD-SHLIB-in-Windows-XP-No-output-at-all-tp4385797p4392407.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] R CMD SHLIB in Windows XP - No output at all
Lorenzo