<div>Dear all,</div><div><br></div><div>------------</div><div>Problem</div><div>------------</div><div>    This is a problem I faced when building prerequisite libraries(gmp, mpfr, mpc, ppl, cloog) </div><div>    before building gcc-4.7.2 from source today.</div>
<div>    I found a mismatch between GMP and PPL when trying to compile the PPL library from source code.</div><div>    (Building GMP alone is fine.)</div><div><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span></div>
<div>-------------------------------</div><div>Source Code Version</div><div>-------------------------------</div><div>    The source code that I downloaded from are</div><div><span class="Apple-tab-span" style="white-space:pre">   </span></div>
<div>    a. GMP</div><div>        Site: </div><div>            <a href="http://gmplib.org/#DOWNLOAD">http://gmplib.org/#DOWNLOAD</a></div><div><span class="Apple-tab-span" style="white-space:pre">  </span>Download link:</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>    <a href="ftp://ftp.gmplib.org/pub/gmp-5.1.0/gmp-5.1.0.tar.bz2">ftp://ftp.gmplib.org/pub/gmp-5.1.0/gmp-5.1.0.tar.bz2</a></div><div><span class="Apple-tab-span" style="white-space:pre">    </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>b. PPL(Parma Polyhedra Library)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>Site: </div><div><span class="Apple-tab-span" style="white-space:pre">       </span>    <a href="http://bugseng.com/products/ppl/download">http://bugseng.com/products/ppl/download</a></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>Download link: </div><div><span class="Apple-tab-span" style="white-space:pre">      </span>    <a href="http://bugseng.com/products/ppl/download/ftp/releases/1.0/ppl-1.0.tar.bz2">http://bugseng.com/products/ppl/download/ftp/releases/1.0/ppl-1.0.tar.bz2</a></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span></div><div>-----------------------</div><div>Problem Details</div><div>-----------------------</div>
<div>    1.  < Redefinition of numeric_limits ></div><div><span class="Apple-tab-span" style="white-space:pre">       </span></div><div>        ppl-1.0/src/mp_std_bits.defs.hh:47 and</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gmp-5.1.0/gmpxx.h:3269</div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>both define </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>numeric_limits<mpz_class> and</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>numeric_limits<mpq_class></div><div><span class="Apple-tab-span" style="white-space:pre">      </span>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span></div><div>        Problem:</div><div>        It would lead to a redefinition error when trying to compile PPL source code to object code.</div><div>        It seems that the newer GMP library(5.1.0) has included the definition of numeric_limits but</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>for PPL library, the definitions are not removed.</div><div>        I googled this problem. There are also some reports to this problem.</div><div><br></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>Fix:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>I commented out the numeric_limits defined in ppl-1.0/src/mp_std_bits.defs.hh.</div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span></div><div>    2.  < Static data member name mismatches ></div><div><span class="Apple-tab-span" style="white-space:pre">  </span>    </div><div>         ppl-1.0/src/mp_std_bits.defs.hh:72 and ppl-1.0/src/mp_std_bits.defs.hh:133 defines</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span> static const bool tininess_before = false;</div><div>                                  ^^^^^^^^^^^^^^^^^</div><div>         However, in</div><div>         gmp-5.1.0/gmpxx.h:3302 and gmp-5.1.0/gmpxx.h:3339, there are</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span> static const bool tinyness_before = false;</div><div><span class="Apple-tab-span" style="white-space:pre">          </span>                  ^^^^^^^^^^^^^^^^^^</div>
<div>  <span class="Apple-tab-span" style="white-space:pre">    </span> Problem:</div><div><span class="Apple-tab-span" style="white-space:pre">    </span> I am not sure if the two data member are the same. Since I commented out the whole block of </div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span> numeric_limits in ppl-1.0/src/mp_std_bits.defs.hh in the last step, the member `tininess_before'</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> cannot be resolved.</div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span> Fix:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> Finally, I add </div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span> static const bool tininess_before = false;</div><div><span class="Apple-tab-span" style="white-space:pre">  </span> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span> in gmp-5.1.0/gmpxx.h:3303 and gmp-5.1.0/gmpxx.h:3341</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> and add member initialization </div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span> const bool numeric_limits<T>::tininess_before; \ </div><div><span class="Apple-tab-span" style="white-space:pre">     </span> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span> in gmp-5.1.0/cxx/limits.cc:47</div><div><span class="Apple-tab-span" style="white-space:pre">       </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span> and rebuild the gmp library.</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span> So, for PPL library, even if the code for numeric_limits is commented out, the declarations and object</div><div><span class="Apple-tab-span" style="white-space:pre">      </span> code can be found from GMP library.</div>
<div><span class="Apple-tab-span" style="white-space:pre">              </span></div><div>----------------</div><div>Conclusion</div><div>----------------</div><div>    GMP and PPL libraries can be compiled. I am running the PPL 'make check' test now.</div>
<div>    I am not sure whether it is a bug so I decided to report the issue to both sides. Hope that </div><div>    the mismatch can be fixed, thanks!</div><div><span class="Apple-tab-span" style="white-space:pre">          </span></div>
<div>---------------------</div><div>Attached Files</div><div>---------------------</div><div>    The mismatches are not related to configuration, so I skipped 'config.log'. If needed, please reply to me.</div><div>
<span class="Apple-tab-span" style="white-space:pre">         </span></div><div>    gcc-v.log                          : GCC version</div><div>    uname-a.log                     : Info of environment</div><div>    diff_gmpxx.h.txt                : Modification of gmp-5.1.0/gmpxx.h</div>
<div>    diff_mp_std_bits.defs.hh   : Modification of ppl-1.0/src/mp_std_bits.defs.hh</div><div>    diff_limits.cc.txt                : Modification of gmp-5.1.0/cxx/limits.cc</div><div><span class="Apple-tab-span" style="white-space:pre">                 </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span></div><div>Best Regards</div><div>-- chiahsun</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>