2

I executed the following command (a tool that I need) and got:

$ $TOOLS/moses/moses_20150318/bin/kbmira
terminate called after throwing an instance of 'std::runtime_error'
what():  locale::facet::_S_create_c_locale name not valid
Aborted

I followed this article on how to solve it, and since I am not a root I added this line to my ~/.bashrc but no changes.

export LC_ALL="en_US.UTF-8" 

$locale -a gives

en_US
en_US.ISO-8859-1
en_US.UTF-8
en_ZA

and many other entries. I also looked if "locale" was included somewhere in the source files but could not find anything.

-bash-4.2$ grep  "locale" $DIR/mert/*.cpp
-bash-4.2$ grep  "locale" $DIR/mert/*.h

Any ideas on what's causing this.

Thanks.

Community
  • 1
  • 1
user_3505115
  • 61
  • 1
  • 4
  • stackoverflow.com isn't, unfortunately, the Psychic Friends Network. At a bare minimum, a [mcve] is required. – Sam Varshavchik May 10 '16 at 10:48
  • @SamVarshavchik How about a "to-the-point", helpful comment instead. I am a beginner with c++ and trying to understand the core of the error, if there is anything "Psychic Friends Network" related in my post, how about you point it out. – user_3505115 May 10 '16 at 10:58
  • How do you expect someone to figure out the problem with some C++ code, why it's throwing an exception, if you don't even show the code? Did you read the help center's article on a [mcve], that I helpfully provided, before replying? If not, why not? – Sam Varshavchik May 10 '16 at 11:02
  • The code is not mine, and the package contains more than 60 files (.h and .cpp). The problem is not with the code (and I am not supposed to change the code), it is with me using one of the binaries downloaded. And yes, I read the help center's article. – user_3505115 May 10 '16 at 11:05
  • You could try using export LC_ALL=C – Schore May 10 '16 at 11:17
  • That works perfectly, thanks @Schore. Could you please explain why LC_ALL=C works? – user_3505115 May 10 '16 at 11:19
  • Beats me. I googled and that was what turned up. Link here: http://stackoverflow.com/questions/19668570/mongodb-localefacet-s-create-c-locale-name-not-valid – Schore May 10 '16 at 11:20
  • Got it, thanks @Schore! – user_3505115 May 10 '16 at 11:24

1 Answers1

0

BITCOIN Container

  • If you are getting this error, just setup the env var LC_ALL: C in case locale has been setup in the host.
Marcello DeSales
  • 21,361
  • 14
  • 77
  • 80