title: Weird behavior of gcc while linking BLAS library
body: <p>I have ATLAS library "libatlas.so" in an unstandard directory "/opt/apps/gcc4_7/atlas/3.10.2/lib/"</p>
  
  <p>I put the path along with other search paths in environment variable</p>
  
  <pre><code>LD_LIBRARY_PATH=/opt/apps/gcc4_7/atlas/3.10.2/lib:and_others
  </code></pre>
  
  <p>Then link my code with it as follow:</p>
  
  <pre><code>g++ mycode.o -L$LD_LIBRARY_PATH -latlas
  </code></pre>
  
  <p>It then say "ld: cannot find -latlas"</p>
  
  <p>But if I add the path again as follow:</p>
  
  <pre><code>g++ mycode.o -L$LD_LIBRARY_PATH -L/opt/apps/gcc4_7/atlas/3.10.2/lib/ -latlas
  </code></pre>
  
  <p>I have no issues.</p>
  
  <p>I cannot think of any reasons this could happen. Is it because the $LD_LIBRARY_PATH has too many paths in it?</p>