I am trying to run the following test program on my Solaris 10 sparc machine using gcc 5.5.0
#include <iostream>
#include <cmath>
int main()
{
std::cout << "exp2(4) = " << std::exp2(4) << '\n'
<< "exp2(0.5) = " << std::exp2(0.5) << '\n'
<< "exp2(-4) = " << std::exp2(-4) << '\n';
return 0;
}
Here are the OS details,
~$ uname -a
SunOS sovms577 5.10 Generic_147147-26 sun4v sparc SUNW,SPARC-Enterprise-T5220
~$ cat /etc/release
Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC
Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
Assembled 17 January 2013
On compiling using the following command,
g++ -std=c++11 -Wall test.cpp
I get the following error,
In file included from /opt/csw/include/c++/5.5.0/cmath:44:0,
from test.cpp:2:
/opt/csw/lib/gcc/sparc-sun-solaris2.10/5.5.0/include-fixed/math.h:52:12: error: ‘std::float_t’ has not been declared
using std::float_t;
^
/opt/csw/lib/gcc/sparc-sun-solaris2.10/5.5.0/include-fixed/math.h:53:12: error: ‘std::double_t’ has not been declared
using std::double_t;
^
/opt/csw/lib/gcc/sparc-sun-solaris2.10/5.5.0/include-fixed/math.h:55:12: error: ‘std::fpclassify’ has not been declared
using std::fpclassify;
^
/opt/csw/lib/gcc/sparc-sun-solaris2.10/5.5.0/include-fixed/math.h:56:12: error: ‘std::isfinite’ has not been declared
using std::isfinite;
I installed GCC 5.5 following the instructions given here.