Neumann, Steffen
2017-Apr-19 12:19 UTC
[Rd] Default R-3.4.0 RC CXXFLAGS without -O2 on x86_64-linux-gnu with g++-5.4.0 causes WARNING from stl_list.h
Hi r-devel, a recent install of R-3.4.0 RC (2017-04-13 r72510)? on Linux (Ubuntu 16.04.1 LTS) x86_64-linux-gnu? with?g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 (see?http://bioconductor.org/checkResults/devel/bioc-LATEST/malbec2-NodeInfo.html?for more)? results in CXXFLAGS not containing "-O2" as optimisation flag, there is only " -Wall", while?CFLAGS are happy with "-g -O2 -Wall" This has an influence in at least one place https://stat.ethz.ch/pipermail/bioc-devel/2017-April/010733.html where we have WARNINGS in R CMD check from "Found ?abort?,? possibly from ?abort? (C)" in packages xcms/mzR. The abort() call is not coming from XCMS, but rather? from the C++ code in the STL: [...] # 1770 "/usr/include/c++/5/bits/stl_list.h" void _M_check_equal_allocators(list& __x) { ?if (_M_get_Node_allocator()) ???__builtin_abort(); } If we compile with -O2 optimisation, this getting rid of? the abort() symbol, as shown? in https://github.com/sneumann/xcms/issues/150#issuecomment-293545521 Martin Morgan created a minimum example that shows that? the symbol is indeed deep down in the STL (see below and in: https://stat.ethz.ch/pipermail/bioc-devel/2017-April/010837.html?) This raises several questions: 1) is there any way to avoid the WARNING / abort() inside? ? ?the STL list implementation ? Or just live with it ? 2) If not, is there a reason why the Bioconductor build farm? ? ?Ubuntu machine is not using -O2 as default CXXFLAG ? ? ?BioC admins are trying to have a vanilla R installation with defaults.? ? ?According to Herve Pages, CXXFLAGS without -O2 is default? ? ?since R-3.4 beta, but I don't know enough about the package? ? ?build logic to point to a particular R commit.? 3) I thought about cheating the system and add -O2? ? ?in the package CXXFLAGS, but Martin Morgan? ? ?recommends packages shouldn't mess and override system build defaults ? ?to mask and paper over the actual issue having a nasty abort()? ? ?lurking somewhere. ? ?But I couldn't add PKG_CXXFLAGS=-O2 in first place, since that? ? ?triggers the different WARNING that -O2 is not portable.? => Any help and input would be highly appreciated.? Thanks in advance,? yours, Steffen tmp.cpp by Martin Morgan (also in above linked mail thread) ------- #include <list> int foo(int argc, const char *argv[]) { ?????std::list<int> l1, l2; ?????std::list<int>::iterator it; ?????it = l1.begin(); ?????l1.splice (it, l2); // mylist1: 1 10 20 30 2 3 4 ?????return 0; } ------- Test with ???rm -f tmp.o && R CMD SHLIB tmp.cpp && nm tmp.o | grep abort with compiler settings in ~/.R/Makevars with/without -O2 ------------- CXXFLAGS = -g -O0 ------------- -- IPB Halle????????????????????AG Massenspektrometrie & Bioinformatik Dr. Steffen Neumann??????????http://www.IPB-Halle.DE Weinberg 3 ? ? ? ? ? ? ? ? ? Tel. +49 (0) 345 5582 - 1470 06120 Halle ? ? ? ? ? ? ? ? ? ? ? +49 (0) 345 5582 - 0 ? ? ? ? ?? sneumann(at)IPB-Halle.DE?????Fax. +49 (0) 345 5582 - 1409
Martyn Plummer
2017-Apr-20 08:21 UTC
[Rd] Default R-3.4.0 RC CXXFLAGS without -O2 on x86_64-linux-gnu with g++-5.4.0 causes WARNING from stl_list.h
This is fixed in R-rc_2017-04-19_r72555.tar.gz If you are affected by this issue then please test the RC tarball. This is the last chance to detect problems (including those created by the last-minute patch) before the release of R 3.4.0. Martyn On Wed, 2017-04-19 at 12:19 +0000, Neumann, Steffen wrote:> Hi r-devel, > > a recent install of R-3.4.0 RC (2017-04-13 r72510)? > on Linux (Ubuntu 16.04.1 LTS) x86_64-linux-gnu? > with?g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 > (see?http://bioconductor.org/checkResults/devel/bioc-LATEST/malbec2-N > odeInfo.html?for more)? > results in CXXFLAGS not containing "-O2" as optimisation flag, > there is only " -Wall", while?CFLAGS are happy with "-g -O2 > -Wall" > > This has an influence in at least one place > https://stat.ethz.ch/pipermail/bioc-devel/2017-April/010733.html > where we have WARNINGS in R CMD check from "Found ?abort?,? > possibly from ?abort? (C)" in packages xcms/mzR. > The abort() call is not coming from XCMS, but rather? > from the C++ code in the STL: > > [...] > # 1770 "/usr/include/c++/5/bits/stl_list.h" > void _M_check_equal_allocators(list& __x) { > ?if (_M_get_Node_allocator()) > ???__builtin_abort(); > } > > If we compile with -O2 optimisation, this getting rid of? > the abort() symbol, as shown? > in https://github.com/sneumann/xcms/issues/150#issuecomment-293545521 > > Martin Morgan created a minimum example that shows that? > the symbol is indeed deep down in the STL (see below and in: > https://stat.ethz.ch/pipermail/bioc-devel/2017-April/010837.html?) > > This raises several questions: > > 1) is there any way to avoid the WARNING / abort() inside? > ? ?the STL list implementation ? Or just live with it ? > > 2) If not, is there a reason why the Bioconductor build farm? > ? ?Ubuntu machine is not using -O2 as default CXXFLAG ? > ? ?BioC admins are trying to have a vanilla R installation with > defaults.? > ? ?According to Herve Pages, CXXFLAGS without -O2 is default? > ? ?since R-3.4 beta, but I don't know enough about the package? > ? ?build logic to point to a particular R commit.? > > 3) I thought about cheating the system and add -O2? > ? ?in the package CXXFLAGS, but Martin Morgan? > ? ?recommends packages shouldn't mess and override system build > defaults > ? ?to mask and paper over the actual issue having a nasty abort()? > ? ?lurking somewhere. > ? ?But I couldn't add PKG_CXXFLAGS=-O2 in first place, since that? > ? ?triggers the different WARNING that -O2 is not portable.? > > => Any help and input would be highly appreciated.? > > Thanks in advance,? > yours, > Steffen > > > tmp.cpp by Martin Morgan (also in above linked mail thread) > ------- > #include <list> > > int foo(int argc, const char *argv[]) { > ?????std::list<int> l1, l2; > ?????std::list<int>::iterator it; > > ?????it = l1.begin(); > ?????l1.splice (it, l2); // mylist1: 1 10 20 30 2 3 4 > > ?????return 0; > } > ------- > > Test with > > ???rm -f tmp.o && R CMD SHLIB tmp.cpp && nm tmp.o | grep abort > > with compiler settings in ~/.R/Makevars with/without -O2? > ------------- > CXXFLAGS = -g -O0 > ------------- > > > > > > -- > IPB Halle????????????????????AG Massenspektrometrie & > Bioinformatik > Dr. Steffen Neumann??????????http://www.IPB-Halle.DE > Weinberg 3 ? ? ? ? ? ? ? ? ? Tel. +49 (0) 345 5582 - 1470 > 06120 Halle ? ? ? ? ? ? ? ? ? ? ? +49 (0) 345 5582 - 0 ? ? ? ? ?? > sneumann(at)IPB-Halle.DE?????Fax. +49 (0) 345 5582 - 1409 > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Dear R-developers, I would appreciate any insights over compiling R 3.4 with Intel MKL -- I have been successful until R 3.3.3 but now it stops complaining about pcre though it worked without Intel MKL as follows, ./configure LDFLAGS=-L/genetics/data/software/lib CFLAGS=-fPIC -I/genetics/data/software/include --enable-R-shlib I have used, export MKL_NUM_THREADS=15 export MKLROOT=/genetics/data/software/intel/composer_xe_2013.4.183/mkl export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64 /genetics/data/software/intel/composer_xe_2013.4.183/mkl/bin/mklvars.sh intel64 CPPFLAGS="-I/genetics/data/software/include -L/genetics/data/software/lib" \ ./configure --prefix=/genetics/data/software --enable-R-shlib --enable-threads=posix --with-lapack \ --with-blas="-fopenmp -m64 -I$MKLROOT/include -L$MKLROOT/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm" Many thanks, Jing Hua [[alternative HTML version deleted]]
Apparently Analagous Threads
- Default R-3.4.0 RC CXXFLAGS without -O2 on x86_64-linux-gnu with g++-5.4.0 causes WARNING from stl_list.h
- SSOAP fails with .types[[1]] : subscript out of bounds
- SSOAP: arguments passed as
- Using grid graphics (hexbin) in pairs() plot problem
- Intel MKL compiling issue