Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11064: boost support c++11 with Solaris Studio 12.4
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-26 07:30:07
#11064: boost support c++11 with Solaris Studio 12.4
-------------------------------+---------------------
Reporter: zhifan | Owner:
Type: Support Requests | Status: new
Milestone: To Be Determined | Component: None
Version: Boost 1.57.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+---------------------
Description changed by viboes:
Old description:
> My Environment:
>
> 1. boost_version: 1_57
> 2. solaris stuation version: SolarisStudio12.4-solaris-sparc-
> bin.tar.bz2 (download yesterday)
> 3. OS version:
> bash-3.2$ cat /etc/release
> Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC
> Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights
> reserved.
> Assembled 23 August 2011
>
> bash-3.2$ cd tools/build/src/engine/
> bash-3.2$ ./build.sh sun
> bash-3.2$ tools/build/src/engine/bin.solarissparc/bjam toolset=sun
> --prefix=/export/home/oracle/zhifan/boost address-model=64 --disable-icu
> --with-regex --with-log --with-program_options -j64 install
> With some code fix in boost, I can run the above command without any
> "failed".
>
> Here is my simple test code:
>
> bash-3.2$ cat boost_log.cc
> #include <boost/log/core.hpp>
> #include <boost/log/trivial.hpp>
> #include <boost/log/expressions.hpp>
> #include <vector>
> int main() {
> std::vector<int> a{1, 2, 3,4,5};
> for (auto i : a) {
> BOOST_LOG_TRIVIAL(fatal) << "RedoFile::init ";
> }
> return 0;
> }
>
> bash-3.2$ CC -mt -std=c++11 -m64
> -I/export/home/oracle/zhifan/boost/include -DBOOST_LOG_DYN_LINK
> -L/export/home/oracle/zhifan/boost/lib -lboost_log -DBOOST_LOG_DYN_LINK
> boost_log.cc -o boost_log
> "/export/home/oracle/zhifan/boost/include/boost/log/utility/formatting_ostream.hpp",
> line 551: Error: Cannot use
> boost::log::v2_mt_posix::basic_formatting_ostream<char,
> std::char_traits<char>, std::allocator<char>>::sentry to initialize bool.
> "boost_log.cc", line 10: Where: While instantiating
> "boost::log::v2_mt_posix::basic_formatting_ostream<char,
> std::char_traits<char>, std::allocator<char>>::operator<<(const char*)".
> "boost_log.cc", line 10: Where: Instantiated from non-template code.
> "/export/home/oracle/zhifan/boost/include/boost/log/utility/formatting_ostream.hpp",
> line 551: Error: An expression of scalar type was expected.
> "boost_log.cc", line 10: Where: While instantiating
> "boost::log::v2_mt_posix::basic_formatting_ostream<char,
> std::char_traits<char>, std::allocator<char>>::operator<<(const char*)".
> "boost_log.cc", line 10: Where: Instantiated from non-template code.
> 2 Error(s) detected.
>
> But if I compile this code with boost library compiled by gcc, it works
> perfectly.
>
> bash-3.2$ g++ -pthread -std=c++11 -m64
> -I/export/home/oracle/zhifan/boost_gcc/include -DBOOST_LOG_DYN_LINK
> -L/export/home/oracle/zhifan/boost_gcc/lib -lboost_log
> -DBOOST_LOG_DYN_LINK boost_log.cc -o boost_log
> bash-3.2$ export
> LD_LIBRARY_PATH=/export/home/oracle/zhifan/boost_gcc/lib:$LD_LIBRARY_PATH
> bash-3.2$ ./boost_log
> [2015-02-27 23:26:21.436813] [0x10000000] [fatal] RedoFile::init
> [2015-02-27 23:26:21.438511] [0x10000000] [fatal] RedoFile::init
> [2015-02-27 23:26:21.438591] [0x10000000] [fatal] RedoFile::init
> [2015-02-27 23:26:21.438662] [0x10000000] [fatal] RedoFile::init
> [2015-02-27 23:26:21.438735] [0x10000000] [fatal] RedoFile::init
New description:
My Environment:
1. boost_version: 1_57
2. solaris stuation version: SolarisStudio12.4-solaris-sparc-
bin.tar.bz2 (download yesterday)
3. OS version:
bash-3.2$ cat /etc/release
Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights
reserved.
Assembled 23 August 2011
{{{
bash-3.2$ cd tools/build/src/engine/
bash-3.2$ ./build.sh sun
bash-3.2$ tools/build/src/engine/bin.solarissparc/bjam toolset=sun
--prefix=/export/home/oracle/zhifan/boost address-model=64 --disable-icu
--with-regex --with-log --with-program_options -j64 install
}}}
With some code fix in boost, I can run the above command without any
"failed".
Here is my simple test code:
{{{
bash-3.2$ cat boost_log.cc
#include <boost/log/core.hpp>
#include <boost/log/trivial.hpp>
#include <boost/log/expressions.hpp>
#include <vector>
int main() {
std::vector<int> a{1, 2, 3,4,5};
for (auto i : a) {
BOOST_LOG_TRIVIAL(fatal) << "RedoFile::init ";
}
return 0;
}
}}}
{{{
bash-3.2$ CC -mt -std=c++11 -m64
-I/export/home/oracle/zhifan/boost/include -DBOOST_LOG_DYN_LINK
-L/export/home/oracle/zhifan/boost/lib -lboost_log -DBOOST_LOG_DYN_LINK
boost_log.cc -o boost_log
"/export/home/oracle/zhifan/boost/include/boost/log/utility/formatting_ostream.hpp",
line 551: Error: Cannot use
boost::log::v2_mt_posix::basic_formatting_ostream<char,
std::char_traits<char>, std::allocator<char>>::sentry to initialize bool.
"boost_log.cc", line 10: Where: While instantiating
"boost::log::v2_mt_posix::basic_formatting_ostream<char,
std::char_traits<char>, std::allocator<char>>::operator<<(const char*)".
"boost_log.cc", line 10: Where: Instantiated from non-template code.
"/export/home/oracle/zhifan/boost/include/boost/log/utility/formatting_ostream.hpp",
line 551: Error: An expression of scalar type was expected.
"boost_log.cc", line 10: Where: While instantiating
"boost::log::v2_mt_posix::basic_formatting_ostream<char,
std::char_traits<char>, std::allocator<char>>::operator<<(const char*)".
"boost_log.cc", line 10: Where: Instantiated from non-template code.
2 Error(s) detected.
}}}
But if I compile this code with boost library compiled by gcc, it works
perfectly.
{{{
bash-3.2$ g++ -pthread -std=c++11 -m64
-I/export/home/oracle/zhifan/boost_gcc/include -DBOOST_LOG_DYN_LINK
-L/export/home/oracle/zhifan/boost_gcc/lib -lboost_log
-DBOOST_LOG_DYN_LINK boost_log.cc -o boost_log
bash-3.2$ export
LD_LIBRARY_PATH=/export/home/oracle/zhifan/boost_gcc/lib:$LD_LIBRARY_PATH
bash-3.2$ ./boost_log
[2015-02-27 23:26:21.436813] [0x10000000] [fatal] RedoFile::init
[2015-02-27 23:26:21.438511] [0x10000000] [fatal] RedoFile::init
[2015-02-27 23:26:21.438591] [0x10000000] [fatal] RedoFile::init
[2015-02-27 23:26:21.438662] [0x10000000] [fatal] RedoFile::init
[2015-02-27 23:26:21.438735] [0x10000000] [fatal] RedoFile::init
}}}
-- -- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11064#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC