* [PATCH] Support official CLooG.org versions.
[not found] <4C88C926.6030102@fim.uni-passau.de>
@ 2010-09-10 9:11 ` Andreas Simbürger
2010-09-10 10:55 ` Jack Howarth
2010-09-10 18:27 ` Ralf Wildenhues
0 siblings, 2 replies; 67+ messages in thread
From: Andreas Simbürger @ 2010-09-10 9:11 UTC (permalink / raw)
To: gcc-graphite; +Cc: gcc-patches, Andreas Simbürger
Add support for official CLooG releases.
CLooG's configuration gets detected within 2 stages:
Stage 1: Detect the installed CLooG version.
This is done by linking test programs against the various
CLooG libraries. As CLooG's library sonames depend on the
used backend, this is sufficient to detect the used backend.
We only detect this backends, in order:
1) CLooG-PPL (Legacy): The "old" CLooG.
2) CLooG-ISL: The "new" CLooG.
3) CLooG-Parma: An alternative backend, to compare it with
CLooG-ISL.
CLooG-Poly is not detected, as the PolyLib may conflict
with GCC's license.
Stage 2: Version checks.
After detecting the right configuration, we finally check
if the installed version is usable. There are 2 different
checks: One for CLooG-PPL (Legacy) and one for CLooG-ISL.
* CLooG-ISL:
As the "new" CLooG provides methods to check for its version at
both compile and run time, we use this feature. First
we check for the constants to verify the header's compatibility.
Finally we verify the compatibility of our headers with
the library that will get linked with GCC.
As stated in autoconf's documentation, the run time check
is not usable when cross-compiling, so we skip this check
then.
* CLooG-PPL (Legacy):
This version check provides the same semantics as before.
As CLooG-PPL (Legacy) provides the same constants as the
official CLooG, we can use the same test program for the
compile time check.
Tested with CLooG-ISL and CLooG-PPL (Legacy).
As for now, CLooG-Parma fails to build.
2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* configure.ac: Support official CLooG.org versions.
* configure: Regenerate.
---
ChangeLog.graphite | 5 +
configure | 369 ++++++++++++++++++++++++++++++++++++++++++----------
configure.ac | 149 ++++++++++++++++++----
3 files changed, 433 insertions(+), 90 deletions(-)
diff --git a/ChangeLog.graphite b/ChangeLog.graphite
index c5edc3a..58e30e3 100644
--- a/ChangeLog.graphite
+++ b/ChangeLog.graphite
@@ -1,3 +1,8 @@
+2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * configure.ac: Support official CLooG.org versions.
+ * configure: Regenerate.
+
2010-08-24 Sebastian Pop <sebastian.pop@amd.com>
* Merge from mainline (160224:163495).
diff --git a/configure b/configure
index fc759d7..878b72f 100755
--- a/configure
+++ b/configure
@@ -1816,6 +1816,48 @@ fi
} # ac_fn_c_try_link
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_run
+
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -1940,48 +1982,6 @@ fi
} # ac_fn_c_check_header_mongrel
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
-
-} # ac_fn_c_try_run
-
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
@@ -5885,8 +5885,6 @@ fi
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
# Check whether --with-cloog was given.
@@ -5919,19 +5917,19 @@ case $with_cloog in
"" | yes)
;;
*)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
;;
esac
if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
+ clooginc="-I$with_cloog_include"
fi
if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
+ clooglibs="-L$with_cloog_lib"
fi
if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
enable_cloog_version_check=no
fi
@@ -5943,56 +5941,293 @@ else
fi
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
-$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+if test "x$with_cloog" != "xno"; then
+ # CLooG configure test programs.
+
+
+
+
+ saved_cflags=$CFLAGS
+ saved_libs=$LIBS
+ saved_ldflags=$LDFLAGS
+
+ # Only fail if the user explicitly selected CLooG.
+ cloog_allow_fail="no"
+ if test "x${with_cloog}${with_cloog_include}${with_cloog_lib}" != "x" ; then
+ cloog_allow_fail="yes"
+ fi
+
+ # Stage 1: Detect the available CLooG+backend combination.
+ clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+ CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG type" >&5
+$as_echo_n "checking for installed CLooG type... " >&6; }
+
+ cloog_inc=$clooglegacyinc
+ cloog_org="no"
+ LIBS="-lcloog"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include "cloog/cloog.h"
+
+
+ #include <cloog/cloog.h>
+
int
main ()
{
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
+ cloog_version ()
+
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: CLooG-PPL (Legacy)" >&5
+$as_echo "CLooG-PPL (Legacy)" >&6; }
+else
+
+ cloog_inc=$cloogorginc
+ cloog_org="yes"
+ LIBS="-lcloog-isl -lisl"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+ #include <cloog/cloog.h>
+
+int
+main ()
+{
+
+ cloog_version ()
+
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: CLooG-ISL" >&5
+$as_echo "CLooG-ISL" >&6; }
+else
+
+ LIBS="-lcloog-ppl"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+ #include <cloog/cloog.h>
+
+int
+main ()
+{
+
+ cloog_version ()
+
;
return 0;
}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: CLooG-PPL" >&5
+$as_echo "CLooG-PPL" >&6; }
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; cloog_inc= ; cloog_org= ; LIBS= ;
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ # Setup required flags for CLooG.
+ if test "x${cloog_inc}${cloog_org}" != "x" ; then
+ clooglibs="${clooglibs} ${LIBS}"
+ clooginc="${clooginc} ${cloog_inc}"
+ else
+ clooglibs= ; clooginc= ;
+ fi
+
+ CFLAGS=$saved_cflags
+ LIBS=$saved_libs
+ LDFLAGS=$saved_ldflags
+
+ # Stage 2: Version check the found CLooG.
+ if test "${ENABLE_CLOOG_CHECK}" = "yes" \
+ && test "${cloog_org}" = "yes" ; then
+ saved_CFLAGS="$CFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} "
+ LDFLAGS="${LDFLAGS} ${clooglibs} "
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.14.0 of CLooG (compile and run time)" >&5
+$as_echo_n "checking for version 0.14.0 of CLooG (compile and run time)... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+ #include <cloog/cloog.h>
+
+int
+main ()
+{
+
+ #if CLOOG_VERSION_MAJOR != 0
+ || CLOOG_VERSION_MINOR != 14
+ || CLOOG_VERSION_REVISION < 0
+ choke me
+ #endif
+
+
+ ;
+ return 0;
+}
+
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+
+ if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (cross-compile)" >&5
+$as_echo "yes (cross-compile)" >&6; }
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include "cloog/cloog.h"
+
+
+ #include <stdlib.h>
+ #include <cloog/cloog.h>
+
int
main ()
{
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
+ if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ exit (1);
+ }
+
;
return 0;
}
+
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed at run time" >&5
+$as_echo "failed at run time" >&6; }; clooglibs= ; clooginc=
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed at compile time" >&5
+$as_echo "failed at compile time" >&6; }; clooglibs= ; clooginc=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ CFLAGS=${saved_CFLAGS}
+ LDFLAGS=${saved_LDFLAGS}
+ fi
+
+ # Version check for CLooG-PPL (Legacy).
+ if test "${ENABLE_CLOOG_CHECK}" = "yes" \
+ && test "${cloog_org}" = "no" ; then
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
+$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+ #include <cloog/cloog.h>
+
+int
+main ()
+{
+
+ #if CLOOG_VERSION_MAJOR != 0
+ || CLOOG_VERSION_MINOR != 15
+ || CLOOG_VERSION_REVISION < 5
+ choke me
+ #endif
+
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+ #include <cloog/cloog.h>
+
+int
+main ()
+{
+
+ #if CLOOG_VERSION_MAJOR != 0
+ || CLOOG_VERSION_MINOR != 15
+ || CLOOG_VERSION_REVISION < 9
+ choke me
+ #endif
+
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
$as_echo "buggy but acceptable" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }; clooglibs= ; clooginc=
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$saved_CFLAGS"
+ CFLAGS="$saved_CFLAGS"
+ fi
+
+ if test "${cloog_allow_fail}" = "yes" \
+ && test "x${clooglibs}${clooginc}" = "x"; then
+ as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5
+ fi
fi
# Flags needed for CLOOG
diff --git a/configure.ac b/configure.ac
index 3d969aa..da67bbd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1580,8 +1580,6 @@ AC_SUBST(pplinc)
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
Equivalent to --with-cloog-include=PATH/include
@@ -1601,19 +1599,19 @@ case $with_cloog in
"" | yes)
;;
*)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
;;
esac
if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
+ clooginc="-I$with_cloog_include"
fi
if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
+ clooglibs="-L$with_cloog_lib"
fi
if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
enable_cloog_version_check=no
fi
@@ -1622,21 +1620,126 @@ AC_ARG_ENABLE(cloog-version-check,
ENABLE_CLOOG_CHECK=$enableval,
ENABLE_CLOOG_CHECK=yes)
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
- AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
- ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
- [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
- CFLAGS="$saved_CFLAGS"
+if test "x$with_cloog" != "xno"; then
+ # CLooG configure test programs.
+ m4_define([CLOOG_BACKEND_PROG],[
+ AC_LANG_PROGRAM([
+ #include <cloog/cloog.h>
+ ],[
+ cloog_version ()
+ ]
+ )]
+ )
+ m4_define([CLOOG_CHECK_CT_PROG],[
+ AC_LANG_PROGRAM([
+ #include <cloog/cloog.h>
+ ], [
+ #if CLOOG_VERSION_MAJOR != $1
+ || CLOOG_VERSION_MINOR != $2
+ || CLOOG_VERSION_REVISION < $3
+ choke me
+ #endif
+ ]
+ )]
+ )
+ m4_define([CLOOG_CHECK_RT_PROG],[
+ AC_LANG_PROGRAM([
+ #include <stdlib.h>
+ #include <cloog/cloog.h>
+ ],[
+ if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ exit (1);
+ }
+ ]
+ )]
+ )
+
+ saved_cflags=$CFLAGS
+ saved_libs=$LIBS
+ saved_ldflags=$LDFLAGS
+
+ # Only fail if the user explicitly selected CLooG.
+ cloog_allow_fail="no"
+ if test "x${with_cloog}${with_cloog_include}${with_cloog_lib}" != "x" ; then
+ cloog_allow_fail="yes"
+ fi
+
+ # Stage 1: Detect the available CLooG+backend combination.
+ clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+ CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ AC_MSG_CHECKING([for installed CLooG type])
+
+ cloog_inc=$clooglegacyinc
+ cloog_org="no"
+ LIBS="-lcloog"
+ AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-PPL (Legacy)])],[
+ cloog_inc=$cloogorginc
+ cloog_org="yes"
+ LIBS="-lcloog-isl -lisl"
+ AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-ISL])],[
+ LIBS="-lcloog-ppl"
+ AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-PPL])],[
+ AC_MSG_RESULT([no]); cloog_inc= ; cloog_org= ; LIBS= ;
+ ])
+ ])
+ ])
+
+ # Setup required flags for CLooG.
+ if test "x${cloog_inc}${cloog_org}" != "x" ; then
+ clooglibs="${clooglibs} ${LIBS}"
+ clooginc="${clooginc} ${cloog_inc}"
+ else
+ clooglibs= ; clooginc= ;
+ fi
+
+ CFLAGS=$saved_cflags
+ LIBS=$saved_libs
+ LDFLAGS=$saved_ldflags
+
+ # Stage 2: Version check the found CLooG.
+ if test "${ENABLE_CLOOG_CHECK}" = "yes" \
+ && test "${cloog_org}" = "yes" ; then
+ saved_CFLAGS="$CFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+ CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} "
+ LDFLAGS="${LDFLAGS} ${clooglibs} "
+
+ AC_MSG_CHECKING([for version 0.14.0 of CLooG (compile and run time)])
+ AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,14,0)],[
+ AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([failed at run time]); clooglibs= ; clooginc= ],
+ [AC_MSG_RESULT([yes (cross-compile)])])],
+ [AC_MSG_RESULT([failed at compile time]); clooglibs= ; clooginc= ])
+
+ CFLAGS=${saved_CFLAGS}
+ LDFLAGS=${saved_LDFLAGS}
+ fi
+
+ # Version check for CLooG-PPL (Legacy).
+ if test "${ENABLE_CLOOG_CHECK}" = "yes" \
+ && test "${cloog_org}" = "no" ; then
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
+ AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
+ AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],[
+ AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],[
+ AC_MSG_RESULT([yes])],[
+ AC_MSG_RESULT([buggy but acceptable])])],[
+ AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
+ CFLAGS="$saved_CFLAGS"
+ fi
+
+ if test "${cloog_allow_fail}" = "yes" \
+ && test "x${clooglibs}${clooginc}" = "x"; then
+ AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])
+ fi
fi
# Flags needed for CLOOG
--
1.7.2.2
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-10 9:11 ` [PATCH] Support official CLooG.org versions Andreas Simbürger
@ 2010-09-10 10:55 ` Jack Howarth
2010-09-10 11:42 ` Tobias Grosser
2010-09-10 20:11 ` Sebastian Pop
2010-09-10 18:27 ` Ralf Wildenhues
1 sibling, 2 replies; 67+ messages in thread
From: Jack Howarth @ 2010-09-10 10:55 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-graphite, gcc-patches, sebpop
On Fri, Sep 10, 2010 at 10:26:27AM +0200, Andreas Simbürger wrote:
> Add support for official CLooG releases.
> CLooG's configuration gets detected within 2 stages:
>
> Stage 1: Detect the installed CLooG version.
> This is done by linking test programs against the various
> CLooG libraries. As CLooG's library sonames depend on the
> used backend, this is sufficient to detect the used backend.
>
> We only detect this backends, in order:
> 1) CLooG-PPL (Legacy): The "old" CLooG.
> 2) CLooG-ISL: The "new" CLooG.
> 3) CLooG-Parma: An alternative backend, to compare it with
> CLooG-ISL.
>
> CLooG-Poly is not detected, as the PolyLib may conflict
> with GCC's license.
>
> Stage 2: Version checks.
> After detecting the right configuration, we finally check
> if the installed version is usable. There are 2 different
> checks: One for CLooG-PPL (Legacy) and one for CLooG-ISL.
>
> * CLooG-ISL:
> As the "new" CLooG provides methods to check for its version at
> both compile and run time, we use this feature. First
> we check for the constants to verify the header's compatibility.
> Finally we verify the compatibility of our headers with
> the library that will get linked with GCC.
> As stated in autoconf's documentation, the run time check
> is not usable when cross-compiling, so we skip this check
> then.
>
> * CLooG-PPL (Legacy):
> This version check provides the same semantics as before.
> As CLooG-PPL (Legacy) provides the same constants as the
> official CLooG, we can use the same test program for the
> compile time check.
I thought it was agreed that we shouldn't allow cloog-ppl < 0.16
to be used to build gcc 4.6 and later in order to avoid the ABI issues
introduced with the ppl 0.11 release...
http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00849.html
http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00998.html
http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01033.html
I read the last message as agreeing that in order to solve the issue
of maintaining coherency between the ppl ABI used to build FSF gcc and
cloog that...
1) cloog-ppl would be left incapable of building against ppl >= 0.11.
2) cloog.org would require ppl >= 0.11 to build.
3) when cloog.org support was added to gcc 4.6, the ability to build
against cloog-ppl would be depreciated.
Jack
>
> Tested with CLooG-ISL and CLooG-PPL (Legacy).
> As for now, CLooG-Parma fails to build.
>
> 2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
>
> * configure.ac: Support official CLooG.org versions.
> * configure: Regenerate.
> ---
> ChangeLog.graphite | 5 +
> configure | 369 ++++++++++++++++++++++++++++++++++++++++++----------
> configure.ac | 149 ++++++++++++++++++----
> 3 files changed, 433 insertions(+), 90 deletions(-)
>
> diff --git a/ChangeLog.graphite b/ChangeLog.graphite
> index c5edc3a..58e30e3 100644
> --- a/ChangeLog.graphite
> +++ b/ChangeLog.graphite
> @@ -1,3 +1,8 @@
> +2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
> +
> + * configure.ac: Support official CLooG.org versions.
> + * configure: Regenerate.
> +
> 2010-08-24 Sebastian Pop <sebastian.pop@amd.com>
>
> * Merge from mainline (160224:163495).
> diff --git a/configure b/configure
> index fc759d7..878b72f 100755
> --- a/configure
> +++ b/configure
> @@ -1816,6 +1816,48 @@ fi
>
> } # ac_fn_c_try_link
>
> +# ac_fn_c_try_run LINENO
> +# ----------------------
> +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
> +# that executables *can* be run.
> +ac_fn_c_try_run ()
> +{
> + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
> + if { { ac_try="$ac_link"
> +case "(($ac_try" in
> + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> + *) ac_try_echo=$ac_try;;
> +esac
> +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> +$as_echo "$ac_try_echo"; } >&5
> + (eval "$ac_link") 2>&5
> + ac_status=$?
> + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
> + { { case "(($ac_try" in
> + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> + *) ac_try_echo=$ac_try;;
> +esac
> +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> +$as_echo "$ac_try_echo"; } >&5
> + (eval "$ac_try") 2>&5
> + ac_status=$?
> + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> + test $ac_status = 0; }; }; then :
> + ac_retval=0
> +else
> + $as_echo "$as_me: program exited with status $ac_status" >&5
> + $as_echo "$as_me: failed program was:" >&5
> +sed 's/^/| /' conftest.$ac_ext >&5
> +
> + ac_retval=$ac_status
> +fi
> + rm -rf conftest.dSYM conftest_ipa8_conftest.oo
> + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
> + return $ac_retval
> +
> +} # ac_fn_c_try_run
> +
> # ac_fn_c_try_cpp LINENO
> # ----------------------
> # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
> @@ -1940,48 +1982,6 @@ fi
>
> } # ac_fn_c_check_header_mongrel
>
> -# ac_fn_c_try_run LINENO
> -# ----------------------
> -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
> -# that executables *can* be run.
> -ac_fn_c_try_run ()
> -{
> - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
> - if { { ac_try="$ac_link"
> -case "(($ac_try" in
> - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> - *) ac_try_echo=$ac_try;;
> -esac
> -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> -$as_echo "$ac_try_echo"; } >&5
> - (eval "$ac_link") 2>&5
> - ac_status=$?
> - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
> - { { case "(($ac_try" in
> - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> - *) ac_try_echo=$ac_try;;
> -esac
> -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> -$as_echo "$ac_try_echo"; } >&5
> - (eval "$ac_try") 2>&5
> - ac_status=$?
> - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> - test $ac_status = 0; }; }; then :
> - ac_retval=0
> -else
> - $as_echo "$as_me: program exited with status $ac_status" >&5
> - $as_echo "$as_me: failed program was:" >&5
> -sed 's/^/| /' conftest.$ac_ext >&5
> -
> - ac_retval=$ac_status
> -fi
> - rm -rf conftest.dSYM conftest_ipa8_conftest.oo
> - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
> - return $ac_retval
> -
> -} # ac_fn_c_try_run
> -
> # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
> # -------------------------------------------------------
> # Tests whether HEADER exists and can be compiled using the include files in
> @@ -5885,8 +5885,6 @@ fi
>
>
> # Check for CLOOG
> -clooglibs=" -lcloog "
> -clooginc=" -DCLOOG_PPL_BACKEND "
>
>
> # Check whether --with-cloog was given.
> @@ -5919,19 +5917,19 @@ case $with_cloog in
> "" | yes)
> ;;
> *)
> - clooglibs="-L$with_cloog/lib -lcloog"
> - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
> + clooglibs="-L$with_cloog/lib"
> + clooginc="-I$with_cloog/include"
> ;;
> esac
> if test "x$with_cloog_include" != x; then
> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
> + clooginc="-I$with_cloog_include"
> fi
> if test "x$with_cloog_lib" != x; then
> - clooglibs="-L$with_cloog_lib -lcloog"
> + clooglibs="-L$with_cloog_lib"
> fi
> if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
> - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
> - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
> enable_cloog_version_check=no
> fi
>
> @@ -5943,56 +5941,293 @@ else
> fi
>
>
> -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
> - saved_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
> -$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
> +if test "x$with_cloog" != "xno"; then
> + # CLooG configure test programs.
> +
> +
> +
> +
> + saved_cflags=$CFLAGS
> + saved_libs=$LIBS
> + saved_ldflags=$LDFLAGS
> +
> + # Only fail if the user explicitly selected CLooG.
> + cloog_allow_fail="no"
> + if test "x${with_cloog}${with_cloog_include}${with_cloog_lib}" != "x" ; then
> + cloog_allow_fail="yes"
> + fi
> +
> + # Stage 1: Detect the available CLooG+backend combination.
> + clooglegacyinc="-DCLOOG_PPL_BACKEND"
> + cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc}"
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG type" >&5
> +$as_echo_n "checking for installed CLooG type... " >&6; }
> +
> + cloog_inc=$clooglegacyinc
> + cloog_org="no"
> + LIBS="-lcloog"
> cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> -#include "cloog/cloog.h"
> +
> +
> + #include <cloog/cloog.h>
> +
> int
> main ()
> {
>
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
> - choke me
> - #endif
> + cloog_version ()
> +
> +
> + ;
> + return 0;
> +}
> +
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: CLooG-PPL (Legacy)" >&5
> +$as_echo "CLooG-PPL (Legacy)" >&6; }
> +else
> +
> + cloog_inc=$cloogorginc
> + cloog_org="yes"
> + LIBS="-lcloog-isl -lisl"
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +
> +
> + #include <cloog/cloog.h>
> +
> +int
> +main ()
> +{
> +
> + cloog_version ()
> +
> +
> + ;
> + return 0;
> +}
> +
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: CLooG-ISL" >&5
> +$as_echo "CLooG-ISL" >&6; }
> +else
> +
> + LIBS="-lcloog-ppl"
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +
> +
> + #include <cloog/cloog.h>
> +
> +int
> +main ()
> +{
> +
> + cloog_version ()
> +
>
> ;
> return 0;
> }
> +
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: CLooG-PPL" >&5
> +$as_echo "CLooG-PPL" >&6; }
> +else
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }; cloog_inc= ; cloog_org= ; LIBS= ;
> +
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +
> + # Setup required flags for CLooG.
> + if test "x${cloog_inc}${cloog_org}" != "x" ; then
> + clooglibs="${clooglibs} ${LIBS}"
> + clooginc="${clooginc} ${cloog_inc}"
> + else
> + clooglibs= ; clooginc= ;
> + fi
> +
> + CFLAGS=$saved_cflags
> + LIBS=$saved_libs
> + LDFLAGS=$saved_ldflags
> +
> + # Stage 2: Version check the found CLooG.
> + if test "${ENABLE_CLOOG_CHECK}" = "yes" \
> + && test "${cloog_org}" = "yes" ; then
> + saved_CFLAGS="$CFLAGS"
> + saved_LDFLAGS="$LDFLAGS"
> + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} "
> + LDFLAGS="${LDFLAGS} ${clooglibs} "
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.14.0 of CLooG (compile and run time)" >&5
> +$as_echo_n "checking for version 0.14.0 of CLooG (compile and run time)... " >&6; }
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +
> +
> + #include <cloog/cloog.h>
> +
> +int
> +main ()
> +{
> +
> + #if CLOOG_VERSION_MAJOR != 0
> + || CLOOG_VERSION_MINOR != 14
> + || CLOOG_VERSION_REVISION < 0
> + choke me
> + #endif
> +
> +
> + ;
> + return 0;
> +}
> +
> _ACEOF
> if ac_fn_c_try_compile "$LINENO"; then :
> +
> + if test "$cross_compiling" = yes; then :
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (cross-compile)" >&5
> +$as_echo "yes (cross-compile)" >&6; }
> +else
> cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> -#include "cloog/cloog.h"
> +
> +
> + #include <stdlib.h>
> + #include <cloog/cloog.h>
> +
> int
> main ()
> {
>
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
> - choke me
> - #endif
> + if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
> + {
> + exit (1);
> + }
> +
>
> ;
> return 0;
> }
> +
> _ACEOF
> -if ac_fn_c_try_compile "$LINENO"; then :
> +if ac_fn_c_try_run "$LINENO"; then :
> { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> $as_echo "yes" >&6; }
> else
> - { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed at run time" >&5
> +$as_echo "failed at run time" >&6; }; clooglibs= ; clooginc=
> +fi
> +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
> + conftest.$ac_objext conftest.beam conftest.$ac_ext
> +fi
> +
> +else
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed at compile time" >&5
> +$as_echo "failed at compile time" >&6; }; clooglibs= ; clooginc=
> +fi
> +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +
> + CFLAGS=${saved_CFLAGS}
> + LDFLAGS=${saved_LDFLAGS}
> + fi
> +
> + # Version check for CLooG-PPL (Legacy).
> + if test "${ENABLE_CLOOG_CHECK}" = "yes" \
> + && test "${cloog_org}" = "no" ; then
> + saved_CFLAGS="$CFLAGS"
> + CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
> +$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +
> +
> + #include <cloog/cloog.h>
> +
> +int
> +main ()
> +{
> +
> + #if CLOOG_VERSION_MAJOR != 0
> + || CLOOG_VERSION_MINOR != 15
> + || CLOOG_VERSION_REVISION < 5
> + choke me
> + #endif
> +
> +
> + ;
> + return 0;
> +}
> +
> +_ACEOF
> +if ac_fn_c_try_compile "$LINENO"; then :
> +
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +
> +
> + #include <cloog/cloog.h>
> +
> +int
> +main ()
> +{
> +
> + #if CLOOG_VERSION_MAJOR != 0
> + || CLOOG_VERSION_MINOR != 15
> + || CLOOG_VERSION_REVISION < 9
> + choke me
> + #endif
> +
> +
> + ;
> + return 0;
> +}
> +
> +_ACEOF
> +if ac_fn_c_try_compile "$LINENO"; then :
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> +$as_echo "yes" >&6; }
> +else
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
> $as_echo "buggy but acceptable" >&6; }
> fi
> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> else
> - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> $as_echo "no" >&6; }; clooglibs= ; clooginc=
> fi
> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> - CFLAGS="$saved_CFLAGS"
> + CFLAGS="$saved_CFLAGS"
> + fi
> +
> + if test "${cloog_allow_fail}" = "yes" \
> + && test "x${clooglibs}${clooginc}" = "x"; then
> + as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5
> + fi
> fi
>
> # Flags needed for CLOOG
> diff --git a/configure.ac b/configure.ac
> index 3d969aa..da67bbd 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1580,8 +1580,6 @@ AC_SUBST(pplinc)
>
>
> # Check for CLOOG
> -clooglibs=" -lcloog "
> -clooginc=" -DCLOOG_PPL_BACKEND "
>
> AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
> Equivalent to --with-cloog-include=PATH/include
> @@ -1601,19 +1599,19 @@ case $with_cloog in
> "" | yes)
> ;;
> *)
> - clooglibs="-L$with_cloog/lib -lcloog"
> - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
> + clooglibs="-L$with_cloog/lib"
> + clooginc="-I$with_cloog/include"
> ;;
> esac
> if test "x$with_cloog_include" != x; then
> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
> + clooginc="-I$with_cloog_include"
> fi
> if test "x$with_cloog_lib" != x; then
> - clooglibs="-L$with_cloog_lib -lcloog"
> + clooglibs="-L$with_cloog_lib"
> fi
> if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
> - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
> - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
> enable_cloog_version_check=no
> fi
>
> @@ -1622,21 +1620,126 @@ AC_ARG_ENABLE(cloog-version-check,
> ENABLE_CLOOG_CHECK=$enableval,
> ENABLE_CLOOG_CHECK=yes)
>
> -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
> - saved_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> - AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
> - AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
> - choke me
> - #endif
> - ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
> - choke me
> - #endif
> - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
> - [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
> - CFLAGS="$saved_CFLAGS"
> +if test "x$with_cloog" != "xno"; then
> + # CLooG configure test programs.
> + m4_define([CLOOG_BACKEND_PROG],[
> + AC_LANG_PROGRAM([
> + #include <cloog/cloog.h>
> + ],[
> + cloog_version ()
> + ]
> + )]
> + )
> + m4_define([CLOOG_CHECK_CT_PROG],[
> + AC_LANG_PROGRAM([
> + #include <cloog/cloog.h>
> + ], [
> + #if CLOOG_VERSION_MAJOR != $1
> + || CLOOG_VERSION_MINOR != $2
> + || CLOOG_VERSION_REVISION < $3
> + choke me
> + #endif
> + ]
> + )]
> + )
> + m4_define([CLOOG_CHECK_RT_PROG],[
> + AC_LANG_PROGRAM([
> + #include <stdlib.h>
> + #include <cloog/cloog.h>
> + ],[
> + if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
> + {
> + exit (1);
> + }
> + ]
> + )]
> + )
> +
> + saved_cflags=$CFLAGS
> + saved_libs=$LIBS
> + saved_ldflags=$LDFLAGS
> +
> + # Only fail if the user explicitly selected CLooG.
> + cloog_allow_fail="no"
> + if test "x${with_cloog}${with_cloog_include}${with_cloog_lib}" != "x" ; then
> + cloog_allow_fail="yes"
> + fi
> +
> + # Stage 1: Detect the available CLooG+backend combination.
> + clooglegacyinc="-DCLOOG_PPL_BACKEND"
> + cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc}"
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + AC_MSG_CHECKING([for installed CLooG type])
> +
> + cloog_inc=$clooglegacyinc
> + cloog_org="no"
> + LIBS="-lcloog"
> + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-PPL (Legacy)])],[
> + cloog_inc=$cloogorginc
> + cloog_org="yes"
> + LIBS="-lcloog-isl -lisl"
> + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-ISL])],[
> + LIBS="-lcloog-ppl"
> + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-PPL])],[
> + AC_MSG_RESULT([no]); cloog_inc= ; cloog_org= ; LIBS= ;
> + ])
> + ])
> + ])
> +
> + # Setup required flags for CLooG.
> + if test "x${cloog_inc}${cloog_org}" != "x" ; then
> + clooglibs="${clooglibs} ${LIBS}"
> + clooginc="${clooginc} ${cloog_inc}"
> + else
> + clooglibs= ; clooginc= ;
> + fi
> +
> + CFLAGS=$saved_cflags
> + LIBS=$saved_libs
> + LDFLAGS=$saved_ldflags
> +
> + # Stage 2: Version check the found CLooG.
> + if test "${ENABLE_CLOOG_CHECK}" = "yes" \
> + && test "${cloog_org}" = "yes" ; then
> + saved_CFLAGS="$CFLAGS"
> + saved_LDFLAGS="$LDFLAGS"
> + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} "
> + LDFLAGS="${LDFLAGS} ${clooglibs} "
> +
> + AC_MSG_CHECKING([for version 0.14.0 of CLooG (compile and run time)])
> + AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,14,0)],[
> + AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
> + [AC_MSG_RESULT([yes])],
> + [AC_MSG_RESULT([failed at run time]); clooglibs= ; clooginc= ],
> + [AC_MSG_RESULT([yes (cross-compile)])])],
> + [AC_MSG_RESULT([failed at compile time]); clooglibs= ; clooginc= ])
> +
> + CFLAGS=${saved_CFLAGS}
> + LDFLAGS=${saved_LDFLAGS}
> + fi
> +
> + # Version check for CLooG-PPL (Legacy).
> + if test "${ENABLE_CLOOG_CHECK}" = "yes" \
> + && test "${cloog_org}" = "no" ; then
> + saved_CFLAGS="$CFLAGS"
> + CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> + AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
> + AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],[
> + AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],[
> + AC_MSG_RESULT([yes])],[
> + AC_MSG_RESULT([buggy but acceptable])])],[
> + AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
> + CFLAGS="$saved_CFLAGS"
> + fi
> +
> + if test "${cloog_allow_fail}" = "yes" \
> + && test "x${clooglibs}${clooginc}" = "x"; then
> + AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])
> + fi
> fi
>
> # Flags needed for CLOOG
> --
> 1.7.2.2
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-10 10:55 ` Jack Howarth
@ 2010-09-10 11:42 ` Tobias Grosser
2010-09-10 17:14 ` Joseph S. Myers
2010-09-10 20:11 ` Sebastian Pop
1 sibling, 1 reply; 67+ messages in thread
From: Tobias Grosser @ 2010-09-10 11:42 UTC (permalink / raw)
To: Jack Howarth
Cc: Andreas Simbürger, gcc-graphite, gcc-patches, sebpop,
Joseph S. Myers
On 09/10/2010 12:42 PM, Jack Howarth wrote:
> On Fri, Sep 10, 2010 at 10:26:27AM +0200, Andreas Simbürger wrote:
>> Add support for official CLooG releases.
From my side this patch set looks OK. It allows us to test graphite
with the new cloog-isl library.
I believe the patchset should also work for static linking as neither
cloog nor isl use libstdcxx and -lisl was added as requested.
@Joseph
Was this implemented correctly?
One thing that was not included is the --with-isl flag. Currently isl is
automatically installed with CLooG (using git). We will start discussion
on how to release both as a tar balls and based on that add additional
configure support to check for isl as well as the needed documentation.
I propose this transition plan:
1. Commit configure support for cloog-isl to graphite (this patch)
2. Start testing with cloog-isl internally
3. Discuss how to release cloog/isl with the cloog maintainer
4. Release beta tar balls.
5. Adapt configure support to use separate cloog/isl tarballs.
6. Move those changes to trunk and ask for wider testing.
7. Fix regressions.
8. Move to the official cloog.
Cheers
Tobi
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-10 11:42 ` Tobias Grosser
@ 2010-09-10 17:14 ` Joseph S. Myers
0 siblings, 0 replies; 67+ messages in thread
From: Joseph S. Myers @ 2010-09-10 17:14 UTC (permalink / raw)
To: Tobias Grosser
Cc: Jack Howarth, Andreas Simbürger, gcc-graphite, gcc-patches, sebpop
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1264 bytes --]
On Fri, 10 Sep 2010, Tobias Grosser wrote:
> On 09/10/2010 12:42 PM, Jack Howarth wrote:
> > On Fri, Sep 10, 2010 at 10:26:27AM +0200, Andreas Simbürger wrote:
> > > Add support for official CLooG releases.
>
> From my side this patch set looks OK. It allows us to test graphite with the
> new cloog-isl library.
>
> I believe the patchset should also work for static linking as neither cloog
> nor isl use libstdcxx and -lisl was added as requested.
>
> @Joseph
> Was this implemented correctly?
I think you want a build system maintainer to review the details of the
implementation. I can only comment on the general principles: a
particular GCC version specifies particular versions of the libraries that
must be used with it when Graphite-enabled (unless special options are
used to disable the version checks), there are suitable configure options
to say where those libraries are installed, library dependencies are
specified explicitly so that linking with static versions of those
libraries works, the libraries themselves can be cross compiled for the
various supported GCC host systems, and the required versions and
configure options are documented in install.texi.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-10 9:11 ` [PATCH] Support official CLooG.org versions Andreas Simbürger
2010-09-10 10:55 ` Jack Howarth
@ 2010-09-10 18:27 ` Ralf Wildenhues
2010-09-10 18:58 ` Andreas Simbuerger
1 sibling, 1 reply; 67+ messages in thread
From: Ralf Wildenhues @ 2010-09-10 18:27 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-graphite, gcc-patches
Hello Andreas,
I cannot approve, and this isn't a full review either, just a couple of
nits I happened to spot:
* Andreas Simbürger wrote on Fri, Sep 10, 2010 at 10:26:27AM CEST:
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1580,8 +1580,6 @@ AC_SUBST(pplinc)
>
>
> # Check for CLOOG
> -clooglibs=" -lcloog "
> -clooginc=" -DCLOOG_PPL_BACKEND "
>
> AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
> Equivalent to --with-cloog-include=PATH/include
> @@ -1601,19 +1599,19 @@ case $with_cloog in
> "" | yes)
> ;;
> *)
> - clooglibs="-L$with_cloog/lib -lcloog"
> - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
> + clooglibs="-L$with_cloog/lib"
> + clooginc="-I$with_cloog/include"
> ;;
> esac
> if test "x$with_cloog_include" != x; then
This isn't new with your patch (so not a reason for rejection anyway),
but testing for empty variables rather than unset ones,
test ${with_cloog_include+set} != set
will not let users override the logic with an empty setting. That's ok,
it's normally overridable with something like a single space, but might
be less intuitive than necessary.
> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
> + clooginc="-I$with_cloog_include"
> fi
> if test "x$with_cloog_lib" != x; then
> - clooglibs="-L$with_cloog_lib -lcloog"
> + clooglibs="-L$with_cloog_lib"
> fi
> if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
> - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
> - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
> enable_cloog_version_check=no
> fi
>
> @@ -1622,21 +1620,126 @@ AC_ARG_ENABLE(cloog-version-check,
> ENABLE_CLOOG_CHECK=$enableval,
> ENABLE_CLOOG_CHECK=yes)
>
> -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
> - saved_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> - AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
> - AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
> - choke me
> - #endif
> - ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
> - choke me
> - #endif
> - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
> - [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
> - CFLAGS="$saved_CFLAGS"
> +if test "x$with_cloog" != "xno"; then
> + # CLooG configure test programs.
I'd use dnl rather than # for comments that pertain to m4 constructs
rather than shell ones (that way they don't look misplaced in the
configure output).
> + m4_define([CLOOG_BACKEND_PROG],[
> + AC_LANG_PROGRAM([
> + #include <cloog/cloog.h>
> + ],[
> + cloog_version ()
> + ]
> + )]
> + )
> + m4_define([CLOOG_CHECK_CT_PROG],[
> + AC_LANG_PROGRAM([
> + #include <cloog/cloog.h>
> + ], [
> + #if CLOOG_VERSION_MAJOR != $1
> + || CLOOG_VERSION_MINOR != $2
> + || CLOOG_VERSION_REVISION < $3
Without escaping the two newlines this looks like it will always result
in a compile error, because the second and third line will be eaten by
the compiler, not the preprocessor.
> + choke me
> + #endif
> + ]
> + )]
> + )
> + m4_define([CLOOG_CHECK_RT_PROG],[
> + AC_LANG_PROGRAM([
> + #include <stdlib.h>
> + #include <cloog/cloog.h>
> + ],[
> + if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
> + {
> + exit (1);
> + }
> + ]
> + )]
> + )
> +
> + saved_cflags=$CFLAGS
> + saved_libs=$LIBS
> + saved_ldflags=$LDFLAGS
> +
> + # Only fail if the user explicitly selected CLooG.
> + cloog_allow_fail="no"
> + if test "x${with_cloog}${with_cloog_include}${with_cloog_lib}" != "x" ; then
> + cloog_allow_fail="yes"
> + fi
> +
> + # Stage 1: Detect the available CLooG+backend combination.
> + clooglegacyinc="-DCLOOG_PPL_BACKEND"
> + cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc}"
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + AC_MSG_CHECKING([for installed CLooG type])
> +
> + cloog_inc=$clooglegacyinc
> + cloog_org="no"
> + LIBS="-lcloog"
I don't think LIBS should ever be completely overridden. The user may
be smarter that we and know that on her exotic system, -lfoo is always
needed in addition to, say, -lc; I suggest to replace this with
LIBS="-lcloog $saved_LIBS"
(several instances), and adjust the followup code (you assign LIBS to
clooglibs, which is wrong in this case).
> + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-PPL (Legacy)])],[
> + cloog_inc=$cloogorginc
> + cloog_org="yes"
> + LIBS="-lcloog-isl -lisl"
> + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-ISL])],[
> + LIBS="-lcloog-ppl"
> + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-PPL])],[
> + AC_MSG_RESULT([no]); cloog_inc= ; cloog_org= ; LIBS= ;
> + ])
> + ])
> + ])
> +
> + # Setup required flags for CLooG.
> + if test "x${cloog_inc}${cloog_org}" != "x" ; then
> + clooglibs="${clooglibs} ${LIBS}"
> + clooginc="${clooginc} ${cloog_inc}"
> + else
> + clooglibs= ; clooginc= ;
> + fi
> +
> + CFLAGS=$saved_cflags
> + LIBS=$saved_libs
> + LDFLAGS=$saved_ldflags
> +
> + # Stage 2: Version check the found CLooG.
> + if test "${ENABLE_CLOOG_CHECK}" = "yes" \
> + && test "${cloog_org}" = "yes" ; then
> + saved_CFLAGS="$CFLAGS"
> + saved_LDFLAGS="$LDFLAGS"
> + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} "
> + LDFLAGS="${LDFLAGS} ${clooglibs} "
> +
> + AC_MSG_CHECKING([for version 0.14.0 of CLooG (compile and run time)])
> + AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,14,0)],[
> + AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
> + [AC_MSG_RESULT([yes])],
> + [AC_MSG_RESULT([failed at run time]); clooglibs= ; clooginc= ],
> + [AC_MSG_RESULT([yes (cross-compile)])])],
As far as I can see, there is no way to override this test, say, for
cross-compile cases where your guess is wrong. The usual way to allow
an override is to use a cache variable, e.g.,
AC_CACHE_CHECK([for version 0.14.0 of CLooG],
[gcc_cv_cloog_rt_0_14_0],
[AC_RUN_IFELSE([...],
[gcc_cv_cloog_rt_0_14_0=yes],
[gcc_cv_cloog_rt_0_14_0=no],
[gcc_cv_cloog_rt_0_14_0="guessing yes"])])
if test "$gcc_cv_cloog_rt_0_14_0" = ...
or
case $gcc_cv_cloog_rt_0_14_0 in
...
You can also cache the other tests (using other variable names, of
course), but for runtime tests it is the most important. Just be sure
that the third argument of AC_CACHE_CHECK doesn't have side effects
other than setting the cache variable.
> + [AC_MSG_RESULT([failed at compile time]); clooglibs= ; clooginc= ])
> +
> + CFLAGS=${saved_CFLAGS}
> + LDFLAGS=${saved_LDFLAGS}
> + fi
> +
> + # Version check for CLooG-PPL (Legacy).
> + if test "${ENABLE_CLOOG_CHECK}" = "yes" \
> + && test "${cloog_org}" = "no" ; then
> + saved_CFLAGS="$CFLAGS"
> + CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> + AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
> + AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],[
> + AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],[
> + AC_MSG_RESULT([yes])],[
> + AC_MSG_RESULT([buggy but acceptable])])],[
> + AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
> + CFLAGS="$saved_CFLAGS"
> + fi
> +
> + if test "${cloog_allow_fail}" = "yes" \
> + && test "x${clooglibs}${clooginc}" = "x"; then
> + AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])
> + fi
> fi
Cheers,
Ralf
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-10 18:27 ` Ralf Wildenhues
@ 2010-09-10 18:58 ` Andreas Simbuerger
2010-09-11 10:12 ` Ralf Wildenhues
0 siblings, 1 reply; 67+ messages in thread
From: Andreas Simbuerger @ 2010-09-10 18:58 UTC (permalink / raw)
To: Ralf Wildenhues, gcc-graphite, gcc-patches
On 09/10/2010 07:14 PM, Ralf Wildenhues wrote:
> Hello Andreas,
>
> I cannot approve, and this isn't a full review either, just a couple of
> nits I happened to spot:
>
> * Andreas Simbürger wrote on Fri, Sep 10, 2010 at 10:26:27AM CEST:
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -1580,8 +1580,6 @@ AC_SUBST(pplinc)
>>
>>
>> # Check for CLOOG
>> -clooglibs=" -lcloog "
>> -clooginc=" -DCLOOG_PPL_BACKEND "
>>
>> AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
>> Equivalent to --with-cloog-include=PATH/include
>> @@ -1601,19 +1599,19 @@ case $with_cloog in
>> "" | yes)
>> ;;
>> *)
>> - clooglibs="-L$with_cloog/lib -lcloog"
>> - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
>> + clooglibs="-L$with_cloog/lib"
>> + clooginc="-I$with_cloog/include"
>> ;;
>> esac
>> if test "x$with_cloog_include" != x; then
>
> This isn't new with your patch (so not a reason for rejection anyway),
> but testing for empty variables rather than unset ones,
> test ${with_cloog_include+set} != set
>
> will not let users override the logic with an empty setting. That's ok,
> it's normally overridable with something like a single space, but might
> be less intuitive than necessary.
>
Thanks for pointing this out :-)
>> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
>> + clooginc="-I$with_cloog_include"
>> fi
>> if test "x$with_cloog_lib" != x; then
>> - clooglibs="-L$with_cloog_lib -lcloog"
>> + clooglibs="-L$with_cloog_lib"
>> fi
>> if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
>> - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
>> - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
>> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
>> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
>> enable_cloog_version_check=no
>> fi
>>
>> @@ -1622,21 +1620,126 @@ AC_ARG_ENABLE(cloog-version-check,
>> ENABLE_CLOOG_CHECK=$enableval,
>> ENABLE_CLOOG_CHECK=yes)
>>
>> -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
>> - saved_CFLAGS="$CFLAGS"
>> - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
>> - AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
>> - AC_TRY_COMPILE([#include "cloog/cloog.h"],[
>> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
>> - choke me
>> - #endif
>> - ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
>> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
>> - choke me
>> - #endif
>> - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
>> - [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
>> - CFLAGS="$saved_CFLAGS"
>> +if test "x$with_cloog" != "xno"; then
>> + # CLooG configure test programs.
>
> I'd use dnl rather than # for comments that pertain to m4 constructs
> rather than shell ones (that way they don't look misplaced in the
> configure output).
>
>> + m4_define([CLOOG_BACKEND_PROG],[
>> + AC_LANG_PROGRAM([
>> + #include <cloog/cloog.h>
>> + ],[
>> + cloog_version ()
>> + ]
>> + )]
>> + )
>> + m4_define([CLOOG_CHECK_CT_PROG],[
>> + AC_LANG_PROGRAM([
>> + #include <cloog/cloog.h>
>> + ], [
>> + #if CLOOG_VERSION_MAJOR != $1
>> + || CLOOG_VERSION_MINOR != $2
>> + || CLOOG_VERSION_REVISION < $3
>
> Without escaping the two newlines this looks like it will always result
> in a compile error, because the second and third line will be eaten by
> the compiler, not the preprocessor.
>
That is confusing now. I have to admit you're right. However I tested it
with both cloog-isl and cloog-ppl and it worked like a charm.
Interesting. I will fix that.
>> + choke me
>> + #endif
>> + ]
>> + )]
>> + )
>> + m4_define([CLOOG_CHECK_RT_PROG],[
>> + AC_LANG_PROGRAM([
>> + #include <stdlib.h>
>> + #include <cloog/cloog.h>
>> + ],[
>> + if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
>> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
>> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
>> + {
>> + exit (1);
>> + }
>> + ]
>> + )]
>> + )
>> +
>> + saved_cflags=$CFLAGS
>> + saved_libs=$LIBS
>> + saved_ldflags=$LDFLAGS
>> +
>> + # Only fail if the user explicitly selected CLooG.
>> + cloog_allow_fail="no"
>> + if test "x${with_cloog}${with_cloog_include}${with_cloog_lib}" != "x" ; then
>> + cloog_allow_fail="yes"
>> + fi
>> +
>> + # Stage 1: Detect the available CLooG+backend combination.
>> + clooglegacyinc="-DCLOOG_PPL_BACKEND"
>> + cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
>> + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc}"
>> + LDFLAGS="${LDFLAGS} ${clooglibs}"
>> +
>> + AC_MSG_CHECKING([for installed CLooG type])
>> +
>> + cloog_inc=$clooglegacyinc
>> + cloog_org="no"
>> + LIBS="-lcloog"
>
> I don't think LIBS should ever be completely overridden. The user may
> be smarter that we and know that on her exotic system, -lfoo is always
> needed in addition to, say, -lc; I suggest to replace this with
> LIBS="-lcloog $saved_LIBS"
>
> (several instances), and adjust the followup code (you assign LIBS to
> clooglibs, which is wrong in this case).
>
I though i could avoid introducing another variable by "hijacking" LIBS.
>> + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-PPL (Legacy)])],[
>> + cloog_inc=$cloogorginc
>> + cloog_org="yes"
>> + LIBS="-lcloog-isl -lisl"
>> + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-ISL])],[
>> + LIBS="-lcloog-ppl"
>> + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([CLooG-PPL])],[
>> + AC_MSG_RESULT([no]); cloog_inc= ; cloog_org= ; LIBS= ;
>> + ])
>> + ])
>> + ])
>> +
>> + # Setup required flags for CLooG.
>> + if test "x${cloog_inc}${cloog_org}" != "x" ; then
>> + clooglibs="${clooglibs} ${LIBS}"
>> + clooginc="${clooginc} ${cloog_inc}"
>> + else
>> + clooglibs= ; clooginc= ;
>> + fi
>> +
>> + CFLAGS=$saved_cflags
>> + LIBS=$saved_libs
>> + LDFLAGS=$saved_ldflags
>> +
>> + # Stage 2: Version check the found CLooG.
>> + if test "${ENABLE_CLOOG_CHECK}" = "yes" \
>> + && test "${cloog_org}" = "yes" ; then
>> + saved_CFLAGS="$CFLAGS"
>> + saved_LDFLAGS="$LDFLAGS"
>> + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} "
>> + LDFLAGS="${LDFLAGS} ${clooglibs} "
>> +
>> + AC_MSG_CHECKING([for version 0.14.0 of CLooG (compile and run time)])
>> + AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,14,0)],[
>> + AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
>> + [AC_MSG_RESULT([yes])],
>> + [AC_MSG_RESULT([failed at run time]); clooglibs= ; clooginc= ],
>> + [AC_MSG_RESULT([yes (cross-compile)])])],
>
> As far as I can see, there is no way to override this test, say, for
> cross-compile cases where your guess is wrong. The usual way to allow
> an override is to use a cache variable, e.g.,
> AC_CACHE_CHECK([for version 0.14.0 of CLooG],
> [gcc_cv_cloog_rt_0_14_0],
> [AC_RUN_IFELSE([...],
> [gcc_cv_cloog_rt_0_14_0=yes],
> [gcc_cv_cloog_rt_0_14_0=no],
> [gcc_cv_cloog_rt_0_14_0="guessing yes"])])
> if test "$gcc_cv_cloog_rt_0_14_0" = ...
> or
> case $gcc_cv_cloog_rt_0_14_0 in
> ...
>
> You can also cache the other tests (using other variable names, of
> course), but for runtime tests it is the most important. Just be sure
> that the third argument of AC_CACHE_CHECK doesn't have side effects
> other than setting the cache variable.
This is something i don't get right now. The testing goes:
1) Test the compilation.
2) If successful: Test the runtime. If cross-compiling: Ignore the
runtime check and go on.
What is the advantage of providing an override to a test that is ignored
anyways when cross-compiling?
>
>> + [AC_MSG_RESULT([failed at compile time]); clooglibs= ; clooginc= ])
>> +
>> + CFLAGS=${saved_CFLAGS}
>> + LDFLAGS=${saved_LDFLAGS}
>> + fi
>> +
>> + # Version check for CLooG-PPL (Legacy).
>> + if test "${ENABLE_CLOOG_CHECK}" = "yes" \
>> + && test "${cloog_org}" = "no" ; then
>> + saved_CFLAGS="$CFLAGS"
>> + CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
>> + AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
>> + AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],[
>> + AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],[
>> + AC_MSG_RESULT([yes])],[
>> + AC_MSG_RESULT([buggy but acceptable])])],[
>> + AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
>> + CFLAGS="$saved_CFLAGS"
>> + fi
>> +
>> + if test "${cloog_allow_fail}" = "yes" \
>> + && test "x${clooglibs}${clooginc}" = "x"; then
>> + AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])
>> + fi
>> fi
>
> Cheers,
> Ralf
Thanks for reviewing! :-)
Cheers,
Andreas
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-10 10:55 ` Jack Howarth
2010-09-10 11:42 ` Tobias Grosser
@ 2010-09-10 20:11 ` Sebastian Pop
2010-09-10 22:47 ` Jack Howarth
1 sibling, 1 reply; 67+ messages in thread
From: Sebastian Pop @ 2010-09-10 20:11 UTC (permalink / raw)
To: Jack Howarth; +Cc: Andreas Simbürger, gcc-graphite, gcc-patches
On Fri, Sep 10, 2010 at 05:42, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> 1) cloog-ppl would be left incapable of building against ppl >= 0.11.
cloog-ppl-0.15.10 does not have this restriction anymore.
> 2) cloog.org would require ppl >= 0.11 to build.
Correct.
Cloog-parma depends on ppl-0.11, I don't think that
this is a hard dependence, i.e. maybe it can also be
built with ppl-0.10.
> 3) when cloog.org support was added to gcc 4.6, the ability to build
> against cloog-ppl would be depreciated.
This is step number 8 from Tobias' plan.
Sebastian
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-10 20:11 ` Sebastian Pop
@ 2010-09-10 22:47 ` Jack Howarth
0 siblings, 0 replies; 67+ messages in thread
From: Jack Howarth @ 2010-09-10 22:47 UTC (permalink / raw)
To: Sebastian Pop; +Cc: Andreas Simbürger, gcc-graphite, gcc-patches
On Fri, Sep 10, 2010 at 01:57:58PM -0500, Sebastian Pop wrote:
> On Fri, Sep 10, 2010 at 05:42, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> > 1) cloog-ppl would be left incapable of building against ppl >= 0.11.
>
> cloog-ppl-0.15.10 does not have this restriction anymore.
That is scary. Doesn't this open us up to the following scenario?
1) User installs ppl 0.10.2
2) User installs cloog-ppl 0.15.9 built against ppl 0.10.2
3) User installs gcc 4.5.x or trunk built against both ppl 0.10.2 and cloog-ppl 0.15.9.
4) User 'upgrades' ppl to 0.11
5) User 'upgrades' cloog to 0.15.10 built against ppl 0.11
The user now ends up running a gcc release built directly against ppl 0.10.2
and cloog-ppl 0.15.9 but now running against ppl 0.11 via cloog-ppl 0.15.10.
FSF gcc should have some way to sanity check at run time via cloog that it
was built with the same ppl ABI as the cloog it is linked against.
Jack
>
> > 2) cloog.org would require ppl >= 0.11 to build.
>
> Correct.
> Cloog-parma depends on ppl-0.11, I don't think that
> this is a hard dependence, i.e. maybe it can also be
> built with ppl-0.10.
>
> > 3) when cloog.org support was added to gcc 4.6, the ability to build
> > against cloog-ppl would be depreciated.
>
> This is step number 8 from Tobias' plan.
>
> Sebastian
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-10 18:58 ` Andreas Simbuerger
@ 2010-09-11 10:12 ` Ralf Wildenhues
2010-09-11 12:28 ` Andreas Simbuerger
0 siblings, 1 reply; 67+ messages in thread
From: Ralf Wildenhues @ 2010-09-11 10:12 UTC (permalink / raw)
To: Andreas Simbuerger; +Cc: gcc-graphite, gcc-patches
* Andreas Simbuerger wrote on Fri, Sep 10, 2010 at 08:34:50PM CEST:
> On 09/10/2010 07:14 PM, Ralf Wildenhues wrote:
> >> + AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
> >> + [AC_MSG_RESULT([yes])],
> >> + [AC_MSG_RESULT([failed at run time]); clooglibs= ; clooginc= ],
> >> + [AC_MSG_RESULT([yes (cross-compile)])])],
> >
> > As far as I can see, there is no way to override this test, say, for
> > cross-compile cases where your guess is wrong. The usual way to allow
> > an override is to use a cache variable, e.g.,
> > AC_CACHE_CHECK([for version 0.14.0 of CLooG],
> > [gcc_cv_cloog_rt_0_14_0],
> > [AC_RUN_IFELSE([...],
> > [gcc_cv_cloog_rt_0_14_0=yes],
> > [gcc_cv_cloog_rt_0_14_0=no],
> > [gcc_cv_cloog_rt_0_14_0="guessing yes"])])
> > if test "$gcc_cv_cloog_rt_0_14_0" = ...
> > or
> > case $gcc_cv_cloog_rt_0_14_0 in
> > ...
> >
> > You can also cache the other tests (using other variable names, of
> > course), but for runtime tests it is the most important. Just be sure
> > that the third argument of AC_CACHE_CHECK doesn't have side effects
> > other than setting the cache variable.
>
> This is something i don't get right now. The testing goes:
> 1) Test the compilation.
> 2) If successful: Test the runtime. If cross-compiling: Ignore the
> runtime check and go on.
>
> What is the advantage of providing an override to a test that is ignored
> anyways when cross-compiling?
Yeah, maybe you're right in that an override is overkill in this case.
(Generally, runtime tests without cache guard trigger a raised eyebrow
because they might get users stuck. I wonder whether we can let
autoconf warn about them.)
Cheers,
Ralf
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-11 10:12 ` Ralf Wildenhues
@ 2010-09-11 12:28 ` Andreas Simbuerger
2010-09-12 12:11 ` Andreas Simbürger
0 siblings, 1 reply; 67+ messages in thread
From: Andreas Simbuerger @ 2010-09-11 12:28 UTC (permalink / raw)
To: Ralf Wildenhues, gcc-graphite, gcc-patches
On 09/11/2010 10:02 AM, Ralf Wildenhues wrote:
> * Andreas Simbuerger wrote on Fri, Sep 10, 2010 at 08:34:50PM CEST:
>> On 09/10/2010 07:14 PM, Ralf Wildenhues wrote:
>
>>>> + AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
>>>> + [AC_MSG_RESULT([yes])],
>>>> + [AC_MSG_RESULT([failed at run time]); clooglibs= ; clooginc= ],
>>>> + [AC_MSG_RESULT([yes (cross-compile)])])],
>>>
>>> As far as I can see, there is no way to override this test, say, for
>>> cross-compile cases where your guess is wrong. The usual way to allow
>>> an override is to use a cache variable, e.g.,
>>> AC_CACHE_CHECK([for version 0.14.0 of CLooG],
>>> [gcc_cv_cloog_rt_0_14_0],
>>> [AC_RUN_IFELSE([...],
>>> [gcc_cv_cloog_rt_0_14_0=yes],
>>> [gcc_cv_cloog_rt_0_14_0=no],
>>> [gcc_cv_cloog_rt_0_14_0="guessing yes"])])
>>> if test "$gcc_cv_cloog_rt_0_14_0" = ...
>>> or
>>> case $gcc_cv_cloog_rt_0_14_0 in
>>> ...
>>>
>>> You can also cache the other tests (using other variable names, of
>>> course), but for runtime tests it is the most important. Just be sure
>>> that the third argument of AC_CACHE_CHECK doesn't have side effects
>>> other than setting the cache variable.
>>
>> This is something i don't get right now. The testing goes:
>> 1) Test the compilation.
>> 2) If successful: Test the runtime. If cross-compiling: Ignore the
>> runtime check and go on.
>>
>> What is the advantage of providing an override to a test that is ignored
>> anyways when cross-compiling?
>
> Yeah, maybe you're right in that an override is overkill in this case.
> (Generally, runtime tests without cache guard trigger a raised eyebrow
> because they might get users stuck. I wonder whether we can let
> autoconf warn about them.)
Ah thanks. I played around with some of your suggestions the rest of the
day and will have an updated patch soon. Thank you again for having
a quick look. :-)
>
> Cheers,
> Ralf
Cheers,
Andreas
^ permalink raw reply [flat|nested] 67+ messages in thread
* [PATCH] Support official CLooG.org versions.
2010-09-11 12:28 ` Andreas Simbuerger
@ 2010-09-12 12:11 ` Andreas Simbürger
2010-09-12 12:39 ` Konrad Trifunovic
0 siblings, 1 reply; 67+ messages in thread
From: Andreas Simbürger @ 2010-09-12 12:11 UTC (permalink / raw)
To: gcc-patches; +Cc: gcc-graphite, Andreas Simbürger
Add support for official CLooG releases.
CLooG's configuration gets detected within 2 stages:
Stage 1: Detect the installed CLooG version.
This is done by linking test programs against the various
CLooG libraries. As CLooG's library sonames depend on the
used backend, this is sufficient to detect the used backend.
We only detect this backends, in order:
1) CLooG-PPL (Legacy): The "old" CLooG.
2) CLooG-ISL: The "new" CLooG.
3) CLooG-Parma: An alternative backend, to compare it with
CLooG-ISL.
CLooG-Poly is not detected, as the PolyLib may conflict
with GCC's license.
Stage 2: Version checks.
After detecting the right configuration, we finally check
if the installed version is usable. There are 2 different
checks: One for CLooG-PPL (Legacy) and one for CLooG-ISL.
* CLooG-ISL:
As the "new" CLooG provides methods to check for its version at
both compile and run time, we use this feature. First
we check for the constants to verify the header's compatibility.
Finally we verify the compatibility of our headers with
the library that will get linked with GCC.
As stated in autoconf's documentation, the run time check
is not usable when cross-compiling, so we skip this check
then.
* CLooG-PPL (Legacy):
This version check provides the same semantics as before.
As CLooG-PPL (Legacy) provides the same constants as the
official CLooG, we can use the same test program for the
compile time check.
Tested with CLooG-ISL and CLooG-PPL (Legacy).
As for now, CLooG-Parma fails to build.
2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* configure.ac: Support official CLooG.org versions.
* configure: Regenerate.
---
ChangeLog.graphite | 5 +
configure | 352 +++++++++++++++++++++++++++++++++++++++++-----------
configure.ac | 165 ++++++++++++++++++++----
3 files changed, 420 insertions(+), 102 deletions(-)
diff --git a/ChangeLog.graphite b/ChangeLog.graphite
index c5edc3a..58e30e3 100644
--- a/ChangeLog.graphite
+++ b/ChangeLog.graphite
@@ -1,3 +1,8 @@
+2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * configure.ac: Support official CLooG.org versions.
+ * configure: Regenerate.
+
2010-08-24 Sebastian Pop <sebastian.pop@amd.com>
* Merge from mainline (160224:163495).
diff --git a/configure b/configure
index fc759d7..f629449 100755
--- a/configure
+++ b/configure
@@ -1816,6 +1816,48 @@ fi
} # ac_fn_c_try_link
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_run
+
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -1940,48 +1982,6 @@ fi
} # ac_fn_c_check_header_mongrel
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
-
-} # ac_fn_c_try_run
-
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
@@ -5885,8 +5885,6 @@ fi
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
# Check whether --with-cloog was given.
@@ -5919,19 +5917,20 @@ case $with_cloog in
"" | yes)
;;
*)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
;;
esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
+if test "${with_cloog_include+set}" = set ; then
+ clooginc="-I$with_cloog_include"
fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
+if test "${with_cloog_lib+set}" = set; then
+ clooglibs="-L$with_cloog_lib"
fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
+if test "${with_cloog+set}" = set && test "${with_cloog_include+set}" = set \
+ && test "${with_cloog_lib+set}" = x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
enable_cloog_version_check=no
fi
@@ -5943,22 +5942,212 @@ else
fi
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
-$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+if test "x$with_cloog" != "xno"; then
+
+
+
+
+
+
+ saved_cflags=$CFLAGS
+ saved_libs=$LIBS
+ saved_ldflags=$LDFLAGS
+
+ # Only fail if the user explicitly selected CLooG.
+ cloog_allow_fail=no
+ if test "${with_cloog+set}" = set \
+ || test "${with_cloog_include+set}" = set \
+ || test "${with_cloog_lib+set}" = set ; then
+ cloog_allow_fail=yes
+ fi
+
+ # Stage 1: Detect the available CLooG+backend combination.
+ clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG type" >&5
+$as_echo_n "checking for installed CLooG type... " >&6; }
+if test "${gcc_cv_cloog_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ LIBS="-lcloog ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type="PPL Legacy"
+else
+ LIBS="-lcloog-isl -lisl ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=ISL
+else
+ LIBS="-lcloog-ppl ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=PPL
+else
+ gcc_cv_cloog_type=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
+$as_echo "$gcc_cv_cloog_type" >&6; }
+
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ ;;
+ esac
+
+ # Stage 2: Version check the found CLooG.
+ CFLAGS="${saved_cflags} ${gmpinc} ${pplinc} ${clooginc}"
+ LDFLAGS="${saved_ldflags} ${clooglibs}"
+
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG (compile time)" >&5
+$as_echo_n "checking for verison 0.14.0 of CLooG (compile time)... " >&6; }
+if test "${gcc_cv_cloog_ct_0_14_0+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "cloog/cloog.h"
int
main ()
{
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 14 \
+ || CLOOG_VERSION_REVISION < 0
+ choke me
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gcc_cv_cloog_ct_0_14_0=yes
+else
+ gcc_cv_cloog_ct_0_14_0=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_14_0" >&5
+$as_echo "$gcc_cv_cloog_ct_0_14_0" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.14.0 of CLooG (run time)" >&5
+$as_echo_n "checking for version 0.14.0 of CLooG (run time)... " >&6; }
+if test "${gcc_cv_cloog_rt_0_14_0+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ gcc_cv_cloog_rt_0_14_0=guessing yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #include "cloog/cloog.h"
+int
+main ()
+{
+if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ exit (1);
+ }
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gcc_cv_cloog_rt_0_14_0=yes
+else
+ gcc_cv_cloog_rt_0_14_0=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_rt_0_14_0" >&5
+$as_echo "$gcc_cv_cloog_rt_0_14_0" >&6; }
+ fi
+ # Version check for CLooG-PPL (Legacy).
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
+$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+if test "${gcc_cv_cloog_ct_0_15_5+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "cloog/cloog.h"
+int
+main ()
+{
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 5
+ choke me
+ #endif
;
return 0;
}
@@ -5970,32 +6159,47 @@ if ac_fn_c_try_compile "$LINENO"; then :
int
main ()
{
-
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
-
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 9
+ choke me
+ #endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ gcc_cv_cloog_ct_0_15_5=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
-$as_echo "buggy but acceptable" >&6; }
+ gcc_cv_cloog_ct_0_15_5=buggy but acceptable
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; clooglibs= ; clooginc=
+ gcc_cv_cloog_ct_0_15_5=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$saved_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_15_5" >&5
+$as_echo "$gcc_cv_cloog_ct_0_15_5" >&6; }
+ fi
+
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${cloog_allow_fail}" = yes \
+ && test "${clooglibs:-null}" = null && test "${clooginc:-null}" = null ; then
+ as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5
+ fi
+
+ CFLAGS=$saved_cflags
+ LIBS=$saved_libs
+ LDFLAGS=$saved_ldflags
fi
-# Flags needed for CLOOG
diff --git a/configure.ac b/configure.ac
index 3d969aa..721115a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1580,8 +1580,6 @@ AC_SUBST(pplinc)
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
Equivalent to --with-cloog-include=PATH/include
@@ -1593,7 +1591,7 @@ if test "x$with_ppl" = "xno"; then
with_cloog=no
fi
-case $with_cloog in
+case $with_cloog in
no)
clooglibs=
clooginc=
@@ -1601,19 +1599,20 @@ case $with_cloog in
"" | yes)
;;
*)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
;;
esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
+if test "${with_cloog_include+set}" = set ; then
+ clooginc="-I$with_cloog_include"
fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
+if test "${with_cloog_lib+set}" = set; then
+ clooglibs="-L$with_cloog_lib"
fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
+if test "${with_cloog+set}" = set && test "${with_cloog_include+set}" = set \
+ && test "${with_cloog_lib+set}" = x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
enable_cloog_version_check=no
fi
@@ -1622,24 +1621,134 @@ AC_ARG_ENABLE(cloog-version-check,
ENABLE_CLOOG_CHECK=$enableval,
ENABLE_CLOOG_CHECK=yes)
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
- AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
- ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
- [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
- CFLAGS="$saved_CFLAGS"
+if test "x$with_cloog" != "xno"; then
+ dnl CLooG configure test programs.
+ m4_define([CLOOG_BACKEND_PROG],[AC_LANG_PROGRAM(
+ [#include <cloog/cloog.h>],
+ [cloog_version ()])])
+
+ m4_define([CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
+ [#include "cloog/cloog.h"],
+ [#if CLOOG_VERSION_MAJOR != $1 \
+ || CLOOG_VERSION_MINOR != $2 \
+ || CLOOG_VERSION_REVISION < $3
+ choke me
+ #endif])])
+
+ m4_define([CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM(
+ [#include <stdlib.h>
+ #include "cloog/cloog.h"],
+ [if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ exit (1);
+ }])])
+
+ saved_cflags=$CFLAGS
+ saved_libs=$LIBS
+ saved_ldflags=$LDFLAGS
+
+ # Only fail if the user explicitly selected CLooG.
+ cloog_allow_fail=no
+ if test "${with_cloog+set}" = set \
+ || test "${with_cloog_include+set}" = set \
+ || test "${with_cloog_lib+set}" = set ; then
+ cloog_allow_fail=yes
+ fi
+
+ # Stage 1: Detect the available CLooG+backend combination.
+ clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ AC_CACHE_CHECK([for installed CLooG type],
+ [gcc_cv_cloog_type],
+ [LIBS="-lcloog ${saved_libs}"
+ AC_LINK_IFELSE([CLOOG_BACKEND_PROG],
+ [gcc_cv_cloog_type="PPL Legacy"],
+ [LIBS="-lcloog-isl -lisl ${saved_libs}"
+ AC_LINK_IFELSE([CLOOG_BACKEND_PROG],
+ [gcc_cv_cloog_type=ISL],
+ [LIBS="-lcloog-ppl ${saved_libs}"
+ AC_LINK_IFELSE([CLOOG_BACKEND_PROG],
+ [gcc_cv_cloog_type=PPL],
+ [gcc_cv_cloog_type=no])])])])
+
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ ;;
+ esac
+
+ # Stage 2: Version check the found CLooG.
+ CFLAGS="${saved_cflags} ${gmpinc} ${pplinc} ${clooginc}"
+ LDFLAGS="${saved_ldflags} ${clooglibs}"
+
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = yes ; then
+ AC_CACHE_CHECK([for verison 0.14.0 of CLooG (compile time)],
+ [gcc_cv_cloog_ct_0_14_0],
+ [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,14,0)],
+ [gcc_cv_cloog_ct_0_14_0=yes],
+ [gcc_cv_cloog_ct_0_14_0=no])])
+
+ AC_CACHE_CHECK([for version 0.14.0 of CLooG (run time)],
+ [gcc_cv_cloog_rt_0_14_0],
+ [AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
+ [gcc_cv_cloog_rt_0_14_0=yes],
+ [gcc_cv_cloog_rt_0_14_0=no],
+ [gcc_cv_cloog_rt_0_14_0=guessing yes])])
+ fi
+
+ # Version check for CLooG-PPL (Legacy).
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = no ; then
+ AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG],
+ [gcc_cv_cloog_ct_0_15_5],
+ [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],
+ [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],
+ [gcc_cv_cloog_ct_0_15_5=yes],
+ [gcc_cv_cloog_ct_0_15_5=buggy but acceptable])],
+ [gcc_cv_cloog_ct_0_15_5=no])])
+ fi
+
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${cloog_allow_fail}" = yes \
+ && test "${clooglibs:-null}" = null && test "${clooginc:-null}" = null ; then
+ AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])
+ fi
+
+ CFLAGS=$saved_cflags
+ LIBS=$saved_libs
+ LDFLAGS=$saved_ldflags
fi
-# Flags needed for CLOOG
+dnl Flags needed for CLOOG
AC_SUBST(clooglibs)
AC_SUBST(clooginc)
--
1.7.2.2
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-12 12:11 ` Andreas Simbürger
@ 2010-09-12 12:39 ` Konrad Trifunovic
2010-09-12 12:54 ` Andreas Simbuerger
2010-09-12 13:23 ` Konrad Trifunovic
0 siblings, 2 replies; 67+ messages in thread
From: Konrad Trifunovic @ 2010-09-12 12:39 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-patches, gcc-graphite
Hi,
just a short comment/question:
> + # Only fail if the user explicitly selected CLooG.
> + cloog_allow_fail=no
> + if test "${with_cloog+set}" = set \
> + || test "${with_cloog_include+set}" = set \
> + || test "${with_cloog_lib+set}" = set ; then
> + cloog_allow_fail=yes
> + fi
It seems that 'cloog_allow_fail' would be set to YES, if
we enable one of the flags. But if we enable all the
flags (with_cloog, with_cloog_include, with_cloog_lib)
then it would remain NO. Is this intended?
Konrad
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-12 12:39 ` Konrad Trifunovic
@ 2010-09-12 12:54 ` Andreas Simbuerger
2010-09-12 16:58 ` Konrad Trifunovic
2010-09-12 13:23 ` Konrad Trifunovic
1 sibling, 1 reply; 67+ messages in thread
From: Andreas Simbuerger @ 2010-09-12 12:54 UTC (permalink / raw)
To: Konrad Trifunovic; +Cc: gcc-patches, gcc-graphite
On 09/12/2010 01:23 PM, Konrad Trifunovic wrote:
> Hi,
>
> just a short comment/question:
>
>> + # Only fail if the user explicitly selected CLooG.
>> + cloog_allow_fail=no
>> + if test "${with_cloog+set}" = set \
>> + || test "${with_cloog_include+set}" = set \
>> + || test "${with_cloog_lib+set}" = set ; then
>> + cloog_allow_fail=yes
>> + fi
>
> It seems that 'cloog_allow_fail' would be set to YES, if
> we enable one of the flags. But if we enable all the
> flags (with_cloog, with_cloog_include, with_cloog_lib)
> then it would remain NO. Is this intended?
>
Hi Konrad,
AFAIK the ||-Operator is not exclusive, so matching all three works
fine.
../configure --prefix=$HOME/install/gcc
--with-ppl=$HOME/install/ppl-0.11 --enable-languages=c,c++,fortran
--with-cloog=$HOME/install/cloog-isl/
--with-cloog-lib=$HOME/install/cloog-isl/lib
--with-cloog-include=$HOME/install/cloog-isl/include/
...
checking for version 0.10 (or later revision) of PPL... yes
checking for installed CLooG type... ISL
checking for verison 0.14.0 of CLooG (compile time)... yes
checking for version 0.14.0 of CLooG (run time)... yes
...
> Konrad
Cheers,
Andreas
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-12 12:39 ` Konrad Trifunovic
2010-09-12 12:54 ` Andreas Simbuerger
@ 2010-09-12 13:23 ` Konrad Trifunovic
2010-09-13 11:07 ` Andreas Simbuerger
1 sibling, 1 reply; 67+ messages in thread
From: Konrad Trifunovic @ 2010-09-12 13:23 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-patches, gcc-graphite
Hi again,
it seems that I have a problem with the following scenario:
I have a cloog-ppl installed in /usr/local/lib (a legacy one).
Now, I have also a new cloog-isl installed in one of my home
directories (/home/konrad/cloog-isl).
I configure it with: ./configure --with-cloog=/home/konrad/cloog-isl/lib
Now, it seems I'm not able to override the order in which
a configuration script is looking for cloog libraries.
It first tries a legacy one (linking with -lcloog).
It finds that there is indeed a legacy cloog in /usr/local/lib
and it is not even trying "-lcloog-isl" with the value
--with-cloog=/home/konrad/cloog-isl/lib.
I think we need some prioritizing mechanism. Let's say, that if you could find
both legacy and isl-cloog then the priority should be given to the isl-cloog.
But, this is not a good solution either. It seems that if we can find multiple
valid cloog installations, an user should be able to manually override the
desired cloog version.
I'm not a configuration scripts expert.
I'm not sure whether this solution would be accepted by GCC community,
but I propose the following:
have a flag called "--with-cloog" that can take several values, for
example "auto", "isl", "ppl", "no" etc.
Then, have other flag called "--with-cloog-prefix" that gives a path
to the place where we should be looking for a cloog.
Konrad
2010/9/12 Konrad Trifunovic <konrad.trifunovic@gmail.com>:
> Hi,
>
> just a short comment/question:
>
>> + # Only fail if the user explicitly selected CLooG.
>> + cloog_allow_fail=no
>> + if test "${with_cloog+set}" = set \
>> + || test "${with_cloog_include+set}" = set \
>> + || test "${with_cloog_lib+set}" = set ; then
>> + cloog_allow_fail=yes
>> + fi
>
> It seems that 'cloog_allow_fail' would be set to YES, if
> we enable one of the flags. But if we enable all the
> flags (with_cloog, with_cloog_include, with_cloog_lib)
> then it would remain NO. Is this intended?
>
> Konrad
>
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-12 12:54 ` Andreas Simbuerger
@ 2010-09-12 16:58 ` Konrad Trifunovic
2010-09-13 7:38 ` Konrad Trifunovic
0 siblings, 1 reply; 67+ messages in thread
From: Konrad Trifunovic @ 2010-09-12 16:58 UTC (permalink / raw)
To: Andreas Simbuerger; +Cc: gcc-patches, gcc-graphite
Hi,
you use this variable in the following code:
+ if test "${cloog_allow_fail}" = yes \
+ && test "${clooglibs:-null}" = null && test "${clooginc:-null}" =
null ; then
+ AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])
+ fi
I understand it as: "if you allow to fail and you cannot find a CLooG
then you would
fail the configuration script". I would rather rename this variable to
"cloog_disallow_fail". So the meaning would be:
"If you are not allowed to fail and you fail to find a CLooG, then I would
terminate the configuration script with an error".
You might think I'm picky, but it would be easier to follow the code for
non-experts ;)
Konrad
2010/9/12 Andreas Simbuerger <simbuerg@googlemail.com>:
> On 09/12/2010 01:23 PM, Konrad Trifunovic wrote:
>> Hi,
>>
>> just a short comment/question:
>>
>>> + # Only fail if the user explicitly selected CLooG.
>>> + cloog_allow_fail=no
>>> + if test "${with_cloog+set}" = set \
>>> + || test "${with_cloog_include+set}" = set \
>>> + || test "${with_cloog_lib+set}" = set ; then
>>> + cloog_allow_fail=yes
>>> + fi
>>
>> It seems that 'cloog_allow_fail' would be set to YES, if
>> we enable one of the flags. But if we enable all the
>> flags (with_cloog, with_cloog_include, with_cloog_lib)
>> then it would remain NO. Is this intended?
>>
>
> Hi Konrad,
>
> AFAIK the ||-Operator is not exclusive, so matching all three works
> fine.
>
> ../configure --prefix=$HOME/install/gcc
> --with-ppl=$HOME/install/ppl-0.11 --enable-languages=c,c++,fortran
> --with-cloog=$HOME/install/cloog-isl/
> --with-cloog-lib=$HOME/install/cloog-isl/lib
> --with-cloog-include=$HOME/install/cloog-isl/include/
>
> ...
> checking for version 0.10 (or later revision) of PPL... yes
> checking for installed CLooG type... ISL
> checking for verison 0.14.0 of CLooG (compile time)... yes
> checking for version 0.14.0 of CLooG (run time)... yes
> ...
>
>> Konrad
>
> Cheers,
> Andreas
>
>
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-12 16:58 ` Konrad Trifunovic
@ 2010-09-13 7:38 ` Konrad Trifunovic
2010-09-13 10:53 ` Andreas Simbuerger
0 siblings, 1 reply; 67+ messages in thread
From: Konrad Trifunovic @ 2010-09-13 7:38 UTC (permalink / raw)
To: Andreas Simbuerger; +Cc: gcc-patches, gcc-graphite
Hi,
again, the similar scenario I have described before:
I have both PPL and old CLooG installed in:
/usr/local/lib
and the headers are in
/usr/local/include
I have a new cloog-isl in /home/konrad/cloog.isl.
Now, I have given the parameters:
--with-ppl=/usr/local #since I want to have a PPL that is
installed in one of my standard directories
--with-cloog-include=/home/konrad/cloog.isl/include
Now, since there is an old cloog in /usr/local/include,
and given the following order:
+ # Stage 2: Version check the found CLooG.
+ CFLAGS="${saved_cflags} ${gmpinc} ${pplinc} ${clooginc}"
it would produce a compilation flags as follows:
-I/usr/local/include -I/home/konrad/cloog.isl/include
Thus, it would use a cloog that is in -I/usr/local/include, which
is the old one, and not the one that I want. (The first path
comes from --with-ppl and the second from --with-cloog-include).
Now, this could be simply solved by reordering includes:
+ # Stage 2: Version check the found CLooG.
+ CFLAGS="${saved_cflags} ${gmpinc} ${clooginc}" ${pplinc}
Now, the --with-cloog-include is given a priority in searching
for include files.
I propose this to be changed.
regards,
konrad
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-13 7:38 ` Konrad Trifunovic
@ 2010-09-13 10:53 ` Andreas Simbuerger
2010-09-13 10:57 ` Andreas Simbürger
0 siblings, 1 reply; 67+ messages in thread
From: Andreas Simbuerger @ 2010-09-13 10:53 UTC (permalink / raw)
To: Konrad Trifunovic; +Cc: gcc-patches, gcc-graphite
On 09/13/2010 01:05 AM, Konrad Trifunovic wrote:
> Hi,
> again, the similar scenario I have described before:
> I have both PPL and old CLooG installed in:
> /usr/local/lib
> and the headers are in
> /usr/local/include
>
> I have a new cloog-isl in /home/konrad/cloog.isl.
>
> Now, I have given the parameters:
> --with-ppl=/usr/local #since I want to have a PPL that is
> installed in one of my standard directories
> --with-cloog-include=/home/konrad/cloog.isl/include
>
> Now, since there is an old cloog in /usr/local/include,
> and given the following order:
>
>
> + # Stage 2: Version check the found CLooG.
> + CFLAGS="${saved_cflags} ${gmpinc} ${pplinc} ${clooginc}"
>
>
> it would produce a compilation flags as follows:
> -I/usr/local/include -I/home/konrad/cloog.isl/include
>
> Thus, it would use a cloog that is in -I/usr/local/include, which
> is the old one, and not the one that I want. (The first path
> comes from --with-ppl and the second from --with-cloog-include).
>
> Now, this could be simply solved by reordering includes:
>
> + # Stage 2: Version check the found CLooG.
> + CFLAGS="${saved_cflags} ${gmpinc} ${clooginc}" ${pplinc}
>
> Now, the --with-cloog-include is given a priority in searching
> for include files.
>
> I propose this to be changed.
>
> regards,
> konrad
I totally agree, i will send a new version. :-)
Andreas
^ permalink raw reply [flat|nested] 67+ messages in thread
* [PATCH] Support official CLooG.org versions.
2010-09-13 10:53 ` Andreas Simbuerger
@ 2010-09-13 10:57 ` Andreas Simbürger
2010-09-22 21:48 ` Sebastian Pop
0 siblings, 1 reply; 67+ messages in thread
From: Andreas Simbürger @ 2010-09-13 10:57 UTC (permalink / raw)
To: gcc-patches; +Cc: gcc-graphite, Andreas Simbürger
Add support for official CLooG releases.
CLooG's configuration gets detected within 2 stages:
Stage 1: Detect the installed CLooG version.
This is done by linking test programs against the various
CLooG libraries. As CLooG's library sonames depend on the
used backend, this is sufficient to detect the used backend.
We only detect this backends, in order:
1) CLooG-PPL (Legacy): The "old" CLooG.
2) CLooG-ISL: The "new" CLooG.
3) CLooG-Parma: An alternative backend, to compare it with
CLooG-ISL.
CLooG-Poly is not detected, as the PolyLib may conflict
with GCC's license.
Stage 2: Version checks.
After detecting the right configuration, we finally check
if the installed version is usable. There are 2 different
checks: One for CLooG-PPL (Legacy) and one for CLooG-ISL.
* CLooG-ISL:
As the "new" CLooG provides methods to check for its version at
both compile and run time, we use this feature. First
we check for the constants to verify the header's compatibility.
Finally we verify the compatibility of our headers with
the library that will get linked with GCC.
As stated in autoconf's documentation, the run time check
is not usable when cross-compiling, so we skip this check
then.
* CLooG-PPL (Legacy):
This version check provides the same semantics as before.
As CLooG-PPL (Legacy) provides the same constants as the
official CLooG, we can use the same test program for the
compile time check.
Tested with CLooG-ISL and CLooG-PPL (Legacy).
As for now, CLooG-Parma fails to build.
2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* configure.ac: Support official CLooG.org versions.
* configure: Regenerate.
---
ChangeLog.graphite | 5 +
configure | 355 +++++++++++++++++++++++++++++++++++++++++-----------
configure.ac | 170 +++++++++++++++++++++----
3 files changed, 428 insertions(+), 102 deletions(-)
diff --git a/ChangeLog.graphite b/ChangeLog.graphite
index c5edc3a..58e30e3 100644
--- a/ChangeLog.graphite
+++ b/ChangeLog.graphite
@@ -1,3 +1,8 @@
+2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * configure.ac: Support official CLooG.org versions.
+ * configure: Regenerate.
+
2010-08-24 Sebastian Pop <sebastian.pop@amd.com>
* Merge from mainline (160224:163495).
diff --git a/configure b/configure
index fc759d7..e9f9c8c 100755
--- a/configure
+++ b/configure
@@ -1816,6 +1816,48 @@ fi
} # ac_fn_c_try_link
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_run
+
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -1940,48 +1982,6 @@ fi
} # ac_fn_c_check_header_mongrel
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
-
-} # ac_fn_c_try_run
-
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
@@ -5885,8 +5885,6 @@ fi
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
# Check whether --with-cloog was given.
@@ -5919,19 +5917,20 @@ case $with_cloog in
"" | yes)
;;
*)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
;;
esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
+if test "${with_cloog_include+set}" = set ; then
+ clooginc="-I$with_cloog_include"
fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
+if test "${with_cloog_lib+set}" = set; then
+ clooglibs="-L$with_cloog_lib"
fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
+if test "${with_cloog+set}" = set && test "${with_cloog_include+set}" = set \
+ && test "${with_cloog_lib+set}" = x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
enable_cloog_version_check=no
fi
@@ -5943,22 +5942,214 @@ else
fi
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
-$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+if test "x$with_cloog" != "xno"; then
+
+
+
+
+
+
+
+
+ saved_cflags=$CFLAGS
+ saved_libs=$LIBS
+ saved_ldflags=$LDFLAGS
+
+ # Only fail if the user explicitly selected CLooG.
+ graphite_requested=no
+ if test "${with_cloog+set}" = set \
+ || test "${with_cloog_include+set}" = set \
+ || test "${with_cloog_lib+set}" = set ; then
+ graphite_requested=yes
+ fi
+
+ # Stage 1: Detect the available CLooG+backend combination.
+ clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ CFLAGS="${CFLAGS} ${clooginc} ${cloogorginc} ${gmpinc} ${pplinc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG type" >&5
+$as_echo_n "checking for installed CLooG type... " >&6; }
+if test "${gcc_cv_cloog_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ LIBS="-lcloog ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+ppl_version_major ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type="PPL Legacy"
+else
+ LIBS="-lcloog-isl -lisl ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=ISL
+else
+ LIBS="-lcloog-ppl ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=PPL
+else
+ gcc_cv_cloog_type=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
+$as_echo "$gcc_cv_cloog_type" >&6; }
+
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ ;;
+ esac
+
+ # Stage 2: Version check the found CLooG.
+ CFLAGS="${saved_cflags} ${clooginc} ${gmpinc} ${pplinc}"
+ LDFLAGS="${saved_ldflags} ${clooglibs}"
+
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG (compile time)" >&5
+$as_echo_n "checking for verison 0.14.0 of CLooG (compile time)... " >&6; }
+if test "${gcc_cv_cloog_ct_0_14_0+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "cloog/cloog.h"
int
main ()
{
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 14 \
+ || CLOOG_VERSION_REVISION < 0
+ choke me
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gcc_cv_cloog_ct_0_14_0=yes
+else
+ gcc_cv_cloog_ct_0_14_0=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_14_0" >&5
+$as_echo "$gcc_cv_cloog_ct_0_14_0" >&6; }
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.14.0 of CLooG (run time)" >&5
+$as_echo_n "checking for version 0.14.0 of CLooG (run time)... " >&6; }
+if test "${gcc_cv_cloog_rt_0_14_0+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ gcc_cv_cloog_rt_0_14_0=guessing yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #include "cloog/cloog.h"
+int
+main ()
+{
+if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ exit (1);
+ }
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gcc_cv_cloog_rt_0_14_0=yes
+else
+ gcc_cv_cloog_rt_0_14_0=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_rt_0_14_0" >&5
+$as_echo "$gcc_cv_cloog_rt_0_14_0" >&6; }
+ fi
+ # Version check for CLooG-PPL (Legacy).
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
+$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+if test "${gcc_cv_cloog_ct_0_15_5+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "cloog/cloog.h"
+int
+main ()
+{
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 5
+ choke me
+ #endif
;
return 0;
}
@@ -5970,32 +6161,48 @@ if ac_fn_c_try_compile "$LINENO"; then :
int
main ()
{
-
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
-
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 9
+ choke me
+ #endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ gcc_cv_cloog_ct_0_15_5=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
-$as_echo "buggy but acceptable" >&6; }
+ gcc_cv_cloog_ct_0_15_5=buggy but acceptable
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; clooglibs= ; clooginc=
+ gcc_cv_cloog_ct_0_15_5=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$saved_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_15_5" >&5
+$as_echo "$gcc_cv_cloog_ct_0_15_5" >&6; }
+ fi
+
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${graphite_requested}" = yes \
+ && test "${clooglibs:-null}" = null \
+ && test "${clooginc:-null}" = null ; then
+ as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5
+ fi
+
+ CFLAGS=$saved_cflags
+ LIBS=$saved_libs
+ LDFLAGS=$saved_ldflags
fi
-# Flags needed for CLOOG
diff --git a/configure.ac b/configure.ac
index 3d969aa..7ae72a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1580,8 +1580,6 @@ AC_SUBST(pplinc)
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
Equivalent to --with-cloog-include=PATH/include
@@ -1593,7 +1591,7 @@ if test "x$with_ppl" = "xno"; then
with_cloog=no
fi
-case $with_cloog in
+case $with_cloog in
no)
clooglibs=
clooginc=
@@ -1601,19 +1599,20 @@ case $with_cloog in
"" | yes)
;;
*)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
;;
esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
+if test "${with_cloog_include+set}" = set ; then
+ clooginc="-I$with_cloog_include"
fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
+if test "${with_cloog_lib+set}" = set; then
+ clooglibs="-L$with_cloog_lib"
fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
+if test "${with_cloog+set}" = set && test "${with_cloog_include+set}" = set \
+ && test "${with_cloog_lib+set}" = x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
enable_cloog_version_check=no
fi
@@ -1622,24 +1621,139 @@ AC_ARG_ENABLE(cloog-version-check,
ENABLE_CLOOG_CHECK=$enableval,
ENABLE_CLOOG_CHECK=yes)
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
- AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
- ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
- [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
- CFLAGS="$saved_CFLAGS"
+if test "x$with_cloog" != "xno"; then
+ dnl CLooG configure test programs.
+ m4_define([CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
+ [#include <cloog/cloog.h>],
+ [cloog_version ()])])
+
+ m4_define([CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
+ [#include <cloog/cloog.h>],
+ [ppl_version_major ()])])
+
+ m4_define([CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
+ [#include "cloog/cloog.h"],
+ [#if CLOOG_VERSION_MAJOR != $1 \
+ || CLOOG_VERSION_MINOR != $2 \
+ || CLOOG_VERSION_REVISION < $3
+ choke me
+ #endif])])
+
+ m4_define([CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM(
+ [#include <stdlib.h>
+ #include "cloog/cloog.h"],
+ [if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ exit (1);
+ }])])
+
+ saved_cflags=$CFLAGS
+ saved_libs=$LIBS
+ saved_ldflags=$LDFLAGS
+
+ # Only fail if the user explicitly selected CLooG.
+ graphite_requested=no
+ if test "${with_cloog+set}" = set \
+ || test "${with_cloog_include+set}" = set \
+ || test "${with_cloog_lib+set}" = set ; then
+ graphite_requested=yes
+ fi
+
+ # Stage 1: Detect the available CLooG+backend combination.
+ clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ CFLAGS="${CFLAGS} ${clooginc} ${cloogorginc} ${gmpinc} ${pplinc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ AC_CACHE_CHECK([for installed CLooG type],
+ [gcc_cv_cloog_type],
+ [LIBS="-lcloog ${saved_libs}"
+ AC_LINK_IFELSE([CLOOG_PPL_LEGACY_PROG],
+ [gcc_cv_cloog_type="PPL Legacy"],
+ [LIBS="-lcloog-isl -lisl ${saved_libs}"
+ AC_LINK_IFELSE([CLOOG_ORG_PROG],
+ [gcc_cv_cloog_type=ISL],
+ [LIBS="-lcloog-ppl ${saved_libs}"
+ AC_LINK_IFELSE([CLOOG_ORG_PROG],
+ [gcc_cv_cloog_type=PPL],
+ [gcc_cv_cloog_type=no])])])])
+
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ ;;
+ esac
+
+ # Stage 2: Version check the found CLooG.
+ CFLAGS="${saved_cflags} ${clooginc} ${gmpinc} ${pplinc}"
+ LDFLAGS="${saved_ldflags} ${clooglibs}"
+
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = yes ; then
+ AC_CACHE_CHECK([for verison 0.14.0 of CLooG (compile time)],
+ [gcc_cv_cloog_ct_0_14_0],
+ [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,14,0)],
+ [gcc_cv_cloog_ct_0_14_0=yes],
+ [gcc_cv_cloog_ct_0_14_0=no])])
+
+ AC_CACHE_CHECK([for version 0.14.0 of CLooG (run time)],
+ [gcc_cv_cloog_rt_0_14_0],
+ [AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
+ [gcc_cv_cloog_rt_0_14_0=yes],
+ [gcc_cv_cloog_rt_0_14_0=no],
+ [gcc_cv_cloog_rt_0_14_0=guessing yes])])
+ fi
+
+ # Version check for CLooG-PPL (Legacy).
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = no ; then
+ AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG],
+ [gcc_cv_cloog_ct_0_15_5],
+ [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],
+ [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],
+ [gcc_cv_cloog_ct_0_15_5=yes],
+ [gcc_cv_cloog_ct_0_15_5=buggy but acceptable])],
+ [gcc_cv_cloog_ct_0_15_5=no])])
+ fi
+
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${graphite_requested}" = yes \
+ && test "${clooglibs:-null}" = null \
+ && test "${clooginc:-null}" = null ; then
+ AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])
+ fi
+
+ CFLAGS=$saved_cflags
+ LIBS=$saved_libs
+ LDFLAGS=$saved_ldflags
fi
-# Flags needed for CLOOG
+dnl Flags needed for CLOOG
AC_SUBST(clooglibs)
AC_SUBST(clooginc)
--
1.7.2.2
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-12 13:23 ` Konrad Trifunovic
@ 2010-09-13 11:07 ` Andreas Simbuerger
0 siblings, 0 replies; 67+ messages in thread
From: Andreas Simbuerger @ 2010-09-13 11:07 UTC (permalink / raw)
To: Konrad Trifunovic; +Cc: gcc-patches, gcc-graphite
On 09/12/2010 02:36 PM, Konrad Trifunovic wrote:
> Hi again,
>
> it seems that I have a problem with the following scenario:
>
> I have a cloog-ppl installed in /usr/local/lib (a legacy one).
> Now, I have also a new cloog-isl installed in one of my home
> directories (/home/konrad/cloog-isl).
>
> I configure it with: ./configure --with-cloog=/home/konrad/cloog-isl/lib
>
> Now, it seems I'm not able to override the order in which
> a configuration script is looking for cloog libraries.
>
> It first tries a legacy one (linking with -lcloog).
> It finds that there is indeed a legacy cloog in /usr/local/lib
> and it is not even trying "-lcloog-isl" with the value
> --with-cloog=/home/konrad/cloog-isl/lib.
>
> I think we need some prioritizing mechanism. Let's say, that if you could find
> both legacy and isl-cloog then the priority should be given to the isl-cloog.
> But, this is not a good solution either. It seems that if we can find multiple
> valid cloog installations, an user should be able to manually override the
> desired cloog version.
>
I could add such an option if you need it, but this patch is just
intended for Graphite testing. After successfully testing CLooG-ISL
the CLooG-PPL (legacy) support and CLooG-PPL support will be removed.
With the recent include path changes you proposed it should be possible
to control the used backend with the --with-cloog* options.
> I'm not a configuration scripts expert.
> I'm not sure whether this solution would be accepted by GCC community,
> but I propose the following:
>
> have a flag called "--with-cloog" that can take several values, for
> example "auto", "isl", "ppl", "no" etc.
>
> Then, have other flag called "--with-cloog-prefix" that gives a path
> to the place where we should be looking for a cloog.
>
> Konrad
>
>
Thanks for pointing this out :-)
Cheers,
Andreas
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-13 10:57 ` Andreas Simbürger
@ 2010-09-22 21:48 ` Sebastian Pop
2010-09-29 18:28 ` Paolo Bonzini
0 siblings, 1 reply; 67+ messages in thread
From: Sebastian Pop @ 2010-09-22 21:48 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-patches, gcc-graphite, Paolo Bonzini
Ping configure patch.
Paolo, could you have a look at this patch please?
Thanks,
Sebastian
On Mon, Sep 13, 2010 at 05:31, Andreas Simbürger
<simbuerg@googlemail.com> wrote:
> Add support for official CLooG releases.
> CLooG's configuration gets detected within 2 stages:
>
> Stage 1: Detect the installed CLooG version.
> This is done by linking test programs against the various
> CLooG libraries. As CLooG's library sonames depend on the
> used backend, this is sufficient to detect the used backend.
>
> We only detect this backends, in order:
> 1) CLooG-PPL (Legacy): The "old" CLooG.
> 2) CLooG-ISL: The "new" CLooG.
> 3) CLooG-Parma: An alternative backend, to compare it with
> CLooG-ISL.
>
> CLooG-Poly is not detected, as the PolyLib may conflict
> with GCC's license.
>
> Stage 2: Version checks.
> After detecting the right configuration, we finally check
> if the installed version is usable. There are 2 different
> checks: One for CLooG-PPL (Legacy) and one for CLooG-ISL.
>
> * CLooG-ISL:
> As the "new" CLooG provides methods to check for its version at
> both compile and run time, we use this feature. First
> we check for the constants to verify the header's compatibility.
> Finally we verify the compatibility of our headers with
> the library that will get linked with GCC.
> As stated in autoconf's documentation, the run time check
> is not usable when cross-compiling, so we skip this check
> then.
>
> * CLooG-PPL (Legacy):
> This version check provides the same semantics as before.
> As CLooG-PPL (Legacy) provides the same constants as the
> official CLooG, we can use the same test program for the
> compile time check.
>
> Tested with CLooG-ISL and CLooG-PPL (Legacy).
> As for now, CLooG-Parma fails to build.
>
> 2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
>
> * configure.ac: Support official CLooG.org versions.
> * configure: Regenerate.
> ---
> ChangeLog.graphite | 5 +
> configure | 355 +++++++++++++++++++++++++++++++++++++++++-----------
> configure.ac | 170 +++++++++++++++++++++----
> 3 files changed, 428 insertions(+), 102 deletions(-)
>
> diff --git a/ChangeLog.graphite b/ChangeLog.graphite
> index c5edc3a..58e30e3 100644
> --- a/ChangeLog.graphite
> +++ b/ChangeLog.graphite
> @@ -1,3 +1,8 @@
> +2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
> +
> + * configure.ac: Support official CLooG.org versions.
> + * configure: Regenerate.
> +
> 2010-08-24 Sebastian Pop <sebastian.pop@amd.com>
>
> * Merge from mainline (160224:163495).
> diff --git a/configure b/configure
> index fc759d7..e9f9c8c 100755
> --- a/configure
> +++ b/configure
> @@ -1816,6 +1816,48 @@ fi
>
> } # ac_fn_c_try_link
>
> +# ac_fn_c_try_run LINENO
> +# ----------------------
> +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
> +# that executables *can* be run.
> +ac_fn_c_try_run ()
> +{
> + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
> + if { { ac_try="$ac_link"
> +case "(($ac_try" in
> + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> + *) ac_try_echo=$ac_try;;
> +esac
> +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> +$as_echo "$ac_try_echo"; } >&5
> + (eval "$ac_link") 2>&5
> + ac_status=$?
> + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
> + { { case "(($ac_try" in
> + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> + *) ac_try_echo=$ac_try;;
> +esac
> +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> +$as_echo "$ac_try_echo"; } >&5
> + (eval "$ac_try") 2>&5
> + ac_status=$?
> + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> + test $ac_status = 0; }; }; then :
> + ac_retval=0
> +else
> + $as_echo "$as_me: program exited with status $ac_status" >&5
> + $as_echo "$as_me: failed program was:" >&5
> +sed 's/^/| /' conftest.$ac_ext >&5
> +
> + ac_retval=$ac_status
> +fi
> + rm -rf conftest.dSYM conftest_ipa8_conftest.oo
> + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
> + return $ac_retval
> +
> +} # ac_fn_c_try_run
> +
> # ac_fn_c_try_cpp LINENO
> # ----------------------
> # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
> @@ -1940,48 +1982,6 @@ fi
>
> } # ac_fn_c_check_header_mongrel
>
> -# ac_fn_c_try_run LINENO
> -# ----------------------
> -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
> -# that executables *can* be run.
> -ac_fn_c_try_run ()
> -{
> - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
> - if { { ac_try="$ac_link"
> -case "(($ac_try" in
> - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> - *) ac_try_echo=$ac_try;;
> -esac
> -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> -$as_echo "$ac_try_echo"; } >&5
> - (eval "$ac_link") 2>&5
> - ac_status=$?
> - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
> - { { case "(($ac_try" in
> - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> - *) ac_try_echo=$ac_try;;
> -esac
> -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> -$as_echo "$ac_try_echo"; } >&5
> - (eval "$ac_try") 2>&5
> - ac_status=$?
> - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> - test $ac_status = 0; }; }; then :
> - ac_retval=0
> -else
> - $as_echo "$as_me: program exited with status $ac_status" >&5
> - $as_echo "$as_me: failed program was:" >&5
> -sed 's/^/| /' conftest.$ac_ext >&5
> -
> - ac_retval=$ac_status
> -fi
> - rm -rf conftest.dSYM conftest_ipa8_conftest.oo
> - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
> - return $ac_retval
> -
> -} # ac_fn_c_try_run
> -
> # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
> # -------------------------------------------------------
> # Tests whether HEADER exists and can be compiled using the include files in
> @@ -5885,8 +5885,6 @@ fi
>
>
> # Check for CLOOG
> -clooglibs=" -lcloog "
> -clooginc=" -DCLOOG_PPL_BACKEND "
>
>
> # Check whether --with-cloog was given.
> @@ -5919,19 +5917,20 @@ case $with_cloog in
> "" | yes)
> ;;
> *)
> - clooglibs="-L$with_cloog/lib -lcloog"
> - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
> + clooglibs="-L$with_cloog/lib"
> + clooginc="-I$with_cloog/include"
> ;;
> esac
> -if test "x$with_cloog_include" != x; then
> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
> +if test "${with_cloog_include+set}" = set ; then
> + clooginc="-I$with_cloog_include"
> fi
> -if test "x$with_cloog_lib" != x; then
> - clooglibs="-L$with_cloog_lib -lcloog"
> +if test "${with_cloog_lib+set}" = set; then
> + clooglibs="-L$with_cloog_lib"
> fi
> -if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
> - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
> - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
> +if test "${with_cloog+set}" = set && test "${with_cloog_include+set}" = set \
> + && test "${with_cloog_lib+set}" = x && test -d ${srcdir}/cloog; then
> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
> enable_cloog_version_check=no
> fi
>
> @@ -5943,22 +5942,214 @@ else
> fi
>
>
> -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
> - saved_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
> -$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
> +if test "x$with_cloog" != "xno"; then
> +
> +
> +
> +
> +
> +
> +
> +
> + saved_cflags=$CFLAGS
> + saved_libs=$LIBS
> + saved_ldflags=$LDFLAGS
> +
> + # Only fail if the user explicitly selected CLooG.
> + graphite_requested=no
> + if test "${with_cloog+set}" = set \
> + || test "${with_cloog_include+set}" = set \
> + || test "${with_cloog_lib+set}" = set ; then
> + graphite_requested=yes
> + fi
> +
> + # Stage 1: Detect the available CLooG+backend combination.
> + clooglegacyinc="-DCLOOG_PPL_BACKEND"
> + cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> +
> + CFLAGS="${CFLAGS} ${clooginc} ${cloogorginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG type" >&5
> +$as_echo_n "checking for installed CLooG type... " >&6; }
> +if test "${gcc_cv_cloog_type+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> +else
> + LIBS="-lcloog ${saved_libs}"
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include <cloog/cloog.h>
> +int
> +main ()
> +{
> +ppl_version_major ()
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> + gcc_cv_cloog_type="PPL Legacy"
> +else
> + LIBS="-lcloog-isl -lisl ${saved_libs}"
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include <cloog/cloog.h>
> +int
> +main ()
> +{
> +cloog_version ()
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> + gcc_cv_cloog_type=ISL
> +else
> + LIBS="-lcloog-ppl ${saved_libs}"
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include <cloog/cloog.h>
> +int
> +main ()
> +{
> +cloog_version ()
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> + gcc_cv_cloog_type=PPL
> +else
> + gcc_cv_cloog_type=no
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
> +$as_echo "$gcc_cv_cloog_type" >&6; }
> +
> + case $gcc_cv_cloog_type in
> + "PPL Legacy")
> + clooginc="${clooginc} ${clooglegacyinc}"
> + clooglibs="${clooglibs} -lcloog"
> + cloog_org=no
> + ;;
> + "ISL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-isl"
> + cloog_org=yes
> + ;;
> + "PPL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-ppl"
> + cloog_org=yes
> + ;;
> + *)
> + clooglibs=
> + clooginc=
> + ;;
> + esac
> +
> + # Stage 2: Version check the found CLooG.
> + CFLAGS="${saved_cflags} ${clooginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${saved_ldflags} ${clooglibs}"
> +
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = yes ; then
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG (compile time)" >&5
> +$as_echo_n "checking for verison 0.14.0 of CLooG (compile time)... " >&6; }
> +if test "${gcc_cv_cloog_ct_0_14_0+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> +else
> cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> #include "cloog/cloog.h"
> int
> main ()
> {
> +#if CLOOG_VERSION_MAJOR != 0 \
> + || CLOOG_VERSION_MINOR != 14 \
> + || CLOOG_VERSION_REVISION < 0
> + choke me
> + #endif
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_compile "$LINENO"; then :
> + gcc_cv_cloog_ct_0_14_0=yes
> +else
> + gcc_cv_cloog_ct_0_14_0=no
> +fi
> +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_14_0" >&5
> +$as_echo "$gcc_cv_cloog_ct_0_14_0" >&6; }
>
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
> - choke me
> - #endif
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.14.0 of CLooG (run time)" >&5
> +$as_echo_n "checking for version 0.14.0 of CLooG (run time)... " >&6; }
> +if test "${gcc_cv_cloog_rt_0_14_0+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> +else
> + if test "$cross_compiling" = yes; then :
> + gcc_cv_cloog_rt_0_14_0=guessing yes
> +else
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include <stdlib.h>
> + #include "cloog/cloog.h"
> +int
> +main ()
> +{
> +if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
> + {
> + exit (1);
> + }
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_run "$LINENO"; then :
> + gcc_cv_cloog_rt_0_14_0=yes
> +else
> + gcc_cv_cloog_rt_0_14_0=no
> +fi
> +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
> + conftest.$ac_objext conftest.beam conftest.$ac_ext
> +fi
> +
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_rt_0_14_0" >&5
> +$as_echo "$gcc_cv_cloog_rt_0_14_0" >&6; }
> + fi
>
> + # Version check for CLooG-PPL (Legacy).
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = no ; then
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
> +$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
> +if test "${gcc_cv_cloog_ct_0_15_5+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> +else
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include "cloog/cloog.h"
> +int
> +main ()
> +{
> +#if CLOOG_VERSION_MAJOR != 0 \
> + || CLOOG_VERSION_MINOR != 15 \
> + || CLOOG_VERSION_REVISION < 5
> + choke me
> + #endif
> ;
> return 0;
> }
> @@ -5970,32 +6161,48 @@ if ac_fn_c_try_compile "$LINENO"; then :
> int
> main ()
> {
> -
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
> - choke me
> - #endif
> -
> +#if CLOOG_VERSION_MAJOR != 0 \
> + || CLOOG_VERSION_MINOR != 15 \
> + || CLOOG_VERSION_REVISION < 9
> + choke me
> + #endif
> ;
> return 0;
> }
> _ACEOF
> if ac_fn_c_try_compile "$LINENO"; then :
> - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> -$as_echo "yes" >&6; }
> + gcc_cv_cloog_ct_0_15_5=yes
> else
> - { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
> -$as_echo "buggy but acceptable" >&6; }
> + gcc_cv_cloog_ct_0_15_5=buggy but acceptable
> fi
> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> else
> - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -$as_echo "no" >&6; }; clooglibs= ; clooginc=
> + gcc_cv_cloog_ct_0_15_5=no
> fi
> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> - CFLAGS="$saved_CFLAGS"
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_15_5" >&5
> +$as_echo "$gcc_cv_cloog_ct_0_15_5" >&6; }
> + fi
> +
> + if test "${gcc_cv_cloog_ct_0_14_0}" = no \
> + || test "${gcc_cv_cloog_rt_0_14_0}" = no \
> + || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
> + clooglibs=
> + clooginc=
> + fi
> +
> + if test "${graphite_requested}" = yes \
> + && test "${clooglibs:-null}" = null \
> + && test "${clooginc:-null}" = null ; then
> + as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5
> + fi
> +
> + CFLAGS=$saved_cflags
> + LIBS=$saved_libs
> + LDFLAGS=$saved_ldflags
> fi
>
> -# Flags needed for CLOOG
>
>
>
> diff --git a/configure.ac b/configure.ac
> index 3d969aa..7ae72a1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1580,8 +1580,6 @@ AC_SUBST(pplinc)
>
>
> # Check for CLOOG
> -clooglibs=" -lcloog "
> -clooginc=" -DCLOOG_PPL_BACKEND "
>
> AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
> Equivalent to --with-cloog-include=PATH/include
> @@ -1593,7 +1591,7 @@ if test "x$with_ppl" = "xno"; then
> with_cloog=no
> fi
>
> -case $with_cloog in
> +case $with_cloog in
> no)
> clooglibs=
> clooginc=
> @@ -1601,19 +1599,20 @@ case $with_cloog in
> "" | yes)
> ;;
> *)
> - clooglibs="-L$with_cloog/lib -lcloog"
> - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
> + clooglibs="-L$with_cloog/lib"
> + clooginc="-I$with_cloog/include"
> ;;
> esac
> -if test "x$with_cloog_include" != x; then
> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
> +if test "${with_cloog_include+set}" = set ; then
> + clooginc="-I$with_cloog_include"
> fi
> -if test "x$with_cloog_lib" != x; then
> - clooglibs="-L$with_cloog_lib -lcloog"
> +if test "${with_cloog_lib+set}" = set; then
> + clooglibs="-L$with_cloog_lib"
> fi
> -if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
> - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
> - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
> +if test "${with_cloog+set}" = set && test "${with_cloog_include+set}" = set \
> + && test "${with_cloog_lib+set}" = x && test -d ${srcdir}/cloog; then
> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
> enable_cloog_version_check=no
> fi
>
> @@ -1622,24 +1621,139 @@ AC_ARG_ENABLE(cloog-version-check,
> ENABLE_CLOOG_CHECK=$enableval,
> ENABLE_CLOOG_CHECK=yes)
>
> -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
> - saved_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> - AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
> - AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
> - choke me
> - #endif
> - ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
> - choke me
> - #endif
> - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
> - [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
> - CFLAGS="$saved_CFLAGS"
> +if test "x$with_cloog" != "xno"; then
> + dnl CLooG configure test programs.
> + m4_define([CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
> + [#include <cloog/cloog.h>],
> + [cloog_version ()])])
> +
> + m4_define([CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
> + [#include <cloog/cloog.h>],
> + [ppl_version_major ()])])
> +
> + m4_define([CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
> + [#include "cloog/cloog.h"],
> + [#if CLOOG_VERSION_MAJOR != $1 \
> + || CLOOG_VERSION_MINOR != $2 \
> + || CLOOG_VERSION_REVISION < $3
> + choke me
> + #endif])])
> +
> + m4_define([CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM(
> + [#include <stdlib.h>
> + #include "cloog/cloog.h"],
> + [if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
> + {
> + exit (1);
> + }])])
> +
> + saved_cflags=$CFLAGS
> + saved_libs=$LIBS
> + saved_ldflags=$LDFLAGS
> +
> + # Only fail if the user explicitly selected CLooG.
> + graphite_requested=no
> + if test "${with_cloog+set}" = set \
> + || test "${with_cloog_include+set}" = set \
> + || test "${with_cloog_lib+set}" = set ; then
> + graphite_requested=yes
> + fi
> +
> + # Stage 1: Detect the available CLooG+backend combination.
> + clooglegacyinc="-DCLOOG_PPL_BACKEND"
> + cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> +
> + CFLAGS="${CFLAGS} ${clooginc} ${cloogorginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + AC_CACHE_CHECK([for installed CLooG type],
> + [gcc_cv_cloog_type],
> + [LIBS="-lcloog ${saved_libs}"
> + AC_LINK_IFELSE([CLOOG_PPL_LEGACY_PROG],
> + [gcc_cv_cloog_type="PPL Legacy"],
> + [LIBS="-lcloog-isl -lisl ${saved_libs}"
> + AC_LINK_IFELSE([CLOOG_ORG_PROG],
> + [gcc_cv_cloog_type=ISL],
> + [LIBS="-lcloog-ppl ${saved_libs}"
> + AC_LINK_IFELSE([CLOOG_ORG_PROG],
> + [gcc_cv_cloog_type=PPL],
> + [gcc_cv_cloog_type=no])])])])
> +
> + case $gcc_cv_cloog_type in
> + "PPL Legacy")
> + clooginc="${clooginc} ${clooglegacyinc}"
> + clooglibs="${clooglibs} -lcloog"
> + cloog_org=no
> + ;;
> + "ISL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-isl"
> + cloog_org=yes
> + ;;
> + "PPL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-ppl"
> + cloog_org=yes
> + ;;
> + *)
> + clooglibs=
> + clooginc=
> + ;;
> + esac
> +
> + # Stage 2: Version check the found CLooG.
> + CFLAGS="${saved_cflags} ${clooginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${saved_ldflags} ${clooglibs}"
> +
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = yes ; then
> + AC_CACHE_CHECK([for verison 0.14.0 of CLooG (compile time)],
> + [gcc_cv_cloog_ct_0_14_0],
> + [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,14,0)],
> + [gcc_cv_cloog_ct_0_14_0=yes],
> + [gcc_cv_cloog_ct_0_14_0=no])])
> +
> + AC_CACHE_CHECK([for version 0.14.0 of CLooG (run time)],
> + [gcc_cv_cloog_rt_0_14_0],
> + [AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
> + [gcc_cv_cloog_rt_0_14_0=yes],
> + [gcc_cv_cloog_rt_0_14_0=no],
> + [gcc_cv_cloog_rt_0_14_0=guessing yes])])
> + fi
> +
> + # Version check for CLooG-PPL (Legacy).
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = no ; then
> + AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG],
> + [gcc_cv_cloog_ct_0_15_5],
> + [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],
> + [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],
> + [gcc_cv_cloog_ct_0_15_5=yes],
> + [gcc_cv_cloog_ct_0_15_5=buggy but acceptable])],
> + [gcc_cv_cloog_ct_0_15_5=no])])
> + fi
> +
> + if test "${gcc_cv_cloog_ct_0_14_0}" = no \
> + || test "${gcc_cv_cloog_rt_0_14_0}" = no \
> + || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
> + clooglibs=
> + clooginc=
> + fi
> +
> + if test "${graphite_requested}" = yes \
> + && test "${clooglibs:-null}" = null \
> + && test "${clooginc:-null}" = null ; then
> + AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])
> + fi
> +
> + CFLAGS=$saved_cflags
> + LIBS=$saved_libs
> + LDFLAGS=$saved_ldflags
> fi
>
> -# Flags needed for CLOOG
> +dnl Flags needed for CLOOG
> AC_SUBST(clooglibs)
> AC_SUBST(clooginc)
>
> --
> 1.7.2.2
>
>
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-22 21:48 ` Sebastian Pop
@ 2010-09-29 18:28 ` Paolo Bonzini
2010-09-29 22:49 ` Andreas Simbuerger
0 siblings, 1 reply; 67+ messages in thread
From: Paolo Bonzini @ 2010-09-29 18:28 UTC (permalink / raw)
To: Sebastian Pop; +Cc: Andreas Simbürger, gcc-patches, gcc-graphite
On 09/22/2010 04:16 PM, Sebastian Pop wrote:
>> -if test "x$with_cloog_include" != x; then
>> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
>> +if test "${with_cloog_include+set}" = set ; then
>> + clooginc="-I$with_cloog_include"
>> fi
>> -if test "x$with_cloog_lib" != x; then
>> - clooglibs="-L$with_cloog_lib -lcloog"
>> +if test "${with_cloog_lib+set}" = set; then
>> + clooglibs="-L$with_cloog_lib"
>> fi
I don't understand the change in the "if" statements, since -I and -L do
not make sense if the variable is empty.
Also, this is now a substantial body of code, can you move it to
config/cloog.m4 please?
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-09-29 18:28 ` Paolo Bonzini
@ 2010-09-29 22:49 ` Andreas Simbuerger
2010-10-08 10:45 ` Andreas Simbürger
0 siblings, 1 reply; 67+ messages in thread
From: Andreas Simbuerger @ 2010-09-29 22:49 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Sebastian Pop, gcc-patches, gcc-graphite
On 09/29/2010 04:12 PM, Paolo Bonzini wrote:
> On 09/22/2010 04:16 PM, Sebastian Pop wrote:
>>> -if test "x$with_cloog_include" != x; then
>>> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
>>> +if test "${with_cloog_include+set}" = set ; then
>>> + clooginc="-I$with_cloog_include"
>>> fi
>>> -if test "x$with_cloog_lib" != x; then
>>> - clooglibs="-L$with_cloog_lib -lcloog"
>>> +if test "${with_cloog_lib+set}" = set; then
>>> + clooglibs="-L$with_cloog_lib"
>>> fi
>
> I don't understand the change in the "if" statements, since -I and -L do
> not make sense if the variable is empty.
>
That makes sense, thank you. :-)
> Also, this is now a substantial body of code, can you move it to
> config/cloog.m4 please?
ok
>
> Paolo
Andreas
^ permalink raw reply [flat|nested] 67+ messages in thread
* [PATCH] Support official CLooG.org versions.
2010-09-29 22:49 ` Andreas Simbuerger
@ 2010-10-08 10:45 ` Andreas Simbürger
2010-10-08 13:08 ` Jack Howarth
2010-10-09 8:50 ` Ralf Wildenhues
0 siblings, 2 replies; 67+ messages in thread
From: Andreas Simbürger @ 2010-10-08 10:45 UTC (permalink / raw)
To: gcc-graphite; +Cc: gcc-patches, Andreas Simbürger
Changes to previous patch:
* Refactored CLooG-Checks in their own .m4 file (config/cloog.m4).
* Switched back from ${var+name} = name notation to "x${var}" != x.
Add support for official CLooG releases.
CLooG's configuration gets detected within 2 stages:
Stage 1: Detect the installed CLooG version.
This is done by linking test programs against the various
CLooG libraries. As CLooG's library sonames depend on the
used backend, this is sufficient to detect the used backend.
We only detect this backends, in order:
1) CLooG-PPL (Legacy): The "old" CLooG.
2) CLooG-ISL: The "new" CLooG.
3) CLooG-Parma: An alternative backend, to compare it with
CLooG-ISL.
CLooG-Poly is not detected, as the PolyLib may conflict
with GCC's license.
Stage 2: Version checks.
After detecting the right configuration, we finally check
if the installed version is usable. There are 2 different
checks: One for CLooG-PPL (Legacy) and one for CLooG-ISL.
* CLooG-ISL:
As the "new" CLooG provides methods to check for its version at
both compile and run time, we use this feature. First
we check for the constants to verify the header's compatibility.
Finally we verify the compatibility of our headers with
the library that will get linked with GCC.
As stated in autoconf's documentation, the run time check
is not usable when cross-compiling, so we skip this check
then.
* CLooG-PPL (Legacy):
This version check provides the same semantics as before.
As CLooG-PPL (Legacy) provides the same constants as the
official CLooG, we can use the same test program for the
compile time check.
Tested with CLooG-ISL and CLooG-PPL (Legacy).
As for now, CLooG-Parma fails to build.
2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* configure.ac: Support official CLooG.org versions.
* configure: Regenerate.
* config/cloog.m4: New.
---
ChangeLog.graphite | 6 +
config/cloog.m4 | 189 +++++++++++++++++++++++++
configure | 392 ++++++++++++++++++++++++++++++++++++++++------------
configure.ac | 70 ++++------
4 files changed, 530 insertions(+), 127 deletions(-)
create mode 100644 config/cloog.m4
diff --git a/ChangeLog.graphite b/ChangeLog.graphite
index b9d0723..c797dd3 100644
--- a/ChangeLog.graphite
+++ b/ChangeLog.graphite
@@ -1,3 +1,9 @@
+2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * configure.ac: Support official CLooG.org versions.
+ * configure: Regenerate.
+ * config/cloog.m4: New.
+
2010-09-24 Sebastian Pop <sebastian.pop@amd.com>
* Merge from mainline (163495:164578).
diff --git a/config/cloog.m4 b/config/cloog.m4
new file mode 100644
index 0000000..a435f8e
--- /dev/null
+++ b/config/cloog.m4
@@ -0,0 +1,189 @@
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Andreas Simbuerger.
+
+dnl Test program for detecting CLooG.org's backend.
+m4_define([CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
+ [#include <cloog/cloog.h>],
+ [cloog_version ()])])
+
+dnl Test program for detecting CLooG-Legacy (CLooG-PPL).
+m4_define([CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
+ [#include <cloog/cloog.h>],
+ [ppl_version_major ()])])
+
+dnl Test CLooG's version (compile time).
+m4_define([CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
+ [#include "cloog/cloog.h"],
+ [#if CLOOG_VERSION_MAJOR != $1 \
+ || CLOOG_VERSION_MINOR != $2 \
+ || CLOOG_VERSION_REVISION < $3
+ choke me
+ #endif])])
+
+dnl Test CLooG's version (run time).
+m4_define([CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM(
+ [#include <stdlib.h>
+ #include "cloog/cloog.h"],
+ [if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ exit (1);
+ }])])
+
+dnl Initialize clooglibs/clooginc according to the user input.
+AC_DEFUN([CLOOG_INIT_FLAGS],
+[
+ case $with_cloog in
+ no)
+ clooglibs=
+ clooginc=
+ ;;
+ "" | yes)
+ ;;
+ *)
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
+ ;;
+ esac
+ if test "x${with_cloog_include}" != x ; then
+ clooginc="-I$with_cloog_include"
+ fi
+ if test "x${with_cloog_lib}" != x; then
+ clooglibs="-L$with_cloog_lib"
+ fi
+ if test "x${with_cloog}" != x && test "x${with_cloog_include}" != x \
+ && test "x${with_cloog_lib}" != x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
+ enable_cloog_version_check=no
+ fi
+]
+)
+
+dnl CLOOG_REQUESTED([ACTION-IF-REQUESTED], [ACTION-IF-NOT])
+AC_DEFUN([CLOOG_REQUESTED],
+[
+ if test "x${with_cloog}" != x \
+ || test "x${with_cloog_include}" != x \
+ || test "x${with_cloog_lib}" != x ; then
+ $1
+ else
+ $2
+ fi
+]
+)
+
+dnl Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org.
+dnl Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
+AC_DEFUN([CLOOG_SET_FLAGS],
+[
+ clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ CFLAGS="${CFLAGS} ${clooginc} ${cloogorginc} ${gmpinc} ${pplinc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ AC_CACHE_CHECK([for installed CLooG type],
+ [gcc_cv_cloog_type],
+ [LIBS="-lcloog ${saved_libs}"
+ AC_LINK_IFELSE([CLOOG_PPL_LEGACY_PROG],
+ [gcc_cv_cloog_type="PPL Legacy"],
+ [LIBS="-lcloog-isl -lisl ${saved_libs}"
+ AC_LINK_IFELSE([CLOOG_ORG_PROG],
+ [gcc_cv_cloog_type=ISL],
+ [LIBS="-lcloog-ppl ${saved_libs}"
+ AC_LINK_IFELSE([CLOOG_ORG_PROG],
+ [gcc_cv_cloog_type=PPL],
+ [gcc_cv_cloog_type=no])])])])
+
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ ;;
+ esac
+
+ CFLAGS="${saved_cflags} ${clooginc} ${gmpinc} ${pplinc}"
+ LDFLAGS="${saved_ldflags} ${clooglibs}"
+]
+)
+
+dnl Version checks for CLooG.org
+dnl
+dnl CLOOG_CHECK_VERSION([MAJOR],[MINOR],[REVISION])
+AC_DEFUN([CLOOG_CHECK_VERSION],
+[
+ AC_CACHE_CHECK([for verison $1.$2.$3 of CLooG (compile time)],
+ [gcc_cv_cloog_ct_0_14_0],
+ [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG($1,$2,$3)],
+ [gcc_cv_cloog_ct_0_14_0=yes],
+ [gcc_cv_cloog_ct_0_14_0=no])])
+
+ AC_CACHE_CHECK([for version $1.$2.$3 of CLooG (run time)],
+ [gcc_cv_cloog_rt_0_14_0],
+ [AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
+ [gcc_cv_cloog_rt_0_14_0=yes],
+ [gcc_cv_cloog_rt_0_14_0=no],
+ [gcc_cv_cloog_rt_0_14_0=guessing yes])])
+]
+)
+
+dnl Version checks for CLooG-Legacy (CLooG-PPL).
+dnl As this gets removed more sooner than later, don't bother
+dnl making it variable.
+AC_DEFUN([CLOOG_CHECK_VERSION_LEGACY],
+[
+ AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG],
+ [gcc_cv_cloog_ct_0_15_5],
+ [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],
+ [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],
+ [gcc_cv_cloog_ct_0_15_5=yes],
+ [gcc_cv_cloog_ct_0_15_5=buggy but acceptable])],
+ [gcc_cv_cloog_ct_0_15_5=no])])
+]
+)
+
+dnl Executes [ACTION-IF-FAILED], if GRAPHITE was requested and
+dnl the checks failed.
+dnl
+dnl CLOOG_IF_FAILED([ACTION-IF-FAILED])
+AC_DEFUN([CLOOG_IF_FAILED],
+[
+ CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])dnl
+
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${graphite_requested}" = yes \
+ && test "x${clooglibs}" = x \
+ && test "x${clooginc}" = x ; then
+ $1
+ fi
+]
+)
diff --git a/configure b/configure
index 9e39867..bcbec16 100755
--- a/configure
+++ b/configure
@@ -833,6 +833,9 @@ LIBS
CPPFLAGS
CXX
CXXFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
CCC
CPP
AR
@@ -1816,6 +1819,48 @@ fi
} # ac_fn_c_try_link
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ return $ac_retval
+
+} # ac_fn_c_try_run
+
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -1940,48 +1985,6 @@ fi
} # ac_fn_c_check_header_mongrel
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
-
-} # ac_fn_c_try_run
-
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
@@ -5885,8 +5888,6 @@ fi
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
# Check whether --with-cloog was given.
@@ -5911,29 +5912,33 @@ if test "x$with_ppl" = "xno"; then
with_cloog=no
fi
-case $with_cloog in
- no)
- clooglibs=
- clooginc=
- ;;
- "" | yes)
- ;;
- *)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
- ;;
-esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
-fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
-fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
- enable_cloog_version_check=no
-fi
+
+ case $with_cloog in
+ no)
+ clooglibs=
+ clooginc=
+ ;;
+ "" | yes)
+ ;;
+ *)
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
+ ;;
+ esac
+ if test "x${with_cloog_include}" != x ; then
+ clooginc="-I$with_cloog_include"
+ fi
+ if test "x${with_cloog_lib}" != x; then
+ clooglibs="-L$with_cloog_lib"
+ fi
+ if test "x${with_cloog}" != x && test "x${with_cloog_include}" != x \
+ && test "x${with_cloog_lib}" != x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
+ enable_cloog_version_check=no
+ fi
+
+
# Check whether --enable-cloog-version-check was given.
if test "${enable_cloog_version_check+set}" = set; then :
@@ -5943,22 +5948,202 @@ else
fi
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
-$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+if test "x$with_cloog" != "xno"; then
+ saved_cflags=$CFLAGS
+ saved_libs=$LIBS
+ saved_ldflags=$LDFLAGS
+
+
+ clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ CFLAGS="${CFLAGS} ${clooginc} ${cloogorginc} ${gmpinc} ${pplinc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG type" >&5
+$as_echo_n "checking for installed CLooG type... " >&6; }
+if test "${gcc_cv_cloog_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ LIBS="-lcloog ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+ppl_version_major ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type="PPL Legacy"
+else
+ LIBS="-lcloog-isl -lisl ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=ISL
+else
+ LIBS="-lcloog-ppl ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=PPL
+else
+ gcc_cv_cloog_type=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
+$as_echo "$gcc_cv_cloog_type" >&6; }
+
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ ;;
+ esac
+
+ CFLAGS="${saved_cflags} ${clooginc} ${gmpinc} ${pplinc}"
+ LDFLAGS="${saved_ldflags} ${clooglibs}"
+
+
+
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = yes ; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG (compile time)" >&5
+$as_echo_n "checking for verison 0.14.0 of CLooG (compile time)... " >&6; }
+if test "${gcc_cv_cloog_ct_0_14_0+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "cloog/cloog.h"
int
main ()
{
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 14 \
+ || CLOOG_VERSION_REVISION < 0
+ choke me
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gcc_cv_cloog_ct_0_14_0=yes
+else
+ gcc_cv_cloog_ct_0_14_0=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_14_0" >&5
+$as_echo "$gcc_cv_cloog_ct_0_14_0" >&6; }
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.14.0 of CLooG (run time)" >&5
+$as_echo_n "checking for version 0.14.0 of CLooG (run time)... " >&6; }
+if test "${gcc_cv_cloog_rt_0_14_0+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ gcc_cv_cloog_rt_0_14_0=guessing yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #include "cloog/cloog.h"
+int
+main ()
+{
+if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ exit (1);
+ }
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gcc_cv_cloog_rt_0_14_0=yes
+else
+ gcc_cv_cloog_rt_0_14_0=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_rt_0_14_0" >&5
+$as_echo "$gcc_cv_cloog_rt_0_14_0" >&6; }
+
+
+ fi
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = no ; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
+$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+if test "${gcc_cv_cloog_ct_0_15_5+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "cloog/cloog.h"
+int
+main ()
+{
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 5
+ choke me
+ #endif
;
return 0;
}
@@ -5970,29 +6155,62 @@ if ac_fn_c_try_compile "$LINENO"; then :
int
main ()
{
-
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
-
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 9
+ choke me
+ #endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ gcc_cv_cloog_ct_0_15_5=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
-$as_echo "buggy but acceptable" >&6; }
+ gcc_cv_cloog_ct_0_15_5=buggy but acceptable
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; clooglibs= ; clooginc=
+ gcc_cv_cloog_ct_0_15_5=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$saved_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_15_5" >&5
+$as_echo "$gcc_cv_cloog_ct_0_15_5" >&6; }
+
+
+ fi
+
+
+
+ if test "x${with_cloog}" != x \
+ || test "x${with_cloog_include}" != x \
+ || test "x${with_cloog_lib}" != x ; then
+ graphite_requested=yes
+ else
+ graphite_requested=no
+ fi
+
+
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${graphite_requested}" = yes \
+ && test "x${clooglibs}" = x \
+ && test "x${clooginc}" = x ; then
+
+ as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5
+ fi
+
+
+
+ CFLAGS=$saved_cflags
+ LIBS=$saved_libs
+ LDFLAGS=$saved_ldflags
fi
# Flags needed for CLOOG
diff --git a/configure.ac b/configure.ac
index 67e79fe..2aa4e3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,7 @@ m4_include([ltoptions.m4])
m4_include([ltsugar.m4])
m4_include([ltversion.m4])
m4_include([lt~obsolete.m4])
+m4_include([config/cloog.m4])
AC_INIT(move-if-change)
AC_PREREQ(2.64)
@@ -1580,8 +1581,6 @@ AC_SUBST(pplinc)
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
Equivalent to --with-cloog-include=PATH/include
@@ -1593,50 +1592,41 @@ if test "x$with_ppl" = "xno"; then
with_cloog=no
fi
-case $with_cloog in
- no)
- clooglibs=
- clooginc=
- ;;
- "" | yes)
- ;;
- *)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
- ;;
-esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
-fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
-fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
- enable_cloog_version_check=no
-fi
+CLOOG_INIT_FLAGS()
AC_ARG_ENABLE(cloog-version-check,
[ --disable-cloog-version-check disable check for CLooG version],
ENABLE_CLOOG_CHECK=$enableval,
ENABLE_CLOOG_CHECK=yes)
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
- AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
- ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
- [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
- CFLAGS="$saved_CFLAGS"
+if test "x$with_cloog" != "xno"; then
+ saved_cflags=$CFLAGS
+ saved_libs=$LIBS
+ saved_ldflags=$LDFLAGS
+
+ dnl Detect and set clooginc/clooglibs.
+ dnl Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
+ CLOOG_SET_FLAGS()
+
+ dnl Version check for CLooG-Org
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = yes ; then
+ CLOOG_CHECK_VERSION(0,14,0)
+ fi
+
+ dnl Version check for CLooG-PPL (Legacy).
+ if test "${ENABLE_CLOOG_CHECK}" = yes \
+ && test "${cloog_org}" = no ; then
+ CLOOG_CHECK_VERSION_LEGACY()
+ fi
+
+ dnl Only fails, if GRAPHITE was requested.
+ CLOOG_IF_FAILED([
+ AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])])
+
+ CFLAGS=$saved_cflags
+ LIBS=$saved_libs
+ LDFLAGS=$saved_ldflags
fi
# Flags needed for CLOOG
--
1.7.3.1
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-10-08 10:45 ` Andreas Simbürger
@ 2010-10-08 13:08 ` Jack Howarth
2010-10-09 8:50 ` Ralf Wildenhues
1 sibling, 0 replies; 67+ messages in thread
From: Jack Howarth @ 2010-10-08 13:08 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-graphite, gcc-patches
On Fri, Oct 08, 2010 at 12:36:42PM +0200, Andreas Simbürger wrote:
> Changes to previous patch:
> * Refactored CLooG-Checks in their own .m4 file (config/cloog.m4).
> * Switched back from ${var+name} = name notation to "x${var}" != x.
>
> Add support for official CLooG releases.
> CLooG's configuration gets detected within 2 stages:
>
> Stage 1: Detect the installed CLooG version.
> This is done by linking test programs against the various
> CLooG libraries. As CLooG's library sonames depend on the
> used backend, this is sufficient to detect the used backend.
>
> We only detect this backends, in order:
> 1) CLooG-PPL (Legacy): The "old" CLooG.
> 2) CLooG-ISL: The "new" CLooG.
> 3) CLooG-Parma: An alternative backend, to compare it with
> CLooG-ISL.
>
> CLooG-Poly is not detected, as the PolyLib may conflict
> with GCC's license.
>
> Stage 2: Version checks.
> After detecting the right configuration, we finally check
> if the installed version is usable. There are 2 different
> checks: One for CLooG-PPL (Legacy) and one for CLooG-ISL.
>
> * CLooG-ISL:
> As the "new" CLooG provides methods to check for its version at
> both compile and run time, we use this feature. First
> we check for the constants to verify the header's compatibility.
> Finally we verify the compatibility of our headers with
> the library that will get linked with GCC.
> As stated in autoconf's documentation, the run time check
> is not usable when cross-compiling, so we skip this check
> then.
>
> * CLooG-PPL (Legacy):
> This version check provides the same semantics as before.
> As CLooG-PPL (Legacy) provides the same constants as the
> official CLooG, we can use the same test program for the
> compile time check.
>
> Tested with CLooG-ISL and CLooG-PPL (Legacy).
> As for now, CLooG-Parma fails to build.
>
Andreas,
Is there a tentative release date yet for cloog.org's cloog
0.16 release?
Jack
> 2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
>
> * configure.ac: Support official CLooG.org versions.
> * configure: Regenerate.
> * config/cloog.m4: New.
> ---
> ChangeLog.graphite | 6 +
> config/cloog.m4 | 189 +++++++++++++++++++++++++
> configure | 392 ++++++++++++++++++++++++++++++++++++++++------------
> configure.ac | 70 ++++------
> 4 files changed, 530 insertions(+), 127 deletions(-)
> create mode 100644 config/cloog.m4
>
> diff --git a/ChangeLog.graphite b/ChangeLog.graphite
> index b9d0723..c797dd3 100644
> --- a/ChangeLog.graphite
> +++ b/ChangeLog.graphite
> @@ -1,3 +1,9 @@
> +2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
> +
> + * configure.ac: Support official CLooG.org versions.
> + * configure: Regenerate.
> + * config/cloog.m4: New.
> +
> 2010-09-24 Sebastian Pop <sebastian.pop@amd.com>
>
> * Merge from mainline (163495:164578).
> diff --git a/config/cloog.m4 b/config/cloog.m4
> new file mode 100644
> index 0000000..a435f8e
> --- /dev/null
> +++ b/config/cloog.m4
> @@ -0,0 +1,189 @@
> +dnl Copyright (C) 2010 Free Software Foundation, Inc.
> +dnl This file is free software, distributed under the terms of the GNU
> +dnl General Public License. As a special exception to the GNU General
> +dnl Public License, this file may be distributed as part of a program
> +dnl that contains a configuration script generated by Autoconf, under
> +dnl the same distribution terms as the rest of that program.
> +
> +dnl From Andreas Simbuerger.
> +
> +dnl Test program for detecting CLooG.org's backend.
> +m4_define([CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
> + [#include <cloog/cloog.h>],
> + [cloog_version ()])])
> +
> +dnl Test program for detecting CLooG-Legacy (CLooG-PPL).
> +m4_define([CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
> + [#include <cloog/cloog.h>],
> + [ppl_version_major ()])])
> +
> +dnl Test CLooG's version (compile time).
> +m4_define([CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
> + [#include "cloog/cloog.h"],
> + [#if CLOOG_VERSION_MAJOR != $1 \
> + || CLOOG_VERSION_MINOR != $2 \
> + || CLOOG_VERSION_REVISION < $3
> + choke me
> + #endif])])
> +
> +dnl Test CLooG's version (run time).
> +m4_define([CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM(
> + [#include <stdlib.h>
> + #include "cloog/cloog.h"],
> + [if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
> + {
> + exit (1);
> + }])])
> +
> +dnl Initialize clooglibs/clooginc according to the user input.
> +AC_DEFUN([CLOOG_INIT_FLAGS],
> +[
> + case $with_cloog in
> + no)
> + clooglibs=
> + clooginc=
> + ;;
> + "" | yes)
> + ;;
> + *)
> + clooglibs="-L$with_cloog/lib"
> + clooginc="-I$with_cloog/include"
> + ;;
> + esac
> + if test "x${with_cloog_include}" != x ; then
> + clooginc="-I$with_cloog_include"
> + fi
> + if test "x${with_cloog_lib}" != x; then
> + clooglibs="-L$with_cloog_lib"
> + fi
> + if test "x${with_cloog}" != x && test "x${with_cloog_include}" != x \
> + && test "x${with_cloog_lib}" != x && test -d ${srcdir}/cloog; then
> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
> + enable_cloog_version_check=no
> + fi
> +]
> +)
> +
> +dnl CLOOG_REQUESTED([ACTION-IF-REQUESTED], [ACTION-IF-NOT])
> +AC_DEFUN([CLOOG_REQUESTED],
> +[
> + if test "x${with_cloog}" != x \
> + || test "x${with_cloog_include}" != x \
> + || test "x${with_cloog_lib}" != x ; then
> + $1
> + else
> + $2
> + fi
> +]
> +)
> +
> +dnl Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org.
> +dnl Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
> +AC_DEFUN([CLOOG_SET_FLAGS],
> +[
> + clooglegacyinc="-DCLOOG_PPL_BACKEND"
> + cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> +
> + CFLAGS="${CFLAGS} ${clooginc} ${cloogorginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + AC_CACHE_CHECK([for installed CLooG type],
> + [gcc_cv_cloog_type],
> + [LIBS="-lcloog ${saved_libs}"
> + AC_LINK_IFELSE([CLOOG_PPL_LEGACY_PROG],
> + [gcc_cv_cloog_type="PPL Legacy"],
> + [LIBS="-lcloog-isl -lisl ${saved_libs}"
> + AC_LINK_IFELSE([CLOOG_ORG_PROG],
> + [gcc_cv_cloog_type=ISL],
> + [LIBS="-lcloog-ppl ${saved_libs}"
> + AC_LINK_IFELSE([CLOOG_ORG_PROG],
> + [gcc_cv_cloog_type=PPL],
> + [gcc_cv_cloog_type=no])])])])
> +
> + case $gcc_cv_cloog_type in
> + "PPL Legacy")
> + clooginc="${clooginc} ${clooglegacyinc}"
> + clooglibs="${clooglibs} -lcloog"
> + cloog_org=no
> + ;;
> + "ISL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-isl"
> + cloog_org=yes
> + ;;
> + "PPL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-ppl"
> + cloog_org=yes
> + ;;
> + *)
> + clooglibs=
> + clooginc=
> + ;;
> + esac
> +
> + CFLAGS="${saved_cflags} ${clooginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${saved_ldflags} ${clooglibs}"
> +]
> +)
> +
> +dnl Version checks for CLooG.org
> +dnl
> +dnl CLOOG_CHECK_VERSION([MAJOR],[MINOR],[REVISION])
> +AC_DEFUN([CLOOG_CHECK_VERSION],
> +[
> + AC_CACHE_CHECK([for verison $1.$2.$3 of CLooG (compile time)],
> + [gcc_cv_cloog_ct_0_14_0],
> + [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG($1,$2,$3)],
> + [gcc_cv_cloog_ct_0_14_0=yes],
> + [gcc_cv_cloog_ct_0_14_0=no])])
> +
> + AC_CACHE_CHECK([for version $1.$2.$3 of CLooG (run time)],
> + [gcc_cv_cloog_rt_0_14_0],
> + [AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
> + [gcc_cv_cloog_rt_0_14_0=yes],
> + [gcc_cv_cloog_rt_0_14_0=no],
> + [gcc_cv_cloog_rt_0_14_0=guessing yes])])
> +]
> +)
> +
> +dnl Version checks for CLooG-Legacy (CLooG-PPL).
> +dnl As this gets removed more sooner than later, don't bother
> +dnl making it variable.
> +AC_DEFUN([CLOOG_CHECK_VERSION_LEGACY],
> +[
> + AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG],
> + [gcc_cv_cloog_ct_0_15_5],
> + [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],
> + [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],
> + [gcc_cv_cloog_ct_0_15_5=yes],
> + [gcc_cv_cloog_ct_0_15_5=buggy but acceptable])],
> + [gcc_cv_cloog_ct_0_15_5=no])])
> +]
> +)
> +
> +dnl Executes [ACTION-IF-FAILED], if GRAPHITE was requested and
> +dnl the checks failed.
> +dnl
> +dnl CLOOG_IF_FAILED([ACTION-IF-FAILED])
> +AC_DEFUN([CLOOG_IF_FAILED],
> +[
> + CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])dnl
> +
> + if test "${gcc_cv_cloog_ct_0_14_0}" = no \
> + || test "${gcc_cv_cloog_rt_0_14_0}" = no \
> + || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
> + clooglibs=
> + clooginc=
> + fi
> +
> + if test "${graphite_requested}" = yes \
> + && test "x${clooglibs}" = x \
> + && test "x${clooginc}" = x ; then
> + $1
> + fi
> +]
> +)
> diff --git a/configure b/configure
> index 9e39867..bcbec16 100755
> --- a/configure
> +++ b/configure
> @@ -833,6 +833,9 @@ LIBS
> CPPFLAGS
> CXX
> CXXFLAGS
> +LDFLAGS
> +LIBS
> +CPPFLAGS
> CCC
> CPP
> AR
> @@ -1816,6 +1819,48 @@ fi
>
> } # ac_fn_c_try_link
>
> +# ac_fn_c_try_run LINENO
> +# ----------------------
> +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
> +# that executables *can* be run.
> +ac_fn_c_try_run ()
> +{
> + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
> + if { { ac_try="$ac_link"
> +case "(($ac_try" in
> + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> + *) ac_try_echo=$ac_try;;
> +esac
> +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> +$as_echo "$ac_try_echo"; } >&5
> + (eval "$ac_link") 2>&5
> + ac_status=$?
> + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
> + { { case "(($ac_try" in
> + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> + *) ac_try_echo=$ac_try;;
> +esac
> +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> +$as_echo "$ac_try_echo"; } >&5
> + (eval "$ac_try") 2>&5
> + ac_status=$?
> + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> + test $ac_status = 0; }; }; then :
> + ac_retval=0
> +else
> + $as_echo "$as_me: program exited with status $ac_status" >&5
> + $as_echo "$as_me: failed program was:" >&5
> +sed 's/^/| /' conftest.$ac_ext >&5
> +
> + ac_retval=$ac_status
> +fi
> + rm -rf conftest.dSYM conftest_ipa8_conftest.oo
> + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
> + return $ac_retval
> +
> +} # ac_fn_c_try_run
> +
> # ac_fn_c_try_cpp LINENO
> # ----------------------
> # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
> @@ -1940,48 +1985,6 @@ fi
>
> } # ac_fn_c_check_header_mongrel
>
> -# ac_fn_c_try_run LINENO
> -# ----------------------
> -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
> -# that executables *can* be run.
> -ac_fn_c_try_run ()
> -{
> - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
> - if { { ac_try="$ac_link"
> -case "(($ac_try" in
> - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> - *) ac_try_echo=$ac_try;;
> -esac
> -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> -$as_echo "$ac_try_echo"; } >&5
> - (eval "$ac_link") 2>&5
> - ac_status=$?
> - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
> - { { case "(($ac_try" in
> - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
> - *) ac_try_echo=$ac_try;;
> -esac
> -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
> -$as_echo "$ac_try_echo"; } >&5
> - (eval "$ac_try") 2>&5
> - ac_status=$?
> - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> - test $ac_status = 0; }; }; then :
> - ac_retval=0
> -else
> - $as_echo "$as_me: program exited with status $ac_status" >&5
> - $as_echo "$as_me: failed program was:" >&5
> -sed 's/^/| /' conftest.$ac_ext >&5
> -
> - ac_retval=$ac_status
> -fi
> - rm -rf conftest.dSYM conftest_ipa8_conftest.oo
> - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
> - return $ac_retval
> -
> -} # ac_fn_c_try_run
> -
> # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
> # -------------------------------------------------------
> # Tests whether HEADER exists and can be compiled using the include files in
> @@ -5885,8 +5888,6 @@ fi
>
>
> # Check for CLOOG
> -clooglibs=" -lcloog "
> -clooginc=" -DCLOOG_PPL_BACKEND "
>
>
> # Check whether --with-cloog was given.
> @@ -5911,29 +5912,33 @@ if test "x$with_ppl" = "xno"; then
> with_cloog=no
> fi
>
> -case $with_cloog in
> - no)
> - clooglibs=
> - clooginc=
> - ;;
> - "" | yes)
> - ;;
> - *)
> - clooglibs="-L$with_cloog/lib -lcloog"
> - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
> - ;;
> -esac
> -if test "x$with_cloog_include" != x; then
> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
> -fi
> -if test "x$with_cloog_lib" != x; then
> - clooglibs="-L$with_cloog_lib -lcloog"
> -fi
> -if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
> - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
> - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
> - enable_cloog_version_check=no
> -fi
> +
> + case $with_cloog in
> + no)
> + clooglibs=
> + clooginc=
> + ;;
> + "" | yes)
> + ;;
> + *)
> + clooglibs="-L$with_cloog/lib"
> + clooginc="-I$with_cloog/include"
> + ;;
> + esac
> + if test "x${with_cloog_include}" != x ; then
> + clooginc="-I$with_cloog_include"
> + fi
> + if test "x${with_cloog_lib}" != x; then
> + clooglibs="-L$with_cloog_lib"
> + fi
> + if test "x${with_cloog}" != x && test "x${with_cloog_include}" != x \
> + && test "x${with_cloog_lib}" != x && test -d ${srcdir}/cloog; then
> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
> + enable_cloog_version_check=no
> + fi
> +
> +
>
> # Check whether --enable-cloog-version-check was given.
> if test "${enable_cloog_version_check+set}" = set; then :
> @@ -5943,22 +5948,202 @@ else
> fi
>
>
> -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
> - saved_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
> -$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
> +if test "x$with_cloog" != "xno"; then
> + saved_cflags=$CFLAGS
> + saved_libs=$LIBS
> + saved_ldflags=$LDFLAGS
> +
> +
> + clooglegacyinc="-DCLOOG_PPL_BACKEND"
> + cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> +
> + CFLAGS="${CFLAGS} ${clooginc} ${cloogorginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG type" >&5
> +$as_echo_n "checking for installed CLooG type... " >&6; }
> +if test "${gcc_cv_cloog_type+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> +else
> + LIBS="-lcloog ${saved_libs}"
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include <cloog/cloog.h>
> +int
> +main ()
> +{
> +ppl_version_major ()
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> + gcc_cv_cloog_type="PPL Legacy"
> +else
> + LIBS="-lcloog-isl -lisl ${saved_libs}"
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include <cloog/cloog.h>
> +int
> +main ()
> +{
> +cloog_version ()
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> + gcc_cv_cloog_type=ISL
> +else
> + LIBS="-lcloog-ppl ${saved_libs}"
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include <cloog/cloog.h>
> +int
> +main ()
> +{
> +cloog_version ()
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> + gcc_cv_cloog_type=PPL
> +else
> + gcc_cv_cloog_type=no
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
> +$as_echo "$gcc_cv_cloog_type" >&6; }
> +
> + case $gcc_cv_cloog_type in
> + "PPL Legacy")
> + clooginc="${clooginc} ${clooglegacyinc}"
> + clooglibs="${clooglibs} -lcloog"
> + cloog_org=no
> + ;;
> + "ISL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-isl"
> + cloog_org=yes
> + ;;
> + "PPL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-ppl"
> + cloog_org=yes
> + ;;
> + *)
> + clooglibs=
> + clooginc=
> + ;;
> + esac
> +
> + CFLAGS="${saved_cflags} ${clooginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${saved_ldflags} ${clooglibs}"
> +
> +
> +
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = yes ; then
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG (compile time)" >&5
> +$as_echo_n "checking for verison 0.14.0 of CLooG (compile time)... " >&6; }
> +if test "${gcc_cv_cloog_ct_0_14_0+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> +else
> cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> #include "cloog/cloog.h"
> int
> main ()
> {
> +#if CLOOG_VERSION_MAJOR != 0 \
> + || CLOOG_VERSION_MINOR != 14 \
> + || CLOOG_VERSION_REVISION < 0
> + choke me
> + #endif
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_compile "$LINENO"; then :
> + gcc_cv_cloog_ct_0_14_0=yes
> +else
> + gcc_cv_cloog_ct_0_14_0=no
> +fi
> +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_14_0" >&5
> +$as_echo "$gcc_cv_cloog_ct_0_14_0" >&6; }
>
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
> - choke me
> - #endif
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.14.0 of CLooG (run time)" >&5
> +$as_echo_n "checking for version 0.14.0 of CLooG (run time)... " >&6; }
> +if test "${gcc_cv_cloog_rt_0_14_0+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> +else
> + if test "$cross_compiling" = yes; then :
> + gcc_cv_cloog_rt_0_14_0=guessing yes
> +else
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include <stdlib.h>
> + #include "cloog/cloog.h"
> +int
> +main ()
> +{
> +if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
> + {
> + exit (1);
> + }
> + ;
> + return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_run "$LINENO"; then :
> + gcc_cv_cloog_rt_0_14_0=yes
> +else
> + gcc_cv_cloog_rt_0_14_0=no
> +fi
> +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
> + conftest.$ac_objext conftest.beam conftest.$ac_ext
> +fi
> +
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_rt_0_14_0" >&5
> +$as_echo "$gcc_cv_cloog_rt_0_14_0" >&6; }
> +
> +
> + fi
>
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = no ; then
> +
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
> +$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
> +if test "${gcc_cv_cloog_ct_0_15_5+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> +else
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h. */
> +#include "cloog/cloog.h"
> +int
> +main ()
> +{
> +#if CLOOG_VERSION_MAJOR != 0 \
> + || CLOOG_VERSION_MINOR != 15 \
> + || CLOOG_VERSION_REVISION < 5
> + choke me
> + #endif
> ;
> return 0;
> }
> @@ -5970,29 +6155,62 @@ if ac_fn_c_try_compile "$LINENO"; then :
> int
> main ()
> {
> -
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
> - choke me
> - #endif
> -
> +#if CLOOG_VERSION_MAJOR != 0 \
> + || CLOOG_VERSION_MINOR != 15 \
> + || CLOOG_VERSION_REVISION < 9
> + choke me
> + #endif
> ;
> return 0;
> }
> _ACEOF
> if ac_fn_c_try_compile "$LINENO"; then :
> - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> -$as_echo "yes" >&6; }
> + gcc_cv_cloog_ct_0_15_5=yes
> else
> - { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
> -$as_echo "buggy but acceptable" >&6; }
> + gcc_cv_cloog_ct_0_15_5=buggy but acceptable
> fi
> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> else
> - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -$as_echo "no" >&6; }; clooglibs= ; clooginc=
> + gcc_cv_cloog_ct_0_15_5=no
> fi
> rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> - CFLAGS="$saved_CFLAGS"
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_15_5" >&5
> +$as_echo "$gcc_cv_cloog_ct_0_15_5" >&6; }
> +
> +
> + fi
> +
> +
> +
> + if test "x${with_cloog}" != x \
> + || test "x${with_cloog_include}" != x \
> + || test "x${with_cloog_lib}" != x ; then
> + graphite_requested=yes
> + else
> + graphite_requested=no
> + fi
> +
> +
> + if test "${gcc_cv_cloog_ct_0_14_0}" = no \
> + || test "${gcc_cv_cloog_rt_0_14_0}" = no \
> + || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
> + clooglibs=
> + clooginc=
> + fi
> +
> + if test "${graphite_requested}" = yes \
> + && test "x${clooglibs}" = x \
> + && test "x${clooginc}" = x ; then
> +
> + as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5
> + fi
> +
> +
> +
> + CFLAGS=$saved_cflags
> + LIBS=$saved_libs
> + LDFLAGS=$saved_ldflags
> fi
>
> # Flags needed for CLOOG
> diff --git a/configure.ac b/configure.ac
> index 67e79fe..2aa4e3b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -28,6 +28,7 @@ m4_include([ltoptions.m4])
> m4_include([ltsugar.m4])
> m4_include([ltversion.m4])
> m4_include([lt~obsolete.m4])
> +m4_include([config/cloog.m4])
>
> AC_INIT(move-if-change)
> AC_PREREQ(2.64)
> @@ -1580,8 +1581,6 @@ AC_SUBST(pplinc)
>
>
> # Check for CLOOG
> -clooglibs=" -lcloog "
> -clooginc=" -DCLOOG_PPL_BACKEND "
>
> AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
> Equivalent to --with-cloog-include=PATH/include
> @@ -1593,50 +1592,41 @@ if test "x$with_ppl" = "xno"; then
> with_cloog=no
> fi
>
> -case $with_cloog in
> - no)
> - clooglibs=
> - clooginc=
> - ;;
> - "" | yes)
> - ;;
> - *)
> - clooglibs="-L$with_cloog/lib -lcloog"
> - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
> - ;;
> -esac
> -if test "x$with_cloog_include" != x; then
> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
> -fi
> -if test "x$with_cloog_lib" != x; then
> - clooglibs="-L$with_cloog_lib -lcloog"
> -fi
> -if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
> - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
> - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
> - enable_cloog_version_check=no
> -fi
> +CLOOG_INIT_FLAGS()
>
> AC_ARG_ENABLE(cloog-version-check,
> [ --disable-cloog-version-check disable check for CLooG version],
> ENABLE_CLOOG_CHECK=$enableval,
> ENABLE_CLOOG_CHECK=yes)
>
> -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
> - saved_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> - AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
> - AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
> - choke me
> - #endif
> - ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
> - choke me
> - #endif
> - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
> - [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
> - CFLAGS="$saved_CFLAGS"
> +if test "x$with_cloog" != "xno"; then
> + saved_cflags=$CFLAGS
> + saved_libs=$LIBS
> + saved_ldflags=$LDFLAGS
> +
> + dnl Detect and set clooginc/clooglibs.
> + dnl Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
> + CLOOG_SET_FLAGS()
> +
> + dnl Version check for CLooG-Org
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = yes ; then
> + CLOOG_CHECK_VERSION(0,14,0)
> + fi
> +
> + dnl Version check for CLooG-PPL (Legacy).
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = no ; then
> + CLOOG_CHECK_VERSION_LEGACY()
> + fi
> +
> + dnl Only fails, if GRAPHITE was requested.
> + CLOOG_IF_FAILED([
> + AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])])
> +
> + CFLAGS=$saved_cflags
> + LIBS=$saved_libs
> + LDFLAGS=$saved_ldflags
> fi
>
> # Flags needed for CLOOG
> --
> 1.7.3.1
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-10-08 10:45 ` Andreas Simbürger
2010-10-08 13:08 ` Jack Howarth
@ 2010-10-09 8:50 ` Ralf Wildenhues
1 sibling, 0 replies; 67+ messages in thread
From: Ralf Wildenhues @ 2010-10-09 8:50 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-graphite, gcc-patches
Hello Andreas,
* Andreas Simbürger wrote on Fri, Oct 08, 2010 at 12:36:42PM CEST:
> 2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
>
> * configure.ac: Support official CLooG.org versions.
> * configure: Regenerate.
> * config/cloog.m4: New.
See a couple of nits inline (I can't approve or reject this patch).
The important part I guess is that you tested out as many combinations
as possible (in-tree, out of tree, old version, new version, for each of
the cloog variants).
Thanks,
Ralf
> --- /dev/null
> +++ b/config/cloog.m4
> @@ -0,0 +1,189 @@
> +dnl Copyright (C) 2010 Free Software Foundation, Inc.
> +dnl This file is free software, distributed under the terms of the GNU
> +dnl General Public License. As a special exception to the GNU General
> +dnl Public License, this file may be distributed as part of a program
> +dnl that contains a configuration script generated by Autoconf, under
> +dnl the same distribution terms as the rest of that program.
> +
> +dnl From Andreas Simbuerger.
> +
> +dnl Test program for detecting CLooG.org's backend.
> +m4_define([CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
> + [#include <cloog/cloog.h>],
> + [cloog_version ()])])
> +
> +dnl Test program for detecting CLooG-Legacy (CLooG-PPL).
> +m4_define([CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
> + [#include <cloog/cloog.h>],
> + [ppl_version_major ()])])
> +
> +dnl Test CLooG's version (compile time).
For what it's worth, GCS-like comments would look about like this:
# CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION)
# -------------------------------------------
# Ensure the CLooG version is exactly MAJOR.MINOR and at least
# REVISION.
That way, it also becomes clear that this macro has different semantics
from the next one.
> +m4_define([CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
> + [#include "cloog/cloog.h"],
> + [#if CLOOG_VERSION_MAJOR != $1 \
> + || CLOOG_VERSION_MINOR != $2 \
> + || CLOOG_VERSION_REVISION < $3
> + choke me
> + #endif])])
> +
> +dnl Test CLooG's version (run time).
> +m4_define([CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM(
> + [#include <stdlib.h>
> + #include "cloog/cloog.h"],
> + [if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
> + {
> + exit (1);
Prefer return from main to exit, then you don't need to include
stdlib.h and are still C++ safe.
> + }])])
> +
> +dnl Initialize clooglibs/clooginc according to the user input.
> +AC_DEFUN([CLOOG_INIT_FLAGS],
> +[
> + case $with_cloog in
> + no)
> + clooglibs=
> + clooginc=
> + ;;
> + "" | yes)
> + ;;
> + *)
> + clooglibs="-L$with_cloog/lib"
> + clooginc="-I$with_cloog/include"
> + ;;
> + esac
> + if test "x${with_cloog_include}" != x ; then
> + clooginc="-I$with_cloog_include"
> + fi
> + if test "x${with_cloog_lib}" != x; then
> + clooglibs="-L$with_cloog_lib"
> + fi
> + if test "x${with_cloog}" != x && test "x${with_cloog_include}" != x \
> + && test "x${with_cloog_lib}" != x && test -d ${srcdir}/cloog; then
> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
> + enable_cloog_version_check=no
> + fi
> +]
> +)
> +
> +dnl CLOOG_REQUESTED([ACTION-IF-REQUESTED], [ACTION-IF-NOT])
The brackets in macro synopsis are usually meant to denote optional
arguments. Here, they are required though, for they'll cause a shell
syntax error otherwise. Or, ...
> +AC_DEFUN([CLOOG_REQUESTED],
> +[
> + if test "x${with_cloog}" != x \
> + || test "x${with_cloog_include}" != x \
> + || test "x${with_cloog_lib}" != x ; then
... you add a ':' command here, and ...
> + $1
> + else
> + $2
replace these two lines with something like
m4_ifval([$2], [else $2])
> + fi
> +]
> +)
> +
> +dnl Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org.
> +dnl Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
> +AC_DEFUN([CLOOG_SET_FLAGS],
> +[
> + clooglegacyinc="-DCLOOG_PPL_BACKEND"
> + cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
-D switches belong in CPPFLAGS rather than CFLAGS.
> + CFLAGS="${CFLAGS} ${clooginc} ${cloogorginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + AC_CACHE_CHECK([for installed CLooG type],
> + [gcc_cv_cloog_type],
> + [LIBS="-lcloog ${saved_libs}"
For cleanliness you should save and restore LIBS inside the macro,
rather than relying on variables set elsewhere, and rename saved_libs to
something that doesn't clash with code calling this macro.
Alternatively, this is a sign of maybe too much factorization if you
need to carry internal shell variables across macros without
AC_REQUIRE'ing them.
> + AC_LINK_IFELSE([CLOOG_PPL_LEGACY_PROG],
> + [gcc_cv_cloog_type="PPL Legacy"],
> + [LIBS="-lcloog-isl -lisl ${saved_libs}"
> + AC_LINK_IFELSE([CLOOG_ORG_PROG],
> + [gcc_cv_cloog_type=ISL],
> + [LIBS="-lcloog-ppl ${saved_libs}"
> + AC_LINK_IFELSE([CLOOG_ORG_PROG],
> + [gcc_cv_cloog_type=PPL],
> + [gcc_cv_cloog_type=no])])])])
> +
> + case $gcc_cv_cloog_type in
> + "PPL Legacy")
> + clooginc="${clooginc} ${clooglegacyinc}"
> + clooglibs="${clooglibs} -lcloog"
> + cloog_org=no
> + ;;
> + "ISL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-isl"
> + cloog_org=yes
> + ;;
> + "PPL")
> + clooginc="${clooginc} ${cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-ppl"
> + cloog_org=yes
> + ;;
> + *)
> + clooglibs=
> + clooginc=
> + ;;
> + esac
> +
> + CFLAGS="${saved_cflags} ${clooginc} ${gmpinc} ${pplinc}"
> + LDFLAGS="${saved_ldflags} ${clooglibs}"
> +]
> +)
> +
> +dnl Version checks for CLooG.org
> +dnl
> +dnl CLOOG_CHECK_VERSION([MAJOR],[MINOR],[REVISION])
> +AC_DEFUN([CLOOG_CHECK_VERSION],
> +[
> + AC_CACHE_CHECK([for verison $1.$2.$3 of CLooG (compile time)],
> + [gcc_cv_cloog_ct_0_14_0],
> + [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG($1,$2,$3)],
> + [gcc_cv_cloog_ct_0_14_0=yes],
> + [gcc_cv_cloog_ct_0_14_0=no])])
> +
> + AC_CACHE_CHECK([for version $1.$2.$3 of CLooG (run time)],
> + [gcc_cv_cloog_rt_0_14_0],
> + [AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
> + [gcc_cv_cloog_rt_0_14_0=yes],
> + [gcc_cv_cloog_rt_0_14_0=no],
> + [gcc_cv_cloog_rt_0_14_0=guessing yes])])
> +]
> +)
> +
> +dnl Version checks for CLooG-Legacy (CLooG-PPL).
> +dnl As this gets removed more sooner than later, don't bother
> +dnl making it variable.
> +AC_DEFUN([CLOOG_CHECK_VERSION_LEGACY],
> +[
> + AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG],
> + [gcc_cv_cloog_ct_0_15_5],
> + [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,5)],
> + [AC_COMPILE_IFELSE([CLOOG_CHECK_CT_PROG(0,15,9)],
I think the fact that this uses revision 9 rather than 5 deserves a
comment, otherwise it reads like a bug. Or, maybe it is a bug?
> + [gcc_cv_cloog_ct_0_15_5=yes],
> + [gcc_cv_cloog_ct_0_15_5=buggy but acceptable])],
> + [gcc_cv_cloog_ct_0_15_5=no])])
> +]
> +)
> +
> +dnl Executes [ACTION-IF-FAILED], if GRAPHITE was requested and
> +dnl the checks failed.
> +dnl
> +dnl CLOOG_IF_FAILED([ACTION-IF-FAILED])
> +AC_DEFUN([CLOOG_IF_FAILED],
> +[
> + CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])dnl
> +
> + if test "${gcc_cv_cloog_ct_0_14_0}" = no \
> + || test "${gcc_cv_cloog_rt_0_14_0}" = no \
> + || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
> + clooglibs=
> + clooginc=
> + fi
> +
> + if test "${graphite_requested}" = yes \
> + && test "x${clooglibs}" = x \
> + && test "x${clooginc}" = x ; then
> + $1
> + fi
> +]
> +)
> --- a/configure.ac
> +++ b/configure.ac
> @@ -28,6 +28,7 @@ m4_include([ltoptions.m4])
> m4_include([ltsugar.m4])
> m4_include([ltversion.m4])
> m4_include([lt~obsolete.m4])
> +m4_include([config/cloog.m4])
>
> AC_INIT(move-if-change)
> AC_PREREQ(2.64)
> @@ -1580,8 +1581,6 @@ AC_SUBST(pplinc)
>
>
> # Check for CLOOG
> -clooglibs=" -lcloog "
> -clooginc=" -DCLOOG_PPL_BACKEND "
>
> AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
> Equivalent to --with-cloog-include=PATH/include
> @@ -1593,50 +1592,41 @@ if test "x$with_ppl" = "xno"; then
> with_cloog=no
> fi
>
> -case $with_cloog in
> - no)
> - clooglibs=
> - clooginc=
> - ;;
> - "" | yes)
> - ;;
> - *)
> - clooglibs="-L$with_cloog/lib -lcloog"
> - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
> - ;;
> -esac
> -if test "x$with_cloog_include" != x; then
> - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
> -fi
> -if test "x$with_cloog_lib" != x; then
> - clooglibs="-L$with_cloog_lib -lcloog"
> -fi
> -if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
> - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
> - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
> - enable_cloog_version_check=no
> -fi
> +CLOOG_INIT_FLAGS()
>
> AC_ARG_ENABLE(cloog-version-check,
> [ --disable-cloog-version-check disable check for CLooG version],
> ENABLE_CLOOG_CHECK=$enableval,
> ENABLE_CLOOG_CHECK=yes)
>
> -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
> - saved_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
> - AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
> - AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
> - choke me
> - #endif
> - ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
> - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
> - choke me
> - #endif
> - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
> - [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
> - CFLAGS="$saved_CFLAGS"
> +if test "x$with_cloog" != "xno"; then
> + saved_cflags=$CFLAGS
> + saved_libs=$LIBS
> + saved_ldflags=$LDFLAGS
> +
> + dnl Detect and set clooginc/clooglibs.
> + dnl Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
> + CLOOG_SET_FLAGS()
> +
> + dnl Version check for CLooG-Org
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = yes ; then
> + CLOOG_CHECK_VERSION(0,14,0)
> + fi
> +
> + dnl Version check for CLooG-PPL (Legacy).
> + if test "${ENABLE_CLOOG_CHECK}" = yes \
> + && test "${cloog_org}" = no ; then
> + CLOOG_CHECK_VERSION_LEGACY()
> + fi
> +
> + dnl Only fails, if GRAPHITE was requested.
> + CLOOG_IF_FAILED([
> + AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])])
> +
> + CFLAGS=$saved_cflags
> + LIBS=$saved_libs
> + LDFLAGS=$saved_ldflags
> fi
>
> # Flags needed for CLOOG
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-24 15:51 ` Paolo Bonzini
@ 2010-11-25 10:29 ` Ralf Wildenhues
0 siblings, 0 replies; 67+ messages in thread
From: Ralf Wildenhues @ 2010-11-25 10:29 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Tobias Grosser, Andreas Schwab, gcc-patches, gcc-graphite
* Paolo Bonzini wrote on Wed, Nov 24, 2010 at 04:12:32PM CET:
> On Wed, Nov 24, 2010 at 15:24, Tobias Grosser wrote:
> > On 11/22/2010 04:29 AM, Andreas Schwab wrote:
> >> Ralf Wildenhues writes:
> >>
> >>>> --- a/config/cloog.m4
> >>>> +++ b/config/cloog.m4
> >>>> @@ -38,10 +38,10 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
> >>>> Â Â Â Â [Specify the directory for the installed CLooG library])])
> >>>>
> >>>> Â Â AC_ARG_ENABLE(cloog-backend,
> >>>> - Â Â [ Â --enable-cloog-backend[=backend]
> >>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â isl: The cloog.org isl backend
> >>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ppl-legacy: The legacy ppl backend -
> >>>> default
> >>>> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ppl: The cloog.org ppl backend],
> >>>> + Â Â [AS_HELP_STRING(
> >>>> + Â Â Â [--enable-cloog-backend[=backend]],
> >>>
> >>> Please use either
> >>> Â Â Â Â Â [--enable-cloog-backend[[=BACKEND]]],
> >>
> >> IMHO this is better (the whole argument is a fixed string):
> >>
> >> Â Â Â Â Â Â [[--enable-cloog-backend[=BACKEND]]],
> >
> > I just tried this and autoconf is generating the exact same configure file
> > for this. Do you want me to change it anyways?
>
> I have no preference, but I'll let Ralf and/or Andreas decide.
Oh, I don't have a strong preference either way either. I guess maximal
quoting is probably a bit more consistent, but I'm not sure I would
invest a lot of time into making the GCC code base very consistent here.
If somebody else wants to do that (in stage 1) however ...
So yes, I'm fine with making the change, if you also sync to src.
Thanks,
Ralf
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-24 15:49 ` Tobias Grosser
@ 2010-11-24 15:51 ` Paolo Bonzini
2010-11-25 10:29 ` Ralf Wildenhues
0 siblings, 1 reply; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-24 15:51 UTC (permalink / raw)
To: Tobias Grosser; +Cc: Andreas Schwab, Ralf Wildenhues, gcc-patches, gcc-graphite
On Wed, Nov 24, 2010 at 15:24, Tobias Grosser <grosser@fim.uni-passau.de> wrote:
> On 11/22/2010 04:29 AM, Andreas Schwab wrote:
>>
>> Ralf Wildenhues<Ralf.Wildenhues@gmx.de> writes:
>>
>>>> --- a/config/cloog.m4
>>>> +++ b/config/cloog.m4
>>>> @@ -38,10 +38,10 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
>>>> [Specify the directory for the installed CLooG library])])
>>>>
>>>> AC_ARG_ENABLE(cloog-backend,
>>>> - [ --enable-cloog-backend[=backend]
>>>> - isl: The cloog.org isl backend
>>>> - ppl-legacy: The legacy ppl backend -
>>>> default
>>>> - ppl: The cloog.org ppl backend],
>>>> + [AS_HELP_STRING(
>>>> + [--enable-cloog-backend[=backend]],
>>>
>>> Please use either
>>> [--enable-cloog-backend[[=BACKEND]]],
>>
>> IMHO this is better (the whole argument is a fixed string):
>>
>> [[--enable-cloog-backend[=BACKEND]]],
>
> I just tried this and autoconf is generating the exact same configure file
> for this. Do you want me to change it anyways?
I have no preference, but I'll let Ralf and/or Andreas decide.
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-22 11:17 ` Andreas Schwab
@ 2010-11-24 15:49 ` Tobias Grosser
2010-11-24 15:51 ` Paolo Bonzini
0 siblings, 1 reply; 67+ messages in thread
From: Tobias Grosser @ 2010-11-24 15:49 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Ralf Wildenhues, Paolo Bonzini, gcc-patches, gcc-graphite
On 11/22/2010 04:29 AM, Andreas Schwab wrote:
> Ralf Wildenhues<Ralf.Wildenhues@gmx.de> writes:
>
>>> --- a/config/cloog.m4
>>> +++ b/config/cloog.m4
>>> @@ -38,10 +38,10 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
>>> [Specify the directory for the installed CLooG library])])
>>>
>>> AC_ARG_ENABLE(cloog-backend,
>>> - [ --enable-cloog-backend[=backend]
>>> - isl: The cloog.org isl backend
>>> - ppl-legacy: The legacy ppl backend - default
>>> - ppl: The cloog.org ppl backend],
>>> + [AS_HELP_STRING(
>>> + [--enable-cloog-backend[=backend]],
>>
>> Please use either
>> [--enable-cloog-backend[[=BACKEND]]],
>
> IMHO this is better (the whole argument is a fixed string):
>
> [[--enable-cloog-backend[=BACKEND]]],
I just tried this and autoconf is generating the exact same configure
file for this. Do you want me to change it anyways?
Cheers
Tobi
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-19 21:30 ` Ralf Wildenhues
@ 2010-11-22 11:17 ` Andreas Schwab
2010-11-24 15:49 ` Tobias Grosser
0 siblings, 1 reply; 67+ messages in thread
From: Andreas Schwab @ 2010-11-22 11:17 UTC (permalink / raw)
To: Ralf Wildenhues; +Cc: Tobias Grosser, Paolo Bonzini, gcc-patches, gcc-graphite
Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
>> --- a/config/cloog.m4
>> +++ b/config/cloog.m4
>> @@ -38,10 +38,10 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
>> [Specify the directory for the installed CLooG library])])
>>
>> AC_ARG_ENABLE(cloog-backend,
>> - [ --enable-cloog-backend[=backend]
>> - isl: The cloog.org isl backend
>> - ppl-legacy: The legacy ppl backend - default
>> - ppl: The cloog.org ppl backend],
>> + [AS_HELP_STRING(
>> + [--enable-cloog-backend[=backend]],
>
> Please use either
> [--enable-cloog-backend[[=BACKEND]]],
IMHO this is better (the whole argument is a fixed string):
[[--enable-cloog-backend[=BACKEND]]],
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-19 20:22 ` Tobias Grosser
@ 2010-11-19 21:30 ` Ralf Wildenhues
2010-11-22 11:17 ` Andreas Schwab
0 siblings, 1 reply; 67+ messages in thread
From: Ralf Wildenhues @ 2010-11-19 21:30 UTC (permalink / raw)
To: Tobias Grosser; +Cc: Andreas Schwab, Paolo Bonzini, gcc-patches, gcc-graphite
* Tobias Grosser wrote on Fri, Nov 19, 2010 at 08:30:16PM CET:
> On 11/15/2010 10:54 AM, Andreas Schwab wrote:
> >Tobias Grosser writes:
> >>--- a/config/cloog.m4
> >>+++ b/config/cloog.m4
> >>@@ -36,7 +36,19 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
> >> [AS_HELP_STRING(
> >> [--with-cloog-lib=PATH],
> >> [Specify the directory for the installed CLooG library])])
> >>-
> >>+
> >>+ AC_ARG_ENABLE(cloog-backend,
> >>+ [ --enable-cloog-backend[=backend]
> >>+ isl: The cloog.org isl backend
> >>+ ppl-legacy: The legacy ppl backend - default
> >>+ ppl: The cloog.org ppl backend],
> >
> >The help string should explain what the option does, referring to the
> >option argument (which should be written in upper case).
> OK to commit?
OK with nits addressed.
Thanks,
Ralf
> Subject: [PATCH] config/cloog.m4: Use AS_HELP_STRING and fix description
> --- a/config/cloog.m4
> +++ b/config/cloog.m4
> @@ -38,10 +38,10 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
> [Specify the directory for the installed CLooG library])])
>
> AC_ARG_ENABLE(cloog-backend,
> - [ --enable-cloog-backend[=backend]
> - isl: The cloog.org isl backend
> - ppl-legacy: The legacy ppl backend - default
> - ppl: The cloog.org ppl backend],
> + [AS_HELP_STRING(
> + [--enable-cloog-backend[=backend]],
Please use either
[--enable-cloog-backend[[=BACKEND]]],
or
[--enable-cloog-backend@<:@=BACKEND@:>@],
so the brackets are rendered in the output. Please upper-case only the
metasyntactic variables, not the actual values that are to be used:
> + [Set the CLooG backend used to either ISL, PPL or PPL-LEGACY.
> + If not specified PPL-LEGACY is selected.])],
Also, I think messages should not be capitalized nor end with period;
and, since they get refilled anyway, you could shorten, e.g.:
[set the CLooG BACKEND used to either isl, ppl, or ppl-legacy
(default)])],
Please run autoconf and ./configure --help to check for sane output
before committing. Thanks.
> [ if test "x${enableval}" = "xisl"; then
> cloog_backend=isl
> elif test "x${enableval}" = "xppl"; then
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-15 16:41 ` Andreas Schwab
@ 2010-11-19 20:22 ` Tobias Grosser
2010-11-19 21:30 ` Ralf Wildenhues
0 siblings, 1 reply; 67+ messages in thread
From: Tobias Grosser @ 2010-11-19 20:22 UTC (permalink / raw)
To: Andreas Schwab
Cc: Paolo Bonzini, Sven Verdoolaege, Jack Howarth, Joseph S. Myers,
Sebastian Pop, Andreas Simbürger, gcc-patches, gcc-graphite
[-- Attachment #1: Type: text/plain, Size: 919 bytes --]
On 11/15/2010 10:54 AM, Andreas Schwab wrote:
> Tobias Grosser<grosser@fim.uni-passau.de> writes:
>
>> diff --git a/config/cloog.m4 b/config/cloog.m4
>> index 6ed0f1b..4936e8a 100644
>> --- a/config/cloog.m4
>> +++ b/config/cloog.m4
>> @@ -36,7 +36,19 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
>> [AS_HELP_STRING(
>> [--with-cloog-lib=PATH],
>> [Specify the directory for the installed CLooG library])])
>> -
>> +
>> + AC_ARG_ENABLE(cloog-backend,
>> + [ --enable-cloog-backend[=backend]
>> + isl: The cloog.org isl backend
>> + ppl-legacy: The legacy ppl backend - default
>> + ppl: The cloog.org ppl backend],
>
> The help string should explain what the option does, referring to the
> option argument (which should be written in upper case).
Andreas,
I propose the attached patch to address your comments.
* config/cloog.m4: Use AS_HELP_STRING and fix description.
OK to commit?
Tobi
[-- Attachment #2: 0001-config-cloog.m4-Use-AS_HELP_STRING-and-fix-descripti.patch --]
[-- Type: text/x-diff, Size: 1842 bytes --]
From be959d16334626e12238e6e3119635b48cc6b087 Mon Sep 17 00:00:00 2001
From: Tobias Grosser <grosser@fim.uni-passau.de>
Date: Fri, 19 Nov 2010 14:27:31 -0500
Subject: [PATCH] config/cloog.m4: Use AS_HELP_STRING and fix description
---
config/cloog.m4 | 8 ++++----
configure | 5 ++---
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/config/cloog.m4 b/config/cloog.m4
index 96ebd4d..2a846cf 100644
--- a/config/cloog.m4
+++ b/config/cloog.m4
@@ -38,10 +38,10 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
[Specify the directory for the installed CLooG library])])
AC_ARG_ENABLE(cloog-backend,
- [ --enable-cloog-backend[=backend]
- isl: The cloog.org isl backend
- ppl-legacy: The legacy ppl backend - default
- ppl: The cloog.org ppl backend],
+ [AS_HELP_STRING(
+ [--enable-cloog-backend[=backend]],
+ [Set the CLooG backend used to either ISL, PPL or PPL-LEGACY.
+ If not specified PPL-LEGACY is selected.])],
[ if test "x${enableval}" = "xisl"; then
cloog_backend=isl
elif test "x${enableval}" = "xppl"; then
diff --git a/configure b/configure
index b1235c2..1d1993d 100755
--- a/configure
+++ b/configure
@@ -1453,9 +1453,8 @@ Optional Features:
--enable-build-with-cxx build with C++ compiler instead of C compiler
--disable-ppl-version-check disable check for PPL version
--enable-cloog-backend=backend
- isl: The cloog.org isl backend
- ppl-legacy: The legacy ppl backend - default
- ppl: The cloog.org ppl backend
+ Set the CLooG backend used to either ISL, PPL or
+ PPL-LEGACY. If not specified PPL-LEGACY is selected.
--disable-cloog-version-check
disable check for CLooG version
--enable-lto enable link time optimization support
--
1.7.1
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-15 16:23 ` Paolo Bonzini
@ 2010-11-15 16:48 ` Andreas Schwab
2010-11-15 16:48 ` Paolo Bonzini
0 siblings, 1 reply; 67+ messages in thread
From: Andreas Schwab @ 2010-11-15 16:48 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Andreas Simbürger, gcc-patches, gcc-graphite
Paolo Bonzini <bonzini@gnu.org> writes:
> On 11/15/2010 04:38 PM, Andreas Schwab wrote:
>>> > + AC_ARG_WITH(cloog_include,
>> The option is called --with-cloog-include, not --with-cloog_include.
>>
>>> > + AC_ARG_WITH(cloog_lib,
>> Likewise.
>
> I noticed the same, but since it doesn't matter (either works) and
> other AC_ARG_WITH invocations are using underscores,
2010-11-15 Andreas Schwab <schwab@redhat.com>
* configure.ac: Fix spelling in option names.
* configure: Regenerated.
config/:
* cloog.m4 (CLOOG_INIT_FLAGS): Fix spelling in option names.
Index: configure.ac
===================================================================
--- configure.ac (revision 166757)
+++ configure.ac (working copy)
@@ -1273,9 +1273,9 @@
AC_ARG_WITH(mpc, [ --with-mpc=PATH specify prefix directory for installed MPC package.
Equivalent to --with-mpc-include=PATH/include
plus --with-mpc-lib=PATH/lib])
-AC_ARG_WITH(mpc_include, [ --with-mpc-include=PATH
+AC_ARG_WITH(mpc-include, [ --with-mpc-include=PATH
specify directory for installed MPC include files])
-AC_ARG_WITH(mpc_lib, [ --with-mpc-lib=PATH specify directory for the installed MPC library])
+AC_ARG_WITH(mpc-lib, [ --with-mpc-lib=PATH specify directory for the installed MPC library])
if test "x$with_mpc" != x; then
gmplibs="-L$with_mpc/lib $gmplibs"
@@ -1306,9 +1306,9 @@
AC_ARG_WITH(mpfr, [ --with-mpfr=PATH specify prefix directory for installed MPFR package.
Equivalent to --with-mpfr-include=PATH/include
plus --with-mpfr-lib=PATH/lib])
-AC_ARG_WITH(mpfr_include, [ --with-mpfr-include=PATH
+AC_ARG_WITH(mpfr-include, [ --with-mpfr-include=PATH
specify directory for installed MPFR include files])
-AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH specify directory for the installed MPFR library])
+AC_ARG_WITH(mpfr-lib, [ --with-mpfr-lib=PATH specify directory for the installed MPFR library])
if test "x$with_mpfr" != x; then
gmplibs="-L$with_mpfr/lib $gmplibs"
@@ -1339,8 +1339,8 @@
AC_ARG_WITH(gmp, [ --with-gmp=PATH specify prefix directory for the installed GMP package.
Equivalent to --with-gmp-include=PATH/include
plus --with-gmp-lib=PATH/lib])
-AC_ARG_WITH(gmp_include, [ --with-gmp-include=PATH specify directory for installed GMP include files])
-AC_ARG_WITH(gmp_lib, [ --with-gmp-lib=PATH specify directory for the installed GMP library])
+AC_ARG_WITH(gmp-include, [ --with-gmp-include=PATH specify directory for installed GMP include files])
+AC_ARG_WITH(gmp-lib, [ --with-gmp-lib=PATH specify directory for the installed GMP library])
if test "x$with_gmp" != x; then
@@ -1539,8 +1539,8 @@
AC_ARG_WITH(ppl, [ --with-ppl=PATH Specify prefix directory for the installed PPL package
Equivalent to --with-ppl-include=PATH/include
plus --with-ppl-lib=PATH/lib])
-AC_ARG_WITH(ppl_include, [ --with-ppl-include=PATH Specify directory for installed PPL include files])
-AC_ARG_WITH(ppl_lib, [ --with-ppl-lib=PATH Specify the directory for the installed PPL library])
+AC_ARG_WITH(ppl-include, [ --with-ppl-include=PATH Specify directory for installed PPL include files])
+AC_ARG_WITH(ppl-lib, [ --with-ppl-lib=PATH Specify the directory for the installed PPL library])
case $with_ppl in
no)
Index: config/cloog.m4
===================================================================
--- config/cloog.m4 (revision 166757)
+++ config/cloog.m4 (working copy)
@@ -28,11 +28,11 @@
[Specify prefix directory for the installed CLooG-PPL package.
Equivalent to --with-cloog-include=PATH/include
plus --with-cloog-lib=PATH/lib])])
- AC_ARG_WITH(cloog_include,
+ AC_ARG_WITH([cloog-include],
[AS_HELP_STRING(
[--with-cloog-include=PATH],
[Specify directory for installed CLooG include files])])
- AC_ARG_WITH(cloog_lib,
+ AC_ARG_WITH([cloog-lib],
[AS_HELP_STRING(
[--with-cloog-lib=PATH],
[Specify the directory for the installed CLooG library])])
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-15 16:48 ` Andreas Schwab
@ 2010-11-15 16:48 ` Paolo Bonzini
0 siblings, 0 replies; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-15 16:48 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Andreas Simbürger, gcc-patches, gcc-graphite
On 11/15/2010 05:22 PM, Andreas Schwab wrote:
> Paolo Bonzini<bonzini@gnu.org> writes:
>
>> On 11/15/2010 04:38 PM, Andreas Schwab wrote:
>>>>> + AC_ARG_WITH(cloog_include,
>>> The option is called --with-cloog-include, not --with-cloog_include.
>>>
>>>>> + AC_ARG_WITH(cloog_lib,
>>> Likewise.
>>
>> I noticed the same, but since it doesn't matter (either works) and
>> other AC_ARG_WITH invocations are using underscores,
>
> 2010-11-15 Andreas Schwab<schwab@redhat.com>
>
> * configure.ac: Fix spelling in option names.
> * configure: Regenerated.
>
> config/:
> * cloog.m4 (CLOOG_INIT_FLAGS): Fix spelling in option names.
>
>
> Index: configure.ac
> ===================================================================
> --- configure.ac (revision 166757)
> +++ configure.ac (working copy)
> @@ -1273,9 +1273,9 @@
> AC_ARG_WITH(mpc, [ --with-mpc=PATH specify prefix directory for installed MPC package.
> Equivalent to --with-mpc-include=PATH/include
> plus --with-mpc-lib=PATH/lib])
> -AC_ARG_WITH(mpc_include, [ --with-mpc-include=PATH
> +AC_ARG_WITH(mpc-include, [ --with-mpc-include=PATH
> specify directory for installed MPC include files])
> -AC_ARG_WITH(mpc_lib, [ --with-mpc-lib=PATH specify directory for the installed MPC library])
> +AC_ARG_WITH(mpc-lib, [ --with-mpc-lib=PATH specify directory for the installed MPC library])
>
> if test "x$with_mpc" != x; then
> gmplibs="-L$with_mpc/lib $gmplibs"
> @@ -1306,9 +1306,9 @@
> AC_ARG_WITH(mpfr, [ --with-mpfr=PATH specify prefix directory for installed MPFR package.
> Equivalent to --with-mpfr-include=PATH/include
> plus --with-mpfr-lib=PATH/lib])
> -AC_ARG_WITH(mpfr_include, [ --with-mpfr-include=PATH
> +AC_ARG_WITH(mpfr-include, [ --with-mpfr-include=PATH
> specify directory for installed MPFR include files])
> -AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=PATH specify directory for the installed MPFR library])
> +AC_ARG_WITH(mpfr-lib, [ --with-mpfr-lib=PATH specify directory for the installed MPFR library])
>
> if test "x$with_mpfr" != x; then
> gmplibs="-L$with_mpfr/lib $gmplibs"
> @@ -1339,8 +1339,8 @@
> AC_ARG_WITH(gmp, [ --with-gmp=PATH specify prefix directory for the installed GMP package.
> Equivalent to --with-gmp-include=PATH/include
> plus --with-gmp-lib=PATH/lib])
> -AC_ARG_WITH(gmp_include, [ --with-gmp-include=PATH specify directory for installed GMP include files])
> -AC_ARG_WITH(gmp_lib, [ --with-gmp-lib=PATH specify directory for the installed GMP library])
> +AC_ARG_WITH(gmp-include, [ --with-gmp-include=PATH specify directory for installed GMP include files])
> +AC_ARG_WITH(gmp-lib, [ --with-gmp-lib=PATH specify directory for the installed GMP library])
>
>
> if test "x$with_gmp" != x; then
> @@ -1539,8 +1539,8 @@
> AC_ARG_WITH(ppl, [ --with-ppl=PATH Specify prefix directory for the installed PPL package
> Equivalent to --with-ppl-include=PATH/include
> plus --with-ppl-lib=PATH/lib])
> -AC_ARG_WITH(ppl_include, [ --with-ppl-include=PATH Specify directory for installed PPL include files])
> -AC_ARG_WITH(ppl_lib, [ --with-ppl-lib=PATH Specify the directory for the installed PPL library])
> +AC_ARG_WITH(ppl-include, [ --with-ppl-include=PATH Specify directory for installed PPL include files])
> +AC_ARG_WITH(ppl-lib, [ --with-ppl-lib=PATH Specify the directory for the installed PPL library])
>
> case $with_ppl in
> no)
> Index: config/cloog.m4
> ===================================================================
> --- config/cloog.m4 (revision 166757)
> +++ config/cloog.m4 (working copy)
> @@ -28,11 +28,11 @@
> [Specify prefix directory for the installed CLooG-PPL package.
> Equivalent to --with-cloog-include=PATH/include
> plus --with-cloog-lib=PATH/lib])])
> - AC_ARG_WITH(cloog_include,
> + AC_ARG_WITH([cloog-include],
> [AS_HELP_STRING(
> [--with-cloog-include=PATH],
> [Specify directory for installed CLooG include files])])
> - AC_ARG_WITH(cloog_lib,
> + AC_ARG_WITH([cloog-lib],
> [AS_HELP_STRING(
> [--with-cloog-lib=PATH],
> [Specify the directory for the installed CLooG library])])
>
OK
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 20:37 ` Tobias Grosser
` (2 preceding siblings ...)
2010-11-15 15:55 ` Andreas Schwab
@ 2010-11-15 16:41 ` Andreas Schwab
2010-11-19 20:22 ` Tobias Grosser
3 siblings, 1 reply; 67+ messages in thread
From: Andreas Schwab @ 2010-11-15 16:41 UTC (permalink / raw)
To: Tobias Grosser
Cc: Paolo Bonzini, Sven Verdoolaege, Jack Howarth, Joseph S. Myers,
Sebastian Pop, Andreas Simbürger, gcc-patches, gcc-graphite
Tobias Grosser <grosser@fim.uni-passau.de> writes:
> diff --git a/config/cloog.m4 b/config/cloog.m4
> index 6ed0f1b..4936e8a 100644
> --- a/config/cloog.m4
> +++ b/config/cloog.m4
> @@ -36,7 +36,19 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
> [AS_HELP_STRING(
> [--with-cloog-lib=PATH],
> [Specify the directory for the installed CLooG library])])
> -
> +
> + AC_ARG_ENABLE(cloog-backend,
> + [ --enable-cloog-backend[=backend]
> + isl: The cloog.org isl backend
> + ppl-legacy: The legacy ppl backend - default
> + ppl: The cloog.org ppl backend],
The help string should explain what the option does, referring to the
option argument (which should be written in upper case).
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-15 15:52 ` Andreas Schwab
@ 2010-11-15 16:23 ` Paolo Bonzini
2010-11-15 16:48 ` Andreas Schwab
0 siblings, 1 reply; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-15 16:23 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Andreas Simbürger, gcc-patches, gcc-graphite
On 11/15/2010 04:38 PM, Andreas Schwab wrote:
>> > + AC_ARG_WITH(cloog_include,
> The option is called --with-cloog-include, not --with-cloog_include.
>
>> > + AC_ARG_WITH(cloog_lib,
> Likewise.
I noticed the same, but since it doesn't matter (either works) and other
AC_ARG_WITH invocations are using underscores, I didn't point that out
for consistency.
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 20:06 ` Andreas Simbürger
2010-11-11 20:39 ` Paolo Bonzini
2010-11-15 15:52 ` Andreas Schwab
@ 2010-11-15 15:55 ` Andreas Schwab
2 siblings, 0 replies; 67+ messages in thread
From: Andreas Schwab @ 2010-11-15 15:55 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-patches, gcc-graphite, bonzini
Andreas Simbürger <simbuerg@googlemail.com> writes:
> + AC_ARG_WITH(cloog,
> + [AS_HELP_STRING(
> + [--with-cloog=PATH],
> + [Specify prefix directory for the installed CLooG-PPL package.
The help string should start with lower case.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 20:37 ` Tobias Grosser
2010-11-12 21:00 ` Jack Howarth
2010-11-12 21:01 ` Paolo Bonzini
@ 2010-11-15 15:55 ` Andreas Schwab
2010-11-15 16:41 ` Andreas Schwab
3 siblings, 0 replies; 67+ messages in thread
From: Andreas Schwab @ 2010-11-15 15:55 UTC (permalink / raw)
To: Tobias Grosser
Cc: Paolo Bonzini, Sven Verdoolaege, Jack Howarth, Joseph S. Myers,
Sebastian Pop, Andreas Simbürger, gcc-patches, gcc-graphite
Tobias Grosser <grosser@fim.uni-passau.de> writes:
> diff --git a/config/cloog.m4 b/config/cloog.m4
> index 6ed0f1b..4936e8a 100644
> --- a/config/cloog.m4
> +++ b/config/cloog.m4
> @@ -36,7 +36,19 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
> [AS_HELP_STRING(
> [--with-cloog-lib=PATH],
> [Specify the directory for the installed CLooG library])])
> -
> +
> + AC_ARG_ENABLE(cloog-backend,
> + [ --enable-cloog-backend[=backend]
> + isl: The cloog.org isl backend
> + ppl-legacy: The legacy ppl backend - default
> + ppl: The cloog.org ppl backend],
Please use AS_HELP_STRING.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 20:06 ` Andreas Simbürger
2010-11-11 20:39 ` Paolo Bonzini
@ 2010-11-15 15:52 ` Andreas Schwab
2010-11-15 16:23 ` Paolo Bonzini
2010-11-15 15:55 ` Andreas Schwab
2 siblings, 1 reply; 67+ messages in thread
From: Andreas Schwab @ 2010-11-15 15:52 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-patches, gcc-graphite, bonzini
Andreas Simbürger <simbuerg@googlemail.com> writes:
> + AC_ARG_WITH(cloog_include,
The option is called --with-cloog-include, not --with-cloog_include.
> + AC_ARG_WITH(cloog_lib,
Likewise.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 22:31 ` Jack Howarth
@ 2010-11-12 22:41 ` Tobias Grosser
0 siblings, 0 replies; 67+ messages in thread
From: Tobias Grosser @ 2010-11-12 22:41 UTC (permalink / raw)
To: Jack Howarth
Cc: Paolo Bonzini, Sven Verdoolaege, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On 11/12/2010 05:08 PM, Jack Howarth wrote:
> On Fri, Nov 12, 2010 at 09:42:38PM +0100, Paolo Bonzini wrote:
>> On 11/12/2010 09:39 PM, Jack Howarth wrote:
>>> Tobi,
>>> I am still a tad concerned about the ABI change between ppl 0.10.x and
>>> 0.11. Is it certain that, for the combination of FSF gcc built against ppl 0.11
>>> and cloog-ppl built against ppl 0.10.x, there are no ppl data structures
>>> passed on the cloog calls between graphite and cloog? If not, might there
>>> be issues if the ABI changes in ppl impacted those data structures?
>>
>> Hopefully that would fail to link due to multiply-defined names? Maybe
>> not on Mac OS X due to two-level namespacing, in any case if somebody
>> wants to experiment with this scenario that's welcome.
>>
>> Paolo
>
> Paolo,
> I did a quick test build of gcc trunk against ppl 0.11 and a legacy cloog-ppl
> built against ppl 0.10.2 on x86_64-apple-darwin10. This produced binaries with
> linkages of...
>
> [MacPro:gcc/x86_64-apple-darwin10.5.0/4.6.0] howarth% otool -L cc1
> cc1:
> /sw/lib/libintl.8.dylib (compatibility version 9.0.0, current version 9.2.0)
> /sw/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
> /sw/lib/libcloog.0.dylib (compatibility version 1.0.0, current version 1.0.0)
> /sw/lib/libppl_c.4.dylib (compatibility version 5.0.0, current version 5.0.0)
> /sw/lib/libppl.9.dylib (compatibility version 10.0.0, current version 10.0.0)
> /sw/lib/libgmpxx.4.dylib (compatibility version 6.0.0, current version 6.2.0)
> /sw/lib/libmpc.2.dylib (compatibility version 3.0.0, current version 3.0.0)
> /sw/lib/libmpfr.1.dylib (compatibility version 4.0.0, current version 4.2.0)
> /sw/lib/libgmp.3.dylib (compatibility version 9.0.0, current version 9.2.0)
> /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
> /sw/lib/gcc4.6/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)
>
> and
>
> [MacPro:gcc/x86_64-apple-darwin10.5.0/4.6.0] howarth% otool -L /sw/lib/libcloog.0.dylib
> /sw/lib/libcloog.0.dylib:
> /sw/lib/libcloog.0.dylib (compatibility version 1.0.0, current version 1.0.0)
> /sw/lib/libgmp.3.dylib (compatibility version 9.0.0, current version 9.2.0)
> /sw/lib/libppl_c.2.dylib (compatibility version 4.0.0, current version 4.0.0)
> /sw/lib/libppl.7.dylib (compatibility version 9.0.0, current version 9.0.0)
> /sw/lib/libgmpxx.4.dylib (compatibility version 6.0.0, current version 6.2.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
>
> Executing...
>
> make -k check RUNTESTFLAGS="graphite.exp --target_board=unix'{-m32,-m64}'"
>
> showed no regressions. So either the cloog calls aren't passing ppl data structures
> or those haven't changed with the ABI changes.
We do not pass any ppl data structures. So there should not be any
problem, right?
Cheers
Tobi
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 21:02 ` Paolo Bonzini
2010-11-12 21:22 ` Jack Howarth
@ 2010-11-12 22:31 ` Jack Howarth
2010-11-12 22:41 ` Tobias Grosser
1 sibling, 1 reply; 67+ messages in thread
From: Jack Howarth @ 2010-11-12 22:31 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Tobias Grosser, Sven Verdoolaege, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On Fri, Nov 12, 2010 at 09:42:38PM +0100, Paolo Bonzini wrote:
> On 11/12/2010 09:39 PM, Jack Howarth wrote:
>> Tobi,
>> I am still a tad concerned about the ABI change between ppl 0.10.x and
>> 0.11. Is it certain that, for the combination of FSF gcc built against ppl 0.11
>> and cloog-ppl built against ppl 0.10.x, there are no ppl data structures
>> passed on the cloog calls between graphite and cloog? If not, might there
>> be issues if the ABI changes in ppl impacted those data structures?
>
> Hopefully that would fail to link due to multiply-defined names? Maybe
> not on Mac OS X due to two-level namespacing, in any case if somebody
> wants to experiment with this scenario that's welcome.
>
> Paolo
Paolo,
I did a quick test build of gcc trunk against ppl 0.11 and a legacy cloog-ppl
built against ppl 0.10.2 on x86_64-apple-darwin10. This produced binaries with
linkages of...
[MacPro:gcc/x86_64-apple-darwin10.5.0/4.6.0] howarth% otool -L cc1
cc1:
/sw/lib/libintl.8.dylib (compatibility version 9.0.0, current version 9.2.0)
/sw/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/sw/lib/libcloog.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/sw/lib/libppl_c.4.dylib (compatibility version 5.0.0, current version 5.0.0)
/sw/lib/libppl.9.dylib (compatibility version 10.0.0, current version 10.0.0)
/sw/lib/libgmpxx.4.dylib (compatibility version 6.0.0, current version 6.2.0)
/sw/lib/libmpc.2.dylib (compatibility version 3.0.0, current version 3.0.0)
/sw/lib/libmpfr.1.dylib (compatibility version 4.0.0, current version 4.2.0)
/sw/lib/libgmp.3.dylib (compatibility version 9.0.0, current version 9.2.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/sw/lib/gcc4.6/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)
and
[MacPro:gcc/x86_64-apple-darwin10.5.0/4.6.0] howarth% otool -L /sw/lib/libcloog.0.dylib
/sw/lib/libcloog.0.dylib:
/sw/lib/libcloog.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/sw/lib/libgmp.3.dylib (compatibility version 9.0.0, current version 9.2.0)
/sw/lib/libppl_c.2.dylib (compatibility version 4.0.0, current version 4.0.0)
/sw/lib/libppl.7.dylib (compatibility version 9.0.0, current version 9.0.0)
/sw/lib/libgmpxx.4.dylib (compatibility version 6.0.0, current version 6.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
Executing...
make -k check RUNTESTFLAGS="graphite.exp --target_board=unix'{-m32,-m64}'"
showed no regressions. So either the cloog calls aren't passing ppl data structures
or those haven't changed with the ABI changes.
Jack
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 21:02 ` Paolo Bonzini
@ 2010-11-12 21:22 ` Jack Howarth
2010-11-12 22:31 ` Jack Howarth
1 sibling, 0 replies; 67+ messages in thread
From: Jack Howarth @ 2010-11-12 21:22 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Tobias Grosser, Sven Verdoolaege, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On Fri, Nov 12, 2010 at 09:42:38PM +0100, Paolo Bonzini wrote:
> On 11/12/2010 09:39 PM, Jack Howarth wrote:
>> Tobi,
>> I am still a tad concerned about the ABI change between ppl 0.10.x and
>> 0.11. Is it certain that, for the combination of FSF gcc built against ppl 0.11
>> and cloog-ppl built against ppl 0.10.x, there are no ppl data structures
>> passed on the cloog calls between graphite and cloog? If not, might there
>> be issues if the ABI changes in ppl impacted those data structures?
>
> Hopefully that would fail to link due to multiply-defined names? Maybe
> not on Mac OS X due to two-level namespacing, in any case if somebody
> wants to experiment with this scenario that's welcome.
>
> Paolo
Paolo,
Well originally I had proposed that this issue be avoided by having
legacy cloog-ppl only build against ppl 0.10.x and FSF gcc 4.6 require
ppl 0.11.
http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01033.html
Unfortunately cloog-ppl 0.15.10 apparently added support for ppl 0.11
(although I can't get that release to build due to autogeneration problems).
Jack
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 21:00 ` Jack Howarth
@ 2010-11-12 21:02 ` Paolo Bonzini
2010-11-12 21:22 ` Jack Howarth
2010-11-12 22:31 ` Jack Howarth
0 siblings, 2 replies; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-12 21:02 UTC (permalink / raw)
To: Jack Howarth
Cc: Tobias Grosser, Sven Verdoolaege, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On 11/12/2010 09:39 PM, Jack Howarth wrote:
> Tobi,
> I am still a tad concerned about the ABI change between ppl 0.10.x and
> 0.11. Is it certain that, for the combination of FSF gcc built against ppl 0.11
> and cloog-ppl built against ppl 0.10.x, there are no ppl data structures
> passed on the cloog calls between graphite and cloog? If not, might there
> be issues if the ABI changes in ppl impacted those data structures?
Hopefully that would fail to link due to multiply-defined names? Maybe
not on Mac OS X due to two-level namespacing, in any case if somebody
wants to experiment with this scenario that's welcome.
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 20:37 ` Tobias Grosser
2010-11-12 21:00 ` Jack Howarth
@ 2010-11-12 21:01 ` Paolo Bonzini
2010-11-15 15:55 ` Andreas Schwab
2010-11-15 16:41 ` Andreas Schwab
3 siblings, 0 replies; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-12 21:01 UTC (permalink / raw)
To: Tobias Grosser
Cc: Sven Verdoolaege, Jack Howarth, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On 11/12/2010 09:15 PM, Tobias Grosser wrote:
>
>
> I committed this patch and propose two more.
>
> * Use a CLooG header macro to check for the PPL Legacy backend
>
> Without that patch the PPL Legacy backend may be detected, even if only
> includes of CLooG ORG are in the path, but the cloog-ppl library is
> still in the system library directory.
Nice, thanks.
> * Addition of --enable-cloog-backend
>
> Implemented as you suggested. Now by default we use
> --enable-cloog-backend=ppl-legacy
> All other CLooG backends will fail configure. To use another backend
> this has to be defined explicitly by setting --enable-cloog-backend=isl
> or --enable-cloog-backend=ppl
>
> Could you have a look?
This is okay assuming you tested the patches with all three backends,
and all had the correct outcome (if failing to compile GCC is one of
those outcomes that's fine, but I'd like to know).
I understand you plan to drop ppl-legacy support code from the compiler,
do you plan to support both isl and ppl in the future?
In any case --enable-cloog-backend is needed for the transition, so the
patch is okay even if it will disappear before 4.6. It is also okay, if
you want, to commit it with isl default.
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 20:37 ` Tobias Grosser
@ 2010-11-12 21:00 ` Jack Howarth
2010-11-12 21:02 ` Paolo Bonzini
2010-11-12 21:01 ` Paolo Bonzini
` (2 subsequent siblings)
3 siblings, 1 reply; 67+ messages in thread
From: Jack Howarth @ 2010-11-12 21:00 UTC (permalink / raw)
To: Tobias Grosser
Cc: Paolo Bonzini, Sven Verdoolaege, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On Fri, Nov 12, 2010 at 03:15:58PM -0500, Tobias Grosser wrote:
> On 11/12/2010 12:06 PM, Paolo Bonzini wrote:
>> On 11/12/2010 05:14 PM, Tobias Grosser wrote:
>>> CLooG isl will in some cases generate different code. This is why we
>>> currently have support for both CLooG versions. Our first tests did not
>>> show any new SPEC suite failures, but we still want to run more tests
>>> with different optimization flags and on even more platforms. We push
>>> that patch upstream, such that people like Jack can test CLooG with
>>> CLooG-isl on their platform. (Even if it was not intended they hit such
>>> a simple configure bug)
>>
>> Yes, the bug that Jack found is not a major problem.
>>
>> The main problem is the different generated code; in particular, it's
>> not about failures, _any_ assembly code difference resulting from the
>> same configure options is problematic. Can you make a patch to ensure
>> that only one backend is sought for, depending on the user's choice
>> between --enable-cloog-backend=ppl and --enable-cloog-backend=isl (you
>> choose the default)?
>>
>> To some extent, this is unavoidable when we are delegating optimization
>> choices to an external library, but we should minimize the differences.
>> It is probably necessary to have the version of cloog (and its
>> dependencies whenever applicable) printed as part of the output of "gcc
>> --version".
>>
>> Still, the patch is okay. :)
>
> Thanks Paolo,
>
> I committed this patch and propose two more.
>
> * Use a CLooG header macro to check for the PPL Legacy backend
>
> Without that patch the PPL Legacy backend may be detected, even if only
> includes of CLooG ORG are in the path, but the cloog-ppl library is
> still in the system library directory.
>
> * Addition of --enable-cloog-backend
>
> Implemented as you suggested. Now by default we use
> --enable-cloog-backend=ppl-legacy
> All other CLooG backends will fail configure. To use another backend
> this has to be defined explicitly by setting --enable-cloog-backend=isl
> or --enable-cloog-backend=ppl
>
> Could you have a look?
>
> Thanks for your help
> Tobi
Tobi,
I am still a tad concerned about the ABI change between ppl 0.10.x and
0.11. Is it certain that, for the combination of FSF gcc built against ppl 0.11
and cloog-ppl built against ppl 0.10.x, there are no ppl data structures
passed on the cloog calls between graphite and cloog? If not, might there
be issues if the ABI changes in ppl impacted those data structures?
Jack
> >From 1d5413fd2ee94d8030bb3e2388c808a7b0dcbfa3 Mon Sep 17 00:00:00 2001
> From: Tobias Grosser <grosser@fim.uni-passau.de>
> Date: Fri, 12 Nov 2010 13:16:56 -0500
> Subject: [PATCH 1/3] * config/cloog.m4: Use CLooG predefined macro to check for CLooG PPL. * configure: regenerate
>
> ---
> config/cloog.m4 | 13 +++++++------
> configure | 15 ++++++++-------
> 2 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/config/cloog.m4 b/config/cloog.m4
> index a44aac4..6ed0f1b 100644
> --- a/config/cloog.m4
> +++ b/config/cloog.m4
> @@ -91,15 +91,17 @@ AC_DEFUN([CLOOG_REQUESTED],
> # ------------------
> # Helper for detecting CLooG.org's backend.
> m4_define([_CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
> - [#include <cloog/cloog.h>],
> + [#include "cloog/cloog.h"],
> [cloog_version ()])])
>
> # _CLOOG_PPL_LEGACY_PROG ()
> # -------------------------
> # Helper for detecting CLooG-Legacy (CLooG-PPL).
> m4_define([_CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
> - [#include <cloog/cloog.h>],
> - [ppl_version_major ()])])
> + [#include "cloog/cloog.h"],
> + [#ifndef CLOOG_PPL_BACKEND
> + choke me
> + #endif ])])
>
> # CLOOG_FIND_FLAGS ()
> # ------------------
> @@ -114,12 +116,11 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
> _cloog_saved_LDFLAGS=$LDFLAGS
> _cloog_saved_LIBS=$LIBS
>
> - _clooglegacyinc="-DCLOOG_PPL_BACKEND"
> _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
>
> dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
> CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
> - CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
> + CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
> LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
>
> AC_CACHE_CHECK([for installed CLooG],
> @@ -137,7 +138,7 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
>
> case $gcc_cv_cloog_type in
> "PPL Legacy")
> - clooginc="${clooginc} ${_clooglegacyinc}"
> + clooginc="${clooginc}"
> clooglibs="${clooglibs} -lcloog"
> cloog_org=no
> ;;
> diff --git a/configure b/configure
> index dcb582f..0e4f1ed 100755
> --- a/configure
> +++ b/configure
> @@ -5725,11 +5725,10 @@ if test "x$with_cloog" != "xno"; then
> _cloog_saved_LDFLAGS=$LDFLAGS
> _cloog_saved_LIBS=$LIBS
>
> - _clooglegacyinc="-DCLOOG_PPL_BACKEND"
> _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
>
> CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
> - CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
> + CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
> LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
>
> { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5
> @@ -5740,11 +5739,13 @@ else
> LIBS="-lcloog ${_cloog_saved_LIBS}"
> cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> -#include <cloog/cloog.h>
> +#include "cloog/cloog.h"
> int
> main ()
> {
> -ppl_version_major ()
> +#ifndef CLOOG_PPL_BACKEND
> + choke me
> + #endif
> ;
> return 0;
> }
> @@ -5755,7 +5756,7 @@ else
> LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}"
> cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> -#include <cloog/cloog.h>
> +#include "cloog/cloog.h"
> int
> main ()
> {
> @@ -5770,7 +5771,7 @@ else
> LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
> cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> -#include <cloog/cloog.h>
> +#include "cloog/cloog.h"
> int
> main ()
> {
> @@ -5798,7 +5799,7 @@ $as_echo "$gcc_cv_cloog_type" >&6; }
>
> case $gcc_cv_cloog_type in
> "PPL Legacy")
> - clooginc="${clooginc} ${_clooglegacyinc}"
> + clooginc="${clooginc}"
> clooglibs="${clooglibs} -lcloog"
> cloog_org=no
> ;;
> --
> 1.7.1
>
> >From 8b8b33ade1658dc2e0dc660cccd66f6f0aa18e72 Mon Sep 17 00:00:00 2001
> From: Tobias Grosser <grosser@fim.uni-passau.de>
> Date: Fri, 12 Nov 2010 13:08:54 -0500
> Subject: [PATCH 3/3] Add -enable-cloog-backend.
>
> * config/cloog.m4: Add -enable-cloog-backend=(isl|ppl|ppl-legacy) to
> define the cloog backend to use. Furthermore, only pass the ppllibs
> to the configure checks, if necessary.
> *configure: Regenerate.
> ---
> config/cloog.m4 | 74 +++++++++++++++++++++++++++++++++++-------------
> configure | 85 ++++++++++++++++++++++++++++++++++++++++++++-----------
> 2 files changed, 122 insertions(+), 37 deletions(-)
>
> diff --git a/config/cloog.m4 b/config/cloog.m4
> index 6ed0f1b..4936e8a 100644
> --- a/config/cloog.m4
> +++ b/config/cloog.m4
> @@ -36,7 +36,19 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
> [AS_HELP_STRING(
> [--with-cloog-lib=PATH],
> [Specify the directory for the installed CLooG library])])
> -
> +
> + AC_ARG_ENABLE(cloog-backend,
> + [ --enable-cloog-backend[=backend]
> + isl: The cloog.org isl backend
> + ppl-legacy: The legacy ppl backend - default
> + ppl: The cloog.org ppl backend],
> + [ if test "x${enableval}" = "xisl"; then
> + cloog_backend=isl
> + elif test "x${enableval}" = "xppl"; then
> + cloog_backend=ppl
> + else
> + cloog_backend=ppl-legacy
> + fi], cloog_backend=ppl-legacy)
> AC_ARG_ENABLE(cloog-version-check,
> [AS_HELP_STRING(
> [--disable-cloog-version-check],
> @@ -87,11 +99,19 @@ AC_DEFUN([CLOOG_REQUESTED],
> ]
> )
>
> -# _CLOOG_ORG_PROG ()
> +# _CLOOG_ORG_PROG_ISL ()
> # ------------------
> -# Helper for detecting CLooG.org's backend.
> -m4_define([_CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
> - [#include "cloog/cloog.h"],
> +# Helper for detecting CLooG.org's ISL backend.
> +m4_define([_CLOOG_ORG_PROG_ISL],[AC_LANG_PROGRAM(
> + [#include "cloog/cloog.h" ],
> + [cloog_version ()])])
> +
> +# _CLOOG_ORG_PROG_PPL ()
> +# ------------------
> +# Helper for detecting CLooG.org's PPL backend.
> +m4_define([_CLOOG_ORG_PROG_PPL],[AC_LANG_PROGRAM(
> + [#include "cloog/cloog.h"
> + #include "cloog/ppl/cloog.h"],
> [cloog_version ()])])
>
> # _CLOOG_PPL_LEGACY_PROG ()
> @@ -106,7 +126,7 @@ m4_define([_CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
> # CLOOG_FIND_FLAGS ()
> # ------------------
> # Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org.
> -# Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
> +# Only look for the CLooG backend type specified in --enable-cloog-backend
> AC_DEFUN([CLOOG_FIND_FLAGS],
> [
> AC_REQUIRE([CLOOG_INIT_FLAGS])
> @@ -119,22 +139,36 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
> _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
>
> dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
> - CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
> + CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
> CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
> - LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
> -
> - AC_CACHE_CHECK([for installed CLooG],
> - [gcc_cv_cloog_type],
> - [LIBS="-lcloog ${_cloog_saved_LIBS}"
> - AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG],
> - [gcc_cv_cloog_type="PPL Legacy"],
> - [LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}"
> - AC_LINK_IFELSE([_CLOOG_ORG_PROG],
> - [gcc_cv_cloog_type=ISL],
> - [LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
> - AC_LINK_IFELSE([_CLOOG_ORG_PROG],
> - [gcc_cv_cloog_type=PPL],
> - [gcc_cv_cloog_type=no])])])])
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + case $cloog_backend in
> + "ppl-legacy")
> + CFLAGS="${CFLAGS} ${pplinc}"
> + LDFLAGS="${LDFLAGS} ${ppllibs}"
> + AC_CACHE_CHECK([for installed CLooG PPL Legacy], [gcc_cv_cloog_type],
> + [LIBS="-lcloog ${_cloog_saved_LIBS}"
> + AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG], [gcc_cv_cloog_type="PPL Legacy"],
> + [gcc_cv_cloog_type=no])])
> + ;;
> + "isl")
> + AC_CACHE_CHECK([for installed CLooG ISL], [gcc_cv_cloog_type],
> + [LIBS="-lcloog-isl ${_cloog_saved_LIBS}"
> + AC_LINK_IFELSE([_CLOOG_ORG_PROG_ISL], [gcc_cv_cloog_type="ISL"],
> + [gcc_cv_cloog_type=no])])
> + ;;
> + "ppl")
> + CFLAGS="${CFLAGS} ${pplinc}"
> + LDFLAGS="${LDFLAGS} ${ppllibs}"
> + AC_CACHE_CHECK([for installed CLooG PPL], [gcc_cv_cloog_type],
> + [LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
> + AC_LINK_IFELSE([_CLOOG_ORG_PROG_PPL], [gcc_cv_cloog_type="PPL"],
> + [gcc_cv_cloog_type=no])])
> + ;;
> + *)
> + gcc_cv_cloog_type=""
> + esac
>
> case $gcc_cv_cloog_type in
> "PPL Legacy")
> diff --git a/configure b/configure
> index 0e4f1ed..bcc087b 100755
> --- a/configure
> +++ b/configure
> @@ -765,6 +765,7 @@ enable_ppl_version_check
> with_cloog
> with_cloog_include
> with_cloog_lib
> +enable_cloog_backend
> enable_cloog_version_check
> enable_lto
> enable_stage1_languages
> @@ -1451,6 +1452,10 @@ Optional Features:
> --enable-libssp build libssp directory
> --enable-build-with-cxx build with C++ compiler instead of C compiler
> --disable-ppl-version-check disable check for PPL version
> + --enable-cloog-backend=backend
> + isl: The cloog.org isl backend
> + ppl-legacy: The legacy ppl backend - default
> + ppl: The cloog.org ppl backend
> --disable-cloog-version-check
> disable check for CLooG version
> --enable-lto enable link time optimization support
> @@ -5676,6 +5681,19 @@ if test "${with_cloog_lib+set}" = set; then :
> fi
>
>
> + # Check whether --enable-cloog-backend was given.
> +if test "${enable_cloog_backend+set}" = set; then :
> + enableval=$enable_cloog_backend; if test "x${enableval}" = "xisl"; then
> + cloog_backend=isl
> + elif test "x${enableval}" = "xppl"; then
> + cloog_backend=ppl
> + else
> + cloog_backend=ppl-legacy
> + fi
> +else
> + cloog_backend=ppl-legacy
> +fi
> +
> # Check whether --enable-cloog-version-check was given.
> if test "${enable_cloog_version_check+set}" = set; then :
> enableval=$enable_cloog_version_check; ENABLE_CLOOG_CHECK=$enableval
> @@ -5727,17 +5745,21 @@ if test "x$with_cloog" != "xno"; then
>
> _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
>
> - CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
> + CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
> CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
> - LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
> -
> - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5
> -$as_echo_n "checking for installed CLooG... " >&6; }
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + case $cloog_backend in
> + "ppl-legacy")
> + CFLAGS="${CFLAGS} ${pplinc}"
> + LDFLAGS="${LDFLAGS} ${ppllibs}"
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG PPL Legacy" >&5
> +$as_echo_n "checking for installed CLooG PPL Legacy... " >&6; }
> if test "${gcc_cv_cloog_type+set}" = set; then :
> $as_echo_n "(cached) " >&6
> else
> LIBS="-lcloog ${_cloog_saved_LIBS}"
> - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> #include "cloog/cloog.h"
> int
> @@ -5753,8 +5775,22 @@ _ACEOF
> if ac_fn_c_try_link "$LINENO"; then :
> gcc_cv_cloog_type="PPL Legacy"
> else
> - LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}"
> - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> + gcc_cv_cloog_type=no
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
> +$as_echo "$gcc_cv_cloog_type" >&6; }
> + ;;
> + "isl")
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG ISL" >&5
> +$as_echo_n "checking for installed CLooG ISL... " >&6; }
> +if test "${gcc_cv_cloog_type+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> +else
> + LIBS="-lcloog-isl ${_cloog_saved_LIBS}"
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> #include "cloog/cloog.h"
> int
> @@ -5766,12 +5802,29 @@ cloog_version ()
> }
> _ACEOF
> if ac_fn_c_try_link "$LINENO"; then :
> - gcc_cv_cloog_type=ISL
> + gcc_cv_cloog_type="ISL"
> +else
> + gcc_cv_cloog_type=no
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> + conftest$ac_exeext conftest.$ac_ext
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
> +$as_echo "$gcc_cv_cloog_type" >&6; }
> + ;;
> + "ppl")
> + CFLAGS="${CFLAGS} ${pplinc}"
> + LDFLAGS="${LDFLAGS} ${ppllibs}"
> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG PPL" >&5
> +$as_echo_n "checking for installed CLooG PPL... " >&6; }
> +if test "${gcc_cv_cloog_type+set}" = set; then :
> + $as_echo_n "(cached) " >&6
> else
> LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
> - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> /* end confdefs.h. */
> #include "cloog/cloog.h"
> + #include "cloog/ppl/cloog.h"
> int
> main ()
> {
> @@ -5781,21 +5834,19 @@ cloog_version ()
> }
> _ACEOF
> if ac_fn_c_try_link "$LINENO"; then :
> - gcc_cv_cloog_type=PPL
> + gcc_cv_cloog_type="PPL"
> else
> gcc_cv_cloog_type=no
> fi
> rm -f core conftest.err conftest.$ac_objext \
> conftest$ac_exeext conftest.$ac_ext
> fi
> -rm -f core conftest.err conftest.$ac_objext \
> - conftest$ac_exeext conftest.$ac_ext
> -fi
> -rm -f core conftest.err conftest.$ac_objext \
> - conftest$ac_exeext conftest.$ac_ext
> -fi
> { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
> $as_echo "$gcc_cv_cloog_type" >&6; }
> + ;;
> + *)
> + gcc_cv_cloog_type=""
> + esac
>
> case $gcc_cv_cloog_type in
> "PPL Legacy")
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 17:30 ` Paolo Bonzini
@ 2010-11-12 20:37 ` Tobias Grosser
2010-11-12 21:00 ` Jack Howarth
` (3 more replies)
0 siblings, 4 replies; 67+ messages in thread
From: Tobias Grosser @ 2010-11-12 20:37 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Sven Verdoolaege, Jack Howarth, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]
On 11/12/2010 12:06 PM, Paolo Bonzini wrote:
> On 11/12/2010 05:14 PM, Tobias Grosser wrote:
>> CLooG isl will in some cases generate different code. This is why we
>> currently have support for both CLooG versions. Our first tests did not
>> show any new SPEC suite failures, but we still want to run more tests
>> with different optimization flags and on even more platforms. We push
>> that patch upstream, such that people like Jack can test CLooG with
>> CLooG-isl on their platform. (Even if it was not intended they hit such
>> a simple configure bug)
>
> Yes, the bug that Jack found is not a major problem.
>
> The main problem is the different generated code; in particular, it's
> not about failures, _any_ assembly code difference resulting from the
> same configure options is problematic. Can you make a patch to ensure
> that only one backend is sought for, depending on the user's choice
> between --enable-cloog-backend=ppl and --enable-cloog-backend=isl (you
> choose the default)?
>
> To some extent, this is unavoidable when we are delegating optimization
> choices to an external library, but we should minimize the differences.
> It is probably necessary to have the version of cloog (and its
> dependencies whenever applicable) printed as part of the output of "gcc
> --version".
>
> Still, the patch is okay. :)
Thanks Paolo,
I committed this patch and propose two more.
* Use a CLooG header macro to check for the PPL Legacy backend
Without that patch the PPL Legacy backend may be detected, even if only
includes of CLooG ORG are in the path, but the cloog-ppl library is
still in the system library directory.
* Addition of --enable-cloog-backend
Implemented as you suggested. Now by default we use
--enable-cloog-backend=ppl-legacy
All other CLooG backends will fail configure. To use another backend
this has to be defined explicitly by setting --enable-cloog-backend=isl
or --enable-cloog-backend=ppl
Could you have a look?
Thanks for your help
Tobi
[-- Attachment #2: 0001-config-cloog.m4-Use-CLooG-predefined-macro-to-check-.patch --]
[-- Type: text/x-diff, Size: 3528 bytes --]
From 1d5413fd2ee94d8030bb3e2388c808a7b0dcbfa3 Mon Sep 17 00:00:00 2001
From: Tobias Grosser <grosser@fim.uni-passau.de>
Date: Fri, 12 Nov 2010 13:16:56 -0500
Subject: [PATCH 1/3] * config/cloog.m4: Use CLooG predefined macro to check for CLooG PPL. * configure: regenerate
---
config/cloog.m4 | 13 +++++++------
configure | 15 ++++++++-------
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/config/cloog.m4 b/config/cloog.m4
index a44aac4..6ed0f1b 100644
--- a/config/cloog.m4
+++ b/config/cloog.m4
@@ -91,15 +91,17 @@ AC_DEFUN([CLOOG_REQUESTED],
# ------------------
# Helper for detecting CLooG.org's backend.
m4_define([_CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
- [#include <cloog/cloog.h>],
+ [#include "cloog/cloog.h"],
[cloog_version ()])])
# _CLOOG_PPL_LEGACY_PROG ()
# -------------------------
# Helper for detecting CLooG-Legacy (CLooG-PPL).
m4_define([_CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
- [#include <cloog/cloog.h>],
- [ppl_version_major ()])])
+ [#include "cloog/cloog.h"],
+ [#ifndef CLOOG_PPL_BACKEND
+ choke me
+ #endif ])])
# CLOOG_FIND_FLAGS ()
# ------------------
@@ -114,12 +116,11 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
_cloog_saved_LDFLAGS=$LDFLAGS
_cloog_saved_LIBS=$LIBS
- _clooglegacyinc="-DCLOOG_PPL_BACKEND"
_cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
- CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
+ CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
AC_CACHE_CHECK([for installed CLooG],
@@ -137,7 +138,7 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
case $gcc_cv_cloog_type in
"PPL Legacy")
- clooginc="${clooginc} ${_clooglegacyinc}"
+ clooginc="${clooginc}"
clooglibs="${clooglibs} -lcloog"
cloog_org=no
;;
diff --git a/configure b/configure
index dcb582f..0e4f1ed 100755
--- a/configure
+++ b/configure
@@ -5725,11 +5725,10 @@ if test "x$with_cloog" != "xno"; then
_cloog_saved_LDFLAGS=$LDFLAGS
_cloog_saved_LIBS=$LIBS
- _clooglegacyinc="-DCLOOG_PPL_BACKEND"
_cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
- CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
+ CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5
@@ -5740,11 +5739,13 @@ else
LIBS="-lcloog ${_cloog_saved_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <cloog/cloog.h>
+#include "cloog/cloog.h"
int
main ()
{
-ppl_version_major ()
+#ifndef CLOOG_PPL_BACKEND
+ choke me
+ #endif
;
return 0;
}
@@ -5755,7 +5756,7 @@ else
LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <cloog/cloog.h>
+#include "cloog/cloog.h"
int
main ()
{
@@ -5770,7 +5771,7 @@ else
LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <cloog/cloog.h>
+#include "cloog/cloog.h"
int
main ()
{
@@ -5798,7 +5799,7 @@ $as_echo "$gcc_cv_cloog_type" >&6; }
case $gcc_cv_cloog_type in
"PPL Legacy")
- clooginc="${clooginc} ${_clooglegacyinc}"
+ clooginc="${clooginc}"
clooglibs="${clooglibs} -lcloog"
cloog_org=no
;;
--
1.7.1
[-- Attachment #3: 0003-Add-enable-cloog-backend.patch --]
[-- Type: text/x-diff, Size: 9361 bytes --]
From 8b8b33ade1658dc2e0dc660cccd66f6f0aa18e72 Mon Sep 17 00:00:00 2001
From: Tobias Grosser <grosser@fim.uni-passau.de>
Date: Fri, 12 Nov 2010 13:08:54 -0500
Subject: [PATCH 3/3] Add -enable-cloog-backend.
* config/cloog.m4: Add -enable-cloog-backend=(isl|ppl|ppl-legacy) to
define the cloog backend to use. Furthermore, only pass the ppllibs
to the configure checks, if necessary.
*configure: Regenerate.
---
config/cloog.m4 | 74 +++++++++++++++++++++++++++++++++++-------------
configure | 85 ++++++++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 122 insertions(+), 37 deletions(-)
diff --git a/config/cloog.m4 b/config/cloog.m4
index 6ed0f1b..4936e8a 100644
--- a/config/cloog.m4
+++ b/config/cloog.m4
@@ -36,7 +36,19 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
[AS_HELP_STRING(
[--with-cloog-lib=PATH],
[Specify the directory for the installed CLooG library])])
-
+
+ AC_ARG_ENABLE(cloog-backend,
+ [ --enable-cloog-backend[=backend]
+ isl: The cloog.org isl backend
+ ppl-legacy: The legacy ppl backend - default
+ ppl: The cloog.org ppl backend],
+ [ if test "x${enableval}" = "xisl"; then
+ cloog_backend=isl
+ elif test "x${enableval}" = "xppl"; then
+ cloog_backend=ppl
+ else
+ cloog_backend=ppl-legacy
+ fi], cloog_backend=ppl-legacy)
AC_ARG_ENABLE(cloog-version-check,
[AS_HELP_STRING(
[--disable-cloog-version-check],
@@ -87,11 +99,19 @@ AC_DEFUN([CLOOG_REQUESTED],
]
)
-# _CLOOG_ORG_PROG ()
+# _CLOOG_ORG_PROG_ISL ()
# ------------------
-# Helper for detecting CLooG.org's backend.
-m4_define([_CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
- [#include "cloog/cloog.h"],
+# Helper for detecting CLooG.org's ISL backend.
+m4_define([_CLOOG_ORG_PROG_ISL],[AC_LANG_PROGRAM(
+ [#include "cloog/cloog.h" ],
+ [cloog_version ()])])
+
+# _CLOOG_ORG_PROG_PPL ()
+# ------------------
+# Helper for detecting CLooG.org's PPL backend.
+m4_define([_CLOOG_ORG_PROG_PPL],[AC_LANG_PROGRAM(
+ [#include "cloog/cloog.h"
+ #include "cloog/ppl/cloog.h"],
[cloog_version ()])])
# _CLOOG_PPL_LEGACY_PROG ()
@@ -106,7 +126,7 @@ m4_define([_CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
# CLOOG_FIND_FLAGS ()
# ------------------
# Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org.
-# Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
+# Only look for the CLooG backend type specified in --enable-cloog-backend
AC_DEFUN([CLOOG_FIND_FLAGS],
[
AC_REQUIRE([CLOOG_INIT_FLAGS])
@@ -119,22 +139,36 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
_cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
- CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
+ CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
- LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
-
- AC_CACHE_CHECK([for installed CLooG],
- [gcc_cv_cloog_type],
- [LIBS="-lcloog ${_cloog_saved_LIBS}"
- AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG],
- [gcc_cv_cloog_type="PPL Legacy"],
- [LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}"
- AC_LINK_IFELSE([_CLOOG_ORG_PROG],
- [gcc_cv_cloog_type=ISL],
- [LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
- AC_LINK_IFELSE([_CLOOG_ORG_PROG],
- [gcc_cv_cloog_type=PPL],
- [gcc_cv_cloog_type=no])])])])
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ case $cloog_backend in
+ "ppl-legacy")
+ CFLAGS="${CFLAGS} ${pplinc}"
+ LDFLAGS="${LDFLAGS} ${ppllibs}"
+ AC_CACHE_CHECK([for installed CLooG PPL Legacy], [gcc_cv_cloog_type],
+ [LIBS="-lcloog ${_cloog_saved_LIBS}"
+ AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG], [gcc_cv_cloog_type="PPL Legacy"],
+ [gcc_cv_cloog_type=no])])
+ ;;
+ "isl")
+ AC_CACHE_CHECK([for installed CLooG ISL], [gcc_cv_cloog_type],
+ [LIBS="-lcloog-isl ${_cloog_saved_LIBS}"
+ AC_LINK_IFELSE([_CLOOG_ORG_PROG_ISL], [gcc_cv_cloog_type="ISL"],
+ [gcc_cv_cloog_type=no])])
+ ;;
+ "ppl")
+ CFLAGS="${CFLAGS} ${pplinc}"
+ LDFLAGS="${LDFLAGS} ${ppllibs}"
+ AC_CACHE_CHECK([for installed CLooG PPL], [gcc_cv_cloog_type],
+ [LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
+ AC_LINK_IFELSE([_CLOOG_ORG_PROG_PPL], [gcc_cv_cloog_type="PPL"],
+ [gcc_cv_cloog_type=no])])
+ ;;
+ *)
+ gcc_cv_cloog_type=""
+ esac
case $gcc_cv_cloog_type in
"PPL Legacy")
diff --git a/configure b/configure
index 0e4f1ed..bcc087b 100755
--- a/configure
+++ b/configure
@@ -765,6 +765,7 @@ enable_ppl_version_check
with_cloog
with_cloog_include
with_cloog_lib
+enable_cloog_backend
enable_cloog_version_check
enable_lto
enable_stage1_languages
@@ -1451,6 +1452,10 @@ Optional Features:
--enable-libssp build libssp directory
--enable-build-with-cxx build with C++ compiler instead of C compiler
--disable-ppl-version-check disable check for PPL version
+ --enable-cloog-backend=backend
+ isl: The cloog.org isl backend
+ ppl-legacy: The legacy ppl backend - default
+ ppl: The cloog.org ppl backend
--disable-cloog-version-check
disable check for CLooG version
--enable-lto enable link time optimization support
@@ -5676,6 +5681,19 @@ if test "${with_cloog_lib+set}" = set; then :
fi
+ # Check whether --enable-cloog-backend was given.
+if test "${enable_cloog_backend+set}" = set; then :
+ enableval=$enable_cloog_backend; if test "x${enableval}" = "xisl"; then
+ cloog_backend=isl
+ elif test "x${enableval}" = "xppl"; then
+ cloog_backend=ppl
+ else
+ cloog_backend=ppl-legacy
+ fi
+else
+ cloog_backend=ppl-legacy
+fi
+
# Check whether --enable-cloog-version-check was given.
if test "${enable_cloog_version_check+set}" = set; then :
enableval=$enable_cloog_version_check; ENABLE_CLOOG_CHECK=$enableval
@@ -5727,17 +5745,21 @@ if test "x$with_cloog" != "xno"; then
_cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
- CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
+ CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
- LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5
-$as_echo_n "checking for installed CLooG... " >&6; }
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ case $cloog_backend in
+ "ppl-legacy")
+ CFLAGS="${CFLAGS} ${pplinc}"
+ LDFLAGS="${LDFLAGS} ${ppllibs}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG PPL Legacy" >&5
+$as_echo_n "checking for installed CLooG PPL Legacy... " >&6; }
if test "${gcc_cv_cloog_type+set}" = set; then :
$as_echo_n "(cached) " >&6
else
LIBS="-lcloog ${_cloog_saved_LIBS}"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "cloog/cloog.h"
int
@@ -5753,8 +5775,22 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"; then :
gcc_cv_cloog_type="PPL Legacy"
else
- LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ gcc_cv_cloog_type=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
+$as_echo "$gcc_cv_cloog_type" >&6; }
+ ;;
+ "isl")
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG ISL" >&5
+$as_echo_n "checking for installed CLooG ISL... " >&6; }
+if test "${gcc_cv_cloog_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ LIBS="-lcloog-isl ${_cloog_saved_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "cloog/cloog.h"
int
@@ -5766,12 +5802,29 @@ cloog_version ()
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- gcc_cv_cloog_type=ISL
+ gcc_cv_cloog_type="ISL"
+else
+ gcc_cv_cloog_type=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
+$as_echo "$gcc_cv_cloog_type" >&6; }
+ ;;
+ "ppl")
+ CFLAGS="${CFLAGS} ${pplinc}"
+ LDFLAGS="${LDFLAGS} ${ppllibs}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG PPL" >&5
+$as_echo_n "checking for installed CLooG PPL... " >&6; }
+if test "${gcc_cv_cloog_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "cloog/cloog.h"
+ #include "cloog/ppl/cloog.h"
int
main ()
{
@@ -5781,21 +5834,19 @@ cloog_version ()
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- gcc_cv_cloog_type=PPL
+ gcc_cv_cloog_type="PPL"
else
gcc_cv_cloog_type=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
$as_echo "$gcc_cv_cloog_type" >&6; }
+ ;;
+ *)
+ gcc_cv_cloog_type=""
+ esac
case $gcc_cv_cloog_type in
"PPL Legacy")
--
1.7.1
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 16:46 ` Tobias Grosser
2010-11-12 17:30 ` Paolo Bonzini
@ 2010-11-12 19:07 ` Jack Howarth
1 sibling, 0 replies; 67+ messages in thread
From: Jack Howarth @ 2010-11-12 19:07 UTC (permalink / raw)
To: Tobias Grosser
Cc: Paolo Bonzini, Sven Verdoolaege, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On Fri, Nov 12, 2010 at 11:14:38AM -0500, Tobias Grosser wrote:
> On 11/12/2010 04:10 AM, Paolo Bonzini wrote:
>> On 11/12/2010 10:08 AM, Sven Verdoolaege wrote:
>>> On Fri, Nov 12, 2010 at 09:59:45AM +0100, Paolo Bonzini wrote:
>>>> On 11/12/2010 09:43 AM, Sven Verdoolaege wrote:
>>>>> On Fri, Nov 12, 2010 at 09:26:00AM +0100, Paolo Bonzini wrote:
>>>>>> Also, if I understood correctly ISL and PPL are different ways to
>>>>>> "do the same thing", and they should cause no differences in code
>>>>>> generation. I assumed this because the patch didn't require any
>>>>>> testsuite adjustment. Is this the case?
>>>>>
>>>>> Semantically, the results should be the same, but there may
>>>>> be syntactic differences. Perhaps no such syntactic differences
>>>>> occur for the gcc testsuite.
>>>>
>>>> What does "semantic" and "syntactic" mean? I suppose you mean that
>>>> the produced code should be correct in any case (of course) but the
>>>> GCC assembly language output may change?
>>>
>>> Exactly.
>>
>> That's bad. Sebastian, please revert the patch. It would also be
>> appreciated to compile SPEC with both backends, and see how many
>> different decisions are taken.
>
> Hi,
>
> I just tested this again and Jack Howarth's analysis was correct. CLooG
> PPL is not detected, if PPL is not in the default path. This slipped
> through our tests. As long as PPL is installed in the system library
> path everything is all right.
Tobias,
Are you sure your analysis is correct? It seems to me that the problem
is actually due to the code section in config/cloog.m4 below...
# CLOOG_FIND_FLAGS ()
# ------------------
# Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org.
# Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
AC_DEFUN([CLOOG_FIND_FLAGS],
[
AC_REQUIRE([CLOOG_INIT_FLAGS])
_cloog_saved_CFLAGS=$CFLAGS
_cloog_saved_CPPFLAGS=$CPPFLAGS
_cloog_saved_LDFLAGS=$LDFLAGS
_cloog_saved_LIBS=$LIBS
_clooglegacyinc="-DCLOOG_PPL_BACKEND"
_cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
LDFLAGS="${LDFLAGS} ${clooglibs}"
AC_CACHE_CHECK([for installed CLooG],
[gcc_cv_cloog_type],
[LIBS="-lcloog ${_cloog_saved_LIBS}"
AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG],
[gcc_cv_cloog_type="PPL Legacy"],
[LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}"
AC_LINK_IFELSE([_CLOOG_ORG_PROG],
[gcc_cv_cloog_type=ISL],
[LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
AC_LINK_IFELSE([_CLOOG_ORG_PROG],
[gcc_cv_cloog_type=PPL],
[gcc_cv_cloog_type=no])])])])
case $gcc_cv_cloog_type in
"PPL Legacy")
clooginc="${clooginc} ${_clooglegacyinc}"
clooglibs="${clooglibs} -lcloog"
cloog_org=no
;;
"ISL")
clooginc="${clooginc} ${_cloogorginc}"
clooglibs="${clooglibs} -lcloog-isl"
cloog_org=yes
;;
"PPL")
clooginc="${clooginc} ${_cloogorginc}"
clooglibs="${clooglibs} -lcloog-ppl"
cloog_org=yes
;;
*)
clooglibs=
clooginc=
cloog_org=
;;
esac
LIBS=$_cloog_saved_LIBS
CFLAGS=$_cloog_saved_CFLAGS
CPPFLAGS=$_cloog_saved_CPPFLAGS
LDFLAGS=$_cloog_saved_LDFLAGS
]
)
In particular, the lines...
dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
LDFLAGS="${LDFLAGS} ${clooglibs}"
where ${pplinc} is blindly passed to all the tests on CFLAGS but
${ppllibs} is never passed to LDFLAGS for the legacy cloog test.
Since only the legacy cloog test directly makes a call into ppl...
# _CLOOG_PPL_LEGACY_PROG ()
# -------------------------
# Helper for detecting CLooG-Legacy (CLooG-PPL).
m4_define([_CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
[#include <cloog/cloog.h>],
[ppl_version_major ()])])
...it would seem that ${pplinc} and ${ppllibs} only need to be
provided to CFLAGS and LDFLAGS respectively in that case.
Jack
> This is definitely a bug in the patch, as the patch was not intended to
> change the default behavior at all. I propose to fix this bug.
> A patch for this is attached (the one Jack proposed).
>
> Regarding the syntactic difference:
>
> CLooG isl will in some cases generate different code. This is why we
> currently have support for both CLooG versions. Our first tests did not
> show any new SPEC suite failures, but we still want to run more tests
> with different optimization flags and on even more platforms. We push
> that patch upstream, such that people like Jack can test CLooG with
> CLooG-isl on their platform. (Even if it was not intended they hit such
> a simple configure bug)
>
> I believe with the attached patch, the know CLooG configure bugs are
> fixed and configure should act as it was planned.
>
> The behavior is:
>
> configure will detect CLooG PPL if available in the default search paths
> or pointed to using the --with-cloog flag.
> Only in the case no CLooG PPL is available but a version of CLooG ISL is
> installed or pointed explicitly to using the --with-cloog flag, gcc will
> compile against cloog-isl.
>
> cloog-isl is currently unreleased (only available using git).
>
> Is this behavior OK for configure? The idea is to keep it like this for
> a couple of weeks, such that more people can try CLooG isl and help us
> finding the remaining bugs.
>
> The final goal for gcc 4.6 is to remove CLooG ppl support.
>
> Is this plan as explained and finally implemented (with the attached
> fix) OK, or do we need to change anything else?
>
> Cheers
> Tobi
> >From a8d97d865ab5e0af7e1a760ee6769dfb877231a1 Mon Sep 17 00:00:00 2001
> From: Tobias Grosser <grosser@fim.uni-passau.de>
> Date: Thu, 11 Nov 2010 22:54:55 -0500
> Subject: [PATCH 2/2] Pass PPL libraries to CLooG version check
>
> * config/cloog.m4: Pass ppl libraries to the CLooG version check.
> * configure: Regenerate.
> ---
> config/cloog.m4 | 4 ++--
> configure | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/config/cloog.m4 b/config/cloog.m4
> index d24b5ac..87ff50a 100644
> --- a/config/cloog.m4
> +++ b/config/cloog.m4
> @@ -122,7 +122,7 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
> dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
> CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
> CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
> - LDFLAGS="${LDFLAGS} ${clooglibs}"
> + LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
>
> AC_CACHE_CHECK([for installed CLooG],
> [gcc_cv_cloog_type],
> @@ -206,7 +206,7 @@ AC_DEFUN([CLOOG_CHECK_VERSION],
> _cloog_saved_LDFLAGS=$LDFLAGS
>
> CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
> - LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs}"
> + LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${ppllibs}"
>
> if test "${cloog_org}" = yes ; then
> AC_CACHE_CHECK([for verison $1.$2.$3 of CLooG],
> diff --git a/configure b/configure
> index 3f8c26a..a85874e 100755
> --- a/configure
> +++ b/configure
> @@ -5730,7 +5730,7 @@ if test "x$with_cloog" != "xno"; then
>
> CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
> CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
> - LDFLAGS="${LDFLAGS} ${clooglibs}"
> + LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
>
> { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5
> $as_echo_n "checking for installed CLooG... " >&6; }
> @@ -5835,7 +5835,7 @@ $as_echo "$gcc_cv_cloog_type" >&6; }
> _cloog_saved_LDFLAGS=$LDFLAGS
>
> CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
> - LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs}"
> + LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${ppllibs}"
>
> if test "${cloog_org}" = yes ; then
> { $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG" >&5
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 16:46 ` Tobias Grosser
@ 2010-11-12 17:30 ` Paolo Bonzini
2010-11-12 20:37 ` Tobias Grosser
2010-11-12 19:07 ` Jack Howarth
1 sibling, 1 reply; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-12 17:30 UTC (permalink / raw)
To: Tobias Grosser
Cc: Sven Verdoolaege, Jack Howarth, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On 11/12/2010 05:14 PM, Tobias Grosser wrote:
> CLooG isl will in some cases generate different code. This is why we
> currently have support for both CLooG versions. Our first tests did not
> show any new SPEC suite failures, but we still want to run more tests
> with different optimization flags and on even more platforms. We push
> that patch upstream, such that people like Jack can test CLooG with
> CLooG-isl on their platform. (Even if it was not intended they hit such
> a simple configure bug)
Yes, the bug that Jack found is not a major problem.
The main problem is the different generated code; in particular, it's
not about failures, _any_ assembly code difference resulting from the
same configure options is problematic. Can you make a patch to ensure
that only one backend is sought for, depending on the user's choice
between --enable-cloog-backend=ppl and --enable-cloog-backend=isl (you
choose the default)?
To some extent, this is unavoidable when we are delegating optimization
choices to an external library, but we should minimize the differences.
It is probably necessary to have the version of cloog (and its
dependencies whenever applicable) printed as part of the output of "gcc
--version".
Still, the patch is okay. :)
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 9:58 ` Paolo Bonzini
@ 2010-11-12 16:46 ` Tobias Grosser
2010-11-12 17:30 ` Paolo Bonzini
2010-11-12 19:07 ` Jack Howarth
0 siblings, 2 replies; 67+ messages in thread
From: Tobias Grosser @ 2010-11-12 16:46 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Sven Verdoolaege, Jack Howarth, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
[-- Attachment #1: Type: text/plain, Size: 2880 bytes --]
On 11/12/2010 04:10 AM, Paolo Bonzini wrote:
> On 11/12/2010 10:08 AM, Sven Verdoolaege wrote:
>> On Fri, Nov 12, 2010 at 09:59:45AM +0100, Paolo Bonzini wrote:
>>> On 11/12/2010 09:43 AM, Sven Verdoolaege wrote:
>>>> On Fri, Nov 12, 2010 at 09:26:00AM +0100, Paolo Bonzini wrote:
>>>>> Also, if I understood correctly ISL and PPL are different ways to
>>>>> "do the same thing", and they should cause no differences in code
>>>>> generation. I assumed this because the patch didn't require any
>>>>> testsuite adjustment. Is this the case?
>>>>
>>>> Semantically, the results should be the same, but there may
>>>> be syntactic differences. Perhaps no such syntactic differences
>>>> occur for the gcc testsuite.
>>>
>>> What does "semantic" and "syntactic" mean? I suppose you mean that
>>> the produced code should be correct in any case (of course) but the
>>> GCC assembly language output may change?
>>
>> Exactly.
>
> That's bad. Sebastian, please revert the patch. It would also be
> appreciated to compile SPEC with both backends, and see how many
> different decisions are taken.
Hi,
I just tested this again and Jack Howarth's analysis was correct. CLooG
PPL is not detected, if PPL is not in the default path. This slipped
through our tests. As long as PPL is installed in the system library
path everything is all right.
This is definitely a bug in the patch, as the patch was not intended to
change the default behavior at all. I propose to fix this bug.
A patch for this is attached (the one Jack proposed).
Regarding the syntactic difference:
CLooG isl will in some cases generate different code. This is why we
currently have support for both CLooG versions. Our first tests did not
show any new SPEC suite failures, but we still want to run more tests
with different optimization flags and on even more platforms. We push
that patch upstream, such that people like Jack can test CLooG with
CLooG-isl on their platform. (Even if it was not intended they hit such
a simple configure bug)
I believe with the attached patch, the know CLooG configure bugs are
fixed and configure should act as it was planned.
The behavior is:
configure will detect CLooG PPL if available in the default search paths
or pointed to using the --with-cloog flag.
Only in the case no CLooG PPL is available but a version of CLooG ISL is
installed or pointed explicitly to using the --with-cloog flag, gcc will
compile against cloog-isl.
cloog-isl is currently unreleased (only available using git).
Is this behavior OK for configure? The idea is to keep it like this for
a couple of weeks, such that more people can try CLooG isl and help us
finding the remaining bugs.
The final goal for gcc 4.6 is to remove CLooG ppl support.
Is this plan as explained and finally implemented (with the attached
fix) OK, or do we need to change anything else?
Cheers
Tobi
[-- Attachment #2: 0002-Pass-PPL-libraries-to-CLooG-version-check.patch --]
[-- Type: text/x-diff, Size: 2245 bytes --]
From a8d97d865ab5e0af7e1a760ee6769dfb877231a1 Mon Sep 17 00:00:00 2001
From: Tobias Grosser <grosser@fim.uni-passau.de>
Date: Thu, 11 Nov 2010 22:54:55 -0500
Subject: [PATCH 2/2] Pass PPL libraries to CLooG version check
* config/cloog.m4: Pass ppl libraries to the CLooG version check.
* configure: Regenerate.
---
config/cloog.m4 | 4 ++--
configure | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/config/cloog.m4 b/config/cloog.m4
index d24b5ac..87ff50a 100644
--- a/config/cloog.m4
+++ b/config/cloog.m4
@@ -122,7 +122,7 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
- LDFLAGS="${LDFLAGS} ${clooglibs}"
+ LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
AC_CACHE_CHECK([for installed CLooG],
[gcc_cv_cloog_type],
@@ -206,7 +206,7 @@ AC_DEFUN([CLOOG_CHECK_VERSION],
_cloog_saved_LDFLAGS=$LDFLAGS
CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
- LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs}"
+ LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${ppllibs}"
if test "${cloog_org}" = yes ; then
AC_CACHE_CHECK([for verison $1.$2.$3 of CLooG],
diff --git a/configure b/configure
index 3f8c26a..a85874e 100755
--- a/configure
+++ b/configure
@@ -5730,7 +5730,7 @@ if test "x$with_cloog" != "xno"; then
CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
- LDFLAGS="${LDFLAGS} ${clooglibs}"
+ LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5
$as_echo_n "checking for installed CLooG... " >&6; }
@@ -5835,7 +5835,7 @@ $as_echo "$gcc_cv_cloog_type" >&6; }
_cloog_saved_LDFLAGS=$LDFLAGS
CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
- LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs}"
+ LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${ppllibs}"
if test "${cloog_org}" = yes ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG" >&5
--
1.7.1
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
[not found] ` <20101112090859.GP4255MdfPADPa@purples>
@ 2010-11-12 9:58 ` Paolo Bonzini
2010-11-12 16:46 ` Tobias Grosser
0 siblings, 1 reply; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-12 9:58 UTC (permalink / raw)
To: Sven Verdoolaege
Cc: Jack Howarth, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On 11/12/2010 10:08 AM, Sven Verdoolaege wrote:
> On Fri, Nov 12, 2010 at 09:59:45AM +0100, Paolo Bonzini wrote:
>> On 11/12/2010 09:43 AM, Sven Verdoolaege wrote:
>>> On Fri, Nov 12, 2010 at 09:26:00AM +0100, Paolo Bonzini wrote:
>>>> Also, if I understood correctly ISL and PPL are different ways to
>>>> "do the same thing", and they should cause no differences in code
>>>> generation. I assumed this because the patch didn't require any
>>>> testsuite adjustment. Is this the case?
>>>
>>> Semantically, the results should be the same, but there may
>>> be syntactic differences. Perhaps no such syntactic differences
>>> occur for the gcc testsuite.
>>
>> What does "semantic" and "syntactic" mean? I suppose you mean that
>> the produced code should be correct in any case (of course) but the
>> GCC assembly language output may change?
>
> Exactly.
That's bad. Sebastian, please revert the patch. It would also be
appreciated to compile SPEC with both backends, and see how many
different decisions are taken.
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
[not found] ` <20101112084306.GO4255MdfPADPa@purples>
@ 2010-11-12 9:11 ` Paolo Bonzini
[not found] ` <20101112090859.GP4255MdfPADPa@purples>
0 siblings, 1 reply; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-12 9:11 UTC (permalink / raw)
To: Sven Verdoolaege
Cc: Jack Howarth, Joseph S. Myers, Sebastian Pop,
Andreas Simbürger, gcc-patches, gcc-graphite
On 11/12/2010 09:43 AM, Sven Verdoolaege wrote:
> On Fri, Nov 12, 2010 at 09:26:00AM +0100, Paolo Bonzini wrote:
>> Also, if I understood correctly ISL and PPL are different ways to
>> "do the same thing", and they should cause no differences in code
>> generation. I assumed this because the patch didn't require any
>> testsuite adjustment. Is this the case?
>
> Semantically, the results should be the same, but there may
> be syntactic differences. Perhaps no such syntactic differences
> occur for the gcc testsuite.
What does "semantic" and "syntactic" mean? I suppose you mean that the
produced code should be correct in any case (of course) but the GCC
assembly language output may change? This is what we care about.
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 8:26 ` Jack Howarth
@ 2010-11-12 9:00 ` Paolo Bonzini
[not found] ` <20101112084306.GO4255MdfPADPa@purples>
0 siblings, 1 reply; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-12 9:00 UTC (permalink / raw)
To: Jack Howarth
Cc: Joseph S. Myers, Sebastian Pop, Andreas Simbürger,
gcc-patches, gcc-graphite
On 11/12/2010 05:09 AM, Jack Howarth wrote:
>> If the configure changes have the effect of deprecating something or
>> adjusting the required versions of something, there is a serious problem
>> and they should not have been approved: the documentation of prerequisites
>> in install.texi does not appear to have been changed and it still
>> specifies CLooG-PPL. It is not acceptable to change the prerequisites
>> without including the documentation changes in the same commit.
That was not mentioned in the discussion of the patch. In fact I
suppose Cloog-PPL was simply not tested. Andreas, did you try all
possible configurations?
Also, if I understood correctly ISL and PPL are different ways to "do
the same thing", and they should cause no differences in code
generation. I assumed this because the patch didn't require any
testsuite adjustment. Is this the case? If so, we only need to
document the new possible choice of Cloog libraries.
If not, however, as Joseph said we need: 1) documentation of the new
prerequisites; 2) a --enable-cloog-ppl option to enable Cloog-PPL tests
_and_ disable Cloog-ISL at the same time. In this case, I suggest
reverting the patch on trunk.
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 3:01 ` Joseph S. Myers
@ 2010-11-12 8:26 ` Jack Howarth
2010-11-12 9:00 ` Paolo Bonzini
0 siblings, 1 reply; 67+ messages in thread
From: Jack Howarth @ 2010-11-12 8:26 UTC (permalink / raw)
To: Joseph S. Myers
Cc: Sebastian Pop, Paolo Bonzini, Andreas Simbürger,
gcc-patches, gcc-graphite
On Fri, Nov 12, 2010 at 02:29:58AM +0000, Joseph S. Myers wrote:
> On Thu, 11 Nov 2010, Jack Howarth wrote:
>
> > On Thu, Nov 11, 2010 at 06:41:03PM -0500, Jack Howarth wrote:
> > >
> > > Sebastian,
> > > Do these new changes require cloog-ppl 0.15.10 rather than 0.15.9? I am
> > > finding the the x86_64-apple-darwin bootstrap fails with...
> > >
> > > checking for version 0.10 (or later revision) of PPL... yes
> > > checking for installed CLooG... no
> > > configure: error: Unable to find a usable CLooG. See config.log for details.
> > > ### execution of /var/tmp/tmp.1.UpSRyE failed, exit code 1
> > >
> >
> > Sebastian,
> > I finally caught on that the recent check-ins completely depreciate the use
> > of cloog-ppl. It would be nice if the configure error message alerted the user
> > to that fact. Installed cloog-org from the git using the recommended commands...
>
> If the configure changes have the effect of deprecating something or
> adjusting the required versions of something, there is a serious problem
> and they should not have been approved: the documentation of prerequisites
> in install.texi does not appear to have been changed and it still
> specifies CLooG-PPL. It is not acceptable to change the prerequisites
> without including the documentation changes in the same commit.
>
Joseph.
Actually the problem with building against the legacy cloog-ppl 0.15.9 seems
to be that configure's test omits passing ${ppllibs} to LDFLAGS. The gross hack...
Index: configure
===================================================================
--- configure (revision 166643)
+++ configure (working copy)
@@ -5730,7 +5731,7 @@
CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
- LDFLAGS="${LDFLAGS} ${clooglibs}"
+ LDFLAGS="${LDFLAGS} ${clooglibs} ${ppllibs}"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5
$as_echo_n "checking for installed CLooG... " >&6; }
allows configure to detect the installed legacy cloog. This may need to be
adjusted to avoid passing ${ppllibs} to the cloog-isl test.
Jack
> > Is there any documentation on how to build cloog-ppl from the cloog.org git?
> > Also what will be the recommended build configuration for gcc's graphite support
> > in gcc 4.6? Will it be ppl 0.11 and cloog-isl or cloog-ppl?
>
> Regarding recommended configurations the same principle as before still
> applies: the version of GCC and the configure options should determine the
> code generated, so given any particular configure options it should not
> accept different CLooG variants that may cause GCC to generate different
> code, it should accept only the recommended version unless
> sanity-check-disabling options such as --disable-cloog-version-check are
> passed.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 2:23 ` Jack Howarth
@ 2010-11-12 3:01 ` Jack Howarth
0 siblings, 0 replies; 67+ messages in thread
From: Jack Howarth @ 2010-11-12 3:01 UTC (permalink / raw)
To: Sebastian Pop
Cc: Paolo Bonzini, Andreas Simbürger, gcc-patches, gcc-graphite
On Thu, Nov 11, 2010 at 09:07:22PM -0500, Jack Howarth wrote:
> > where the ppl installed is 0.11. This build unfortunately fails at...
> >
> > /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./prev-gcc/xgcc -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./prev-gcc/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/bin/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/bin/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/lib/ -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/include -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/sys-include -c -g -O2 -mdynamic-no-pic -gtoggle -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.6-20101111/gcc -I../../gcc-4.6-20101111/gcc/. -I../../gcc-4.6-20101111/gcc/../include -I../../gcc-4.6-20101111/gcc/../libcpp/include -I/sw/include -I/sw/include -I../../gcc-4.6-20101111/gcc/../libdecnumber -I../../gcc-4.6-20101111/gcc/../libdecnumber/dpd -I../libdecnumber -I/sw/include -I/sw/include -DCLOOG_INT_GMP -DCLOOG_ORG -I/sw/include ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c -o graphite-cloog-util.o
> > ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c: In function 'oppose_constraint':
> > ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c:63:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> > ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c: In function 'cloog_matrix_to_ppl_constraint':
> > ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c:180:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> > ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c: In function 'new_Constraint_System_from_Cloog_Matrix':
> > ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c:210:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> > cc1: all warnings being treated as errors
> >
> > make[3]: *** [graphite-cloog-util.o] Error 1
> > make[3]: *** Waiting for unfinished jobs....
> >
FYI, I get the same error if I build gcc trunk against ppl 0.10.2 and cloog-isl.
Jack
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 2:07 ` Jack Howarth
2010-11-12 2:23 ` Jack Howarth
@ 2010-11-12 3:01 ` Joseph S. Myers
2010-11-12 8:26 ` Jack Howarth
1 sibling, 1 reply; 67+ messages in thread
From: Joseph S. Myers @ 2010-11-12 3:01 UTC (permalink / raw)
To: Jack Howarth
Cc: Sebastian Pop, Paolo Bonzini, Andreas Simbürger,
gcc-patches, gcc-graphite
On Thu, 11 Nov 2010, Jack Howarth wrote:
> On Thu, Nov 11, 2010 at 06:41:03PM -0500, Jack Howarth wrote:
> >
> > Sebastian,
> > Do these new changes require cloog-ppl 0.15.10 rather than 0.15.9? I am
> > finding the the x86_64-apple-darwin bootstrap fails with...
> >
> > checking for version 0.10 (or later revision) of PPL... yes
> > checking for installed CLooG... no
> > configure: error: Unable to find a usable CLooG. See config.log for details.
> > ### execution of /var/tmp/tmp.1.UpSRyE failed, exit code 1
> >
>
> Sebastian,
> I finally caught on that the recent check-ins completely depreciate the use
> of cloog-ppl. It would be nice if the configure error message alerted the user
> to that fact. Installed cloog-org from the git using the recommended commands...
If the configure changes have the effect of deprecating something or
adjusting the required versions of something, there is a serious problem
and they should not have been approved: the documentation of prerequisites
in install.texi does not appear to have been changed and it still
specifies CLooG-PPL. It is not acceptable to change the prerequisites
without including the documentation changes in the same commit.
> Is there any documentation on how to build cloog-ppl from the cloog.org git?
> Also what will be the recommended build configuration for gcc's graphite support
> in gcc 4.6? Will it be ppl 0.11 and cloog-isl or cloog-ppl?
Regarding recommended configurations the same principle as before still
applies: the version of GCC and the configure options should determine the
code generated, so given any particular configure options it should not
accept different CLooG variants that may cause GCC to generate different
code, it should accept only the recommended version unless
sanity-check-disabling options such as --disable-cloog-version-check are
passed.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-12 2:07 ` Jack Howarth
@ 2010-11-12 2:23 ` Jack Howarth
2010-11-12 3:01 ` Jack Howarth
2010-11-12 3:01 ` Joseph S. Myers
1 sibling, 1 reply; 67+ messages in thread
From: Jack Howarth @ 2010-11-12 2:23 UTC (permalink / raw)
To: Sebastian Pop
Cc: Paolo Bonzini, Andreas Simbürger, gcc-patches, gcc-graphite
On Thu, Nov 11, 2010 at 08:53:20PM -0500, Jack Howarth wrote:
>
> Sebastian,
> I finally caught on that the recent check-ins completely depreciate the use
> of cloog-ppl. It would be nice if the configure error message alerted the user
> to that fact. Installed cloog-org from the git using the recommended commands...
>
> git clone git://repo.or.cz/cloog.git
> cd cloog
> ./get_submodules.sh
> ./autogen.sh
> ./configure --with-gmp-prefix=/path/to/gmp/installation
> make
> And as root: make install
>
> which doesn't appear to provide the required support for building cloog-ppl
> in cloog.org. Using the installed cloog-isl, I was able to start a build of
> current gcc trunk with...
>
> ../gcc-4.6-20101111/configure --prefix=/sw --prefix=/sw/lib/gcc4.6 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.6/info --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.6 --enable-checking=yes
>
> where the ppl installed is 0.11. This build unfortunately fails at...
>
> /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./prev-gcc/xgcc -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./prev-gcc/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/bin/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/bin/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/lib/ -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/include -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/sys-include -c -g -O2 -mdynamic-no-pic -gtoggle -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.6-20101111/gcc -I../../gcc-4.6-20101111/gcc/. -I../../gcc-4.6-20101111/gcc/../include -I../../gcc-4.6-20101111/gcc/../libcpp/include -I/sw/include -I/sw/include -I../../gcc-4.6-20101111/gcc/../libdecnumber -I../../gcc-4.6-20101111/gcc/../libdecnumber/dpd -I../libdecnumber -I/sw/include -I/sw/include -DCLOOG_INT_GMP -DCLOOG_ORG -I/sw/include ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c -o graphite-cloog-util.o
> ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c: In function 'oppose_constraint':
> ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c:63:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c: In function 'cloog_matrix_to_ppl_constraint':
> ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c:180:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c: In function 'new_Constraint_System_from_Cloog_Matrix':
> ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c:210:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> cc1: all warnings being treated as errors
>
> make[3]: *** [graphite-cloog-util.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
>
> Is there any documentation on how to build cloog-ppl from the cloog.org git?
> Also what will be the recommended build configuration for gcc's graphite support
> in gcc 4.6? Will it be ppl 0.11 and cloog-isl or cloog-ppl?
> Jack
Sebastian,
I just checked the graphite branch and was surprised to find that gcc trunk is being jumped ahead
of the graphite branch with respect to cloog.org support. It doesn't appear that the configury changes
have been installed there yet.
Jack
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 23:52 ` Jack Howarth
@ 2010-11-12 2:07 ` Jack Howarth
2010-11-12 2:23 ` Jack Howarth
2010-11-12 3:01 ` Joseph S. Myers
0 siblings, 2 replies; 67+ messages in thread
From: Jack Howarth @ 2010-11-12 2:07 UTC (permalink / raw)
To: Sebastian Pop
Cc: Paolo Bonzini, Andreas Simbürger, gcc-patches, gcc-graphite
On Thu, Nov 11, 2010 at 06:41:03PM -0500, Jack Howarth wrote:
>
> Sebastian,
> Do these new changes require cloog-ppl 0.15.10 rather than 0.15.9? I am
> finding the the x86_64-apple-darwin bootstrap fails with...
>
> checking for version 0.10 (or later revision) of PPL... yes
> checking for installed CLooG... no
> configure: error: Unable to find a usable CLooG. See config.log for details.
> ### execution of /var/tmp/tmp.1.UpSRyE failed, exit code 1
>
Sebastian,
I finally caught on that the recent check-ins completely depreciate the use
of cloog-ppl. It would be nice if the configure error message alerted the user
to that fact. Installed cloog-org from the git using the recommended commands...
git clone git://repo.or.cz/cloog.git
cd cloog
./get_submodules.sh
./autogen.sh
./configure --with-gmp-prefix=/path/to/gmp/installation
make
And as root: make install
which doesn't appear to provide the required support for building cloog-ppl
in cloog.org. Using the installed cloog-isl, I was able to start a build of
current gcc trunk with...
../gcc-4.6-20101111/configure --prefix=/sw --prefix=/sw/lib/gcc4.6 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.6/info --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.6 --enable-checking=yes
where the ppl installed is 0.11. This build unfortunately fails at...
/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./prev-gcc/xgcc -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./prev-gcc/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/bin/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/bin/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/lib/ -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/include -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/sys-include -c -g -O2 -mdynamic-no-pic -gtoggle -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.6-20101111/gcc -I../../gcc-4.6-20101111/gcc/. -I../../gcc-4.6-20101111/gcc/../include -I../../gcc-4.6-20101111/gcc/../libcpp/include -I/sw/include -I/sw/include -I../../gcc-4.6-20101111/gcc/../libdecnumber -I../../gcc-4.6-20101111/gcc/../libdecnumber/dpd -I../libdecnumber -I/sw/include -I/sw/include -DCLOOG_INT_GMP -DCLOOG_ORG -I/sw/include ../../gcc-4.6-20101111/gcc/graphite-cloog-util.c -o graphite-cloog-util.o
../../gcc-4.6-20101111/gcc/graphite-cloog-util.c: In function 'oppose_constraint':
../../gcc-4.6-20101111/gcc/graphite-cloog-util.c:63:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
../../gcc-4.6-20101111/gcc/graphite-cloog-util.c: In function 'cloog_matrix_to_ppl_constraint':
../../gcc-4.6-20101111/gcc/graphite-cloog-util.c:180:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
../../gcc-4.6-20101111/gcc/graphite-cloog-util.c: In function 'new_Constraint_System_from_Cloog_Matrix':
../../gcc-4.6-20101111/gcc/graphite-cloog-util.c:210:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
cc1: all warnings being treated as errors
make[3]: *** [graphite-cloog-util.o] Error 1
make[3]: *** Waiting for unfinished jobs....
Is there any documentation on how to build cloog-ppl from the cloog.org git?
Also what will be the recommended build configuration for gcc's graphite support
in gcc 4.6? Will it be ppl 0.11 and cloog-isl or cloog-ppl?
Jack
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 21:40 ` Sebastian Pop
` (2 preceding siblings ...)
2010-11-11 22:42 ` Jack Howarth
@ 2010-11-11 23:52 ` Jack Howarth
2010-11-12 2:07 ` Jack Howarth
3 siblings, 1 reply; 67+ messages in thread
From: Jack Howarth @ 2010-11-11 23:52 UTC (permalink / raw)
To: Sebastian Pop
Cc: Paolo Bonzini, Andreas Simbürger, gcc-patches, gcc-graphite
On Thu, Nov 11, 2010 at 03:35:02PM -0600, Sebastian Pop wrote:
> On Thu, Nov 11, 2010 at 14:38, Paolo Bonzini <bonzini@gnu.org> wrote:
> > On 11/11/2010 09:01 PM, Andreas Simbürger wrote:
> >>
> >> --------------------------
> >> Changes to previous patch:
> >> * Moved AC_SUBST's inside CLOOG_INIT_FLAGS
> >> * Separated in-tree opts from CLOOG_INIT_FLAGS
> >>
> >> As discussed with Paolo, I will prepare a separate patch to implement
> >> his proposal of moving the version checking inside the gcc/configure.ac
> >> script.
> >>
> >> Sorry for the delay, after a small break after my exams I got pulled off
> >> by some other work and completely forgot about sending in this patch :-(.
> >
> > Ok.
>
> Thanks Andreas for your effort on getting this done.
> I committed the patch on trunk as r166622.
>
> Sebastian
Sebastian,
Do these new changes require cloog-ppl 0.15.10 rather than 0.15.9? I am
finding the the x86_64-apple-darwin bootstrap fails with...
checking for version 0.10 (or later revision) of PPL... yes
checking for installed CLooG... no
configure: error: Unable to find a usable CLooG. See config.log for details.
### execution of /var/tmp/tmp.1.UpSRyE failed, exit code 1
with the config.log contents...
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ ../gcc-4.6-20101111/configure --prefix=/sw --prefix=/sw/lib/gcc4.6 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.6/info --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.6 --enable-checking=yes
## --------- ##
## Platform. ##
## --------- ##
hostname = MacPro.local
uname -m = i386
uname -r = 10.5.0
uname -s = Darwin
uname -v = Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386
/usr/bin/uname -p = i386
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = Mach kernel version:
Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386
Kernel configured for up to 8 processors.
8 processors are physically available.
8 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3 4 5 6 7
Primary memory available: 12.00 gigabytes
Default processor set: 98 tasks, 287 threads, 8 processors
Load average: 0.98, Mach factor: 7.01
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /sw/var/lib/fink/path-prefix-10.6
PATH: /sw/bin
PATH: /sw/sbin
PATH: /bin
PATH: /usr/bin
PATH: /sbin
PATH: /usr/sbin
PATH: /usr/X11R6/bin
PATH: /sw/share/tinker/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2199: checking build system type
configure:2213: result: x86_64-apple-darwin10.5.0
configure:2260: checking host system type
configure:2273: result: x86_64-apple-darwin10.5.0
configure:2293: checking target system type
configure:2306: result: x86_64-apple-darwin10.5.0
configure:2360: checking for a BSD-compatible install
configure:2428: result: /usr/bin/install -c
configure:2439: checking whether ln works
configure:2461: result: yes
configure:2465: checking whether ln -s works
configure:2469: result: yes
configure:2476: checking for a sed that does not truncate output
configure:2540: result: /usr/bin/sed
configure:2549: checking for gawk
configure:2565: found /sw/bin/gawk
configure:2576: result: gawk
configure:3825: checking for gcc
configure:3841: found /sw/var/lib/fink/path-prefix-10.6/gcc
configure:3852: result: gcc
configure:4081: checking for C compiler version
configure:4090: gcc --version >&5
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:4101: $? = 0
configure:4090: gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5664~105/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)
configure:4101: $? = 0
configure:4090: gcc -V >&5
gcc-4.2: argument to `-V' is missing
configure:4101: $? = 1
configure:4090: gcc -qversion >&5
i686-apple-darwin10-gcc-4.2.1: no input files
configure:4101: $? = 1
configure:4121: checking for C compiler default output file name
configure:4143: gcc conftest.c >&5
configure:4147: $? = 0
configure:4184: result: a.out
configure:4200: checking whether the C compiler works
configure:4209: ./a.out
configure:4213: $? = 0
configure:4228: result: yes
configure:4235: checking whether we are cross compiling
configure:4237: result: no
configure:4240: checking for suffix of executables
configure:4247: gcc -o conftest conftest.c >&5
configure:4251: $? = 0
configure:4273: result:
configure:4279: checking for suffix of object files
configure:4301: gcc -c conftest.c >&5
configure:4305: $? = 0
configure:4326: result: o
configure:4330: checking whether we are using the GNU C compiler
configure:4349: gcc -c conftest.c >&5
configure:4349: $? = 0
configure:4358: result: yes
configure:4367: checking whether gcc accepts -g
configure:4387: gcc -c -g conftest.c >&5
configure:4387: $? = 0
configure:4428: result: yes
configure:4445: checking for gcc option to accept ISO C89
configure:4509: gcc -c -g -O2 conftest.c >&5
configure:4509: $? = 0
configure:4522: result: none needed
configure:4600: checking for g++
configure:4616: found /sw/var/lib/fink/path-prefix-10.6/g++
configure:4627: result: g++
configure:4654: checking for C++ compiler version
configure:4663: g++ --version >&5
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:4674: $? = 0
configure:4663: g++ -v >&5
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5664~105/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)
configure:4674: $? = 0
configure:4663: g++ -V >&5
g++-4.2: argument to `-V' is missing
configure:4674: $? = 1
configure:4663: g++ -qversion >&5
i686-apple-darwin10-g++-4.2.1: no input files
configure:4674: $? = 1
configure:4678: checking whether we are using the GNU C++ compiler
configure:4697: g++ -c conftest.cpp >&5
configure:4697: $? = 0
configure:4706: result: yes
configure:4715: checking whether g++ accepts -g
configure:4735: g++ -c -g conftest.cpp >&5
configure:4735: $? = 0
configure:4776: result: yes
configure:4865: checking for gnatbind
configure:4895: result: no
configure:4957: checking for gnatmake
configure:4987: result: no
configure:5006: checking whether compiler driver understands Ada
configure:5029: result: no
configure:5038: checking how to compare bootstrapped objects
configure:5063: result: cmp --ignore-initial=16 $$f1 $$f2
configure:5079: checking for objdir
configure:5094: result: .libs
configure:5260: checking for the correct version of gmp.h
configure:5280: gcc -c -g -O2 -I/sw/include -I/sw/include conftest.c >&5
configure:5280: $? = 0
configure:5298: gcc -c -g -O2 -I/sw/include -I/sw/include conftest.c >&5
configure:5298: $? = 0
configure:5299: result: yes
configure:5315: checking for the correct version of mpfr.h
configure:5333: gcc -c -g -O2 -I/sw/include -I/sw/include conftest.c >&5
configure:5333: $? = 0
configure:5350: gcc -c -g -O2 -I/sw/include -I/sw/include conftest.c >&5
configure:5350: $? = 0
configure:5351: result: yes
configure:5368: checking for the correct version of mpc.h
configure:5385: gcc -c -g -O2 -I/sw/include -I/sw/include conftest.c >&5
configure:5385: $? = 0
configure:5401: gcc -c -g -O2 -I/sw/include -I/sw/include conftest.c >&5
configure:5401: $? = 0
configure:5402: result: yes
configure:5420: checking for the correct version of the gmp/mpfr/mpc libraries
configure:5451: gcc -o conftest -g -O2 -I/sw/include -I/sw/include conftest.c -L/sw/lib -L/sw/lib -lmpc -lmpfr -lgmp >&5
configure:5451: $? = 0
configure:5452: result: yes
configure:5625: checking for version 0.10 (or later revision) of PPL
configure:5642: gcc -c -g -O2 -I/sw/include -I/sw/include -I/sw/include conftest.c >&5
configure:5642: $? = 0
configure:5643: result: yes
configure:5736: checking for installed CLooG
configure:5753: gcc -o conftest -g -O2 -I/sw/include -I/sw/include -I/sw/include -I/sw/include -DCLOOG_PPL_BACKEND -DCLOOG_INT_GMP -DCLOOG_ORG -L/sw/lib conftest.c -lcloog >&5
Undefined symbols:
"_ppl_version_major", referenced from:
_main in ccRD4C69.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure:5753: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
| #include <cloog/cloog.h>
| int
| main ()
| {
| ppl_version_major ()
| ;
| return 0;
| }
configure:5768: gcc -o conftest -g -O2 -I/sw/include -I/sw/include -I/sw/include -I/sw/include -DCLOOG_PPL_BACKEND -DCLOOG_INT_GMP -DCLOOG_ORG -L/sw/lib conftest.c -lcloog-isl -lisl >&5
ld: library not found for -lcloog-isl
collect2: ld returned 1 exit status
configure:5768: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
| #include <cloog/cloog.h>
| int
| main ()
| {
| cloog_version ()
| ;
| return 0;
| }
configure:5783: gcc -o conftest -g -O2 -I/sw/include -I/sw/include -I/sw/include -I/sw/include -DCLOOG_PPL_BACKEND -DCLOOG_INT_GMP -DCLOOG_ORG -L/sw/lib conftest.c -lcloog-ppl >&5
ld: library not found for -lcloog-ppl
collect2: ld returned 1 exit status
configure:5783: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
| #include <cloog/cloog.h>
| int
| main ()
| {
| cloog_version ()
| ;
| return 0;
| }
configure:5797: result: no
configure:5952: error: Unable to find a usable CLooG. See config.log for details.
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-apple-darwin10.5.0
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_AR_FOR_TARGET_set=
ac_cv_env_AR_FOR_TARGET_value=
ac_cv_env_AR_set=
ac_cv_env_AR_value=
ac_cv_env_AS_FOR_TARGET_set=
ac_cv_env_AS_FOR_TARGET_value=
ac_cv_env_AS_set=
ac_cv_env_AS_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_FOR_TARGET_set=
ac_cv_env_CC_FOR_TARGET_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_FOR_TARGET_set=
ac_cv_env_CXX_FOR_TARGET_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_DLLTOOL_FOR_TARGET_set=
ac_cv_env_DLLTOOL_FOR_TARGET_value=
ac_cv_env_DLLTOOL_set=
ac_cv_env_DLLTOOL_value=
ac_cv_env_GCC_FOR_TARGET_set=
ac_cv_env_GCC_FOR_TARGET_value=
ac_cv_env_GCJ_FOR_TARGET_set=
ac_cv_env_GCJ_FOR_TARGET_value=
ac_cv_env_GFORTRAN_FOR_TARGET_set=
ac_cv_env_GFORTRAN_FOR_TARGET_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LD_FOR_TARGET_set=
ac_cv_env_LD_FOR_TARGET_value=
ac_cv_env_LD_set=
ac_cv_env_LD_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LIPO_FOR_TARGET_set=
ac_cv_env_LIPO_FOR_TARGET_value=
ac_cv_env_LIPO_set=
ac_cv_env_LIPO_value=
ac_cv_env_NM_FOR_TARGET_set=
ac_cv_env_NM_FOR_TARGET_value=
ac_cv_env_NM_set=
ac_cv_env_NM_value=
ac_cv_env_OBJCOPY_set=
ac_cv_env_OBJCOPY_value=
ac_cv_env_OBJDUMP_FOR_TARGET_set=
ac_cv_env_OBJDUMP_FOR_TARGET_value=
ac_cv_env_OBJDUMP_set=
ac_cv_env_OBJDUMP_value=
ac_cv_env_RANLIB_FOR_TARGET_set=
ac_cv_env_RANLIB_FOR_TARGET_value=
ac_cv_env_RANLIB_set=
ac_cv_env_RANLIB_value=
ac_cv_env_STRIP_FOR_TARGET_set=
ac_cv_env_STRIP_FOR_TARGET_value=
ac_cv_env_STRIP_set=
ac_cv_env_STRIP_value=
ac_cv_env_WINDMC_FOR_TARGET_set=
ac_cv_env_WINDMC_FOR_TARGET_value=
ac_cv_env_WINDMC_set=
ac_cv_env_WINDMC_value=
ac_cv_env_WINDRES_FOR_TARGET_set=
ac_cv_env_WINDRES_FOR_TARGET_value=
ac_cv_env_WINDRES_set=
ac_cv_env_WINDRES_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_build_configargs_set=
ac_cv_env_build_configargs_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_host_configargs_set=
ac_cv_env_host_configargs_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_env_target_configargs_set=
ac_cv_env_target_configargs_value=
ac_cv_host=x86_64-apple-darwin10.5.0
ac_cv_objext=o
ac_cv_path_INTLTOOL_PERL=/usr/bin/perl
ac_cv_path_SED=/usr/bin/sed
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
ac_cv_target=x86_64-apple-darwin10.5.0
acx_cv_cc_gcc_supports_ada=no
acx_cv_prog_LN=ln
gcc_cv_cloog_type=no
gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
lt_cv_objdir=.libs
## ----------------- ##
## Output variables. ##
## ----------------- ##
AR=''
AR_FOR_BUILD='$(AR)'
AR_FOR_TARGET=''
AS=''
AS_FOR_BUILD='$(AS)'
AS_FOR_TARGET=''
AWK='gawk'
BISON=''
BUILD_CONFIG=''
CC='gcc'
CC_FOR_BUILD='$(CC)'
CC_FOR_TARGET=''
CFLAGS='-g -O2'
CFLAGS_FOR_BUILD=''
CFLAGS_FOR_TARGET=''
COMPILER_AS_FOR_TARGET=''
COMPILER_LD_FOR_TARGET=''
COMPILER_NM_FOR_TARGET=''
CONFIGURE_GDB_TK=''
CPPFLAGS=''
CXX='g++'
CXXFLAGS='-g -O2'
CXXFLAGS_FOR_BUILD=''
CXXFLAGS_FOR_TARGET=''
CXX_FOR_BUILD='$(CXX)'
CXX_FOR_TARGET=''
DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
DEFS=''
DLLTOOL=''
DLLTOOL_FOR_BUILD='$(DLLTOOL)'
DLLTOOL_FOR_TARGET=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EXEEXT=''
EXPECT=''
FLAGS_FOR_TARGET=''
FLEX=''
GCC_FOR_TARGET=''
GCC_SHLIB_SUBDIR=''
GCJ_FOR_BUILD='$(GCJ)'
GCJ_FOR_TARGET=''
GDB_TK=''
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET=''
GNATBIND='no'
GNATMAKE='no'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD='/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld'
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET=''
LEX=''
LIBOBJS=''
LIBS=''
LIPO=''
LIPO_FOR_TARGET=''
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO=''
NM=''
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET=''
OBJCOPY=''
OBJDUMP=''
OBJDUMP_FOR_TARGET=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET=''
RAW_CXX_FOR_TARGET=''
RPATH_ENVVAR=''
RUNTEST=''
SED='/usr/bin/sed'
SHELL='/bin/sh'
STRIP=''
STRIP_FOR_TARGET=''
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='../gcc-4.6-20101111/configure --prefix=/sw --prefix=/sw/lib/gcc4.6 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.6/info --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.6 --enable-checking=yes'
WINDMC=''
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET=''
WINDRES=''
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET=''
YACC=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
bindir='${exec_prefix}/bin'
build='x86_64-apple-darwin10.5.0'
build_alias=''
build_configargs=''
build_configdirs='build-libiberty build-texinfo build-byacc build-flex build-bison build-m4 build-fixincludes'
build_cpu='x86_64'
build_libsubdir='build-x86_64-apple-darwin10.5.0'
build_noncanonical='x86_64-apple-darwin10.5.0'
build_os='darwin10.5.0'
build_subdir='build-x86_64-apple-darwin10.5.0'
build_tooldir=''
build_vendor='apple'
clooginc=''
clooglibs=''
compare_exclusions=''
config_shell='/bin/sh'
configdirs='intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr mpc ppl cloog libelf libiconv texinfo byacc flex bison binutils gas ld fixincludes gcc cgen sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
do_compare='cmp --ignore-initial=16 $$f1 $$f2'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
extra_host_libiberty_configure_flags=''
extra_mpc_gmp_configure_flags=''
extra_mpc_mpfr_configure_flags=''
extra_mpfr_configure_flags=''
gmpinc='-I/sw/include -I/sw/include '
gmplibs='-L/sw/lib -L/sw/lib -lmpc -lmpfr -lgmp'
host='x86_64-apple-darwin10.5.0'
host_alias=''
host_configargs=''
host_cpu='x86_64'
host_noncanonical='x86_64-apple-darwin10.5.0'
host_os='darwin10.5.0'
host_subdir='.'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='/sw/lib/gcc4.6/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='/sw/share/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
poststage1_ldflags=''
poststage1_libs=''
pplinc='-I/sw/include '
ppllibs='-L/sw/lib -lppl_c -lppl -lgmpxx'
prefix='/sw/lib/gcc4.6'
program_transform_name='s&$$&-fsf-4.6&'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags=''
stage1_checking=''
stage1_languages=''
stage1_ldflags=''
stage1_libs=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='x86_64-apple-darwin10.5.0'
target_alias=''
target_configargs=''
target_configdirs='target-libgcc target-libiberty target-libgloss target-newlib target-libgomp target-libstdc++-v3 target-libmudflap target-libssp target-libquadmath target-libgfortran target-boehm-gc target-libffi target-zlib target-qthreads target-libjava target-libobjc target-libada target-examples target-groff target-gperf target-rda'
target_cpu='x86_64'
target_noncanonical='x86_64-apple-darwin10.5.0'
target_os='darwin10.5.0'
target_subdir='x86_64-apple-darwin10.5.0'
target_vendor='apple'
tooldir=''
## ------------------- ##
## File substitutions. ##
## ------------------- ##
alphaieee_frag=''
host_makefile_frag='config/mh-darwin'
ospace_frag=''
serialization_dependencies=''
target_makefile_frag=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define LT_OBJDIR ".libs/"
configure: exit 1
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 21:43 ` Sebastian Pop
@ 2010-11-11 22:53 ` Paolo Bonzini
0 siblings, 0 replies; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-11 22:53 UTC (permalink / raw)
To: Sebastian Pop; +Cc: Andreas Simbürger, gcc-patches, gcc-graphite
On 11/11/2010 10:40 PM, Sebastian Pop wrote:
> Paolo,
> I committed this only on the GCC side. I remember that in the past there
> were some problems of synchronizing the toplevel configure changes with
> the other projects at toplevel. Where exactly this change should also be
> committed?
I'll take care of it tomorrow.
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 21:40 ` Sebastian Pop
2010-11-11 21:41 ` Sebastian Pop
2010-11-11 21:43 ` Sebastian Pop
@ 2010-11-11 22:42 ` Jack Howarth
2010-11-11 23:52 ` Jack Howarth
3 siblings, 0 replies; 67+ messages in thread
From: Jack Howarth @ 2010-11-11 22:42 UTC (permalink / raw)
To: Sebastian Pop
Cc: Paolo Bonzini, Andreas Simbürger, gcc-patches, gcc-graphite
On Thu, Nov 11, 2010 at 03:35:02PM -0600, Sebastian Pop wrote:
> On Thu, Nov 11, 2010 at 14:38, Paolo Bonzini <bonzini@gnu.org> wrote:
> > On 11/11/2010 09:01 PM, Andreas Simbürger wrote:
> >>
> >> --------------------------
> >> Changes to previous patch:
> >> * Moved AC_SUBST's inside CLOOG_INIT_FLAGS
> >> * Separated in-tree opts from CLOOG_INIT_FLAGS
> >>
> >> As discussed with Paolo, I will prepare a separate patch to implement
> >> his proposal of moving the version checking inside the gcc/configure.ac
> >> script.
> >>
> >> Sorry for the delay, after a small break after my exams I got pulled off
> >> by some other work and completely forgot about sending in this patch :-(.
> >
> > Ok.
>
> Thanks Andreas for your effort on getting this done.
> I committed the patch on trunk as r166622.
>
> Sebastian
Sebastian,
Is there a schedule yet for the cloog.org 0.15 release? Now that the gcc
build machinery support is in place, perhaps a release candidate tarball for
cloog.org 0.15 could be posted.
Jack
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 21:40 ` Sebastian Pop
2010-11-11 21:41 ` Sebastian Pop
@ 2010-11-11 21:43 ` Sebastian Pop
2010-11-11 22:53 ` Paolo Bonzini
2010-11-11 22:42 ` Jack Howarth
2010-11-11 23:52 ` Jack Howarth
3 siblings, 1 reply; 67+ messages in thread
From: Sebastian Pop @ 2010-11-11 21:43 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Andreas Simbürger, gcc-patches, gcc-graphite
On Thu, Nov 11, 2010 at 15:35, Sebastian Pop <sebpop@gmail.com> wrote:
> On Thu, Nov 11, 2010 at 14:38, Paolo Bonzini <bonzini@gnu.org> wrote:
>> On 11/11/2010 09:01 PM, Andreas Simbürger wrote:
>>>
>>> --------------------------
>>> Changes to previous patch:
>>> * Moved AC_SUBST's inside CLOOG_INIT_FLAGS
>>> * Separated in-tree opts from CLOOG_INIT_FLAGS
>>>
>>> As discussed with Paolo, I will prepare a separate patch to implement
>>> his proposal of moving the version checking inside the gcc/configure.ac
>>> script.
>>>
>>> Sorry for the delay, after a small break after my exams I got pulled off
>>> by some other work and completely forgot about sending in this patch :-(.
>>
>> Ok.
>
> Thanks Andreas for your effort on getting this done.
> I committed the patch on trunk as r166622.
Paolo,
I committed this only on the GCC side. I remember that in the past there
were some problems of synchronizing the toplevel configure changes with
the other projects at toplevel. Where exactly this change should also be
committed?
Thanks,
Sebastian
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 21:40 ` Sebastian Pop
@ 2010-11-11 21:41 ` Sebastian Pop
2010-11-11 21:43 ` Sebastian Pop
` (2 subsequent siblings)
3 siblings, 0 replies; 67+ messages in thread
From: Sebastian Pop @ 2010-11-11 21:41 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Andreas Simbürger, gcc-patches, gcc-graphite
On Thu, Nov 11, 2010 at 14:38, Paolo Bonzini <bonzini@gnu.org> wrote:
> On 11/11/2010 09:01 PM, Andreas Simbürger wrote:
>>
>> --------------------------
>> Changes to previous patch:
>> * Moved AC_SUBST's inside CLOOG_INIT_FLAGS
>> * Separated in-tree opts from CLOOG_INIT_FLAGS
>>
>> As discussed with Paolo, I will prepare a separate patch to implement
>> his proposal of moving the version checking inside the gcc/configure.ac
>> script.
>>
>> Sorry for the delay, after a small break after my exams I got pulled off
>> by some other work and completely forgot about sending in this patch :-(.
>
> Ok.
Thanks Andreas for your effort on getting this done.
I committed the patch on trunk as r166622.
Sebastian
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 20:39 ` Paolo Bonzini
@ 2010-11-11 21:40 ` Sebastian Pop
2010-11-11 21:41 ` Sebastian Pop
` (3 more replies)
0 siblings, 4 replies; 67+ messages in thread
From: Sebastian Pop @ 2010-11-11 21:40 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Andreas Simbürger, gcc-patches, gcc-graphite
On Thu, Nov 11, 2010 at 14:38, Paolo Bonzini <bonzini@gnu.org> wrote:
> On 11/11/2010 09:01 PM, Andreas Simbürger wrote:
>>
>> --------------------------
>> Changes to previous patch:
>> * Moved AC_SUBST's inside CLOOG_INIT_FLAGS
>> * Separated in-tree opts from CLOOG_INIT_FLAGS
>>
>> As discussed with Paolo, I will prepare a separate patch to implement
>> his proposal of moving the version checking inside the gcc/configure.ac
>> script.
>>
>> Sorry for the delay, after a small break after my exams I got pulled off
>> by some other work and completely forgot about sending in this patch :-(.
>
> Ok.
Thanks Andreas for your effort on getting this done.
I committed the patch on trunk as r166622.
Sebastian
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-11-11 20:06 ` Andreas Simbürger
@ 2010-11-11 20:39 ` Paolo Bonzini
2010-11-11 21:40 ` Sebastian Pop
2010-11-15 15:52 ` Andreas Schwab
2010-11-15 15:55 ` Andreas Schwab
2 siblings, 1 reply; 67+ messages in thread
From: Paolo Bonzini @ 2010-11-11 20:39 UTC (permalink / raw)
To: Andreas Simbürger; +Cc: gcc-patches, gcc-graphite
On 11/11/2010 09:01 PM, Andreas Simbürger wrote:
> --------------------------
> Changes to previous patch:
> * Moved AC_SUBST's inside CLOOG_INIT_FLAGS
> * Separated in-tree opts from CLOOG_INIT_FLAGS
>
> As discussed with Paolo, I will prepare a separate patch to implement
> his proposal of moving the version checking inside the gcc/configure.ac
> script.
>
> Sorry for the delay, after a small break after my exams I got pulled off
> by some other work and completely forgot about sending in this patch :-(.
Ok.
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* [PATCH] Support official CLooG.org versions.
2010-10-31 10:03 ` Paolo Bonzini
@ 2010-11-11 20:06 ` Andreas Simbürger
2010-11-11 20:39 ` Paolo Bonzini
` (2 more replies)
0 siblings, 3 replies; 67+ messages in thread
From: Andreas Simbürger @ 2010-11-11 20:06 UTC (permalink / raw)
To: gcc-patches; +Cc: gcc-graphite, bonzini, Andreas Simbürger
--------------------------
Changes to previous patch:
* Moved AC_SUBST's inside CLOOG_INIT_FLAGS
* Separated in-tree opts from CLOOG_INIT_FLAGS
As discussed with Paolo, I will prepare a separate patch to implement
his proposal of moving the version checking inside the gcc/configure.ac
script.
Sorry for the delay, after a small break after my exams I got pulled off
by some other work and completely forgot about sending in this patch :-(.
--------------------------
Add support for official CLooG releases.
CLooG's configuration gets detected within 2 stages:
Stage 1: Detect the installed CLooG version.
This is done by linking test programs against the various
CLooG libraries. As CLooG's library sonames depend on the
used backend, this is sufficient to detect the used backend.
We only detect this backends, in order:
1) CLooG-PPL (Legacy): The "old" CLooG.
2) CLooG-ISL: The "new" CLooG.
3) CLooG-Parma: An alternative backend, to compare it with
CLooG-ISL.
CLooG-Poly is not detected, as the PolyLib may conflict
with GCC's license.
Stage 2: Version checks.
After detecting the right configuration, we finally check
if the installed version is usable. There are 2 different
checks: One for CLooG-PPL (Legacy) and one for CLooG-ISL.
* CLooG-ISL:
As the "new" CLooG provides methods to check for its version at
both compile and run time, we use the compile time check.
We check for the constants to verify the header's compatibility.
* CLooG-PPL (Legacy):
This version check provides the same semantics as before.
As CLooG-PPL (Legacy) provides the same constants as the
official CLooG, we can use the same test program for the
compile time check.
Tested with CLooG-ISL and CLooG-PPL (Legacy).
As for now, CLooG-Parma fails to build.
2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* configure.ac: Support official CLooG.org versions.
* configure: Regenerate.
* config/cloog.m4: New.
---
ChangeLog.graphite | 6 +
config/cloog.m4 | 252 +++++++++++++++++++++++++++++++++++++++++++
configure | 304 ++++++++++++++++++++++++++++++++++++++++++----------
configure.ac | 83 +++++----------
4 files changed, 533 insertions(+), 112 deletions(-)
create mode 100644 config/cloog.m4
diff --git a/ChangeLog.graphite b/ChangeLog.graphite
index 46f1290..d067200 100644
--- a/ChangeLog.graphite
+++ b/ChangeLog.graphite
@@ -1,3 +1,9 @@
+2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * configure.ac: Support official CLooG.org versions.
+ * configure: Regenerate.
+ * config/cloog.m4: New.
+
2010-10-20 Sebastian Pop <sebastian.pop@amd.com>
* Merge from mainline (164578:165734).
diff --git a/config/cloog.m4 b/config/cloog.m4
new file mode 100644
index 0000000..9ddea98
--- /dev/null
+++ b/config/cloog.m4
@@ -0,0 +1,252 @@
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3, or (at your option) any later
+# version.
+#
+# GCC is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+# CLOOG_INIT_FLAGS ()
+# -------------------------
+# Provide configure switches for CLooG support.
+# Initialize clooglibs/clooginc according to the user input.
+AC_DEFUN([CLOOG_INIT_FLAGS],
+[
+ AC_ARG_WITH(cloog,
+ [AS_HELP_STRING(
+ [--with-cloog=PATH],
+ [Specify prefix directory for the installed CLooG-PPL package.
+ Equivalent to --with-cloog-include=PATH/include
+ plus --with-cloog-lib=PATH/lib])])
+ AC_ARG_WITH(cloog_include,
+ [AS_HELP_STRING(
+ [--with-cloog-include=PATH],
+ [Specify directory for installed CLooG include files])])
+ AC_ARG_WITH(cloog_lib,
+ [AS_HELP_STRING(
+ [--with-cloog-lib=PATH],
+ [Specify the directory for the installed CLooG library])])
+
+ AC_ARG_ENABLE(cloog-version-check,
+ [AS_HELP_STRING(
+ [--disable-cloog-version-check],
+ [disable check for CLooG version])],
+ ENABLE_CLOOG_CHECK=$enableval,
+ ENABLE_CLOOG_CHECK=yes)
+
+ # Initialize clooglibs and clooginc.
+ case $with_cloog in
+ no)
+ clooglibs=
+ clooginc=
+ ;;
+ "" | yes)
+ ;;
+ *)
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
+ ;;
+ esac
+ if test "x${with_cloog_include}" != x ; then
+ clooginc="-I$with_cloog_include"
+ fi
+ if test "x${with_cloog_lib}" != x; then
+ clooglibs="-L$with_cloog_lib"
+ fi
+
+ dnl Flags needed for CLOOG
+ AC_SUBST(clooglibs)
+ AC_SUBST(clooginc)
+]
+)
+
+# CLOOG_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
+# ----------------------------------------------------
+# Provide actions for failed CLooG detection.
+AC_DEFUN([CLOOG_REQUESTED],
+[
+ AC_REQUIRE([CLOOG_INIT_FLAGS])
+
+ if test "x${with_cloog}" != x \
+ || test "x${with_cloog_include}" != x \
+ || test "x${with_cloog_lib}" != x ; then
+ $1
+ else
+ $2
+ fi
+]
+)
+
+# _CLOOG_ORG_PROG ()
+# ------------------
+# Helper for detecting CLooG.org's backend.
+m4_define([_CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
+ [#include <cloog/cloog.h>],
+ [cloog_version ()])])
+
+# _CLOOG_PPL_LEGACY_PROG ()
+# -------------------------
+# Helper for detecting CLooG-Legacy (CLooG-PPL).
+m4_define([_CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
+ [#include <cloog/cloog.h>],
+ [ppl_version_major ()])])
+
+# CLOOG_FIND_FLAGS ()
+# ------------------
+# Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org.
+# Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
+AC_DEFUN([CLOOG_FIND_FLAGS],
+[
+ AC_REQUIRE([CLOOG_INIT_FLAGS])
+
+ _cloog_saved_CFLAGS=$CFLAGS
+ _cloog_saved_CPPFLAGS=$CPPFLAGS
+ _cloog_saved_LDFLAGS=$LDFLAGS
+ _cloog_saved_LIBS=$LIBS
+
+ _clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
+ CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
+ CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ AC_CACHE_CHECK([for installed CLooG],
+ [gcc_cv_cloog_type],
+ [LIBS="-lcloog ${_cloog_saved_LIBS}"
+ AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG],
+ [gcc_cv_cloog_type="PPL Legacy"],
+ [LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}"
+ AC_LINK_IFELSE([_CLOOG_ORG_PROG],
+ [gcc_cv_cloog_type=ISL],
+ [LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
+ AC_LINK_IFELSE([_CLOOG_ORG_PROG],
+ [gcc_cv_cloog_type=PPL],
+ [gcc_cv_cloog_type=no])])])])
+
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${_clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${_cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${_cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ cloog_org=
+ ;;
+ esac
+
+ LIBS=$_cloog_saved_LIBS
+ CFLAGS=$_cloog_saved_CFLAGS
+ CPPFLAGS=$_cloog_saved_CPPFLAGS
+ LDFLAGS=$_cloog_saved_LDFLAGS
+]
+)
+
+# _CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION)
+# --------------------------------------------
+# Helper for verifying CLooG's compile time version.
+m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
+ [#include "cloog/cloog.h"],
+ [#if CLOOG_VERSION_MAJOR != $1 \
+ || CLOOG_VERSION_MINOR != $2 \
+ || CLOOG_VERSION_REVISION < $3
+ choke me
+ #endif])])
+
+# _CLOOG_CHECK_RT_PROG ()
+# -----------------------
+# Helper for verifying that CLooG's compile time version
+# matches the run time version.
+m4_define([_CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM(
+ [#include "cloog/cloog.h"],
+ [if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ return 1;
+ }])])
+
+# CLOOG_CHECK_VERSION CLOOG_CHECK_VERSION (MAJOR, MINOR, REVISION)
+# ----------------------------------------------------------------
+# Test the found CLooG to be exact of version MAJOR.MINOR and at least
+# REVISION.
+# If we're using the old CLooG-PPL (Legacy), the old version check will
+# be executed (Ignores the provided version information).
+AC_DEFUN([CLOOG_CHECK_VERSION],
+[
+ AC_REQUIRE([CLOOG_FIND_FLAGS])
+
+ if test "${ENABLE_CLOOG_CHECK}" = yes ; then
+ _cloog_saved_CFLAGS=$CFLAGS
+ _cloog_saved_LDFLAGS=$LDFLAGS
+
+ CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
+ LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs}"
+
+ if test "${cloog_org}" = yes ; then
+ AC_CACHE_CHECK([for verison $1.$2.$3 of CLooG],
+ [gcc_cv_cloog_ct_0_14_0],
+ [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG($1,$2,$3)],
+ [gcc_cv_cloog_ct_0_14_0=yes],
+ [gcc_cv_cloog_ct_0_14_0=no])])
+ elif test "${cloog_org}" = no ; then
+ AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG],
+ [gcc_cv_cloog_ct_0_15_5],
+ [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG(0,15,5)],
+ [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG(0,15,9)],
+ [gcc_cv_cloog_ct_0_15_5=yes],
+ [gcc_cv_cloog_ct_0_15_5="buggy but acceptable"])],
+ [gcc_cv_cloog_ct_0_15_5=no])])
+ fi
+
+ CFLAGS=$_cloog_saved_CFLAGS
+ LDFLAGS=$_cloog_saved_LDFLAGS
+ fi
+]
+)
+
+# CLOOG_IF_FAILED (ACTION-IF-FAILED)
+# ----------------------------------
+# Executes ACTION-IF-FAILED, if GRAPHITE was requested and
+# the checks failed.
+AC_DEFUN([CLOOG_IF_FAILED],
+[
+ CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])
+
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${graphite_requested}" = yes \
+ && test "x${clooglibs}" = x \
+ && test "x${clooginc}" = x ; then
+ $1
+ fi
+]
+)
diff --git a/configure b/configure
index b1fbfaa..372459c 100755
--- a/configure
+++ b/configure
@@ -833,6 +833,9 @@ LIBS
CPPFLAGS
CXX
CXXFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
CCC
CPP
build_configargs
@@ -1491,7 +1494,8 @@ Optional Features:
--enable-libssp build libssp directory
--enable-build-with-cxx build with C++ compiler instead of C compiler
--disable-ppl-version-check disable check for PPL version
- --disable-cloog-version-check disable check for CLooG version
+ --disable-cloog-version-check
+ disable check for CLooG version
--enable-lto enable link time optimization support
--enable-stage1-languages[=all] choose additional languages to build during
stage1. Mostly useful for compiler development.
@@ -1542,11 +1546,14 @@ Optional Packages:
plus --with-ppl-lib=PATH/lib
--with-ppl-include=PATH Specify directory for installed PPL include files
--with-ppl-lib=PATH Specify the directory for the installed PPL library
- --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
- Equivalent to --with-cloog-include=PATH/include
- plus --with-cloog-lib=PATH/lib
- --with-cloog-include=PATH Specify directory for installed CLooG include files
- --with-cloog-lib=PATH Specify the directory for the installed CLooG library
+ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL
+ package. Equivalent to
+ --with-cloog-include=PATH/include plus
+ --with-cloog-lib=PATH/lib
+ --with-cloog-include=PATH
+ Specify directory for installed CLooG include files
+ --with-cloog-lib=PATH Specify the directory for the installed CLooG
+ library
--with-libelf=PATH Specify prefix directory for the installed libelf package
Equivalent to --with-libelf-include=PATH/include
plus --with-libelf-lib=PATH/lib
@@ -5894,8 +5901,7 @@ fi
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
+
# Check whether --with-cloog was given.
@@ -5916,58 +5922,212 @@ if test "${with_cloog_lib+set}" = set; then :
fi
+ # Check whether --enable-cloog-version-check was given.
+if test "${enable_cloog_version_check+set}" = set; then :
+ enableval=$enable_cloog_version_check; ENABLE_CLOOG_CHECK=$enableval
+else
+ ENABLE_CLOOG_CHECK=yes
+fi
+
+
+ # Initialize clooglibs and clooginc.
+ case $with_cloog in
+ no)
+ clooglibs=
+ clooginc=
+ ;;
+ "" | yes)
+ ;;
+ *)
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
+ ;;
+ esac
+ if test "x${with_cloog_include}" != x ; then
+ clooginc="-I$with_cloog_include"
+ fi
+ if test "x${with_cloog_lib}" != x; then
+ clooglibs="-L$with_cloog_lib"
+ fi
+
+
+
+
+
if test "x$with_ppl" = "xno"; then
with_cloog=no
fi
+if test "x${with_cloog}" = x && test "x${with_cloog_include}" = x \
+ && test "x${with_cloog_lib}" = x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
+fi
+if test "x$with_cloog" != "xno"; then
-case $with_cloog in
- no)
- clooglibs=
- clooginc=
- ;;
- "" | yes)
- ;;
- *)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
- ;;
-esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
+
+
+ _cloog_saved_CFLAGS=$CFLAGS
+ _cloog_saved_CPPFLAGS=$CPPFLAGS
+ _cloog_saved_LDFLAGS=$LDFLAGS
+ _cloog_saved_LIBS=$LIBS
+
+ _clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
+ CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5
+$as_echo_n "checking for installed CLooG... " >&6; }
+if test "${gcc_cv_cloog_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ LIBS="-lcloog ${_cloog_saved_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+ppl_version_major ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type="PPL Legacy"
+else
+ LIBS="-lcloog-isl -lisl ${_cloog_saved_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=ISL
+else
+ LIBS="-lcloog-ppl ${_cloog_saved_LIBS}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=PPL
+else
+ gcc_cv_cloog_type=no
fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
- enable_cloog_version_check=no
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-
-# Check whether --enable-cloog-version-check was given.
-if test "${enable_cloog_version_check+set}" = set; then :
- enableval=$enable_cloog_version_check; ENABLE_CLOOG_CHECK=$enableval
-else
- ENABLE_CLOOG_CHECK=yes
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
+$as_echo "$gcc_cv_cloog_type" >&6; }
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${_clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${_cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${_cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ cloog_org=
+ ;;
+ esac
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
+ LIBS=$_cloog_saved_LIBS
+ CFLAGS=$_cloog_saved_CFLAGS
+ CPPFLAGS=$_cloog_saved_CPPFLAGS
+ LDFLAGS=$_cloog_saved_LDFLAGS
+
+
+
+
+
+ if test "${ENABLE_CLOOG_CHECK}" = yes ; then
+ _cloog_saved_CFLAGS=$CFLAGS
+ _cloog_saved_LDFLAGS=$LDFLAGS
+
+ CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
+ LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs}"
+
+ if test "${cloog_org}" = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG" >&5
+$as_echo_n "checking for verison 0.14.0 of CLooG... " >&6; }
+if test "${gcc_cv_cloog_ct_0_14_0+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "cloog/cloog.h"
+int
+main ()
+{
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 14 \
+ || CLOOG_VERSION_REVISION < 0
+ choke me
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gcc_cv_cloog_ct_0_14_0=yes
+else
+ gcc_cv_cloog_ct_0_14_0=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_14_0" >&5
+$as_echo "$gcc_cv_cloog_ct_0_14_0" >&6; }
+ elif test "${cloog_org}" = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+if test "${gcc_cv_cloog_ct_0_15_5+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "cloog/cloog.h"
int
main ()
{
-
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
-
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 5
+ choke me
+ #endif
;
return 0;
}
@@ -5979,34 +6139,66 @@ if ac_fn_c_try_compile "$LINENO"; then :
int
main ()
{
-
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
-
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 9
+ choke me
+ #endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ gcc_cv_cloog_ct_0_15_5=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
-$as_echo "buggy but acceptable" >&6; }
+ gcc_cv_cloog_ct_0_15_5="buggy but acceptable"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; clooglibs= ; clooginc=
+ gcc_cv_cloog_ct_0_15_5=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$saved_CFLAGS"
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_15_5" >&5
+$as_echo "$gcc_cv_cloog_ct_0_15_5" >&6; }
+ fi
+
+ CFLAGS=$_cloog_saved_CFLAGS
+ LDFLAGS=$_cloog_saved_LDFLAGS
+ fi
+
+
+
+
+
+
+
+ if test "x${with_cloog}" != x \
+ || test "x${with_cloog_include}" != x \
+ || test "x${with_cloog_lib}" != x ; then
+ graphite_requested=yes
+ else
+ graphite_requested=no
+ fi
-# Flags needed for CLOOG
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${graphite_requested}" = yes \
+ && test "x${clooglibs}" = x \
+ && test "x${clooginc}" = x ; then
+
+ as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5
+ fi
+
+
+fi
# Check for LTO support.
# Check whether --enable-lto was given.
diff --git a/configure.ac b/configure.ac
index bf5fe3a..1b8260c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,7 @@ m4_include([ltoptions.m4])
m4_include([ltsugar.m4])
m4_include([ltversion.m4])
m4_include([lt~obsolete.m4])
+m4_include([config/cloog.m4])
AC_INIT(move-if-change)
AC_PREREQ(2.64)
@@ -1580,68 +1581,38 @@ AC_SUBST(pplinc)
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
-
-AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
- Equivalent to --with-cloog-include=PATH/include
- plus --with-cloog-lib=PATH/lib])
-AC_ARG_WITH(cloog_include, [ --with-cloog-include=PATH Specify directory for installed CLooG include files])
-AC_ARG_WITH(cloog_lib, [ --with-cloog-lib=PATH Specify the directory for the installed CLooG library])
+dnl Provide configure switches and initialize clooginc & clooglibs
+dnl with user input.
+CLOOG_INIT_FLAGS
if test "x$with_ppl" = "xno"; then
with_cloog=no
fi
-
-case $with_cloog in
- no)
- clooglibs=
- clooginc=
- ;;
- "" | yes)
- ;;
- *)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
- ;;
-esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
+if test "x${with_cloog}" = x && test "x${with_cloog_include}" = x \
+ && test "x${with_cloog_lib}" = x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
+if test "x$with_cloog" != "xno"; then
+ dnl Version check for CLooG-Org
+ dnl As long as there is no new release of CLooG,
+ dnl we will check for 0.14.0.
+ dnl
+ dnl The first git revision that will work with
+ dnl GCC is: bd91b845a65805c290d43fc1bef8139864a163fb
+ dnl This is enforced implictly, as this is the commit that
+ dnl introduced the versioning information used within our
+ dnl checks.
+ dnl
+ dnl If we're using CLooG-Legacy, the provided version information
+ dnl will be ignored.
+ CLOOG_CHECK_VERSION(0,14,0)
+
+ dnl Only execute fail-action, if CLooG has been
+ dnl requested.
+ CLOOG_IF_FAILED([
+ AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])])
fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
- enable_cloog_version_check=no
-fi
-
-AC_ARG_ENABLE(cloog-version-check,
-[ --disable-cloog-version-check disable check for CLooG version],
-ENABLE_CLOOG_CHECK=$enableval,
-ENABLE_CLOOG_CHECK=yes)
-
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
- AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
- ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
- [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
- CFLAGS="$saved_CFLAGS"
-fi
-
-# Flags needed for CLOOG
-AC_SUBST(clooglibs)
-AC_SUBST(clooginc)
# Check for LTO support.
AC_ARG_ENABLE(lto,
--
1.7.3.2
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-10-31 0:16 ` Andreas Simbürger
2010-10-31 8:51 ` Ralf Wildenhues
@ 2010-10-31 10:03 ` Paolo Bonzini
2010-11-11 20:06 ` Andreas Simbürger
1 sibling, 1 reply; 67+ messages in thread
From: Paolo Bonzini @ 2010-10-31 10:03 UTC (permalink / raw)
To: Andreas Simbürger
Cc: gcc-patches, gcc-graphite, Ralf Wildenhues, dj, neroden
First of all, I must say I think the code is very clear, so with the
namespacing problems Ralf pointed out cloog/cloog.m4 is ready.
I have one question:
> +# CLOOG_INIT_FLAGS ()
> +# -------------------------
> +# Provide configure switches for CLooG support.
> +# Initialize clooglibs/clooginc according to the user input.
> +AC_DEFUN([CLOOG_INIT_FLAGS],
> +[
> + AC_ARG_WITH(cloog,
> + [AS_HELP_STRING(
> + [--with-cloog=PATH],
> + [Specify prefix directory for the installed CLooG-PPL package.
> + Equivalent to --with-cloog-include=PATH/include
> + plus --with-cloog-lib=PATH/lib])])
> + AC_ARG_WITH(cloog_include,
> + [AS_HELP_STRING(
> + [--with-cloog-include=PATH],
> + [Specify directory for installed CLooG include files])])
> + AC_ARG_WITH(cloog_lib,
> + [AS_HELP_STRING(
> + [--with-cloog-lib=PATH],
> + [Specify the directory for the installed CLooG library])])
> +
> + AC_ARG_ENABLE(cloog-version-check,
> + [AS_HELP_STRING(
> + [--disable-cloog-version-check],
> + [disable check for CLooG version])],
> + ENABLE_CLOOG_CHECK=$enableval,
> + ENABLE_CLOOG_CHECK=yes)
> +
> + # Initialize clooglibs and clooginc.
> + case $with_cloog in
> + no)
> + clooglibs=
> + clooginc=
> + ;;
> + "" | yes)
> + ;;
> + *)
> + clooglibs="-L$with_cloog/lib"
> + clooginc="-I$with_cloog/include"
> + ;;
> + esac
> + if test "x${with_cloog_include}" != x ; then
> + clooginc="-I$with_cloog_include"
> + fi
> + if test "x${with_cloog_lib}" != x; then
> + clooglibs="-L$with_cloog_lib"
> + fi
> + if test "x${with_cloog}" != x && test "x${with_cloog_include}" != x \
> + && test "x${with_cloog_lib}" != x && test -d ${srcdir}/cloog; then
> + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
> + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
> + enable_cloog_version_check=no
> + fi
> +]
> +)
It seems to me that the "!=" in the last "if" should be "=". Also, I
don't think disabling the version check for an in-tree CLOOG is
necessary, or even good.
However, I'm not sure about the placement of the code, for two reasons:
1) while we have been sloppy on this, the toplevel has no business
determining whether a package is the correct version (historically, this
started with the GMP/MPFR checks which were needed for Fortran but
should now be moved away as well. libelf checks will also disappear
once Ian's objfile library is committed.
2) the last "if" is the only part of cloog/cloog.m4 that relies on the
structure of the GCC build system.
So, it seems to me that the toplevel configure.ac should be basically
oblivious of the exact mechanics of detecting CLOOG. The good news is
that it should be easy to implement what I propose, thanks to the very
good modularization you have in cloog/cloog.m4.
In particular it seems to me that if you remove the last if from
CLOOG_INIT_FLAGS, all you need in the toplevel configure.ac is
CLOOG_INIT_FLAGS
if test "x${with_cloog}" = x && test "x${with_cloog_include}" = x \
&& test "x${with_cloog_lib}" = x && test -d ${srcdir}/cloog; then
clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
fi
(I changed != to = above) and the rest of the detection can go in
gcc/configure.ac, which is where it is really needed. The code in
gcc/configure.ac would be exactly what you're adding to the toplevel
configure script.
Sorry for not noticing this before. This kind of "big picture" problems
are things I typically overlook when the code is bad, so you can take
this as a compliment. :)
Paolo
^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [PATCH] Support official CLooG.org versions.
2010-10-31 0:16 ` Andreas Simbürger
@ 2010-10-31 8:51 ` Ralf Wildenhues
2010-10-31 10:03 ` Paolo Bonzini
1 sibling, 0 replies; 67+ messages in thread
From: Ralf Wildenhues @ 2010-10-31 8:51 UTC (permalink / raw)
To: Andreas Simbürger
Cc: gcc-patches, gcc-graphite, ralph.wildenhues, dj, bonzini, neroden
Hello Andreas,
a couple of nits:
* Andreas Simbürger wrote on Sat, Oct 30, 2010 at 07:43:33PM CEST:
> --- /dev/null
> +++ b/config/cloog.m4
[...]
> +AC_DEFUN([CLOOG_FIND_FLAGS],
> +[
> + AC_REQUIRE([CLOOG_INIT_FLAGS])
> +
> + _saved_cflags=$CFLAGS
> + _saved_cppflags=$CPPFLAGS
> + _saved_ldflags=$LDFLAGS
> + _saved_libs=$LIBS
The leading underscores here ...
> + _clooglegacyinc="-DCLOOG_PPL_BACKEND"
> + _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> +
> + dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
> + CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
> + CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
> + LDFLAGS="${LDFLAGS} ${clooglibs}"
> +
> + AC_CACHE_CHECK([for installed CLooG],
> + [gcc_cv_cloog_type],
> + [LIBS="-lcloog ${saved_libs}"
... are not reflected here,
> + AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG],
> + [gcc_cv_cloog_type="PPL Legacy"],
> + [LIBS="-lcloog-isl -lisl ${saved_libs}"
here,
> + AC_LINK_IFELSE([_CLOOG_ORG_PROG],
> + [gcc_cv_cloog_type=ISL],
> + [LIBS="-lcloog-ppl ${saved_libs}"
and here. The _saved_* variables names are not in a namespace specific
to your macros (_cloog_saved_libs or so); strictly that is problematic
only when the variable names are used in enclosed or enclosing macros
or configure.ac.
> + AC_LINK_IFELSE([_CLOOG_ORG_PROG],
> + [gcc_cv_cloog_type=PPL],
> + [gcc_cv_cloog_type=no])])])])
> +
> + case $gcc_cv_cloog_type in
> + "PPL Legacy")
> + clooginc="${clooginc} ${_clooglegacyinc}"
> + clooglibs="${clooglibs} -lcloog"
> + cloog_org=no
> + ;;
> + "ISL")
> + clooginc="${clooginc} ${_cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-isl"
> + cloog_org=yes
> + ;;
> + "PPL")
> + clooginc="${clooginc} ${_cloogorginc}"
> + clooglibs="${clooglibs} -lcloog-ppl"
> + cloog_org=yes
> + ;;
> + *)
> + clooglibs=
> + clooginc=
> + cloog_org=
> + ;;
> + esac
> +
> + LIBS=$_saved_libs
> + CFLAGS=$_saved_cflags
> + CPPFLAGS=$_saved_cppflags
> + LDFLAGS=$_saved_ldflags
> +]
> +)
> +
> +# _CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION)
> +# --------------------------------------------
> +# Helper for verifying CLooG's compile time version.
> +m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
> + [#include "cloog/cloog.h"],
> + [#if CLOOG_VERSION_MAJOR != $1 \
> + || CLOOG_VERSION_MINOR != $2 \
> + || CLOOG_VERSION_REVISION < $3
> + choke me
> + #endif])])
> +
> +# _CLOOG_CHECK_RT_PROG ()
> +# -----------------------
> +# Helper for verifying that CLooG's compile time version
> +# matches the run time version.
> +m4_define([_CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM(
> + [#include "cloog/cloog.h"],
> + [if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
> + && (cloog_version_minor () != CLOOG_VERSION_MINOR)
> + && (cloog_version_revision () != CLOOG_VERSION_REVISION))
> + {
> + return 1;
> + }])])
> +
> +# CLOOG_CHECK_VERSION CLOOG_CHECK_VERSION (MAJOR, MINOR, REVISION)
> +# ----------------------------------------------------------------
> +# Test the found CLooG to be exact of version MAJOR.MINOR and at least
> +# REVISION.
> +# If we're using the old CLooG-PPL (Legacy), the old version check will
> +# be executed (Ignores the provided version information).
> +AC_DEFUN([CLOOG_CHECK_VERSION],
> +[
> + AC_REQUIRE([CLOOG_FIND_FLAGS])
> +
> + _saved_CFLAGS=$CFLAGS
> + _saved_LDFLAGS=$LDFLAGS
> +
> + CFLAGS="${saved_cflags} ${clooginc} ${pplinc} ${gmpinc}"
> + LDFLAGS="${saved_ldflags} ${clooglibs}"
> +
> + if test "${cloog_org}" = yes ; then
> + AC_CACHE_CHECK([for verison $1.$2.$3 of CLooG],
> + [gcc_cv_cloog_ct_0_14_0],
> + [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG($1,$2,$3)],
> + [gcc_cv_cloog_ct_0_14_0=yes],
> + [gcc_cv_cloog_ct_0_14_0=no])])
> + elif test "${cloog_org}" = no ; then
> + AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG],
> + [gcc_cv_cloog_ct_0_15_5],
> + [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG(0,15,5)],
> + [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG(0,15,9)],
> + [gcc_cv_cloog_ct_0_15_5=yes],
> + [gcc_cv_cloog_ct_0_15_5=buggy but acceptable])],
This will temporarily assign 'buggy' to the variable, while trying to
execute the program 'but' with argument 'acceptable'; use quotes to
avoid this.
While testing build patches, it is fairly important to try to expose all
of the different code cases, or ask somebody else to cover the cases
that you cannot expose on your system, so that such issues are caught.
> + [gcc_cv_cloog_ct_0_15_5=no])])
> + fi
> +
> + CFLAGS=$_saved_CFLAGS
> + LDFLAGS=$_saved_LDFLAGS
> +]
> +)
> +
> +# CLOOG_IF_FAILED (ACTION-IF-FAILED)
> +# ----------------------------------
> +# Executes ACTION-IF-FAILED, if GRAPHITE was requested and
> +# the checks failed.
> +AC_DEFUN([CLOOG_IF_FAILED],
> +[
> + CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])
> +
> + if test "${gcc_cv_cloog_ct_0_14_0}" = no \
> + || test "${gcc_cv_cloog_rt_0_14_0}" = no \
> + || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
> + clooglibs=
> + clooginc=
> + fi
> +
> + if test "${graphite_requested}" = yes \
> + && test "x${clooglibs}" = x \
> + && test "x${clooginc}" = x ; then
> + $1
> + fi
> +]
> +)
Thanks,
Ralf
^ permalink raw reply [flat|nested] 67+ messages in thread
* [PATCH] Support official CLooG.org versions.
2010-10-28 13:38 Ping: " Nathanael Nerode (throwaway)
@ 2010-10-31 0:16 ` Andreas Simbürger
2010-10-31 8:51 ` Ralf Wildenhues
2010-10-31 10:03 ` Paolo Bonzini
0 siblings, 2 replies; 67+ messages in thread
From: Andreas Simbürger @ 2010-10-31 0:16 UTC (permalink / raw)
To: gcc-patches
Cc: gcc-graphite, ralph.wildenhues, dj, bonzini, neroden,
Andreas Simbürger
--------------------------
Changes to previous patch:
* Cleaned up configure.ac.
* Added correct GPL licensing header.
* Changed dnl comments to # comments in config/cloog.m4.
* CPPFLAGS are now used for the -D switches during checks.
* CFLAGS/LDFLAGS/CPPFLAGS are now saved and restored between checks.
* Run time checks removed for now.
--------------------------
Add support for official CLooG releases.
CLooG's configuration gets detected within 2 stages:
Stage 1: Detect the installed CLooG version.
This is done by linking test programs against the various
CLooG libraries. As CLooG's library sonames depend on the
used backend, this is sufficient to detect the used backend.
We only detect this backends, in order:
1) CLooG-PPL (Legacy): The "old" CLooG.
2) CLooG-ISL: The "new" CLooG.
3) CLooG-Parma: An alternative backend, to compare it with
CLooG-ISL.
CLooG-Poly is not detected, as the PolyLib may conflict
with GCC's license.
Stage 2: Version checks.
After detecting the right configuration, we finally check
if the installed version is usable. There are 2 different
checks: One for CLooG-PPL (Legacy) and one for CLooG-ISL.
* CLooG-ISL:
As the "new" CLooG provides methods to check for its version at
both compile and run time, we use the compile time check.
We check for the constants to verify the header's compatibility.
* CLooG-PPL (Legacy):
This version check provides the same semantics as before.
As CLooG-PPL (Legacy) provides the same constants as the
official CLooG, we can use the same test program for the
compile time check.
Tested with CLooG-ISL and CLooG-PPL (Legacy).
As for now, CLooG-Parma fails to build.
2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* configure.ac: Support official CLooG.org versions.
* configure: Regenerate.
* config/cloog.m4: New.
---
ChangeLog.graphite | 6 +
config/cloog.m4 | 252 ++++++++++++++++++++++++++++++++++++++++++
configure | 306 ++++++++++++++++++++++++++++++++++++++++++----------
configure.ac | 74 ++++---------
4 files changed, 533 insertions(+), 105 deletions(-)
create mode 100644 config/cloog.m4
diff --git a/ChangeLog.graphite b/ChangeLog.graphite
index 46f1290..d067200 100644
--- a/ChangeLog.graphite
+++ b/ChangeLog.graphite
@@ -1,3 +1,9 @@
+2010-08-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * configure.ac: Support official CLooG.org versions.
+ * configure: Regenerate.
+ * config/cloog.m4: New.
+
2010-10-20 Sebastian Pop <sebastian.pop@amd.com>
* Merge from mainline (164578:165734).
diff --git a/config/cloog.m4 b/config/cloog.m4
new file mode 100644
index 0000000..d042bfa
--- /dev/null
+++ b/config/cloog.m4
@@ -0,0 +1,252 @@
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3, or (at your option) any later
+# version.
+#
+# GCC is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+# CLOOG_INIT_FLAGS ()
+# -------------------------
+# Provide configure switches for CLooG support.
+# Initialize clooglibs/clooginc according to the user input.
+AC_DEFUN([CLOOG_INIT_FLAGS],
+[
+ AC_ARG_WITH(cloog,
+ [AS_HELP_STRING(
+ [--with-cloog=PATH],
+ [Specify prefix directory for the installed CLooG-PPL package.
+ Equivalent to --with-cloog-include=PATH/include
+ plus --with-cloog-lib=PATH/lib])])
+ AC_ARG_WITH(cloog_include,
+ [AS_HELP_STRING(
+ [--with-cloog-include=PATH],
+ [Specify directory for installed CLooG include files])])
+ AC_ARG_WITH(cloog_lib,
+ [AS_HELP_STRING(
+ [--with-cloog-lib=PATH],
+ [Specify the directory for the installed CLooG library])])
+
+ AC_ARG_ENABLE(cloog-version-check,
+ [AS_HELP_STRING(
+ [--disable-cloog-version-check],
+ [disable check for CLooG version])],
+ ENABLE_CLOOG_CHECK=$enableval,
+ ENABLE_CLOOG_CHECK=yes)
+
+ # Initialize clooglibs and clooginc.
+ case $with_cloog in
+ no)
+ clooglibs=
+ clooginc=
+ ;;
+ "" | yes)
+ ;;
+ *)
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
+ ;;
+ esac
+ if test "x${with_cloog_include}" != x ; then
+ clooginc="-I$with_cloog_include"
+ fi
+ if test "x${with_cloog_lib}" != x; then
+ clooglibs="-L$with_cloog_lib"
+ fi
+ if test "x${with_cloog}" != x && test "x${with_cloog_include}" != x \
+ && test "x${with_cloog_lib}" != x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
+ enable_cloog_version_check=no
+ fi
+]
+)
+
+# CLOOG_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
+# ----------------------------------------------------
+# Provide actions for failed CLooG detection.
+AC_DEFUN([CLOOG_REQUESTED],
+[
+ AC_REQUIRE([CLOOG_INIT_FLAGS])
+
+ if test "x${with_cloog}" != x \
+ || test "x${with_cloog_include}" != x \
+ || test "x${with_cloog_lib}" != x ; then
+ $1
+ else
+ $2
+ fi
+]
+)
+
+# _CLOOG_ORG_PROG ()
+# ------------------
+# Helper for detecting CLooG.org's backend.
+m4_define([_CLOOG_ORG_PROG],[AC_LANG_PROGRAM(
+ [#include <cloog/cloog.h>],
+ [cloog_version ()])])
+
+# _CLOOG_PPL_LEGACY_PROG ()
+# -------------------------
+# Helper for detecting CLooG-Legacy (CLooG-PPL).
+m4_define([_CLOOG_PPL_LEGACY_PROG], [AC_LANG_PROGRAM(
+ [#include <cloog/cloog.h>],
+ [ppl_version_major ()])])
+
+# CLOOG_FIND_FLAGS ()
+# ------------------
+# Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org.
+# Preference: CLooG-PPL (Legacy) > CLooG-ISL > CLooG-PPL
+AC_DEFUN([CLOOG_FIND_FLAGS],
+[
+ AC_REQUIRE([CLOOG_INIT_FLAGS])
+
+ _saved_cflags=$CFLAGS
+ _saved_cppflags=$CPPFLAGS
+ _saved_ldflags=$LDFLAGS
+ _saved_libs=$LIBS
+
+ _clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
+ CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
+ CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ AC_CACHE_CHECK([for installed CLooG],
+ [gcc_cv_cloog_type],
+ [LIBS="-lcloog ${saved_libs}"
+ AC_LINK_IFELSE([_CLOOG_PPL_LEGACY_PROG],
+ [gcc_cv_cloog_type="PPL Legacy"],
+ [LIBS="-lcloog-isl -lisl ${saved_libs}"
+ AC_LINK_IFELSE([_CLOOG_ORG_PROG],
+ [gcc_cv_cloog_type=ISL],
+ [LIBS="-lcloog-ppl ${saved_libs}"
+ AC_LINK_IFELSE([_CLOOG_ORG_PROG],
+ [gcc_cv_cloog_type=PPL],
+ [gcc_cv_cloog_type=no])])])])
+
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${_clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${_cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${_cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ cloog_org=
+ ;;
+ esac
+
+ LIBS=$_saved_libs
+ CFLAGS=$_saved_cflags
+ CPPFLAGS=$_saved_cppflags
+ LDFLAGS=$_saved_ldflags
+]
+)
+
+# _CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION)
+# --------------------------------------------
+# Helper for verifying CLooG's compile time version.
+m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
+ [#include "cloog/cloog.h"],
+ [#if CLOOG_VERSION_MAJOR != $1 \
+ || CLOOG_VERSION_MINOR != $2 \
+ || CLOOG_VERSION_REVISION < $3
+ choke me
+ #endif])])
+
+# _CLOOG_CHECK_RT_PROG ()
+# -----------------------
+# Helper for verifying that CLooG's compile time version
+# matches the run time version.
+m4_define([_CLOOG_CHECK_RT_PROG],[AC_LANG_PROGRAM(
+ [#include "cloog/cloog.h"],
+ [if ((cloog_version_major () != CLOOG_VERSION_MAJOR)
+ && (cloog_version_minor () != CLOOG_VERSION_MINOR)
+ && (cloog_version_revision () != CLOOG_VERSION_REVISION))
+ {
+ return 1;
+ }])])
+
+# CLOOG_CHECK_VERSION CLOOG_CHECK_VERSION (MAJOR, MINOR, REVISION)
+# ----------------------------------------------------------------
+# Test the found CLooG to be exact of version MAJOR.MINOR and at least
+# REVISION.
+# If we're using the old CLooG-PPL (Legacy), the old version check will
+# be executed (Ignores the provided version information).
+AC_DEFUN([CLOOG_CHECK_VERSION],
+[
+ AC_REQUIRE([CLOOG_FIND_FLAGS])
+
+ _saved_CFLAGS=$CFLAGS
+ _saved_LDFLAGS=$LDFLAGS
+
+ CFLAGS="${saved_cflags} ${clooginc} ${pplinc} ${gmpinc}"
+ LDFLAGS="${saved_ldflags} ${clooglibs}"
+
+ if test "${cloog_org}" = yes ; then
+ AC_CACHE_CHECK([for verison $1.$2.$3 of CLooG],
+ [gcc_cv_cloog_ct_0_14_0],
+ [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG($1,$2,$3)],
+ [gcc_cv_cloog_ct_0_14_0=yes],
+ [gcc_cv_cloog_ct_0_14_0=no])])
+ elif test "${cloog_org}" = no ; then
+ AC_CACHE_CHECK([for version 0.15.5 (or later revision) of CLooG],
+ [gcc_cv_cloog_ct_0_15_5],
+ [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG(0,15,5)],
+ [AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG(0,15,9)],
+ [gcc_cv_cloog_ct_0_15_5=yes],
+ [gcc_cv_cloog_ct_0_15_5=buggy but acceptable])],
+ [gcc_cv_cloog_ct_0_15_5=no])])
+ fi
+
+ CFLAGS=$_saved_CFLAGS
+ LDFLAGS=$_saved_LDFLAGS
+]
+)
+
+# CLOOG_IF_FAILED (ACTION-IF-FAILED)
+# ----------------------------------
+# Executes ACTION-IF-FAILED, if GRAPHITE was requested and
+# the checks failed.
+AC_DEFUN([CLOOG_IF_FAILED],
+[
+ CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])
+
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${graphite_requested}" = yes \
+ && test "x${clooglibs}" = x \
+ && test "x${clooginc}" = x ; then
+ $1
+ fi
+]
+)
diff --git a/configure b/configure
index b1fbfaa..60ae15e 100755
--- a/configure
+++ b/configure
@@ -833,6 +833,9 @@ LIBS
CPPFLAGS
CXX
CXXFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
CCC
CPP
build_configargs
@@ -1491,7 +1494,8 @@ Optional Features:
--enable-libssp build libssp directory
--enable-build-with-cxx build with C++ compiler instead of C compiler
--disable-ppl-version-check disable check for PPL version
- --disable-cloog-version-check disable check for CLooG version
+ --disable-cloog-version-check
+ disable check for CLooG version
--enable-lto enable link time optimization support
--enable-stage1-languages[=all] choose additional languages to build during
stage1. Mostly useful for compiler development.
@@ -1542,11 +1546,14 @@ Optional Packages:
plus --with-ppl-lib=PATH/lib
--with-ppl-include=PATH Specify directory for installed PPL include files
--with-ppl-lib=PATH Specify the directory for the installed PPL library
- --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
- Equivalent to --with-cloog-include=PATH/include
- plus --with-cloog-lib=PATH/lib
- --with-cloog-include=PATH Specify directory for installed CLooG include files
- --with-cloog-lib=PATH Specify the directory for the installed CLooG library
+ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL
+ package. Equivalent to
+ --with-cloog-include=PATH/include plus
+ --with-cloog-lib=PATH/lib
+ --with-cloog-include=PATH
+ Specify directory for installed CLooG include files
+ --with-cloog-lib=PATH Specify the directory for the installed CLooG
+ library
--with-libelf=PATH Specify prefix directory for the installed libelf package
Equivalent to --with-libelf-include=PATH/include
plus --with-libelf-lib=PATH/lib
@@ -5894,8 +5901,7 @@ fi
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
+
# Check whether --with-cloog was given.
@@ -5916,58 +5922,212 @@ if test "${with_cloog_lib+set}" = set; then :
fi
+ # Check whether --enable-cloog-version-check was given.
+if test "${enable_cloog_version_check+set}" = set; then :
+ enableval=$enable_cloog_version_check; ENABLE_CLOOG_CHECK=$enableval
+else
+ ENABLE_CLOOG_CHECK=yes
+fi
+
+
+ # Initialize clooglibs and clooginc.
+ case $with_cloog in
+ no)
+ clooglibs=
+ clooginc=
+ ;;
+ "" | yes)
+ ;;
+ *)
+ clooglibs="-L$with_cloog/lib"
+ clooginc="-I$with_cloog/include"
+ ;;
+ esac
+ if test "x${with_cloog_include}" != x ; then
+ clooginc="-I$with_cloog_include"
+ fi
+ if test "x${with_cloog_lib}" != x; then
+ clooglibs="-L$with_cloog_lib"
+ fi
+ if test "x${with_cloog}" != x && test "x${with_cloog_include}" != x \
+ && test "x${with_cloog_lib}" != x && test -d ${srcdir}/cloog; then
+ clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
+ clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include '
+ enable_cloog_version_check=no
+ fi
+
+
+
if test "x$with_ppl" = "xno"; then
with_cloog=no
fi
-case $with_cloog in
- no)
- clooglibs=
- clooginc=
- ;;
- "" | yes)
- ;;
- *)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
- ;;
-esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
+if test "x$with_cloog" != "xno"; then
+ if test "${ENABLE_CLOOG_CHECK}" ; then
+
+
+
+ _saved_cflags=$CFLAGS
+ _saved_cppflags=$CPPFLAGS
+ _saved_ldflags=$LDFLAGS
+ _saved_libs=$LIBS
+
+ _clooglegacyinc="-DCLOOG_PPL_BACKEND"
+ _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+
+ CFLAGS="${CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
+ CPPFLAGS="${CPPFLAGS} ${_clooglegacyinc} ${_cloogorginc}"
+ LDFLAGS="${LDFLAGS} ${clooglibs}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for installed CLooG" >&5
+$as_echo_n "checking for installed CLooG... " >&6; }
+if test "${gcc_cv_cloog_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ LIBS="-lcloog ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+ppl_version_major ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type="PPL Legacy"
+else
+ LIBS="-lcloog-isl -lisl ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=ISL
+else
+ LIBS="-lcloog-ppl ${saved_libs}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <cloog/cloog.h>
+int
+main ()
+{
+cloog_version ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gcc_cv_cloog_type=PPL
+else
+ gcc_cv_cloog_type=no
fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
- enable_cloog_version_check=no
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-
-# Check whether --enable-cloog-version-check was given.
-if test "${enable_cloog_version_check+set}" = set; then :
- enableval=$enable_cloog_version_check; ENABLE_CLOOG_CHECK=$enableval
-else
- ENABLE_CLOOG_CHECK=yes
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_type" >&5
+$as_echo "$gcc_cv_cloog_type" >&6; }
+ case $gcc_cv_cloog_type in
+ "PPL Legacy")
+ clooginc="${clooginc} ${_clooglegacyinc}"
+ clooglibs="${clooglibs} -lcloog"
+ cloog_org=no
+ ;;
+ "ISL")
+ clooginc="${clooginc} ${_cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-isl"
+ cloog_org=yes
+ ;;
+ "PPL")
+ clooginc="${clooginc} ${_cloogorginc}"
+ clooglibs="${clooglibs} -lcloog-ppl"
+ cloog_org=yes
+ ;;
+ *)
+ clooglibs=
+ clooginc=
+ cloog_org=
+ ;;
+ esac
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
+ LIBS=$_saved_libs
+ CFLAGS=$_saved_cflags
+ CPPFLAGS=$_saved_cppflags
+ LDFLAGS=$_saved_ldflags
+
+
+
+
+
+ _saved_CFLAGS=$CFLAGS
+ _saved_LDFLAGS=$LDFLAGS
+
+ CFLAGS="${saved_cflags} ${clooginc} ${pplinc} ${gmpinc}"
+ LDFLAGS="${saved_ldflags} ${clooglibs}"
+
+ if test "${cloog_org}" = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for verison 0.14.0 of CLooG" >&5
+$as_echo_n "checking for verison 0.14.0 of CLooG... " >&6; }
+if test "${gcc_cv_cloog_ct_0_14_0+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "cloog/cloog.h"
+int
+main ()
+{
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 14 \
+ || CLOOG_VERSION_REVISION < 0
+ choke me
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gcc_cv_cloog_ct_0_14_0=yes
+else
+ gcc_cv_cloog_ct_0_14_0=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_14_0" >&5
+$as_echo "$gcc_cv_cloog_ct_0_14_0" >&6; }
+ elif test "${cloog_org}" = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5
$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; }
+if test "${gcc_cv_cloog_ct_0_15_5+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "cloog/cloog.h"
int
main ()
{
-
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
-
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 5
+ choke me
+ #endif
;
return 0;
}
@@ -5979,29 +6139,65 @@ if ac_fn_c_try_compile "$LINENO"; then :
int
main ()
{
-
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
-
+#if CLOOG_VERSION_MAJOR != 0 \
+ || CLOOG_VERSION_MINOR != 15 \
+ || CLOOG_VERSION_REVISION < 9
+ choke me
+ #endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ gcc_cv_cloog_ct_0_15_5=yes
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy but acceptable" >&5
-$as_echo "buggy but acceptable" >&6; }
+ gcc_cv_cloog_ct_0_15_5=buggy but acceptable
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; clooglibs= ; clooginc=
+ gcc_cv_cloog_ct_0_15_5=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$saved_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_cloog_ct_0_15_5" >&5
+$as_echo "$gcc_cv_cloog_ct_0_15_5" >&6; }
+ fi
+
+ CFLAGS=$_saved_CFLAGS
+ LDFLAGS=$_saved_LDFLAGS
+
+
+ fi
+
+
+
+
+
+ if test "x${with_cloog}" != x \
+ || test "x${with_cloog_include}" != x \
+ || test "x${with_cloog_lib}" != x ; then
+ graphite_requested=yes
+ else
+ graphite_requested=no
+ fi
+
+
+
+ if test "${gcc_cv_cloog_ct_0_14_0}" = no \
+ || test "${gcc_cv_cloog_rt_0_14_0}" = no \
+ || test "${gcc_cv_cloog_ct_0_15_5}" = no; then
+ clooglibs=
+ clooginc=
+ fi
+
+ if test "${graphite_requested}" = yes \
+ && test "x${clooglibs}" = x \
+ && test "x${clooginc}" = x ; then
+
+ as_fn_error "Unable to find a usable CLooG. See config.log for details." "$LINENO" 5
+ fi
+
+
fi
# Flags needed for CLOOG
diff --git a/configure.ac b/configure.ac
index bf5fe3a..5d7d0d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,7 @@ m4_include([ltoptions.m4])
m4_include([ltsugar.m4])
m4_include([ltversion.m4])
m4_include([lt~obsolete.m4])
+m4_include([config/cloog.m4])
AC_INIT(move-if-change)
AC_PREREQ(2.64)
@@ -1580,63 +1581,36 @@ AC_SUBST(pplinc)
# Check for CLOOG
-clooglibs=" -lcloog "
-clooginc=" -DCLOOG_PPL_BACKEND "
-AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package
- Equivalent to --with-cloog-include=PATH/include
- plus --with-cloog-lib=PATH/lib])
-AC_ARG_WITH(cloog_include, [ --with-cloog-include=PATH Specify directory for installed CLooG include files])
-AC_ARG_WITH(cloog_lib, [ --with-cloog-lib=PATH Specify the directory for the installed CLooG library])
+dnl Provide configure switches and initialize clooginc & clooglibs
+dnl with user input.
+CLOOG_INIT_FLAGS()
if test "x$with_ppl" = "xno"; then
with_cloog=no
fi
-case $with_cloog in
- no)
- clooglibs=
- clooginc=
- ;;
- "" | yes)
- ;;
- *)
- clooglibs="-L$with_cloog/lib -lcloog"
- clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
- ;;
-esac
-if test "x$with_cloog_include" != x; then
- clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
-fi
-if test "x$with_cloog_lib" != x; then
- clooglibs="-L$with_cloog_lib -lcloog"
-fi
-if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
- enable_cloog_version_check=no
-fi
-
-AC_ARG_ENABLE(cloog-version-check,
-[ --disable-cloog-version-check disable check for CLooG version],
-ENABLE_CLOOG_CHECK=$enableval,
-ENABLE_CLOOG_CHECK=yes)
+if test "x$with_cloog" != "xno"; then
+ dnl Version check for CLooG-Org
+ dnl As long as there is no new release of CLooG,
+ dnl we will check for 0.14.0.
+ dnl
+ dnl The first git revision that will work with
+ dnl GCC is: bd91b845a65805c290d43fc1bef8139864a163fb
+ dnl This is enforced implictly, as this is the commit that
+ dnl introduced the versioning information used within our
+ dnl checks.
+ dnl
+ dnl If we're using CLooG-Legacy, the provided version information
+ dnl will be ignored.
+ if test "${ENABLE_CLOOG_CHECK}" ; then
+ CLOOG_CHECK_VERSION(0,14,0)
+ fi
-if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
- AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG])
- AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5
- choke me
- #endif
- ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[
- #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9
- choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
- [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
- CFLAGS="$saved_CFLAGS"
+ dnl Only execute fail-action, if CLooG has been
+ dnl requested.
+ CLOOG_IF_FAILED([
+ AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])])
fi
# Flags needed for CLOOG
--
1.7.3.2
^ permalink raw reply [flat|nested] 67+ messages in thread
end of thread, other threads:[~2010-11-25 6:37 UTC | newest]
Thread overview: 67+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <4C88C926.6030102@fim.uni-passau.de>
2010-09-10 9:11 ` [PATCH] Support official CLooG.org versions Andreas Simbürger
2010-09-10 10:55 ` Jack Howarth
2010-09-10 11:42 ` Tobias Grosser
2010-09-10 17:14 ` Joseph S. Myers
2010-09-10 20:11 ` Sebastian Pop
2010-09-10 22:47 ` Jack Howarth
2010-09-10 18:27 ` Ralf Wildenhues
2010-09-10 18:58 ` Andreas Simbuerger
2010-09-11 10:12 ` Ralf Wildenhues
2010-09-11 12:28 ` Andreas Simbuerger
2010-09-12 12:11 ` Andreas Simbürger
2010-09-12 12:39 ` Konrad Trifunovic
2010-09-12 12:54 ` Andreas Simbuerger
2010-09-12 16:58 ` Konrad Trifunovic
2010-09-13 7:38 ` Konrad Trifunovic
2010-09-13 10:53 ` Andreas Simbuerger
2010-09-13 10:57 ` Andreas Simbürger
2010-09-22 21:48 ` Sebastian Pop
2010-09-29 18:28 ` Paolo Bonzini
2010-09-29 22:49 ` Andreas Simbuerger
2010-10-08 10:45 ` Andreas Simbürger
2010-10-08 13:08 ` Jack Howarth
2010-10-09 8:50 ` Ralf Wildenhues
2010-09-12 13:23 ` Konrad Trifunovic
2010-09-13 11:07 ` Andreas Simbuerger
2010-10-28 13:38 Ping: " Nathanael Nerode (throwaway)
2010-10-31 0:16 ` Andreas Simbürger
2010-10-31 8:51 ` Ralf Wildenhues
2010-10-31 10:03 ` Paolo Bonzini
2010-11-11 20:06 ` Andreas Simbürger
2010-11-11 20:39 ` Paolo Bonzini
2010-11-11 21:40 ` Sebastian Pop
2010-11-11 21:41 ` Sebastian Pop
2010-11-11 21:43 ` Sebastian Pop
2010-11-11 22:53 ` Paolo Bonzini
2010-11-11 22:42 ` Jack Howarth
2010-11-11 23:52 ` Jack Howarth
2010-11-12 2:07 ` Jack Howarth
2010-11-12 2:23 ` Jack Howarth
2010-11-12 3:01 ` Jack Howarth
2010-11-12 3:01 ` Joseph S. Myers
2010-11-12 8:26 ` Jack Howarth
2010-11-12 9:00 ` Paolo Bonzini
[not found] ` <20101112084306.GO4255MdfPADPa@purples>
2010-11-12 9:11 ` Paolo Bonzini
[not found] ` <20101112090859.GP4255MdfPADPa@purples>
2010-11-12 9:58 ` Paolo Bonzini
2010-11-12 16:46 ` Tobias Grosser
2010-11-12 17:30 ` Paolo Bonzini
2010-11-12 20:37 ` Tobias Grosser
2010-11-12 21:00 ` Jack Howarth
2010-11-12 21:02 ` Paolo Bonzini
2010-11-12 21:22 ` Jack Howarth
2010-11-12 22:31 ` Jack Howarth
2010-11-12 22:41 ` Tobias Grosser
2010-11-12 21:01 ` Paolo Bonzini
2010-11-15 15:55 ` Andreas Schwab
2010-11-15 16:41 ` Andreas Schwab
2010-11-19 20:22 ` Tobias Grosser
2010-11-19 21:30 ` Ralf Wildenhues
2010-11-22 11:17 ` Andreas Schwab
2010-11-24 15:49 ` Tobias Grosser
2010-11-24 15:51 ` Paolo Bonzini
2010-11-25 10:29 ` Ralf Wildenhues
2010-11-12 19:07 ` Jack Howarth
2010-11-15 15:52 ` Andreas Schwab
2010-11-15 16:23 ` Paolo Bonzini
2010-11-15 16:48 ` Andreas Schwab
2010-11-15 16:48 ` Paolo Bonzini
2010-11-15 15:55 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).