1 dnl Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License, or (at your option) any later version.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 AC_DEFUN([CHECK_METIS],[
25 dnl metis could be already found by CHECK_PARMETIS procedure
27 if [[ "x${metis_ok}" != "xyes" ]] ; then
29 AC_CHECKING(for METIS Library)
39 AC_CHECKING(for METIS location)
41 [ --with-metis=DIR root directory path to METIS library installation ],
43 AC_MSG_RESULT("select $withval as path to METIS library")])
45 AC_MSG_RESULT(\$METISDIR = ${METISDIR})
47 CPPFLAGS_old="${CPPFLAGS}"
50 if test "x${METISDIR}" != "x" ; then
51 METIS_CPPFLAGS="-DMED_ENABLE_METIS -I${METISDIR}/Lib"
52 METIS_LIBS="-L${METISDIR} -lmetis"
60 AC_CHECKING(for METIS headers)
61 CPPFLAGS="${CPPFLAGS_old} ${METIS_CPPFLAGS}"
63 metis_include_dir_ok=yes
64 if test "x${METISDIR}" != "x" ; then
65 AC_CHECK_FILE(${METISDIR}/Lib/metis.h,
66 metis_include_dir_ok=yes,
67 metis_include_dir_ok=no)
70 if test "x${metis_include_dir_ok}" = "xyes" ; then
71 AC_TRY_COMPILE([#include <metis.h>],
72 [Change2CNumbering(0,0,0)],
77 if test "x${metis_headers_ok}" = "xno" ; then
78 METIS_CPPFLAGS="METIS_CPPFLAGS_NOT_DEFINED"
80 AC_MSG_RESULT(\$METIS_CPPFLAGS = ${METIS_CPPFLAGS})
82 AC_MSG_RESULT(for metis headers: $metis_headers_ok)
84 if test "x${metis_headers_ok}" = "xyes" ; then
86 AC_CHECKING(for METIS binaries)
88 if test "x${METISDIR}" != "x" ; then
89 AC_CHECK_FILE(${METISDIR}/libmetis.a,
92 if test "x${metis_lib_dir_ok}" = "xno" ; then
94 AC_CHECK_FILE(${METISDIR}/libmetis.a,
99 if test "x${metis_lib_dir_ok}" = "xyes" ; then
100 LIBS="${LIBS_old} ${METIS_LIBS}"
101 AC_TRY_LINK([#include <metis.h>],
102 [Change2CNumbering(0,0,0)],
103 metis_binaries_ok=yes,
104 metis_binaries_ok=no)
105 if test "x${metis_binaries_ok}" = "xno" ; then
107 LIBS="${LIBS_old} ${METIS_LIBS} "
108 AC_TRY_LINK([#include <metis.h>],
109 [Change2CNumbering(0,0,0)],
110 metis_binaries_ok=yes,
111 metis_binaries_ok=no)
116 if test "x${metis_binaries_ok}" = "xno" ; then
117 METIS_LIBS="METIS_LIBS_NOT_FOUND"
118 METIS_LIBSUFFIX="-not-defined"
120 AC_MSG_RESULT(\$METIS_LIBSUFFIX = ${METIS_LIBSUFFIX})
121 AC_MSG_RESULT(\$METIS_LIBS = ${METIS_LIBS})
123 AC_MSG_RESULT(for metis binaries: $metis_binaries_ok)
125 CPPFLAGS="${CPPFLAGS_old}"
128 if test "x${metis_headers_ok}" = "xyes" ; then
129 if test "x${metis_binaries_ok}" = "xyes" ; then
135 AC_MSG_RESULT(for metis: $metis_ok)
137 AC_SUBST(METIS_CPPFLAGS)
138 AC_SUBST(METIS_LIBSUFFIX)
140 AC_SUBST(ENABLE_METIS)