gcc/config/cloog.m4

153 lines
4.4 KiB
Plaintext
Raw Normal View History

# 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-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 If no --with-cloog flag was specified and there is in-tree CLooG
dnl source, set up flags to use that and skip any version tests
dnl as we cannot run them reliably before building CLooG
if test "x${clooginc}" = x && test "x${clooglibs}" = x \
cloog.m4: Set up to work against ISL only. 2012-07-02 Richard Guenther <rguenther@suse.de> Michael Matz <matz@suse.de> Tobias Grosser <tobias@grosser.es> Sebastian Pop <sebpop@gmail.com> config/ * cloog.m4: Set up to work against ISL only. * isl.m4: New file. * Makefile.def: Add ISL host module, remove PPL host module. Adjust ClooG host module to use the proper ISL. * Makefile.tpl: Pass ISL include flags instead of PPL ones. * configure.ac: Include config/isl.m4. Add ISL host library, remove PPL. Remove PPL configury, add ISL configury, adjust ClooG configury. * Makefile.in: Regenerated. * configure: Likewise. gcc/ * Makefile.in: Remove PPL flags in favor of ISL ones. (BACKENDLIBS): Remove PPL libs. (INCLUDES): Remove PPL includes in favor of ISL ones. (graphite-clast-to-gimple.o): Remove graphite-dependences.h and graphite-cloog-compat.h dependencies. (graphite-dependences.o): Likewise. (graphite-poly.o): Likewise. * configure.ac: Declare ISL vars instead of PPL ones. * configure: Regenerated. * doc/install.texi: Replace PPL requirement documentation with ISL one. * graphite-blocking.c: Remove PPL code, add ISL equivalent. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-poly.h: Likewise. * graphite-poly.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * graphite-scop-detection.c: Re-arrange includes. * graphite-cloog-util.c: Remove. * graphite-cloog-util.h: Likewise. * graphite-ppl.h: Likewise. * graphite-ppl.c: Likewise. * graphite-dependences.h: Likewise. libgomp/ * testsuite/libgomp.graphite/force-parallel-4.c: Adjust. * testsuite/libgomp.graphite/force-parallel-5.c: Likewise. * testsuite/libgomp.graphite/force-parallel-7.c: Likewise. * testsuite/libgomp.graphite/force-parallel-8.c: Likewise. Co-Authored-By: Michael Matz <matz@suse.de> Co-Authored-By: Sebastian Pop <sebpop@gmail.com> Co-Authored-By: Tobias Grosser <tobias@grosser.es> From-SVN: r189156
2012-07-02 13:43:46 +02:00
&& 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 -I'${srcdir}'/cloog/include '
ENABLE_CLOOG_CHECK=no
AC_MSG_WARN([using in-tree CLooG, disabling version check])
cloog.m4: Set up to work against ISL only. 2012-07-02 Richard Guenther <rguenther@suse.de> Michael Matz <matz@suse.de> Tobias Grosser <tobias@grosser.es> Sebastian Pop <sebpop@gmail.com> config/ * cloog.m4: Set up to work against ISL only. * isl.m4: New file. * Makefile.def: Add ISL host module, remove PPL host module. Adjust ClooG host module to use the proper ISL. * Makefile.tpl: Pass ISL include flags instead of PPL ones. * configure.ac: Include config/isl.m4. Add ISL host library, remove PPL. Remove PPL configury, add ISL configury, adjust ClooG configury. * Makefile.in: Regenerated. * configure: Likewise. gcc/ * Makefile.in: Remove PPL flags in favor of ISL ones. (BACKENDLIBS): Remove PPL libs. (INCLUDES): Remove PPL includes in favor of ISL ones. (graphite-clast-to-gimple.o): Remove graphite-dependences.h and graphite-cloog-compat.h dependencies. (graphite-dependences.o): Likewise. (graphite-poly.o): Likewise. * configure.ac: Declare ISL vars instead of PPL ones. * configure: Regenerated. * doc/install.texi: Replace PPL requirement documentation with ISL one. * graphite-blocking.c: Remove PPL code, add ISL equivalent. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-poly.h: Likewise. * graphite-poly.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * graphite-scop-detection.c: Re-arrange includes. * graphite-cloog-util.c: Remove. * graphite-cloog-util.h: Likewise. * graphite-ppl.h: Likewise. * graphite-ppl.c: Likewise. * graphite-dependences.h: Likewise. libgomp/ * testsuite/libgomp.graphite/force-parallel-4.c: Adjust. * testsuite/libgomp.graphite/force-parallel-5.c: Likewise. * testsuite/libgomp.graphite/force-parallel-7.c: Likewise. * testsuite/libgomp.graphite/force-parallel-8.c: Likewise. Co-Authored-By: Michael Matz <matz@suse.de> Co-Authored-By: Sebastian Pop <sebpop@gmail.com> Co-Authored-By: Tobias Grosser <tobias@grosser.es> From-SVN: r189156
2012-07-02 13:43:46 +02:00
fi
clooginc="-DCLOOG_INT_GMP ${clooginc}"
clooglibs="${clooglibs} -lcloog-isl ${isllibs} -lisl"
]
)
# 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}" = xno; then
$2
elif test "x${with_cloog}" != x \
|| test "x${with_cloog_include}" != x \
|| test "x${with_cloog_lib}" != x ; then
$1
else
$2
fi
]
)
# _CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION)
# --------------------------------------------
# Helper for verifying CLooG's compile time version.
m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
cloog.m4: Set up to work against ISL only. 2012-07-02 Richard Guenther <rguenther@suse.de> Michael Matz <matz@suse.de> Tobias Grosser <tobias@grosser.es> Sebastian Pop <sebpop@gmail.com> config/ * cloog.m4: Set up to work against ISL only. * isl.m4: New file. * Makefile.def: Add ISL host module, remove PPL host module. Adjust ClooG host module to use the proper ISL. * Makefile.tpl: Pass ISL include flags instead of PPL ones. * configure.ac: Include config/isl.m4. Add ISL host library, remove PPL. Remove PPL configury, add ISL configury, adjust ClooG configury. * Makefile.in: Regenerated. * configure: Likewise. gcc/ * Makefile.in: Remove PPL flags in favor of ISL ones. (BACKENDLIBS): Remove PPL libs. (INCLUDES): Remove PPL includes in favor of ISL ones. (graphite-clast-to-gimple.o): Remove graphite-dependences.h and graphite-cloog-compat.h dependencies. (graphite-dependences.o): Likewise. (graphite-poly.o): Likewise. * configure.ac: Declare ISL vars instead of PPL ones. * configure: Regenerated. * doc/install.texi: Replace PPL requirement documentation with ISL one. * graphite-blocking.c: Remove PPL code, add ISL equivalent. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-poly.h: Likewise. * graphite-poly.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * graphite-scop-detection.c: Re-arrange includes. * graphite-cloog-util.c: Remove. * graphite-cloog-util.h: Likewise. * graphite-ppl.h: Likewise. * graphite-ppl.c: Likewise. * graphite-dependences.h: Likewise. libgomp/ * testsuite/libgomp.graphite/force-parallel-4.c: Adjust. * testsuite/libgomp.graphite/force-parallel-5.c: Likewise. * testsuite/libgomp.graphite/force-parallel-7.c: Likewise. * testsuite/libgomp.graphite/force-parallel-8.c: Likewise. Co-Authored-By: Michael Matz <matz@suse.de> Co-Authored-By: Sebastian Pop <sebpop@gmail.com> Co-Authored-By: Tobias Grosser <tobias@grosser.es> From-SVN: r189156
2012-07-02 13:43:46 +02:00
[#include "cloog/version.h"],
[#if CLOOG_VERSION_MAJOR != $1 \
|| CLOOG_VERSION_MINOR != $2 \
|| CLOOG_VERSION_REVISION < $3
choke me
#endif])])
# CLOOG_CHECK_VERSION CLOOG_CHECK_VERSION (MAJOR, MINOR, REVISION)
# ----------------------------------------------------------------
# Test the found CLooG to be exact of version MAJOR.MINOR and at least
# REVISION.
AC_DEFUN([CLOOG_CHECK_VERSION],
[
cloog.m4: Set up to work against ISL only. 2012-07-02 Richard Guenther <rguenther@suse.de> Michael Matz <matz@suse.de> Tobias Grosser <tobias@grosser.es> Sebastian Pop <sebpop@gmail.com> config/ * cloog.m4: Set up to work against ISL only. * isl.m4: New file. * Makefile.def: Add ISL host module, remove PPL host module. Adjust ClooG host module to use the proper ISL. * Makefile.tpl: Pass ISL include flags instead of PPL ones. * configure.ac: Include config/isl.m4. Add ISL host library, remove PPL. Remove PPL configury, add ISL configury, adjust ClooG configury. * Makefile.in: Regenerated. * configure: Likewise. gcc/ * Makefile.in: Remove PPL flags in favor of ISL ones. (BACKENDLIBS): Remove PPL libs. (INCLUDES): Remove PPL includes in favor of ISL ones. (graphite-clast-to-gimple.o): Remove graphite-dependences.h and graphite-cloog-compat.h dependencies. (graphite-dependences.o): Likewise. (graphite-poly.o): Likewise. * configure.ac: Declare ISL vars instead of PPL ones. * configure: Regenerated. * doc/install.texi: Replace PPL requirement documentation with ISL one. * graphite-blocking.c: Remove PPL code, add ISL equivalent. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-poly.h: Likewise. * graphite-poly.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * graphite-scop-detection.c: Re-arrange includes. * graphite-cloog-util.c: Remove. * graphite-cloog-util.h: Likewise. * graphite-ppl.h: Likewise. * graphite-ppl.c: Likewise. * graphite-dependences.h: Likewise. libgomp/ * testsuite/libgomp.graphite/force-parallel-4.c: Adjust. * testsuite/libgomp.graphite/force-parallel-5.c: Likewise. * testsuite/libgomp.graphite/force-parallel-7.c: Likewise. * testsuite/libgomp.graphite/force-parallel-8.c: Likewise. Co-Authored-By: Michael Matz <matz@suse.de> Co-Authored-By: Sebastian Pop <sebpop@gmail.com> Co-Authored-By: Tobias Grosser <tobias@grosser.es> From-SVN: r189156
2012-07-02 13:43:46 +02:00
AC_REQUIRE([CLOOG_INIT_FLAGS])
if test "${ENABLE_CLOOG_CHECK}" = yes ; then
_cloog_saved_CFLAGS=$CFLAGS
_cloog_saved_LDFLAGS=$LDFLAGS
cloog.m4: Set up to work against ISL only. 2012-07-02 Richard Guenther <rguenther@suse.de> Michael Matz <matz@suse.de> Tobias Grosser <tobias@grosser.es> Sebastian Pop <sebpop@gmail.com> config/ * cloog.m4: Set up to work against ISL only. * isl.m4: New file. * Makefile.def: Add ISL host module, remove PPL host module. Adjust ClooG host module to use the proper ISL. * Makefile.tpl: Pass ISL include flags instead of PPL ones. * configure.ac: Include config/isl.m4. Add ISL host library, remove PPL. Remove PPL configury, add ISL configury, adjust ClooG configury. * Makefile.in: Regenerated. * configure: Likewise. gcc/ * Makefile.in: Remove PPL flags in favor of ISL ones. (BACKENDLIBS): Remove PPL libs. (INCLUDES): Remove PPL includes in favor of ISL ones. (graphite-clast-to-gimple.o): Remove graphite-dependences.h and graphite-cloog-compat.h dependencies. (graphite-dependences.o): Likewise. (graphite-poly.o): Likewise. * configure.ac: Declare ISL vars instead of PPL ones. * configure: Regenerated. * doc/install.texi: Replace PPL requirement documentation with ISL one. * graphite-blocking.c: Remove PPL code, add ISL equivalent. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-poly.h: Likewise. * graphite-poly.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * graphite-scop-detection.c: Re-arrange includes. * graphite-cloog-util.c: Remove. * graphite-cloog-util.h: Likewise. * graphite-ppl.h: Likewise. * graphite-ppl.c: Likewise. * graphite-dependences.h: Likewise. libgomp/ * testsuite/libgomp.graphite/force-parallel-4.c: Adjust. * testsuite/libgomp.graphite/force-parallel-5.c: Likewise. * testsuite/libgomp.graphite/force-parallel-7.c: Likewise. * testsuite/libgomp.graphite/force-parallel-8.c: Likewise. Co-Authored-By: Michael Matz <matz@suse.de> Co-Authored-By: Sebastian Pop <sebpop@gmail.com> Co-Authored-By: Tobias Grosser <tobias@grosser.es> From-SVN: r189156
2012-07-02 13:43:46 +02:00
CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${islinc} ${gmpinc}"
LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${isllibs} ${gmplib}"
AC_MSG_CHECKING([for version $1.$2.$3 of CLooG])
AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG($1,$2,$3)],
[multiple changes] 2012-07-02 Richard Guenther <rguenther@suse.de> Merge from graphite branch 2011-07-21 Tobias Grosser <tobias@grosser.es> * configure: Regenerated. * config/cloog.m4: Remove support for CLooG-ppl and CLooG-parma, both cloog.org and legacy versions. The only supported version will be CLooG with the isl backend. 2011-07-21 Tobias Grosser <tobias@grosser.es> * configure: Regenerated. * configure.ac: Require cloog isl 0.17.0 2011-07-21 Tobias Grosser <tobias@grosser.es> * configure: Regenerated. * config/cloog.m4: Do not define CLOOG_ORG gcc/ * Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o): Remove graphite-cloog-util.h. * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop, build_iv_mapping, translate_clast_user, translate_clast, free_scattering, initialize_cloog_names, build_cloog_prog, create_params_index): Do not use old compatibility functions. (clast_name_to_index, set_cloog_options): Remove code for legacy cloog. * graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old compatibility functions. (new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy cloog. * graphite-cloog-util.h: Remove include of graphite-cloog-util.h. * graphite.c (graphite.c): Do not call outdated cloog_initialize() and cloog_finalize(). * graphite-cloog-compat.h: Remove. 2011-08-09 Tobias Grosser <tobias@grosser.es> gcc/ * graphite-clast-to-gimple.c (new_clast_name_index): Store a copy of the string, no just a reference. (clast_name_index): Add a new field, that specifies if we need to free the name. (free_clast_name_index): If necessary, free the name string. (clast_name_index_elt_info): Calculate the hash based on the string content, not the memory location it is stored in. (clast_name_to_level): Specify that we do not need to free the name. (clast_name_to_index): Dito. (clast_name_to_lb_ub): Dito. (eq_clast_name_indexes): Compare the strings, not their base pointers. (free_scattering): Removed. (initialize_cloog_names): Renamed to add_names_to_union_domain(). (add_names_to_union_domain): Changed to work on a union_domain, instead of a CloogNames structure. (build_cloog_prog): Removed. (build_cloog_union_domain): New. (generate_cloog_input): New. (scop_to_clast): Use CloogInput instead of CloogProgram. (print_generated_program): Adapt to new scop_to_clast() and do not print the CloogProgram any more. (create_params_index): Removed, functionality integrated in add_names_to_union_domain(). (gloog): Adapt to new scop_to_clast(). * graphite-clast-to-gimple.h (scop_to_clast): Remove. 2012-01-11 Tobias Grosser <tobias@grosser.es> * graphite-clast-to-gimple.c (clast_name_to_index, clast_name_to_lb_ub, clast_name_to_gcc): Change types. (clast_to_gcc_expression): Add clast_expr_name as a new case. Do not assume a clast_expr_term points always to a clast_expr_name. (type_for_clast_term): Do not assume a clast_expr_term points always to a clast_expr_name. (type_for_clast_name): New. (type_for_clast_expr): Add clast_expr_name as a new case. 2011-08-03 Sebastian Pop <sebpop@gmail.com> * graphite-cloog-util.c (new_Cloog_Domain_from_ppl_Polyhedron, new_Cloog_Scattering_from_ppl_Polyhedron, new_Cloog_Domain_from_ppl_Pointset_Powerset): Remove ATTRIBUTE_UNUSED. From-SVN: r189155
2012-07-02 13:33:21 +02:00
[gcc_cv_cloog=yes],
[gcc_cv_cloog=no])
AC_MSG_RESULT([$gcc_cv_cloog])
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])
[multiple changes] 2012-07-02 Richard Guenther <rguenther@suse.de> Merge from graphite branch 2011-07-21 Tobias Grosser <tobias@grosser.es> * configure: Regenerated. * config/cloog.m4: Remove support for CLooG-ppl and CLooG-parma, both cloog.org and legacy versions. The only supported version will be CLooG with the isl backend. 2011-07-21 Tobias Grosser <tobias@grosser.es> * configure: Regenerated. * configure.ac: Require cloog isl 0.17.0 2011-07-21 Tobias Grosser <tobias@grosser.es> * configure: Regenerated. * config/cloog.m4: Do not define CLOOG_ORG gcc/ * Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o): Remove graphite-cloog-util.h. * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop, build_iv_mapping, translate_clast_user, translate_clast, free_scattering, initialize_cloog_names, build_cloog_prog, create_params_index): Do not use old compatibility functions. (clast_name_to_index, set_cloog_options): Remove code for legacy cloog. * graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old compatibility functions. (new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy cloog. * graphite-cloog-util.h: Remove include of graphite-cloog-util.h. * graphite.c (graphite.c): Do not call outdated cloog_initialize() and cloog_finalize(). * graphite-cloog-compat.h: Remove. 2011-08-09 Tobias Grosser <tobias@grosser.es> gcc/ * graphite-clast-to-gimple.c (new_clast_name_index): Store a copy of the string, no just a reference. (clast_name_index): Add a new field, that specifies if we need to free the name. (free_clast_name_index): If necessary, free the name string. (clast_name_index_elt_info): Calculate the hash based on the string content, not the memory location it is stored in. (clast_name_to_level): Specify that we do not need to free the name. (clast_name_to_index): Dito. (clast_name_to_lb_ub): Dito. (eq_clast_name_indexes): Compare the strings, not their base pointers. (free_scattering): Removed. (initialize_cloog_names): Renamed to add_names_to_union_domain(). (add_names_to_union_domain): Changed to work on a union_domain, instead of a CloogNames structure. (build_cloog_prog): Removed. (build_cloog_union_domain): New. (generate_cloog_input): New. (scop_to_clast): Use CloogInput instead of CloogProgram. (print_generated_program): Adapt to new scop_to_clast() and do not print the CloogProgram any more. (create_params_index): Removed, functionality integrated in add_names_to_union_domain(). (gloog): Adapt to new scop_to_clast(). * graphite-clast-to-gimple.h (scop_to_clast): Remove. 2012-01-11 Tobias Grosser <tobias@grosser.es> * graphite-clast-to-gimple.c (clast_name_to_index, clast_name_to_lb_ub, clast_name_to_gcc): Change types. (clast_to_gcc_expression): Add clast_expr_name as a new case. Do not assume a clast_expr_term points always to a clast_expr_name. (type_for_clast_term): Do not assume a clast_expr_term points always to a clast_expr_name. (type_for_clast_name): New. (type_for_clast_expr): Add clast_expr_name as a new case. 2011-08-03 Sebastian Pop <sebpop@gmail.com> * graphite-cloog-util.c (new_Cloog_Domain_from_ppl_Polyhedron, new_Cloog_Scattering_from_ppl_Polyhedron, new_Cloog_Domain_from_ppl_Pointset_Powerset): Remove ATTRIBUTE_UNUSED. From-SVN: r189155
2012-07-02 13:33:21 +02:00
if test "${gcc_cv_cloog}" = no ; then
clooglibs=
clooginc=
fi
if test "${graphite_requested}" = yes \
&& test "x${clooglibs}" = x \
&& test "x${clooginc}" = x ; then
$1
fi
]
)