[Bioc-devel] use -Wa, -mbig-obj -O3 when building package under Windows

Ramon Diaz-Uriarte rd|@z02 @end|ng |rom gm@||@com
Fri May 24 16:16:12 CEST 2019


Dear All,

For a package we develop, OncoSimulR
(https://bioconductor.org/packages/release/bioc/html/OncoSimulR.html), we
have added new functionality
(https://github.com/rdiaz02/OncoSimul/tree/freq-dep-fitness) that uses the
ExprTk library[1] for parsing and evaluation of mathematical
expressions. This works fine under Linux. But it is known[2] that ExprTk
can fail when using MinGW with the "too many sections" error.


A solution that has been suggested is to use -Wa,-mbig-obj with -O3 [3].
But I am unable to have R compile the package with -O3; -O3 is never
placed at the right of the default -O2 no matter what I set in
Makevars.win[4].



Any suggestions?

Thanks,


R.



[1] http://www.partow.net/programming/exprtk/index.html
[2] https://sourceforge.net/p/mingw-w64/discussion/723797/thread/c6b70624/.
[3] https://github.com/MrKepzie/Natron/blob/master/Engine/ExprTk.cpp
    "// exprtk requires -Wa,-mbig-obj on mingw, but there is a bug that
    prevents linking if not using -O3"

    See also, for example, https://discourse.mc-stan.org/t/too-many-sections/6261

[4]
https://stackoverflow.com/questions/23414448/r-makevars-file-to-overwrite-r-cmds-default-g-options

Our package has

CXX_STD = CXX11


And I've tried:


## To the left of -O2
PKG_CXXFLAGS = -Wa,-mbig-obj -O3

## To the left of -O2
PKG_CXXFLAGS += -Wa,-mbig-obj -O3


## Also to the left of -O2
PKG_CPPFLAGS = -Wa,-mbig-obj -O3

## Also to the left of -O2
PKG_CPPFLAGS += -Wa,-mbig-obj -O3

## Ignored
PKG_CXX11FLAGS = -Wa,-mbig-obj -O3
## Ignored
PKG_CXX11FLAGS += -Wa,-mbig-obj -O3




--
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-25
Facultad de Medicina
Universidad Autónoma de Madrid
Arzobispo Morcillo, 4
28029 Madrid
Spain

Phone: +34-91-497-2412

Email: rdiaz02 using gmail.com
       ramon.diaz using iib.uam.es

http://ligarto.org/rdiaz



More information about the Bioc-devel mailing list