I'm going to install some packages but I got errors in std::stod( ) method.
My system is Cent OS. I installed GCC 6.2 version with contrib/download_prerequisites in gcc-6.2.0 directory (gmp-4.3.2, isl-0.15, mpc-0.8.1, mpfr-2.4.2) And I have boost-1.62
This is my gcc configure option ./gcc-6.2.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-6.2 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-6.2
So, this is now my installation flow about what I wanna install a package.
[root@cms CASMcode-0.2.0]# scons install
scons: Reading SConscript files ...
rm /usr/local/include/casm
scons: done reading SConscript files.
scons: Building targets ...
Install directory: "include/casm" as "/usr/local/include/casm"
/usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/external/gzstream/gzstream.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude/casm/external/gzstream src/casm/external/gzstream/gzstream.C
cd src/casm/version && sed -e "s|MY_VERSION|0.2.0|g" < version_template.cc > version.cc
/usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/version/version.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude src/casm/version/version.cc
/usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/CASM_global_definitions.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude -I/usr/local/boost_1_62_0/include src/casm/CASM_global_definitions.cc
Here is the where error message occured
In file included from include/casm/casm_io/DataFormatterTools.hh:1291:0,
from include/casm/casm_io/DataFormatter_impl.hh:3,
from include/casm/casm_io/DataFormatter.hh:757,
from include/casm/clex/ConfigIO.hh:4,
from src/casm/clex/ConfigIOStrucScore.cc:6:
include/casm/casm_io/DataFormatterTools_impl.hh: In member function 'bool CASM::DataFormatterOperator<ValueType, ArgType, DataObject>::parse_args(const string&)':
include/casm/casm_io/DataFormatterTools_impl.hh:32:33: error: invalid initialization of reference of type 'const wstring& {aka const std::__cxx11::basic_string<wchar_t>&}' from expression of type 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'
val = std::stod(ttag);
Similar errors happened the following codes std::stol(tag)
And finally the installation process is stopped with this message
At global scope:
cc1plus: warning: unrecognized command line option '-Wno-deprecated-register'
scons: *** [src/casm/clex/ConfigIOStrucScore.os] Error 1
scons: building terminated because of errors.
I'm not familiar with C++ but I heard that std::sto() is some kind of data type changer. But I don't know how to fix it. I thought that these errors come from old gcc version. But how it happens?
This is include/casm/casm_io/DataFormatterTools_impl.hh: file.
#include <algorithm>
#include "casm/external/boost.hh"
namespace CASM {
template<typename ValueType, typename ArgType, typename DataObject>
bool DataFormatterOperator<ValueType,
ArgType,
DataObject>::parse_args(const std::string &_args) {
if(_args.size() == 0)
return true;
if(!m_arg_formatter.empty())
return false;
std::vector<std::string> format_tags, subexprs;
split_formatter_expression(_args, format_tags, subexprs);
//std::cout << "_args: " << _args << "\n";
//std::cout << "format_tabs: " << format_tags << "\n"
//<< "subexprs: '" << subexprs << "'\n";
for(Index i = 0; i < format_tags.size(); i++) {
std::string ttag(format_tags[i].size(), ' ');
std::transform(format_tags[i].cbegin(), format_tags[i].cend(), ttag.begin(), tolower);
char ch = ttag[0];
if(boost::is_any_of("-+.0123456789")(ch)) { // tag is a constant number
if(std::any_of(ttag.cbegin(),
ttag.cend(),
boost::is_any_of(".e"))) {
double val;
try {
val = std::stod(ttag);
}
catch(...) {
throw std::runtime_error("Unable to parse '" + ttag + "' from subexpression " + _args + "\n");
}
m_arg_formatter.push_back(ConstantValueFormatter<double, DataObject>(ttag, val));
}
I have spent very long time to install this package but I couldn't. Please, help me..
Aucun commentaire:
Enregistrer un commentaire