1 dnl Copyright (C) 2007-2023 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_RESULT(for \${SCOTCH_ROOT_DIR}: ${SCOTCH_ROOT_DIR})
48 # --with-scotch option is not used
49 if test "x${SCOTCH_ROOT_DIR}" != "x" ; then
50 SCOTCHDIR=${SCOTCH_ROOT_DIR}
54 if test "x${SCOTCHDIR}" = "x" ; then
55 AC_MSG_WARN(SCOTCHDIR is not specified)
56 AC_MSG_NOTICE(Trying native scotch...)
60 CPPFLAGS_old="${CPPFLAGS}"
70 AC_CHECKING(for SCOTCH headers)
72 for d in ${SCOTCHDIR}/include ${SCOTCHDIR}/include/scotch ${SCOTCHDIR}/bin ${SCOTCHDIR} ; do
74 dnl check scotch.h file availability
76 AC_CHECK_FILE([${d}/scotch.h],
77 [scotch_include_dir_ok=yes],
78 [scotch_include_dir_ok=no])
80 if test "x${scotch_include_dir_ok}" = "xyes" ; then
81 LOCAL_INCLUDES="-DMED_ENABLE_SCOTCH -I${d} ${MPI_INCLUDES}"
82 CPPFLAGS="${CPPFLAGS_old} ${LOCAL_INCLUDES} -std=c99"
87 [SCOTCH_Graph* graph; SCOTCH_graphInit(graph)],
88 [scotch_headers_ok=yes],
89 [scotch_headers_ok=no])
90 if test "x${scotch_headers_ok}" = "xyes" ; then
97 dnl result for headers
99 AC_MSG_RESULT(for scotch headers: $scotch_headers_ok)
104 if test "x${scotch_headers_ok}" = "xyes" ; then
105 AC_CHECKING(for scotch libraries)
107 for d in ${SCOTCHDIR}/lib ${SCOTCHDIR}/lib64 ${SCOTCHDIR}/lib/scotch ${SCOTCHDIR}/lib64/scotch ${SCOTCHDIR}/bin ${SCOTCHDIR} ; do
108 LOCAL_LIBS="-L${d} -lscotch -lscotcherr"
109 LIBS="${LIBS_old} ${LOCAL_LIBS}"
114 [SCOTCH_Graph* graph; SCOTCH_graphInit(graph)],
115 [scotch_binaries_ok=yes],
116 [scotch_binaries_ok=no])
117 if test "x${scotch_binaries_ok}" = "xyes" ; then
124 dnl result for libraries
126 AC_MSG_RESULT(for scotch libraries: $scotch_binaries_ok)
131 if test "x${scotch_binaries_ok}" = "xyes" ; then
132 SCOTCH_CPPFLAGS=${LOCAL_INCLUDES}
133 SCOTCH_LIBS=${LOCAL_LIBS}
137 AC_MSG_RESULT(\$SCOTCH_CPPFLAGS = ${SCOTCH_CPPFLAGS})
138 AC_MSG_RESULT(\$SCOTCH_LIBS = ${SCOTCH_LIBS})
139 AC_MSG_RESULT(\$SCOTCH_LIBSUFFIX = ${SCOTCH_LIBSUFFIX})
141 AC_MSG_RESULT(for scotch: $scotch_ok)
143 CPPFLAGS="${CPPFLAGS_old}"
146 AC_SUBST(SCOTCH_CPPFLAGS)
147 AC_SUBST(SCOTCH_LIBSUFFIX)
148 AC_SUBST(SCOTCH_LIBS)
149 AC_SUBST(ENABLE_SCOTCH)