title: Boost compilation error on Mac using PCL
body: <p>I have installed PCL using homebrew on my MacBook. I also have some code which I want to compile for which I have created a CMakeLists.txt file. However, I get some error concerning the boost library.</p>
  
  <p>I get the error:</p>
  
  <p><code>/usr/local/include/boost/random/detail/polynomial.hpp:267:13: error: use of
        undeclared identifier 'sqr'; did you mean 'sqrt'?
              sqr(out, n);
  </code></p>
  
  <p>When I look in the file polynomial.hpp I can see the following functions:</p>
  
  <pre><code>    static digit_t sqr(digit_t val) {
      const std::size_t bits = std::numeric_limits&lt;digit_t&gt;::digits;
      digit_t mask = (digit_t(1) &lt;&lt; bits/2) - 1;
      for(std::size_t i = bits; i &gt; 1; i /= 2) {
          val = ((val &amp; ~mask) &lt;&lt; i/2) | (val &amp; mask);
          mask = mask &amp; (mask &gt;&gt; i/4);
          mask = mask | (mask &lt;&lt; i/2);
      }
      return val;
  }
  
  static void sqr(digit_t * val, std::size_t size)
  {
      const std::size_t bits = std::numeric_limits&lt;digit_t&gt;::digits;
      digit_t mask = (digit_t(1) &lt;&lt; bits/2) - 1;
      for(std::size_t i = 0; i &lt; size; ++i) {
          digit_t x = val[size - i - 1];
          val[(size - i - 1) * 2] = sqr(x &amp; mask);
          val[(size - i - 1) * 2 + 1] = sqr(x &gt;&gt; bits/2);
      }
  }
  </code></pre>
  
  <p>which are declared above the function call which causes the problem. </p>
  
  <p>Since the functions seem to exist and it is the code from the Boost library which causes the problem I am bit unsure how to proceed.</p>
  
  <p>I have not had those problems on Linux, though that was for PCL 1.7 and this is PCL 1.8.</p>
  
  <p>/ Erik</p>