I tried RcppArmadillo_0.2.21.tar.gz with R-devel from today on FreeBSD 9.0-CURRENT (amd64). The build fails with the following messages:

------------------------------------------
#R CMD INSTALL RcppArmadillo_0.2.21.tar.gz
* installing to library '/usr/local/lib/R/library'
* installing *source* package 'RcppArmadillo' ...
** libs
g++45 -I/usr/local/lib/R/include -I"/usr/local/lib/R/library/Rcpp/include" -I../inst/include -fpic -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc45 -fno-strict-aliasing -c RcppArmadillo.cpp -o RcppArmadillo.o
In file included from ../inst/include/armadillo:113:0,
                 from ../inst/include/RcppArmadilloForward.h:36,
                 from ../inst/include/RcppArmadillo.h:25,
                 from RcppArmadillo.cpp:22:
../inst/include/armadillo_bits/format_wrap.hpp: In function 'std::string arma::arma_boost::str(const arma::arma_boost::basic_format<arma::arma_boost::format, T2>&)': ../inst/include/armadillo_bits/format_wrap.hpp:146:25: error: 'snprintf' is not a member of 'std' ../inst/include/armadillo_bits/format_wrap.hpp: In function 'std::string arma::arma_boost::str(const arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::format, T2>, T3>&)': ../inst/include/armadillo_bits/format_wrap.hpp:198:25: error: 'snprintf' is not a member of 'std' ../inst/include/armadillo_bits/format_wrap.hpp: In function 'std::string arma::arma_boost::str(const arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::format, T2>, T3>, T4>&)': ../inst/include/armadillo_bits/format_wrap.hpp:250:25: error: 'snprintf' is not a member of 'std' ../inst/include/armadillo_bits/format_wrap.hpp: In function 'std::string arma::arma_boost::str(const arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::format, T2>, T3>, T4>, T5>&)': ../inst/include/armadillo_bits/format_wrap.hpp:302:25: error: 'snprintf' is not a member of 'std' ../inst/include/armadillo_bits/format_wrap.hpp: In function 'std::string arma::arma_boost::str(const arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::format, T2>, T3>, T4>, T5>, T6>&)': ../inst/include/armadillo_bits/format_wrap.hpp:354:25: error: 'snprintf' is not a member of 'std'
In file included from ../inst/include/armadillo:113:0,
                 from ../inst/include/RcppArmadilloForward.h:36,
                 from ../inst/include/RcppArmadillo.h:25,
                 from RcppArmadillo.cpp:22:
../inst/include/armadillo_bits/format_wrap.hpp: In function 'std::string arma::arma_boost::str(const arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::basic_format<arma::arma_boost::format, T2>, T3>, T4>, T5>, T6>, T7>&)': ../inst/include/armadillo_bits/format_wrap.hpp:406:25: error: 'snprintf' is not a member of 'std'
*** Error code 1
Stop in /tmp/RtmpXKyP4Y/R.INSTALL4dde5c9e/RcppArmadillo/src.
ERROR: compilation failed for package 'RcppArmadillo'
* removing '/usr/local/lib/R/library/RcppArmadillo'
------------------------------------------


Obviously there is something wrong with 'snprintf'. The appended patch avoids the breakage.

On the other hand the is a definition on FreeBSD for 'snprintf' in libc's stdio (/usr/src/lib/libc/stdio/snprintf.c). There is a short hint in the manpage:

SYNOPSIS
  #define _WITH_DPRINTF
  #include <stdio.h>
     int
     snprintf(char * restrict str, size_t size,
              const char * restrict format, ...);

If this is the same function as meant in 'RcppArmadilloConfig.h' is there any way to integrate it into the package? Please let me know if I can test something.

Many thanks in advance,
Rainer Hurling
--- inst/include/RcppArmadilloConfig.h.origin   2011-05-27 17:18:47.000000000 
+0200
+++ inst/include/RcppArmadilloConfig.h  2011-05-30 13:53:25.000000000 +0200
@@ -37,7 +37,7 @@
 
 
 /* TODO: we might need to undef this on other platforms as well */
-#if defined(__GNUC__) && defined(_WIN64)
+#if defined(__GNUC__) && defined(_WIN64) || defined(__FreeBSD__)
 #undef ARMA_HAVE_STD_SNPRINTF
 #endif
 
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to