|
Boost : |
Subject: [boost] [log] Problem Building Boost 1.55 With GCC Using C++11 Mode Due to AVX2 Support
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2014-08-18 13:51:00
We've run into a problem building log. It doesn't appear to be a known issue and we're not sure how to work around it. We found a hack to make our builds succeed, but there may well be a better workaround and we're not certain whether there are any issues with what we've done.
We tried to build Boost 1.55 with GCC 4.8.1, 4.8.3, and 4.9.1 with the following commands:
./bootstrap.sh --prefix=<prefix> --libdir=<prefix>/lib --with-toolset=gcc
./b2 --build-type=complete --layout=versioned 'cxxflags=-m64 -O2 -g -pipe' 'cflags=-m64 -O2 -g -pipe' 'linkflags=-Wl,-rpath -Wl,<prefix>/lib -L<gcc_dir>/lib64 -Wl,-rpath -Wl,<gcc_dir>/lib64 -m64' -d+2 -j3
./b2 --build-type=complete --layout=versioned 'cxxflags=-m64 -O2 -g -pipe' 'cflags=-m64 -O2 -g -pipe' 'linkflags=-Wl,-rpath -Wl,<prefix>/lib -L<gcc_dir>/lib64 -Wl,-rpath -Wl,<gcc_dir>/lib64 -m64' -d+2 -j3 install
The errors we get come from this command during the build:
gcc.compile.c++ bin.v2/libs/log/build/gcc-4.9/release/link-static/log-api-unix/threading-multi/dump_avx2.o "g++11" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fno-strict-aliasing -ftemplate-depth-1024 -m64 -O2 -g -pipe -march=core-avx2 -mavx -mavx2 -fabi-version=0 -m64 -O2 -g -pipe -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_USE_NATIVE_SYSLOG -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -I"." -c -o "bin.v2/libs/log/build/gcc-4.9/release/link-static/log-api-unix/threading-multi/dump_avx2.o" "libs/log/src/dump_avx2.cpp"
There are many lines of output; I've elided similar messages to highlight the unique ones:
{standard input}: Assembler messages:
{standard input}:611: Error: operand type mismatch for `vpsrldq'
...
{standard input}:819: Error: no such instruction: `vextracti128 $0x1,%ymm2,%xmm2'
...
{standard input}:1087: Error: no such instruction: `vextracti128 $0x1,%ymm3,48(%r15)'
...
{standard input}:1312: Error: operand type mismatch for `vpaddb'
While there might be a way to actually get b2 to disable AVX2 support, we hacked libs/log/build/Jamfile.v2 with these commands:
sed -i 's:dump_avx2::g' libs/log/build/Jamfile.v2
sed -i 's:<define>BOOST_LOG_USE_AVX2::g' libs/log/build/Jamfile.v2
Those remove dump_avx2 from BOOST_LOG_COMMON_AVX2_SRC and remove the definition of BOOST_LOG_USE_AVX2, which prevents compiling enable_avx2().
Is there a better way to solve or work around this problem?
_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Middleware using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
________________________________
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk