Cannot override default -O3 flag on Winodws, dll does not have symbols

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot override default -O3 flag on Winodws, dll does not have symbols

rtaylor
In trying to compile a package with c code using Rtools, -O3 is added by default. This comes from Makeconf?  Compiler flags (CFLAGS="-O0 -g" ) set in src/Makevars.win or src/Makevars appear before this.  

nm pkg.dll reveals no symbols!

How can I compile a Windows package with "-O2 -g"?

Thanks,
RT
Reply | Threaded
Open this post in threaded view
|

Re: Cannot override default -O3 flag on Winodws, dll does not have symbols

Dirk Eddelbuettel

On 9 January 2013 at 18:58, rtaylor wrote:
| In trying to compile a package with c code using Rtools, -O3 is added by
| default. This comes from Makeconf?  Compiler flags (CFLAGS="-O0 -g" ) set in
| src/Makevars.win or src/Makevars appear before this.  
|
| nm pkg.dll reveals no symbols!
|
| How can I compile a Windows package with "-O2 -g"?

a)  [long way] By locally building R with such a configure flag

b)  [shortcut] By editing the Makeconf file of the R installation used for
    compiling, eg in $R_HOME/etc/Makeconf (or maybe Makeconf.win)

Dirk

--
Dirk Eddelbuettel | [hidden email] | http://dirk.eddelbuettel.com

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cannot override default -O3 flag on Winodws, dll does not have symbols

Prof Brian Ripley
In reply to this post by rtaylor
On 10/01/2013 02:58, rtaylor wrote:
> In trying to compile a package with c code using Rtools, -O3 is added by
> default. This comes from Makeconf?  Compiler flags (CFLAGS="-O0 -g" ) set in
> src/Makevars.win or src/Makevars appear before this.
>
> nm pkg.dll reveals no symbols!

That is not a function of using -O3, if there is useful code (as there
needs to be in an R package since you need to link to entry points).
>
> How can I compile a Windows package with "-O2 -g"?

By following the manuals.  'Writing R Extensions' points you to your
local version of
http://cran.r-project.org/doc/manuals/r-release/R-admin.html#Customizing-package-compilation

But it you want debug symbols, read about how to build a debug version
of R in that manual (and use -gdwarf-2).


>
> Thanks,
> RT
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Cannot-override-default-O3-flag-on-Winodws-dll-does-not-have-symbols-tp4655106.html
> Sent from the R devel mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel