[Rcpp-devel] Rcpp-devel Digest, Vol 61, Issue 3

דוד ארנבורג david.arenburg at gmail.com
Thu Nov 13 23:56:04 CET 2014


Dirk,

I've tried running your code and got the following


Generated extern "C" functions
--------------------------------------------------------


#include <Rcpp.h>

Generated R functions
-------------------------------------------------------

`.sourceCpp_22140_DLLInfo` <- dyn.load('C:/Users/DARENB~
1.INT/AppData/Local/Temp/RtmpQzZsMV/sourcecpp_1ff431785209/sourceCpp_26179.dll
')


rm(`.sourceCpp_22140_DLLInfo`)

Building shared library
--------------------------------------------------------

DIR: C:/Users/DARENB~
1.INT/AppData/Local/Temp/RtmpQzZsMV/sourcecpp_1ff431785209

C:/PROGRA~1/R/R-31~1.1/bin/x64/R CMD SHLIB -o "sourceCpp_26179.dll"
--preclean "BoostEx.cpp"
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.1/include" -DNDEBUG
-I"C:/Users/darenburg.INTRANET/Documents/R/win-library/3.1/Rcpp/include"
 -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall
 -mtune=core2 -c BoostEx.cpp -o BoostEx.o
BoostEx.cpp: In function 'SEXPREC* sourceCpp_32214_computeGCD(SEXP, SEXP)':
BoostEx.cpp:10:39: error: 'computeGCD' was not declared in this scope
BoostEx.cpp: In function 'SEXPREC* sourceCpp_32214_computeLCM(SEXP, SEXP)':
BoostEx.cpp:25:39: error: 'computeLCM' was not declared in this scope
make: *** [BoostEx.o] Error 1
Warning message:
running command 'make -f "C:/PROGRA~1/R/R-31~1.1/etc/x64/Makeconf" -f
"C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk"
SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)'
SHLIB="sourceCpp_26179.dll" WIN=64 TCLBIN=64 OBJECTS="BoostEx.o"' had
status 2
Error in
Rcpp::sourceCpp("C:\\Users\\darenburg.INTRANET\\Desktop\\David\\R\\Rcpp\\boostEx.cpp",
 :
  Error 1 occurred building shared library.
----

It also says in the issues that computeGCD and computeLCM were declared in
this scope

Thanks,
David

On Wed, Nov 12, 2014 at 1:00 PM, <
rcpp-devel-request at lists.r-forge.r-project.org> wrote:

> Send Rcpp-devel mailing list submissions to
>         rcpp-devel at lists.r-forge.r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
> or, via email, send a message with subject or body 'help' to
>         rcpp-devel-request at lists.r-forge.r-project.org
>
> You can reach the person managing the list at
>         rcpp-devel-owner at lists.r-forge.r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Rcpp-devel digest..."
>
>
> Today's Topics:
>
>    1. Can't compile BOOST package via Rcpp on Windows7 OS (??? ???????)
>    2. Re: Can't compile BOOST package via Rcpp on Windows7 OS
>       (Dirk Eddelbuettel)
>    3. Re: Can't compile BOOST package via Rcpp on Windows7 OS
>       (Dirk Eddelbuettel)
>    4. Re: Can't compile BOOST package via Rcpp on Windows7 OS
>       (Gabor Grothendieck)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 11 Nov 2014 16:51:53 +0200
> From: ??? ??????? <david.arenburg at gmail.com>
> To: rcpp-devel at lists.r-forge.r-project.org
> Subject: [Rcpp-devel] Can't compile BOOST package via Rcpp on Windows7
>         OS
> Message-ID:
>         <
> CAL6upbb-a_v56XVimHijZTUeFDa1Bfmr1Svkkb5D+JsM_gB8vQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi guys,
>
> So I've installed and loaded the BH
> <http://cran.r-project.org/web/packages/BH/index.html> package without any
> errors, then I tried to run this example
> <http://gallery.rcpp.org/articles/a-first-boost-example/> but sourceCpp
> failed to compile it. I was wondering if there is a quick fix for this and
> I'm just making some very basic mistake here
>
> I saw this
> <
> http://stackoverflow.com/questions/19651954/is-it-possible-to-build-an-r-package-which-use-rcpp-and-boost-thread-on-win-b
> >
> post
> lately and I'm not sure if this means that I just can't compile BH on
> windows or just can't build a package which depends on it
>
> As a side note, I was trying to add the quantile() function from BOOST to
> this
> <
> http://stackoverflow.com/questions/26786078/rcpp-quantile-implementation/26789292#26789292
> >
> SO
> answer in order to improve it for future readers as I didn't find any nice
> BOOST/Rcpp implementations online other than in Dirks Gallery
>
> Thanks,
> David
>
> ---
>
> sessionInfo()
> R version 3.1.1 (2014-07-10)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
>
> locale:
> [1] LC_COLLATE=Hebrew_Israel.1255  LC_CTYPE=Hebrew_Israel.1255
>  LC_MONETARY=Hebrew_Israel.1255
> [4] LC_NUMERIC=C                   LC_TIME=Hebrew_Israel.1255
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] Rcpp_0.11.3 BH_1.54.0-4
>
> loaded via a namespace (and not attached):
> [1] tools_3.1.1
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20141111/d0f2d8ff/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Tue, 11 Nov 2014 09:14:39 -0600
> From: Dirk Eddelbuettel <edd at debian.org>
> To: ??? ???????  <david.arenburg at gmail.com>
> Cc: rcpp-devel at lists.r-forge.r-project.org
> Subject: Re: [Rcpp-devel] Can't compile BOOST package via Rcpp on
>         Windows7 OS
> Message-ID: <21602.10207.495958.672521 at max.nulle.part>
> Content-Type: text/plain; charset=utf-8
>
>
> On 11 November 2014 at 16:51, ??? ??????? wrote:
> | Hi guys,
> |
> | So I've installed and loaded the?BH?package without any errors, then I
> tried to
> | run?this example?but sourceCpp failed to compile it. I was wondering if
> there
> | is a quick fix for this and I'm just making some very basic mistake here
> |
> | I saw?this?post lately and I'm not sure if this means that I just can't
> compile
> | BH on windows or just can't build a package which depends on it
> |
> | As a side note, I was trying to add the quantile() function from BOOST
> to?this
> | ?SO answer in order to improve it for future readers as I didn't find
> any nice
> | BOOST/Rcpp implementations online other than in Dirks Gallery
>
> No error report came along :-/
>
> But there is no known road block for BH -- as a CRAN package, it is happily
> use by win-builder as well as the standard R builder for Windows.  We have
> over two dozen packages now depending on BH.
>
> Dirk
>
> |
> | Thanks,
> | David
> |
> | ---
> |
> | sessionInfo()
> | R version 3.1.1 (2014-07-10)
> | Platform: x86_64-w64-mingw32/x64 (64-bit)
> |
> | locale:
> | [1] LC_COLLATE=Hebrew_Israel.1255 ?LC_CTYPE=Hebrew_Israel.1255 ?
> ?LC_MONETARY=
> | Hebrew_Israel.1255
> | [4] LC_NUMERIC=C ? ? ? ? ? ? ? ? ? LC_TIME=Hebrew_Israel.1255 ? ?
> |
> | attached base packages:
> | [1] stats ? ? graphics ?grDevices utils ? ? datasets ?methods ? base ? ??
> |
> | other attached packages:
> | [1] Rcpp_0.11.3 BH_1.54.0-4
> |
> | loaded via a namespace (and not attached):
> | [1] tools_3.1.1
> | _______________________________________________
> | Rcpp-devel mailing list
> | Rcpp-devel at lists.r-forge.r-project.org
> | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 11 Nov 2014 09:46:44 -0600
> From: Dirk Eddelbuettel <edd at debian.org>
> To: ??? ???????  <david.arenburg at gmail.com>
> Cc: rcpp-devel at lists.r-forge.r-project.org
> Subject: Re: [Rcpp-devel] Can't compile BOOST package via Rcpp on
>         Windows7 OS
> Message-ID: <21602.12132.705103.600405 at max.nulle.part>
> Content-Type: text/plain; charset=us-ascii
>
>
> David,
>
> And for good measure, I just dropped the very first Rcpp Gallery example
> into
> RStudio on my work machine (which, while being Windows, mostly serves for
> receiving x11 terminals from Linux). It passed without any issues:
>
> R> Rcpp::sourceCpp('C:/TEMP/boostEx.cpp', verbose=TRUE, rebuild=TRUE)
>
> Generated extern "C" functions
> --------------------------------------------------------
>
>
> #include <Rcpp.h>
>
> RcppExport SEXP sourceCpp_32214_computeGCD(SEXP aSEXP, SEXP bSEXP) {
> BEGIN_RCPP
>     SEXP __sexp_result;
>     {
>         Rcpp::RNGScope __rngScope;
>         Rcpp::traits::input_parameter< int >::type a(aSEXP );
>         Rcpp::traits::input_parameter< int >::type b(bSEXP );
>         int __result = computeGCD(a, b);
>         PROTECT(__sexp_result = Rcpp::wrap(__result));
>     }
>     UNPROTECT(1);
>     return __sexp_result;
> END_RCPP
> }
>
> RcppExport SEXP sourceCpp_32214_computeLCM(SEXP aSEXP, SEXP bSEXP) {
> BEGIN_RCPP
>     SEXP __sexp_result;
>     {
>         Rcpp::RNGScope __rngScope;
>         Rcpp::traits::input_parameter< int >::type a(aSEXP );
>         Rcpp::traits::input_parameter< int >::type b(bSEXP );
>         int __result = computeLCM(a, b);
>         PROTECT(__sexp_result = Rcpp::wrap(__result));
>     }
>     UNPROTECT(1);
>     return __sexp_result;
> END_RCPP
> }
>
> Generated R functions
> -------------------------------------------------------
>
> `.sourceCpp_32214_DLLInfo` <-
>
> dyn.load('C:/Users/DEDDEL~1/AppData/Local/Temp/Rtmpa00Mwv/sourcecpp_21f846bbab5/sourceCpp_2293.dll')
>
> computeGCD <- Rcpp:::sourceCppFunction(function(a, b) {}, FALSE,
> `.sourceCpp_32214_DLLInfo`, 'sourceCpp_32214_computeGCD')
> computeLCM <- Rcpp:::sourceCppFunction(function(a, b) {}, FALSE,
> `.sourceCpp_32214_DLLInfo`, 'sourceCpp_32214_computeLCM')
>
> rm(`.sourceCpp_32214_DLLInfo`)
>
> Building shared library
> --------------------------------------------------------
>
> DIR: C:/Users/DEDDEL~1/AppData/Local/Temp/Rtmpa00Mwv/sourcecpp_21f846bbab5
>
> C:/opt/R-CURR~1/bin/x64/R CMD SHLIB -o "sourceCpp_2293.dll" --preclean
> "boostEx.cpp"
> g++ -m64 -I"C:/opt/R-CURR~1/include" -DNDEBUG
> -I"c:/opt/R-library/Rcpp/include" -I"c:/opt/R-library/BH/include"
> -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall
> -mtune=core2
> -c boostEx.cpp -o boostEx.o
> g++ -m64 -shared -s -static-libgcc -o sourceCpp_2293.dll tmp.def boostEx.o
> -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64
> -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/opt/R-CURR~1/bin/x64 -lR
> R>
>
>
> Hth, Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 11 Nov 2014 10:46:52 -0500
> From: Gabor Grothendieck <ggrothendieck at gmail.com>
> To: ??? ??????? <david.arenburg at gmail.com>
> Cc: "rcpp-devel at lists.r-forge.r-project.org"
>         <rcpp-devel at lists.r-forge.r-project.org>
> Subject: Re: [Rcpp-devel] Can't compile BOOST package via Rcpp on
>         Windows7 OS
> Message-ID:
>         <CAP01uRkYyL=
> NbZsZ6P+9OfA2SuGoM1NVq_RTuNkLF1vzCWK+KA at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Tue, Nov 11, 2014 at 9:51 AM, ??? ??????? <david.arenburg at gmail.com>
> wrote:
> > Hi guys,
> >
> > So I've installed and loaded the BH package without any errors, then I
> tried
> > to run this example but sourceCpp failed to compile it. I was wondering
> if
> > there is a quick fix for this and I'm just making some very basic mistake
> > here
> >
> > I saw this post lately and I'm not sure if this means that I just can't
> > compile BH on windows or just can't build a package which depends on it
> >
> > As a side note, I was trying to add the quantile() function from BOOST to
> > this SO answer in order to improve it for future readers as I didn't find
> > any nice BOOST/Rcpp implementations online other than in Dirks Gallery
> >
> > Thanks,
> > David
> >
> > ---
> >
> > sessionInfo()
> > R version 3.1.1 (2014-07-10)
> > Platform: x86_64-w64-mingw32/x64 (64-bit)
> >
> > locale:
> > [1] LC_COLLATE=Hebrew_Israel.1255  LC_CTYPE=Hebrew_Israel.1255
> > LC_MONETARY=Hebrew_Israel.1255
> > [4] LC_NUMERIC=C                   LC_TIME=Hebrew_Israel.1255
> >
> > attached base packages:
> > [1] stats     graphics  grDevices utils     datasets  methods   base
> >
> > other attached packages:
> > [1] Rcpp_0.11.3 BH_1.54.0-4
> >
> > loaded via a namespace (and not attached):
> > [1] tools_3.1.1
> >
> > _______________________________________________
> > Rcpp-devel mailing list
> > Rcpp-devel at lists.r-forge.r-project.org
> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
> Calling the file test_boost.cpp this ran without errors for me:
>
> library(Rcpp)
> sourceCpp("test_boost.cpp")
>
> and repeating the test runs shown at the link you mentioned gave the
> same answers as there.  I am using Windows 8.1, the same Rcpp and BH
> versions as you and
>
> > R.version.string
> [1] "R version 3.1.2 RC (2014-10-25 r66870)"
>
> and this version of Rtools:
>
> C:\Rtools>type VERSION.txt
> Rtools version 3.1.0.1942
>
>
>
>
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
>
>
> ------------------------------
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
> End of Rcpp-devel Digest, Vol 61, Issue 3
> *****************************************
>



-- 
דוד
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20141114/87b8b5b5/attachment-0001.html>


More information about the Rcpp-devel mailing list