Re: [R] How to make sure R's g++ compiler uses certain C++ flags when making a package

From: Mike Marchywka <marchywka_at_hotmail.com>
Date: Thu, 17 Mar 2011 07:56:09 -0400



> Date: Wed, 16 Mar 2011 13:50:37 -0700
> From: solomon.messing_at_gmail.com
> To: r-help_at_r-project.org
> Subject: Re: [R] How to make sure R's g++ compiler uses certain C++ flags when making a package
>
> Looks like the problem may be that R is automatically passing this flag to
> the g++ compiler: "-arch x86_64" which appears to be causing trouble for
> opencv. Does anyone know how to suppress this flag?

Are you builing a 32 or 64 bit app? I haven't looked but offhand that may be what this flag is for ( you can man g++ and check I suppose )

I was going to reply after doing some checking as I have never actually made a complete R package but I did make a test one and verified I could call the c++ code from R. I seem to remember that it was easy to just invoke g++ explicitly and R would use whatever binaries you happen to have left there. That is, if you just compile the code for your R modules yourself there is no real reason to worry about how R does it. Mixing some flags will prevent linking or, worse, create mysterious run time errors.

Also, IIRC, your parameters were the output of foreign scripts ( opencv apparently) and not too helpful here ( and in any case you should echo these to see what they are if they are an issue).

>
> --
                                               



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 17 Mar 2011 - 14:01:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Mar 2011 - 14:10:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive