[Rcpp-devel] Conflict between RInside and OpenCV

Romain Francois romain at r-enthusiasts.com
Mon Apr 26 10:14:51 CEST 2010


Le 24/04/10 04:43, Xavi de Blas a écrit :
>
> Finally it works!
>
> Yes, it was a mess with my OpenCV libraries, sometimes it's not easy
> to have them working
>
> Knowing that it worked for you it helped me to find the problem
>
> Thanks for your fast response. Soon I will post how I integrated this
> in my software, i think you will like it.

I look forward to seeing this.


In RInside, we might need to protect the

global_env.find(".AutoloadEnv")

and maybe throw a std::runtime_error instead of the exception find throws.

Romain

> Bye
>
>
> 2010/4/23 Dirk Eddelbuettel<edd at debian.org>:
>>
>> On 23 April 2010 at 23:07, Xavi de Blas wrote:
>> | Hello again
>> |
>> | I deleted .RData and .Rprofile and problem persists.
>> |
>> | In order to have OpenCV right-working with last ffmpeg i have so much
>> | versions and compilations and maybe there's a problem difficult to
>> | reproduce.
>> |
>> | Can you please post your compilation line?
>>
>> Here is what I did:
>>
>>   1) sudo apt-get install libhighgui-dev        # on Ubuntu 9.10 / amd64
>>
>>   2) modify rinside_sample0.cpp to rinside_sample0opencv.cpp
>>      I used your example of
>>
>>           a) adding one line   #include<opencv/cv.>
>>              where I used<>  instead of "" as I use system headers
>>
>>           b) add the same CvFont font = cvFont(1);  line
>>
>>   3)  make                      # which fails, no
>>
>>   4)  As I wrote, insert '-lhighgui' right after '-llapack' in the (long) g++
>>       command produced by make
>>
>>   5)  My machine is current Ubuntu 9.10 plus a few local packages and a few
>>       things I am (co-)author of via SVN.   RInside current, Rcpp a release
>>       ot two behind.
>>
>>   6)  I use the R binaries from CRAN so it is R 2.11.0 (not that this matters
>>       for anything but maybe the compile options).
>>
>> I suggest you temporarily remove / rename all you local OpenCV versions and
>> stick with the Ubuntu versions to replicate what I did.
>>
>> No Rcpp or RInside bug here.
>>
>> Dirk
>>
>>
>> | I'm glad that it's working for you
>> |
>> |
>> | Thanks
>> |
>> |
>> |
>> | 2010/4/23 Dirk Eddelbuettel<edd at debian.org>:
>> |>
>> |>  On 23 April 2010 at 22:25, Xavi de Blas wrote:
>> |>  | Hello Dirk
>> |>  |
>> |>  |
>> |>  |>  No idea whatsoever. That seems very bizarre and implausible.  Do you have
>> |>  |>  anything in your ~/.Profile?
>> |>  |
>> |>  | Nothing special
>> |>
>> |>  It is either that file, or an existing .RData you are loading by virtue of
>> |>  initializing R.
>> |>
>> |>  I can run your example without a problem on an Ubuntu 9.10 box using
>> |>  libhighgui-dev and all it dependents.
>> |>
>> |>  I used RInside from SVN, but that shouldn't matter.  On the machine where I
>> |>  tested this Rcpp is reasonably current but less recent than 0.7.12.
>> |>
>> |>  |>
>> |>  |>  Also, is
>> |>  |>
>> |>  |>        -L/usr/local/lib -lhighgui
>> |>  |>
>> |>  |>  all you need to link with OpenCV?  [ BTW the -L/usr/local/lib is redundant. ]
>> |>  |
>> |>  |
>> |>  | I  normally use this:
>> |>  |
>> |>  | g++ `pkg-config --cflags opencv` kneeAngle.cpp -o kneeAngle
>> |>  | `pkg-config --libs opencv`
>> |>  |
>> |>  | that means:
>> |>  |
>> |>  | -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml
>> |>  |
>> |>  | but for this small sample, there's enought with lhighgui
>> |>
>> |>  Agreed.
>> |>
>> |>  I just inserted -lhighgui right after -llapack, and it links and runs.  So no
>> |>  bug here with RInside.
>> |>
>> |>  |>  Also, that seems to be rinsinse_sample0, not 6, no?
>> |>  |
>> |>  |
>> |>  | Yes sorry, i confused trying to send minimal code possible. Is sample 0
>> |>  |
>> |>  | Maybe I update Ubuntu system, reinstall OpenCV.... but just prefer to
>> |>  | wait if there are some ideas
>> |>  |
>> |>  | I've been all the day trying different compile options and reducing
>> |>  | code, and I feel so unhappy. Thanks for your fast response
>> |>
>> |>  You created a side-effect. Only you can figure out what you did or what you
>> |>  have in .RData or .Rprofile or related files.
>> |>
>> |>  There is no problem with your simple test file.
>> |>
>> |>  --
>> |>    Regards, Dirk
>> |>
>>
>> --
>>   Regards, Dirk
>>
> _______________________________________________
> 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
>
>


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/9aKDM9 : embed images in Rd documents
|- http://tr.im/OIXN : raster images and RImageJ
|- http://tr.im/OcQe : Rcpp 0.7.7



More information about the Rcpp-devel mailing list