Knowledge base dedicated to Linux and applied mathematics.

Home > Mathematics > Linear Systems > How to patch metis-4.0 error: conflicting types for __log2

How to patch metis-4.0 error: conflicting types for __log2

METIS is a set of serial programs for partitioning graphs, partitioning finite element meshes, and producing fill reducing orderings for sparse matrices. The algorithms implemented in METIS are based on the multilevel recursive-bisection, multilevel k-way, and multi-constraint partitioning schemes.
I give a patch for metis-4.0 software, compilation fails with gcc 4.4.x

nsoualem@gold: -> cd metis-4.0
nsoualem@gold: -> make
(cd Lib ; make ) 
make[1]: Entering directory <span class="base64" title="PGNvZGUgY2xhc3M9InNwaXBfY29kZSBzcGlwX2NvZGVfaW5saW5lIiBkaXI9Imx0ciI+L2hvbWUvbnNvdWFsZW0vdGVzdC9saWJfZXh0L2xpYl9leHQvbWV0aXMtNC4wL0xpYicNCmNjICZuYnNwOy1PMiAmbmJzcDstSS4gLWMgY29hcnNlbi5jDQpJbiBmaWxlIGluY2x1ZGVkIGZyb20gLi9tZXRpcy5oOjM2LA0KICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgZnJvbSBjb2Fyc2VuLmM6MTM6DQouL3Byb3RvLmg6NDYyOiBlcnJvcjogY29uZmxpY3RpbmcgdHlwZXMgZm9yICdfX2xvZzInDQovdXNyL2luY2x1ZGUvYml0cy9tYXRoY2FsbHMuaDoxNDU6IG5vdGU6IHByZXZpb3VzIGRlY2xhcmF0aW9uIG9mICdfX2xvZzInIHdhcyBoZXJlDQptYWtlWzFdOiAqKiogW2NvYXJzZW4ub10gRXJyb3IgMQ0KbWFrZVsxXTogTGVhdmluZyBkaXJlY3Rvcnk8L2NvZGU+"></span>/home/nsoualem/test/lib_ext/lib_ext/metis-4.0/Lib'
make: *** [default] Error 2

This error is due to the duplication of __log2 /usr/include/bits/mathcalls.h:145

Here is the patch
to get compilation successful

nsoualem@gold: -> cd metis-4.0
nsoualem@gold: -> patch -p1 < metis-4.0.patch

Also in this section

  1. Cholesky decomposition
  2. Conjugate gradient method
  3. Gauss-Seidel method
  4. Gaussian elimination
  5. How to patch metis-4.0 error: conflicting types for __log2
  6. Jacobi method
  7. LU decomposition
  8. Preconditioned Conjugate Gradient Method