1 dnl Copyright (C) 2007-2016 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 #for a future use...see further down AC_DEFUN([CHECK_PARMETISV4]
25 #for use with ParMETIS V3
26 AC_DEFUN([CHECK_PARMETIS],[
27 AC_REQUIRE([AC_PROG_CC])dnl
28 AC_REQUIRE([AC_PROG_CPP])dnl
29 AC_REQUIRE([CHECK_MPI])dnl
31 AC_CHECKING(for ParMETIS V3 Library)
40 AC_CHECKING(for ParMETIS location)
42 [ --with-parmetis=DIR root directory path to ParMETIS library installation ],
43 [PARMETISDIR="$withval"
44 AC_MSG_RESULT("select $withval as path to ParMETIS library")])
46 if test "x${PARMETISDIR}" == "x" ; then
47 AC_MSG_RESULT(for \${PARMETIS_ROOT_DIR}: ${PARMETIS_ROOT_DIR})
48 # --with-parmetis option is not used
49 if test "x${PARMETIS_ROOT_DIR}" != "x" ; then
50 PARMETISDIR=${PARMETIS_ROOT_DIR}
54 AC_MSG_RESULT(\$PARMETISDIR = ${PARMETISDIR})
56 CPPFLAGS_old="${CPPFLAGS}"
59 if test "x${PARMETISDIR}" != "x" ; then
60 PARMETIS_CPPFLAGS="-DMED_ENABLE_PARMETIS -I${PARMETISDIR} ${MPI_INCLUDES}"
61 PARMETIS_LIBS="-L${PARMETISDIR} -lparmetis -lmetis ${MPI_LIBS}"
65 parmetis_headers_ok=no
66 parmetis_binaries_ok=no
69 AC_CHECKING(for ParMETIS headers)
70 CPPFLAGS="${CPPFLAGS_old} ${PARMETIS_CPPFLAGS}"
72 parmetis_include_dir_ok=yes
73 if test "x${PARMETISDIR}" != "x" ; then
74 AC_CHECK_FILE(${PARMETISDIR}/parmetis.h,
75 parmetis_include_dir_ok=yes,
76 parmetis_include_dir_ok=no)
79 if test "x${parmetis_include_dir_ok}" = "xyes" ; then
80 AC_TRY_COMPILE([#include <parmetis.h>],
81 [ParMETIS_V3_PartGeom(0,0,0,0,0)],
82 parmetis_headers_ok=yes,
83 parmetis_headers_ok=no)
86 if test "x${parmetis_headers_ok}" = "xyes" ; then
87 AC_MSG_RESULT(\$PARMETIS_CPPFLAGS = ${PARMETIS_CPPFLAGS})
89 AC_MSG_RESULT(for ParMETIS headers: $parmetis_headers_ok)
91 if test "x${parmetis_headers_ok}" = "xyes" ; then
93 AC_CHECKING(for ParMETIS binaries)
94 parmetis_lib_dir_ok=yes
95 AC_CHECK_FILE(${PARMETISDIR}/libparmetis.a,
96 parmetis_lib_dir_ok=yes,
97 parmetis_lib_dir_ok=no)
99 if test "x${parmetis_lib_dir_ok}" = "xyes" ; then
100 LIBS="${LIBS_old} ${PARMETIS_LIBS}"
101 AC_TRY_LINK([#include <parmetis.h>],
102 [ParMETIS_V3_PartGeom(0,0,0,0,0)],
103 parmetis_binaries_ok=yes,
104 parmetis_binaries_ok=no)
108 if test "x${parmetis_binaries_ok}" = "xyes" ; then
109 AC_MSG_RESULT(\$PARMETIS_LIBS = ${PARMETIS_LIBS})
111 AC_MSG_RESULT(for ParMETIS binaries: $parmetis_binaries_ok)
113 CPPFLAGS="${CPPFLAGS_old}"
116 if test "x${parmetis_headers_ok}" = "xyes" ; then
117 if test "x${parmetis_binaries_ok}" = "xyes" ; then
119 ENABLE_PARMETIS="yes"
120 # ParMETIS includes METIS, so we redefine METIS cppflags and libs
121 # And metis.h #include parmetis.h + mpi.h
124 METISDIR=${PARMETISDIR}
125 METIS_CPPFLAGS="-DMED_ENABLE_METIS -I${METISDIR}/METISLib ${PARMETIS_CPPFLAGS}"
126 METIS_LIBS="-L${METISDIR} -lmetis ${MPI_LIBS}"
130 AC_MSG_RESULT(for ParMETIS: $parmetis_ok)
132 AC_SUBST(ENABLE_PARMETIS)
133 AC_SUBST(PARMETIS_CPPFLAGS)
134 AC_SUBST(PARMETIS_LIBS)
135 AC_SUBST(ENABLE_METIS)
136 AC_SUBST(METIS_CPPFLAGS)
144 AC_DEFUN([CHECK_PARMETISV4],[
145 AC_REQUIRE([AC_PROG_CC])dnl
146 AC_REQUIRE([AC_PROG_CPP])dnl
147 AC_REQUIRE([CHECK_MPI])dnl
149 AC_CHECKING(for ParMETIS V4 Library)
158 AC_CHECKING(for ParMETIS location)
159 AC_ARG_WITH(parmetis,
160 [ --with-parmetis=DIR root directory path to ParMETIS library installation ],
161 [PARMETISDIR="$withval"
162 AC_MSG_RESULT("select $withval as path to ParMETIS library")])
164 AC_MSG_RESULT(\$PARMETISDIR = ${PARMETISDIR})
166 CPPFLAGS_old="${CPPFLAGS}"
169 if test "x${PARMETISDIR}" != "x" ; then
170 PARMETIS_CPPFLAGS="-DMED_ENABLE_PARMETIS -I${PARMETISDIR}/include ${MPI_INCLUDES}"
171 PARMETIS_LIBS="-L${PARMETISDIR}/lib -lparmetis -lmetis ${MPI_LIBS}"
175 parmetis_headers_ok=no
176 parmetis_binaries_ok=no
179 AC_CHECKING(for ParMETIS headers)
180 CPPFLAGS="${CPPFLAGS_old} ${PARMETIS_CPPFLAGS}"
182 parmetis_include_dir_ok=yes
183 if test "x${PARMETISDIR}" != "x" ; then
184 AC_CHECK_FILE(${PARMETISDIR}/include/parmetis.h,
185 parmetis_headers_ok=yes,
186 parmetis_headers_ok=no)
189 if test "x${parmetis_headers_ok}" = "xyes" ; then
190 AC_MSG_RESULT(\$PARMETIS_CPPFLAGS = ${PARMETIS_CPPFLAGS})
192 AC_MSG_RESULT(for ParMETIS headers: $parmetis_headers_ok)
194 if test "x${parmetis_headers_ok}" = "xyes" ; then
195 dnl ParMETIS binaries
196 AC_CHECKING(for ParMETIS binaries)
197 AC_CHECK_FILE(${PARMETISDIR}/lib/libparmetis.a,
198 parmetis_binaries_ok=yes,
199 parmetis_binaries_ok=no)
202 if test "x${parmetis_binaries_ok}" = "xyes" ; then
203 AC_MSG_RESULT(\$PARMETIS_LIBS = ${PARMETIS_LIBS})
205 AC_MSG_RESULT(for ParMETIS binaries: $parmetis_binaries_ok)
207 CPPFLAGS="${CPPFLAGS_old}"
210 if test "x${parmetis_headers_ok}" = "xyes" ; then
211 if test "x${parmetis_binaries_ok}" = "xyes" ; then
213 ENABLE_PARMETIS="yes"
217 AC_MSG_RESULT(for ParMETIS: $parmetis_ok)
219 AC_SUBST(ENABLE_PARMETIS)
220 AC_SUBST(PARMETIS_CPPFLAGS)
221 AC_SUBST(PARMETIS_LIBS)