1 dnl Copyright (C) 2007-2024 CEA, EDF, 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_TBB],[
24 AC_REQUIRE([AC_PROG_CC])dnl
25 AC_REQUIRE([AC_PROG_CPP])dnl
30 [ --with-TBB=DIR root directory path to TBB installation ],
32 AC_MSG_RESULT("select $withval as path to TBB")
35 AC_SUBST(TBB_INCLUDES)
44 LOCAL_LIBS="-ltbb -ltbbmalloc"
49 CPPFLAGS_old=$CPPFLAGS
51 if test "x$TBBHOME" != "xno"; then
52 if test "x$TBBHOME" == "xyes"; then
57 AC_MSG_WARN(undefined TBBHOME variable which specify TBB library installation directory)
58 AC_PATH_PROG(BINDIR, tbbvars.sh)
59 if test "x$BINDIR" != "x" ; then
60 dnl e.g. BINDIR = ./tbb/bin/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/tbbvars.sh
62 TBBHOME=`echo ${TBBHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
63 TBBHOME=`echo ${TBBHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
64 TBBHOME=`echo ${TBBHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
65 TBBHOME=`echo ${TBBHOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
70 TBBKERNEL='cc4.1.0_libc2.4_kernel2.6.16.21'
71 LOCAL_INCLUDES="-I$TBBHOME/include"
72 if test "x$TBBHOME" != "x/usr"; then
74 if test `uname -m` = "x86_64" ; then
75 INTEL_LOCAL_LIB="$TBBHOME/lib/intel64/$TBBKERNEL"
77 INTEL_LOCAL_LIB="$TBBHOME/lib/ia32/$TBBKERNEL"
79 if test ! -d ${INTEL_LOCAL_LIB} ; then
80 INTEL_LOCAL_LIB="${TBBHOME}/lib"
82 if test -d ${INTEL_LOCAL_LIB} ; then
83 LOCAL_LIBS="-L${INTEL_LOCAL_LIB} $LOCAL_LIBS"
90 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
92 AC_CHECK_HEADER(tbb/tbb.h,tbb_ok=yes ,tbb_ok=no)
95 if test "x$tbb_ok" = "xyes"
101 LIBS="$LIBS $LOCAL_LIBS"
102 AC_TRY_LINK([#include <tbb/tbb.h>],
103 [tbb::simple_partitioner()],
104 tbb_ok=yes,tbb_ok=no)
110 CPPFLAGS=$CPPFLAGS_old
113 AC_MSG_RESULT(for TBB: $tbb_ok)
115 if test "x$tbb_ok" = "xyes"
117 TBB_LIBS="$LOCAL_LIBS"
118 TBB_INCLUDES="$LOCAL_INCLUDES"
119 CPPFLAGS="-DWITH_TBB $CPPFLAGS"
122 AM_CONDITIONAL(WITH_TBB, [test x"$tbb_ok" = xyes])