[R-pkg-devel] How to use O4 flag in an RCpp project?
Kevin Ushey
kev|nu@hey @end|ng |rom gm@||@com
Wed May 21 23:21:44 CEST 2025
Peiyuan,
Respectfully -- RTFM.
https://cran.r-project.org/doc/manuals/R-exts.html#Using-Makevars
https://cran.r-project.org/doc/manuals/R-admin.html#Customizing-package-compilation
The compilation flags are coming either from your R installation's
etc/Makeconf, etc/Makevars.site, a user Makevars, or the package's
Makevars.
You can also use R CMD SHLIB --dry-run to figure out what `make`
invocation R is using, so you can know where these compiler flags are
coming from. For example:
$ R CMD SHLIB --dry-run example.cpp
make cmd is
make -f 'Makevars' -f
'/Library/Frameworks/R.framework/Resources/etc/Makeconf' -f
'/Library/Frameworks/R.framework/Resources/share/make/shlib.mk' -f
'/Users/kevin/.R/Makevars' SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)'
SHLIB_LD='$(SHLIB_CXXLD)' SHLIB='example.so' OBJECTS='example.o'
Kevin
On Wed, May 21, 2025 at 2:12 PM Dirk Eddelbuettel <edd using debian.org> wrote:
>
>
> On 21 May 2025 at 13:55, Peiyuan Zhu wrote:
> | Thanks Kasper, but I don’t know how exactly to accomplish this. As Dirk says
> | the system overwrites it every time.
>
> That is *not* what Dirk said.
>
> Dirk
>
> --
> dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
More information about the R-package-devel
mailing list