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 AC_DEFUN([CHECK_SCOTCH],[
25 AC_CHECKING(for scotch)
33 SCOTCH_CPPFLAGS="SCOTCH_CPPFLAGS_NOT_DEFINED"
34 SCOTCH_LIBS="SCOTCH_LIBS_NOT_FOUND"
35 SCOTCH_LIBSUFFIX="-not-defined"
39 AC_CHECKING(for scotch location)
42 [ --with-scotch=DIR root directory path to SCOTCH library installation ],
44 AC_MSG_RESULT([Select $withval as path to SCOTCH library])])
46 if test "x${SCOTCHDIR}" = "x" ; then
47 AC_MSG_WARN(SCOTCHDIR is not specified)
48 AC_MSG_NOTICE(Trying native scotch...)
52 CPPFLAGS_old="${CPPFLAGS}"
62 AC_CHECKING(for SCOTCH headers)
64 for d in ${SCOTCHDIR}/include ${SCOTCHDIR}/include/scotch ${SCOTCHDIR}/bin ${SCOTCHDIR} ; do
66 dnl check scotch.h file availability
68 AC_CHECK_FILE([${d}/scotch.h],
69 [scotch_include_dir_ok=yes],
70 [scotch_include_dir_ok=no])
72 if test "x${scotch_include_dir_ok}" = "xyes" ; then
73 LOCAL_INCLUDES="-DMED_ENABLE_SCOTCH -I${d} ${MPI_INCLUDES}"
74 CPPFLAGS="${CPPFLAGS_old} ${LOCAL_INCLUDES} -std=c99"
79 [SCOTCH_Graph* graph; SCOTCH_graphInit(graph)],
80 [scotch_headers_ok=yes],
81 [scotch_headers_ok=no])
82 if test "x${scotch_headers_ok}" = "xyes" ; then
89 dnl result for headers
91 AC_MSG_RESULT(for scotch headers: $scotch_headers_ok)
96 if test "x${scotch_headers_ok}" = "xyes" ; then
97 AC_CHECKING(for scotch libraries)
99 for d in ${SCOTCHDIR}/lib ${SCOTCHDIR}/lib64 ${SCOTCHDIR}/lib/scotch ${SCOTCHDIR}/lib64/scotch ${SCOTCHDIR}/bin ${SCOTCHDIR} ; do
100 LOCAL_LIBS="-L${d} -lscotch -lscotcherr"
101 LIBS="${LIBS_old} ${LOCAL_LIBS}"
106 [SCOTCH_Graph* graph; SCOTCH_graphInit(graph)],
107 [scotch_binaries_ok=yes],
108 [scotch_binaries_ok=no])
109 if test "x${scotch_binaries_ok}" = "xyes" ; then
116 dnl result for libraries
118 AC_MSG_RESULT(for scotch libraries: $scotch_binaries_ok)
123 if test "x${scotch_binaries_ok}" = "xyes" ; then
124 SCOTCH_CPPFLAGS=${LOCAL_INCLUDES}
125 SCOTCH_LIBS=${LOCAL_LIBS}
129 AC_MSG_RESULT(\$SCOTCH_CPPFLAGS = ${SCOTCH_CPPFLAGS})
130 AC_MSG_RESULT(\$SCOTCH_LIBS = ${SCOTCH_LIBS})
131 AC_MSG_RESULT(\$SCOTCH_LIBSUFFIX = ${SCOTCH_LIBSUFFIX})
133 AC_MSG_RESULT(for scotch: $scotch_ok)
135 CPPFLAGS="${CPPFLAGS_old}"
138 AC_SUBST(SCOTCH_CPPFLAGS)
139 AC_SUBST(SCOTCH_LIBSUFFIX)
140 AC_SUBST(SCOTCH_LIBS)
141 AC_SUBST(ENABLE_SCOTCH)