title: gcc and clang: thread library is successfully included but nothing won't be compiled with that
body: <p>I've got specific error that I haven't encountered before.</p>
  <p><em>Before I'll start, I need to say that I work on a server and have no root rights.</em> <code>/usr/bin</code> <em>and</em> <code>/usr/local/bin</code> <em>are missing many packages and because of that I had been obliged to install necessary packages (including <code>gcc-5.4.0</code>) locally in my <code>$HOME</code> directory and everything worked fine until today</em></p>
  <p>Something happened and since I cannot compile any program that uses <code>&lt;thread&gt;</code>, <code>&lt;mutex&gt;</code> and anything that related to multithreading. It throws many errors in log like (this is llvm building error):</p>
  <pre><code>mutex.h:69:14: error: ‘condition_variable’ in namespace ‘std’ does not name a type
   typedef std::condition_variable Condition;
  </code></pre>
  <p>I've been looking for solution and many say that you need to pass <code>-std=c++11</code> flag. I think that this is not the reason, but I found something interesting:</p>
  <p>I created a simple program just to check whether it can be compiled:</p>
  <pre><code>#include &lt;mutex&gt;
  
  std::mutex m;
  
  int main() {}
  </code></pre>
  <ol>
  <li>Used locally installed <code>g++</code>: <code>$HOME/g++ -std=c++11 -lpthread mut.cc</code>: <strong>FAILED</strong></li>
  <li>Used globally installed <code>g++</code>: <code>/usr/bin/g++ -std=c++11 -lpthread mut.cc</code>: <strong>SUCCESS</strong></li>
  </ol>
  <p>I suppose this error somehow related to linking with <code>libpthread</code>.
  The same happens with locally installed <code>clang++</code></p>
  <p><strong>UPDATE</strong>: An idea came up to me that if the header exists but it doesn't take names from it, then it means that there should be some disabled defined within it. So, I found source of header <code>&lt;thread&gt;</code> (<code>$HOME/local/include/c++/5.4.0/thread</code>) and enabled these ones:</p>
  <pre><code>#define _GLIBCXX_HAS_GTHREADS 1
  #define _GLIBCXX_USE_C99_STDINT_TR1 1
  </code></pre>
  <p>the same I made for <code>&lt;mutex&gt;</code> and compilation started up. I don't understand how could they be disabled in linux system?</p>