compile error with boost

Hi

I am using boost version 1.58 and PGI compiler version 15.7. Compiling with pgCC everything works fine, however, compiling the same source file with pgc++ I get the following errors related to boost. For interoperability reasons I need to use pgc++ and cannot fallback to pgCC. Any ideas what the problem could be?

Thanks,
LS

“/u/tcadprod/tcad/25.0/L1/amd64/linux/boost2/boost/move/detail/type_traits.hpp”, line 921: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x100)
^

“/u/tcadprod/tcad/25.0/L1/amd64/linux/boost2/boost/move/detail/type_traits.hpp”, line 922: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x200)
^

“/u/tcadprod/tcad/25.0/L1/amd64/linux/boost2/boost/move/detail/type_traits.hpp”, line 923: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x400)
^

“/u/tcadprod/tcad/25.0/L1/amd64/linux/boost2/boost/move/detail/type_traits.hpp”, line 924: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x800)
^

“/u/tcadprod/tcad/25.0/L1/amd64/linux/boost2/boost/move/detail/type_traits.hpp”, line 925: error:
invalid alignment value specified by attribute
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1000)
^

“/u/tcadprod/tcad/25.0/L1/amd64/linux/boost2/boost/asio/detail/gcc_x86_fenced_block.hpp”, line 68: error:
identifier “__builtin_ia32_lfence” is undefined
__builtin_ia32_lfence();
^

“/u/tcadprod/tcad/25.0/L1/amd64/linux/boost2/boost/asio/detail/gcc_x86_fenced_block.hpp”, line 81: error:
identifier “__builtin_ia32_sfence” is undefined
__builtin_ia32_sfence();
^

Hi LS,

I just added a feature request to get “__builtin_ia32_sfence/lfence” added (TPR#21934). These are compiler builtin’s and as such need to added by PGI (as opposed being included in a header file).

In looking at the boost file, can you try adding “&& !defined(__PGI)” to the two macro guard to see if it works around the issue?

# if (__GNUC__ >= 4) && !defined(__INTEL_COMPILER) && !defined(__ICL) && !defined(__PGI)
    __builtin_ia32_lfence();
  • Mat

Hi Mat

thanks for adding the feature request. I followed your advice regarding the workaround and this helped with the

__builtin_ia32_sfence();

problem. However, the

 BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1000)

is still there. I tried to mess around a little in boost/config/suffix.hpp, but could not get it to work. Do you have any suggestions for a workaround?

Thanks,
LS
PS: Sorry for the late reply, I was out of the office for a while.