[Bioc-devel] Problem with non-portable compiler flags on package test

Jochen Knaus jo @end|ng |rom |mb|@un|-|re|burg@de
Fri Apr 12 10:17:13 CEST 2019

Hi everybody,

for our new R package "Netboost" we have a problem about non portable 
compiler flags. Basically we support AVX in our own C++ code (using 
compiler intrinsics to use the AVX units). Of course we have a non-AVX 
code path.

For building we use autotools and configure to determine at installation 
time if the AVX unit is available and supported by the given compilers. 
If available then compilation is done with AVX, if not, then ordinary 
code path is used.

The problem is the R package test, which does see the set AVX flag in 
"Makevars" (as Makevars.in is configured to use AVX if the test is 
executed on a machine supporting AVX).

Note: due to bundled software, this is a Linux only package, so no 
support for Microsoft compilers is required (with other flag names).

Is there any way around this warning, which is a real false-positive, as 
the flag is not set in environments not suitable.

Thanks a lot for any help!



for testing we use GNU Autotools and the AX_EXT M4-macroset to determine 
the hardware and compiler support for additional features: 



# Probe CPU and compilers


PKG_CXXFLAGS=`${R_HOME}/bin/Rscript -e "Rcpp:::CxxFlags()"` @SIMD_FLAGS@

Running R CMD CHECK with --as-cran, we get the warning:


* checking compilation flags used ... WARNING Compilation used the 
following non-portable flag(s): -Wno-deprecated -maes -mavx -mavx2 -mfma 
-mmmx -msse -msse3 -msse4.1 -msse4.2 -mssse3

(Basically we only need -mavx and optionally FMA, but AX_EXT sets all).

Jochen Knaus
Institute of Biometry and Statistics
Faculty of Medicine and Medical Center - University of Freiburg
Office: IMBI library
Postal address: Stefan-Meier-Str. 26, D-79104 Freiburg
Phone: +49/761/203-5528
Mail: jo using imbi.uni-freiburg.de
Homepage: http://www.imbi.uni-freiburg.de

	[[alternative HTML version deleted]]

More information about the Bioc-devel mailing list