Re: xlcpp: use of undeclared identifier 'decltype' used in boost/thread/lockable_traits.hpp

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: xlcpp: use of undeclared identifier 'decltype' used in boost/thread/lockable_traits.hpp

Boost - Users mailing list

Greetings,

While attempting to build boost 1.70.0 for IBM Power9 using the IBM XL compilers using the SPACK tool, the following errors occur repeatedly for every header file that eventually includes boost/thread/lockable_traits.hpp

In file included from ./boost/thread/lock_types.hpp:14:

./boost/thread/lockable_traits.hpp:157:11: error: use of undeclared identifier 'decltype'
decltype(void(boost::declval<T&>().lock()))
^
./boost/thread/lockable_traits.hpp:165:11: error: use of undeclared identifier 'decltype'
decltype(void(boost::declval<T&>().unlock()))
^
./boost/thread/lockable_traits.hpp:173:11: error: use of undeclared identifier 'decltype'
decltype(bool(boost::declval<T&>().try_lock()))
^

These errors could be resolved if the -std=c++11 compiler option is used. Attempting to use SPACK options cxxflags=-std=c++11 or cxxstd=11 failed as if they were ignored. I was able to work-around this pervasive error by adding the following line to the file tools/build/src/tools/xlcpp.jam

flags xlcpp.compile.c++ OPTIONS <cxxstd>11 : -std=c++11 ;

Can you update the xlcpp.jam file to support the cxxstd=11 option, similar to what is implemented in pgi.jam?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Roy Musselman
IBM HPC Application Analyst at Lawrence Livermore National Lab
email: [hidden email]


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

Reply | Threaded
Open this post in threaded view
|

Re: xlcpp: use of undeclared identifier 'decltype' used in boost/thread/lockable_traits.hpp

Boost - Users mailing list
On 9/9/2019 8:58 PM, Roy Musselman via Boost-users wrote:

> Greetings,
>
> While attempting to build boost 1.70.0 for IBM Power9 using the IBM XL
> compilers using the SPACK tool, the following errors occur repeatedly
> for every header file that eventually includes
> boost/thread/lockable_traits.hpp
>
> In file included from ./boost/thread/lock_types.hpp:14:
>
> *./boost/thread/lockable_traits.hpp*:157:11: error: use of undeclared
> identifier 'decltype'
> decltype(void(boost::declval<T&>().lock()))
> ^
> ./boost/thread/lockable_traits.hpp:165:11: error: use of undeclared
> identifier 'decltype'
> decltype(void(boost::declval<T&>().unlock()))
> ^
> ./boost/thread/lockable_traits.hpp:173:11: error: use of undeclared
> identifier 'decltype'
> decltype(bool(boost::declval<T&>().try_lock()))
> ^
>
> These errors could be resolved if the *-std=c++11*compiler option is
> used. Attempting to use SPACK options *cxxflags=-std=c++11*or
> *cxxstd=11*failed as if they were ignored. I was able to work-around
> this pervasive error by adding the following line to the file
> *tools/build/src/tools/xlcpp.jam*
>
> flags xlcpp.compile.c++ OPTIONS <cxxstd>11 : -std=c++11 ;
>
> Can you update the xlcpp.jam file to support the cxxstd=11 option,
> similar to what is implemented in pgi.jam?

I do not know why cxxflags=-std=c++11 did not work. Maybe it needed to
be surrounded by quotes for whatever OS script you are using.

Do you have a list of all the possible -std= choices for the compiler ?
If we include one for c++11 we should probably include one for each
possible choice.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: xlcpp: use of undeclared identifier 'decltype' used in boost/thread/lockable_traits.hpp

Boost - Users mailing list

It would be convenient if the compiler flag cxxflags=-std=c++1 worked. It's specified in the spec used on the spack install command but it seems that, for boost, the spack compiler wrappers are being bypassed. Even the CXXFLAGS environment variable is being ignored. However the option "cxxstd=11" made it all the way from the spack install command down to the invocation of b2. But the underlying xlcpp.jam file was not respecting that option, unlike jam files for other compilers.

'./bootstrap.sh' '--prefix=${path_to_boost}/boost-1.70.0-urzwfgarnvpznbxfbwzgh4b7u5xfs5dz' '--with-toolset=xlcpp' '--with-libraries=locale,random,wave,atomic,serialization,mpi,iostreams,regex,date_time,exception,log,thread,chrono,graph,system,timer,python,program_options,filesystem,test,math,graph_parallel' '--with-python=/usr/tce/packages/python/python-3.7.2/bin/python3.7'
Building Boost.Build engine with toolset xlcpp... tools/build/src/engine/bin.linuxppc/b2
. . .
'./b2' 'install' 'threading=multi' '-j' '32' '--user-config=${path_to_boost}/boost-1.70.0-urzwfgarnvpznbxfbwzgh4b7u5xfs5dz/spack-src/user-config.jam' 'variant=release' '-s' 'BZIP2_INCLUDE=/usr/bin/include' '-s' 'BZIP2_LIBPATH=/usr/bin/lib' '-s' 'ZLIB_INCLUDE=/usr/lib64/include' '-s' 'ZLIB_LIBPATH=/usr/lib64/lib' 'link=static,shared' '--layout=system' 'toolset=xlcpp' 'cxxstd=11' 'visibility=hidden'

Here are the various options for the -std= flag supported by the XL compilers.

-std syntax (C only)
-std=
gnu9x
gnu99
c89
c90
c99
c9x
c11
c1x
iso9899:1990
iso9899:199409
iso9899:1999
iso9899:199x
iso9899:2011
gnu89
gnu90
gnu11

