<p>OK, I think the problem may be because macports-boost was built via clang (probably related to this <a href="http://stackoverflow.com/questions/29354201/linking-error-for-boostprogram-options">http://stackoverflow.com/questions/29354201/linking-error-for-boostprogram-options</a>). I rebuilt boost via gnu compilers and it works now.  So this seems to be down to the incompatibility between clang and gnu. </p>

<p>Thank you, rcurtin!</p>

<p>PS: another not related (but maybe useful) remark  for those who want to install g++ in mac (I prefer gnu compilers because they seem to give faster programs and also support omp): one has to specify the build-in libraries for g++ and gcc correctly, since clang has the same library names in /usr/lib, which do not  have some standard symbols for g++ (such as std::basic_string, etc.) This can be a problem when linking to mlpack dependencies because the libxml2 often lives in the same folder as clang's libraries. </p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/442#issuecomment-112370037">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFJ--tROXjIYqix9cgDUgIR6h7SxEks5oT-qKgaJpZM4FCvAM.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/442#issuecomment-112370037"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>