-std syntax (C++ only)
-std=
gnu++98
gnu++03
c++98
c++03
gnu++11
c++0x
gnu++0x
c++11
c++1y

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Roy Musselman
IBM HPC Application Analyst at Lawrence Livermore National Lab
email: [hidden email]
LLNL office: 925-422-6033
Cell: 507-358-8895, Home: 507-281-9565


Inactive hide details for Edward Diener via Boost-users ---09/10/2019 09:18:03 AM---On 9/9/2019 8:58 PM, Roy Musselman via BoosEdward Diener via Boost-users ---09/10/2019 09:18:03 AM---On 9/9/2019 8:58 PM, Roy Musselman via Boost-users wrote: > Greetings,

From: Edward Diener via Boost-users <[hidden email]>
To: [hidden email]
Cc: Edward Diener <[hidden email]>
Date: 09/10/2019 09:18 AM
Subject: [EXTERNAL] Re: [Boost-users] xlcpp: use of undeclared identifier 'decltype' used in boost/thread/lockable_traits.hpp
Sent by: "Boost-users" <[hidden email]>





On 9/9/2019 8:58 PM, Roy Musselman via Boost-users wrote:

> Greetings,
>
> While attempting to build boost 1.70.0 for IBM Power9 using the IBM XL
> compilers using the SPACK tool, the following errors occur repeatedly
> for every header file that eventually includes
> boost/thread/lockable_traits.hpp
>
> In file included from ./boost/thread/lock_types.hpp:14:
>
> *./boost/thread/lockable_traits.hpp*:157:11: error: use of undeclared
> identifier 'decltype'
> decltype(void(boost::declval<T&>().lock()))
> ^
> ./boost/thread/lockable_traits.hpp:165:11: error: use of undeclared
> identifier 'decltype'
> decltype(void(boost::declval<T&>().unlock()))
> ^
> ./boost/thread/lockable_traits.hpp:173:11: error: use of undeclared
> identifier 'decltype'
> decltype(bool(boost::declval<T&>().try_lock()))
> ^
>
> These errors could be resolved if the *-std=c++11*compiler option is
> used. Attempting to use SPACK options *cxxflags=-std=c++11*or
> *cxxstd=11*failed as if they were ignored. I was able to work-around
> this pervasive error by adding the following line to the file
> *tools/build/src/tools/xlcpp.jam*
>
> flags xlcpp.compile.c++ OPTIONS <cxxstd>11 : -std=c++11 ;
>
> Can you update the xlcpp.jam file to support the cxxstd=11 option,
> similar to what is implemented in pgi.jam?

I do not know why cxxflags=-std=c++11 did not work. Maybe it needed to
be surrounded by quotes for whatever OS script you are using.

Do you have a list of all the possible -std= choices for the compiler ?
If we include one for c++11 we should probably include one for each
possible choice.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users 





_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: xlcpp: use of undeclared identifier 'decltype' used in boost/thread/lockable_traits.hpp

Boost - Users mailing list
On 9/10/2019 2:43 PM, Roy Musselman via Boost-users wrote:

> It would be convenient if the compiler flag cxxflags=-std=c++1 worked.
> It's specified in the spec used on the spack install command but it
> seems that, for boost, the spack compiler wrappers are being bypassed.
> Even the CXXFLAGS environment variable is being ignored. However the
> option *"cxxstd=11"*made it all the way from the spack install command
> down to the invocation of b2. But the underlying xlcpp.jam file was not
> respecting that option, unlike jam files for other compilers.
>
> './bootstrap.sh'
> '--prefix=${path_to_boost}/boost-1.70.0-urzwfgarnvpznbxfbwzgh4b7u5xfs5dz' '--with-toolset=xlcpp'
> '--with-libraries=locale,random,wave,atomic,serialization,mpi,iostreams,regex,date_time,exception,log,thread,chrono,graph,system,timer,python,program_options,filesystem,test,math,graph_parallel'
> '--with-python=/usr/tce/packages/python/python-3.7.2/bin/python3.7'
> Building Boost.Build engine with toolset xlcpp...
> tools/build/src/engine/bin.linuxppc/b2
> . . .
> './b2' 'install' 'threading=multi' '-j' '32'
> '--user-config=${path_to_boost}/boost-1.70.0-urzwfgarnvpznbxfbwzgh4b7u5xfs5dz/spack-src/user-config.jam'
> 'variant=release' '-s' 'BZIP2_INCLUDE=/usr/bin/include' '-s'
> 'BZIP2_LIBPATH=/usr/bin/lib' '-s' 'ZLIB_INCLUDE=/usr/lib64/include' '-s'
> 'ZLIB_LIBPATH=/usr/lib64/lib' 'link=static,shared' '--layout=system'
> 'toolset=xlcpp' '*cxxstd=11*' 'visibility=hidden'
>
> Here are the various options for the -std= flag supported by the XL
> compilers.
>
> -std syntax (C only)
> -std=
> gnu9x
> gnu99
> c89
> c90
> c99
> c9x
> c11
> c1x
> iso9899:1990
> iso9899:199409
> iso9899:1999
> iso9899:199x
> iso9899:2011
> gnu89
> gnu90
> gnu11
>
> -std syntax (C++ only)
> -std=
> gnu++98
> gnu++03
> c++98
> c++03
> gnu++11
> c++0x
> gnu++0x
> c++11
> c++1y

I assume "c++1y" implements the c++14 standard.

I created a pull request for Boost Build on the 'develop' branch. Thanks
for bringing this up.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users