From 4e2953f3e674a563db440882a29493531cd7f197 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 6 Jan 2015 19:51:04 -0500 Subject: [PATCH] BLD: Switch m4 to submodule. This should make autoconf stuff consistent between 2D and 3D codes. Fixes #144. --- .gitmodules | 3 + configure.ac | 2 +- m4 | 1 + m4/ac_pkg_swig.m4 | 126 ----------- m4/cit_fortran.m4 | 363 -------------------------------- m4/cit_funcstring.m4 | 47 ----- m4/cit_hdf.m4 | 81 ------- m4/cit_mpi.m4 | 489 ------------------------------------------- m4/cit_numpy.m4 | 33 --- m4/cit_petsc.m4 | 383 --------------------------------- m4/cit_python.m4 | 465 ---------------------------------------- 11 files changed, 5 insertions(+), 1988 deletions(-) create mode 160000 m4 delete mode 100644 m4/ac_pkg_swig.m4 delete mode 100644 m4/cit_fortran.m4 delete mode 100644 m4/cit_funcstring.m4 delete mode 100644 m4/cit_hdf.m4 delete mode 100644 m4/cit_mpi.m4 delete mode 100644 m4/cit_numpy.m4 delete mode 100644 m4/cit_petsc.m4 delete mode 100644 m4/cit_python.m4 diff --git a/.gitmodules b/.gitmodules index e69de29bb..4da0ec5fd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "m4"] + path = m4 + url = https://github.com/geodynamics/autoconf_cig.git diff --git a/configure.ac b/configure.ac index 86c98ffa1..3b2061b1a 100644 --- a/configure.ac +++ b/configure.ac @@ -67,7 +67,7 @@ AC_FC_WRAPPERS AC_LANG(Fortran) AC_FC_SRCEXT(f90) AC_FC_FREEFORM() -CIT_FC_PP_DEFINE() +AC_FC_PP_DEFINE() AC_SUBST([FC_DEFINE]) AC_PROG_CC diff --git a/m4 b/m4 new file mode 160000 index 000000000..2f5d95b32 --- /dev/null +++ b/m4 @@ -0,0 +1 @@ +Subproject commit 2f5d95b32cea24be622a943d2b434501a9c683db diff --git a/m4/ac_pkg_swig.m4 b/m4/ac_pkg_swig.m4 deleted file mode 100644 index 37279298b..000000000 --- a/m4/ac_pkg_swig.m4 +++ /dev/null @@ -1,126 +0,0 @@ -# =========================================================================== -# http://autoconf-archive.cryp.to/ac_pkg_swig.html -# =========================================================================== -# -# SYNOPSIS -# -# AC_PROG_SWIG([major.minor.micro]) -# -# DESCRIPTION -# -# This macro searches for a SWIG installation on your system. If found you -# should call SWIG via $(SWIG). You can use the optional first argument to -# check if the version of the available SWIG is greater than or equal to -# the value of the argument. It should have the format: N[.N[.N]] (N is a -# number between 0 and 999. Only the first N is mandatory.) -# -# If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that -# the swig package is this version number or higher. -# -# In configure.in, use as: -# -# AC_PROG_SWIG(1.3.17) -# SWIG_ENABLE_CXX -# SWIG_MULTI_MODULE_SUPPORT -# SWIG_PYTHON -# -# LAST MODIFICATION -# -# 2010-07-17 (Brad Aagaard, permit newer major and minor versions than required) -# -# COPYLEFT -# -# Copyright (c) 2008 Sebastian Huber -# Copyright (c) 2008 Alan W. Irwin -# Copyright (c) 2008 Rafael Laboissiere -# Copyright (c) 2008 Andrew Collier -# -# This program 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 2 of the License, or (at your -# option) any later version. -# -# This program 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 this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. - -AC_DEFUN([AC_PROG_SWIG],[ - AC_PATH_PROG([SWIG],[swig]) - if test -z "$SWIG" ; then - AC_MSG_FAILURE([cannot find 'swig' program. Go to http://www.swig.org to download SWIG.]) - SWIG='echo "Error: SWIG is not installed. SWIG is available at http://www.swig.org". ; false' - elif test -n "$1" ; then - AC_MSG_CHECKING([for SWIG version]) - [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] - AC_MSG_RESULT([$swig_version]) - if test -n "$swig_version" ; then - # Calculate the required version number components - [required=$1] - [required_major=`echo $required | sed 's/[^0-9].*//'`] - if test -z "$required_major" ; then - [required_major=0] - fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] - [required_minor=`echo $required | sed 's/[^0-9].*//'`] - if test -z "$required_minor" ; then - [required_minor=0] - fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] - [required_patch=`echo $required | sed 's/[^0-9].*//'`] - if test -z "$required_patch" ; then - [required_patch=0] - fi - # Calculate the available version number components - [available=$swig_version] - [available_major=`echo $available | sed 's/[^0-9].*//'`] - if test -z "$available_major" ; then - [available_major=0] - fi - [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] - [available_minor=`echo $available | sed 's/[^0-9].*//'`] - if test -z "$available_minor" ; then - [available_minor=0] - fi - [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] - [available_patch=`echo $available | sed 's/[^0-9].*//'`] - if test -z "$available_patch" ; then - [available_patch=0] - fi - if test $available_major -lt $required_major ; then - AC_MSG_FAILURE([SWIG version >= $1 is required. You have $swig_version. Go to http://www.swig.org to get the current version.]) - SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. Go to http://www.swig.org to get the current version." ; false' - elif test $available_major -eq $required_major -a $available_minor -lt $required_minor ; then - AC_MSG_FAILURE([SWIG version >= $1 is required. You have $swig_version. Go to http://www.swig.org to get the current version.]) - SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. Go to http://www.swig.org to get the current version." ; false' - elif test $available_major -eq $required_major -a $available_minor -eq $required_minor -a $available_patch -lt $required_patch ; then - AC_MSG_FAILURE([SWIG version >= $1 is required. You have $swig_version. Go to http://www.swig.org to get the current version.]) - SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. Go to http://www.swig.org to get the current version." ; false' - else - AC_MSG_NOTICE([SWIG executable is '$SWIG']) - SWIG_LIB=`$SWIG -swiglib` - AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB']) - fi - else - AC_MSG_FAILURE([cannot determine SWIG version]) - SWIG='echo "Error: Cannot determine SWIG version. See the SWIG website http://www.swig.org" ; false' - fi - fi - AC_SUBST([SWIG_LIB]) -]) diff --git a/m4/cit_fortran.m4 b/m4/cit_fortran.m4 deleted file mode 100644 index c1403ec1d..000000000 --- a/m4/cit_fortran.m4 +++ /dev/null @@ -1,363 +0,0 @@ -# -*- Autoconf -*- - - -## ---------------------------- ## -## Autoconf macros for Fortran. ## -## ---------------------------- ## - - -# _CIT_FC_MAIN -# ------------ -# Define {F77,FC}_MAIN to the name of the alternate main() function -# for use with the Fortran libraries (i.e., MAIN__ or whatever), or -# 'main' if no such alternate name is found. -# -# As of Autoconf 2.59, the macro AC_FC_MAIN does not work with ifort -# v9, because the macro assumes that 'main' will be resolved by -# FCLIBS, but FCLIBS does not include Intel's 'for_main.o'. This -# macro simply links with the Fortran compiler instead. -# -AC_DEFUN([_CIT_FC_MAIN], -[_AC_FORTRAN_ASSERT()dnl -AC_CACHE_CHECK([for alternate main to link with Fortran libraries], - ac_cv_[]_AC_LANG_ABBREV[]_main, -[ac_[]_AC_LANG_ABBREV[]_m_save_LIBS=$LIBS - LIBS="cfortran_test.$ac_objext $LIBS" - ac_fortran_dm_var=[]_AC_FC[]_DUMMY_MAIN - ac_cv_fortran_main="main" # default entry point name - for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do - AC_LANG_PUSH(C) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@ifdef FC_DUMMY_MAIN_EQ_F77 -@%:@ undef F77_DUMMY_MAIN -@%:@ undef FC_DUMMY_MAIN -@%:@else -@%:@ undef $ac_fortran_dm_var -@%:@endif -@%:@define main $ac_func])], - [mv conftest.$ac_objext cfortran_test.$ac_objext], - [AC_MSG_FAILURE([cannot compile a simple C program])]) - AC_LANG_POP(C) - AC_LINK_IFELSE([AC_LANG_SOURCE( -[ subroutine foobar() - return - end])], [ac_cv_fortran_main=$ac_func; break]) - rm -f cfortran_test* conftest* - done - ac_cv_[]_AC_LANG_ABBREV[]_main=$ac_cv_fortran_main - rm -f cfortran_test* conftest* - LIBS=$ac_[]_AC_LANG_ABBREV[]_m_save_LIBS -]) -AC_DEFINE_UNQUOTED([]_AC_FC[]_MAIN, $ac_cv_[]_AC_LANG_ABBREV[]_main, - [Define to alternate name for `main' routine that is - called from a `main' in the Fortran libraries.]) -])# _CIT_FC_MAIN - - -# CIT_F77_MAIN -# ------------ -AC_DEFUN([CIT_F77_MAIN], -[AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])dnl -AC_LANG_PUSH(Fortran 77)dnl -_AC_FC_MAIN -AC_LANG_POP(Fortran 77)dnl -])# CIT_F77_MAIN - - -# CIT_FC_MAIN -# ----------- -AC_DEFUN([CIT_FC_MAIN], -[AC_REQUIRE([AC_FC_LIBRARY_LDFLAGS])dnl -AC_LANG_PUSH(Fortran)dnl -_CIT_FC_MAIN -AC_LANG_POP(Fortran)dnl -])# CIT_FC_MAIN - - -# CIT_FC_OPEN_APPEND -# ------------------ -AC_DEFUN([CIT_FC_OPEN_APPEND], [ -AC_LANG_PUSH(Fortran) -cit_fc_append=no -AC_MSG_CHECKING([whether $FC supports OPEN control item 'position="append"']) -AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([], [[ open(10,file="foo",status="old",position="append")]]) -], [ - AC_MSG_RESULT(yes) - FCFLAGS="-DFORTRAN_POSITION_APPEND $FCFLAGS"; export FCFLAGS - cit_fc_append=yes -], [ - AC_MSG_RESULT(no) -]) -AC_MSG_CHECKING([whether $FC supports OPEN control item 'access="append"']) -AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([], [[ open(10,file="foo",status="old",access="append")]]) -], [ - AC_MSG_RESULT(yes) - FCFLAGS="-DFORTRAN_ACCESS_APPEND $FCFLAGS"; export FCFLAGS - cit_fc_append=yes -], [ - AC_MSG_RESULT(no) -]) -AS_IF([test $cit_fc_append = yes], [], [ - AC_MSG_FAILURE([cannot determine method for appending to Fortran files]) -]) -AC_LANG_POP(Fortran) -])dnl CIT_FC_OPEN_APPEND - - -# CIT_FC_STREAM_IO -# ---------------- -AC_DEFUN([CIT_FC_STREAM_IO], [ -AC_LANG_PUSH(Fortran) -AC_MSG_CHECKING([whether $FC supports stream i/o]) -AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([], [[ open(10,file="foo",status="new",access="stream", - & form="unformatted") - write(10,pos=1) 1,2,3.0d0]]) -], [ - AC_MSG_RESULT(yes) - FCFLAGS="-DFORTRAN_STREAM_IO $FCFLAGS"; export FCFLAGS -], [ - AC_MSG_RESULT(no) - AC_MSG_CHECKING([whether $FC supports f77-style binary direct-access i/o]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([], [[ open(10,file="foo",status="new",access="direct",recl=1, - & form="unformatted") - write(10,rec=1) 1,2,3.0d0]]) - ], [ - AC_MSG_RESULT(yes) - FCFLAGS="-DFORTRAN_F77_IO $FCFLAGS"; export FCFLAGS - AC_MSG_CHECKING([whether $FC supports I/O specifiers 'advance' and 'eor']) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([], [[ open(10,file="foo",status="new",access="direct",recl=1, - & form="unformatted") - write(10,rec=1,advance='yes',eor=10) 1,2,3.0d0 - 10 continue]]) - ], [ - AC_MSG_RESULT(yes) - FCFLAGS="-DFORTRAN_EOR $FCFLAGS"; export FCFLAGS - ], [ - AC_MSG_RESULT(no) - ]) - ], [ - AC_MSG_RESULT(no) - AC_MSG_WARN([cannot determine how to produce binary direct-access files with variable record length]) - FCFLAGS="-DFORTRAN_NO_BINARY $FCFLAGS"; export FCFLAGS - ]) -]) -AC_LANG_POP(Fortran) -])dnl CIT_FC_STREAM_IO - - -# CIT_FC_MPI_MODULE(FILENAME, MPIFC, MPIFCFLAGS, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ----------------------------------------------------- -AC_DEFUN([CIT_FC_MPI_MODULE], [ -# Use 'mpi' module or 'mpif.h', as appropriate. UNFINISHED. -# The default actions are to create FILENAME that either uses the -# appropriate module or includes the existing mpif.h. -# This strategy doesn't play well with "implicit none": whether the -# generated header must be included before or after "implicit none" -# depends upon the result of the test! It might be possible to make -# "use mpi" always work: simply generate an 'mpi' module if the MPI -# library doesn't provide one. The generated module would simply -# "include 'mpif.h'". -AC_LANG_PUSH(Fortran) - -ofile=$1 -cfgfile="${ofile}T" -trap "rm \"$cfgfile\"; exit 1" 1 2 15 -rm -f "$cfgfile" - -cit_fc_header=none -cit_fc_save_fc=$FC -cit_fc_save_fcflags=$FCFLAGS -FC=$2 -FCFLAGS="$FCFLAGS $3" - -AC_MSG_CHECKING([whether "use mpi" works]) -AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([], [[ - use mpi - integer ier - call MPI_INIT(ier) - call MPI_FINALIZE(ier) -]]) -], [ - AC_MSG_RESULT(yes) - m4_default([$4], [cit_fc_header="use mpi"]) -], [ - AC_MSG_RESULT(no) - m4_default([$5], [ - AC_MSG_CHECKING([whether mpif.h works]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([], [[ - include 'mpif.h' - integer ier - call MPI_INIT(ier) - call MPI_FINALIZE(ier) -]]) - ], [ - AC_MSG_RESULT(yes) -dnl Allow projects to simply include the standard 'mpif.h' everywhere. -dnl If FILENAME is 'mpif.h', this macro will conditionally create a header -dnl to override the system header. - if test "$ofile" = "mpif.h"; then - cit_fc_header=none - else - cit_fc_header="include 'mpif.h'" - fi - ], [ - AC_MSG_RESULT(no) - AC_MSG_FAILURE([cannot compile a trivial MPI program using $2]) - ]) -])]) - -if test "$cit_fc_header" != "none"; then - AC_MSG_NOTICE([creating $ofile]) - cat >"$cfgfile" </dev/null` - for cit_arg in $cit_mpifc_info; do - case $cit_arg in - */mpif.h) cit_mpif_h="$cit_arg"; break;; - esac - done - if test "$cit_mpif_h" == "unknown"; then - AC_MSG_FAILURE([cannot compile a trivial MPI program using $1]) - fi - -dnl Special hack for MPICH. - AC_MSG_NOTICE([creating $ofile]) - cat >"$cfgfile" <>"$cfgfile" - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - - AC_MSG_CHECKING([whether generated mpif.h works]) - AC_COMPILE_IFELSE(_CIT_FC_TRIVIAL_MPI_PROGRAM, [ - AC_MSG_RESULT(yes) - ], [ - AC_MSG_RESULT(no) - AC_MSG_FAILURE([cannot compile a trivial MPI program using $1]) - ]) - -]) - -FC=$cit_fc_save_fc -FCFLAGS=$cit_fc_save_fcflags - -AC_LANG_POP(Fortran) -])dnl CIT_FC_MPI_HEADER - - -# _CIT_FC_TRIVIAL_MPI_PROGRAM -# ------------------------ -AC_DEFUN([_CIT_FC_TRIVIAL_MPI_PROGRAM], [ -AC_LANG_PROGRAM([], [[ - include 'mpif.h' - integer, parameter :: CUSTOM_MPI_TYPE = MPI_REAL - integer ier - call MPI_INIT(ier) - call MPI_BARRIER(MPI_COMM_WORLD,ier) - call MPI_FINALIZE(ier) -]]) -])dnl _CIT_FC_TRIVIAL_MPI_PROGRAM - - -# -# The following macro is from autoconf 2.68 (which is still new). -# - -# CIT_FC_PP_DEFINE([ACTION-IF-SUCCESS], [ACTION-IF-FAILURE = FAILURE]) -# ------------------------------------------------------------------- -# Find a flag to specify defines for preprocessed Fortran. Not all -# Fortran compilers use -D. Substitute FC_DEFINE with the result and -# call ACTION-IF-SUCCESS (defaults to nothing) if successful, and -# ACTION-IF-FAILURE (defaults to failing with an error message) if not. -# -# Known flags: -# IBM: -WF,-D -# Lahey/Fujitsu: -Wp,-D older versions??? -# f2c: -D or -Wc,-D -# others: -D -AC_DEFUN([CIT_FC_PP_DEFINE], -[AC_LANG_PUSH([Fortran])dnl -ac_fc_pp_define_srcext_save=$ac_fc_srcext -AC_FC_PP_SRCEXT([F]) -AC_CACHE_CHECK([how to define symbols for preprocessed Fortran], - [ac_cv_fc_pp_define], -[ac_fc_pp_define_srcext_save=$ac_fc_srcext -ac_cv_fc_pp_define=unknown -ac_fc_pp_define_FCFLAGS_save=$FCFLAGS -for ac_flag in -D -WF,-D -Wp,-D -Wc,-D -do - FCFLAGS="$ac_fc_pp_define_FCFLAGS_save ${ac_flag}FOOBAR ${ac_flag}ZORK=42" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ -#ifndef FOOBAR - choke me -#endif -#if ZORK != 42 - choke me -#endif]])], - [ac_cv_fc_pp_define=$ac_flag]) - test x"$ac_cv_fc_pp_define" != xunknown && break -done -FCFLAGS=$ac_fc_pp_define_FCFLAGS_save -]) -ac_fc_srcext=$ac_fc_pp_define_srcext_save -if test "x$ac_cv_fc_pp_define" = xunknown; then - FC_DEFINE= - m4_default([$2], - [AC_MSG_ERROR([Fortran does not allow to define preprocessor symbols], 77)]) -else - FC_DEFINE=$ac_cv_fc_pp_define - $1 -fi -AC_SUBST([FC_DEFINE])dnl -AC_LANG_POP([Fortran])dnl -]) - - -dnl end of file diff --git a/m4/cit_funcstring.m4 b/m4/cit_funcstring.m4 deleted file mode 100644 index d260fcd0d..000000000 --- a/m4/cit_funcstring.m4 +++ /dev/null @@ -1,47 +0,0 @@ -# -*- Autoconf -*- - -## Autoconf macro for testing if compiler provides string with -## function names. -## - -# CIT_HAVE_FUNTIONSTRING -# Defines preprocessor macro __FUNCTION_NAME__. -# ------------ -AC_DEFUN([CIT_FUNCTIONSTRING], [ - AC_LANG(C++) - set_function_name=no - - AC_MSG_CHECKING([whether C++ compiler defines __PRETTY_FUNCTION__]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], - [[const char* name = __PRETTY_FUNCTION__;]])], - [AC_MSG_RESULT(yes) - set_function_name=yes - AC_DEFINE([__FUNCTION_NAME__], [__PRETTY_FUNCTION__], [Define __FUNCTION_NAME__ to __PRETTY_FUNCTION__.])], - [AC_MSG_RESULT(no)]) - - if test "$set_function_name" == no; then - AC_MSG_CHECKING([whether C++ compiler defines __FUNCTION__]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], - [[const char* name = __FUNCTION__;]])], - [AC_MSG_RESULT(yes) - set_function_name=yes - AC_DEFINE([__FUNCTION_NAME__], [__FUNCTION__], [Define __FUNCTION_NAME__ to __FUNCTION__.])], - [AC_MSG_RESULT(no)]) - fi - - if test "$set_function_name" == no; then - AC_MSG_CHECKING([whether C++ compiler defines __func__]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], - [[const char* name = __func__;]])], - [AC_MSG_RESULT(yes) - set_function_name=yes - AC_DEFINE([__FUNCTION_NAME__], [__func__], [Define __FUNCTION_NAME__ to __func__.])], - [AC_MSG_RESULT(no)]) - fi -])) - - -dnl end of file diff --git a/m4/cit_hdf.m4 b/m4/cit_hdf.m4 deleted file mode 100644 index 483d4c32b..000000000 --- a/m4/cit_hdf.m4 +++ /dev/null @@ -1,81 +0,0 @@ -# -*- Autoconf -*- - - -## ------------------------ ## -## Autoconf macros for HDF. ## -## ------------------------ ## - - -# CIT_ARG_HDF5 -# ------------ -AC_DEFUN([CIT_ARG_HDF5], [ -# $Id: cit_hdf.m4 5189 2006-11-07 02:29:23Z leif $ -AC_ARG_VAR(PHDF5_HOME, [home path to HDF5 library]) -AC_ARG_WITH([hdf5], - [AC_HELP_STRING([--with-hdf5], - [enable HDF5 output @<:@default=$1@:>@])], - [want_hdf5="$withval"], - [want_hdf5=$1]) -])dnl CIT_ARG_HDF5 - - -# CIT_CHECK_LIB_HDF5 -# ------------------ -AC_DEFUN([CIT_CHECK_LIB_HDF5], [ -# $Id: cit_hdf.m4 5189 2006-11-07 02:29:23Z leif $ -if test "$want_hdf5" != no; then - if test -n "$PHDF5_HOME"; then - LDFLAGS="-L$PHDF5_HOME/lib $LDFLAGS" - fi - # check for basic HDF5 function - AC_SEARCH_LIBS([H5Fopen], [hdf5], [], [ - if test "$want_hdf5" = auto; then - want_hdf5=no - AC_MSG_WARN([HDF5 library not found; disabling HDF5 support]) - else - AC_MSG_ERROR([HDF5 library not found; try setting PHDF5_HOME]) - fi - ]) -fi -])dnl CIT_CHECK_LIB_HDF5 - - -# CIT_CHECK_LIB_HDF5_PARALLEL -# --------------------------- -AC_DEFUN([CIT_CHECK_LIB_HDF5_PARALLEL], [ -# $Id: cit_hdf.m4 5189 2006-11-07 02:29:23Z leif $ -if test "$want_hdf5" != no; then - # check for HDF5 parallel-IO function - AC_SEARCH_LIBS([H5Pset_dxpl_mpio], [hdf5], [], [ - if test "$want_hdf5" = auto; then - want_hdf5=no - AC_MSG_WARN([parallel HDF5 library not found; disabling HDF5 support]) - else - AC_MSG_ERROR([parallel HDF5 library not found; try configuring HDF5 with '--enable-parallel']) - fi - ]) -fi -])dnl CIT_CHECK_LIB_HDF5_PARALLEL - - -# CIT_CHECK_HEADER_HDF5 -# --------------------- -AC_DEFUN([CIT_CHECK_HEADER_HDF5], [ -# $Id: cit_hdf.m4 5189 2006-11-07 02:29:23Z leif $ -if test "$want_hdf5" != no; then - if test -n "$PHDF5_HOME"; then - CPPFLAGS="-I$PHDF5_HOME/include $CPPFLAGS" - fi - AC_CHECK_HEADERS([hdf5.h], [AC_DEFINE([HAVE_HDF5_H])], [ - if test "$want_hdf5" = auto; then - want_hdf5=no - AC_MSG_WARN([header 'hdf5.h' not found; disabling HDF5 support]) - else - AC_MSG_ERROR([header 'hdf5.h' not found]) - fi - ]) -fi -])dnl CIT_CHECK_HEADER_HDF5 - - -dnl end of file diff --git a/m4/cit_mpi.m4 b/m4/cit_mpi.m4 deleted file mode 100644 index 70a4110fd..000000000 --- a/m4/cit_mpi.m4 +++ /dev/null @@ -1,489 +0,0 @@ -# -*- Autoconf -*- - - -## ------------------------ ## -## Autoconf macros for MPI. ## -## ------------------------ ## - - -# CIT_PROG_MPICC -# -------------- -# Call AC_PROG_CC, but prefer MPI C wrappers to a bare compiler in -# the search list. Set MPICC to the program/wrapper used to compile -# C MPI programs. Set CC to the compiler used to compile ordinary -# C programs, and link shared libraries of all types (see the -# comment about the MPI library, below). Make sure that CC and -# MPICC both represent the same underlying C compiler. -AC_DEFUN([CIT_PROG_MPICC], [ -# $Id: cit_mpi.m4 7980 2007-09-18 01:01:59Z leif $ -AC_PROVIDE([_CIT_PROG_MPICC])dnl -AC_REQUIRE([_CIT_PROG_MPICC_SEARCH_LIST])dnl -AC_BEFORE([$0], [AC_PROG_CC]) -AC_ARG_VAR(MPICC, [MPI C compiler command]) -AC_SUBST([MPICC]) -test -z "$want_mpi" && want_mpi=yes -# The 'cit_compiler_search_list' is the result of merging the -# following: -# * MPI C wrappers -# * the range of values for config's COMPILER_CC_NAME -# (cc cl ecc gcc icc pgcc xlc xlc_r) -# Newer names are tried first (e.g., icc before ecc). -cit_compiler_search_list="gcc cc cl icc ecc pgcc xlc xlc_r" -# There are two C command variables, so there are four cases to -# consider: -# -# ./configure CC=gcc MPICC=mpicc # save MPICC as cit_MPICC; MPICC=$CC -# ./configure CC=gcc # MPICC=$CC, guess cit_MPICC -# ./configure MPICC=mpicc # derive CC -# ./configure # guess MPICC and derive CC -# -# In the cases where CC is explicitly specified, the MPI C wrapper -# (cit_MPICC, if known) is only used to gather compile/link flags (if -# needed). -if test "$want_mpi" = yes; then - if test -n "$CC"; then - cit_MPICC_underlying_CC=$CC - if test -n "$MPICC"; then - # CC=gcc MPICC=mpicc - cit_MPICC=$MPICC - MPICC=$CC - else - # CC=gcc MPICC=??? - AC_CHECK_PROGS(cit_MPICC, $cit_mpicc_search_list) - fi - else - if test -n "$MPICC"; then - # CC=??? MPICC=mpicc - cit_MPICC=$MPICC - CC=$MPICC # will be reevaluated below - else - # CC=??? MPICC=??? - cit_compiler_search_list="$cit_mpicc_search_list $cit_compiler_search_list" - fi - fi -fi -AC_PROG_CC($cit_compiler_search_list) -if test "$want_mpi" = yes; then - if test -z "$MPICC"; then - MPICC=$CC - fi - if test -z "$cit_MPICC"; then - case $MPICC in - *mp* | hcc) - cit_MPICC=$MPICC - ;; - esac - fi - # The MPI library is typically static. Linking a shared object - # against static library is non-portable, and needlessly bloats our - # Python extension modules on the platforms where it does work. - # Unless CC was set explicitly, attempt to set CC to the underlying - # compiler command, so that we may link with the matching C - # compiler, but omit -lmpi/-lmpich from the link line. - if test -z "$cit_MPICC_underlying_CC"; then - if test -n "$cit_MPICC"; then - AC_MSG_CHECKING([for the C compiler underlying $cit_MPICC]) - CC= - AC_LANG_PUSH(C) - for cit_arg_show in CIT_MPI_COMPILE_INFO_SWITCHES - do - cit_cmd="$cit_MPICC -c $cit_arg_show" - if $cit_cmd >/dev/null 2>&1; then - CC=`$cit_cmd 2>/dev/null | sed 's/ .*//'` - if test -n "$CC"; then - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [break 2], [CC=]) - fi - fi - done - AC_LANG_POP(C) - if test -n "$CC"; then - AC_MSG_RESULT($CC) - else - AC_MSG_RESULT(failed) - AC_MSG_FAILURE([can not determine the C compiler underlying $cit_MPICC]) - fi - fi - cit_MPICC_underlying_CC=$CC - fi -fi -])dnl CIT_PROG_MPICC - - -# _CIT_PROG_MPICC -# --------------- -# Search for an MPI C wrapper. ~ This private macro is employed by -# C++-only projects (via CIT_CHECK_LIB_MPI and CIT_HEADER_MPI). It -# handles the case where an MPI C wrapper is present, but an MPI C++ -# wrapper is missing or broken. This can happen if a C++ compiler was -# not found/specified when MPI was installed. -AC_DEFUN([_CIT_PROG_MPICC], [ -AC_REQUIRE([_CIT_PROG_MPICC_SEARCH_LIST])dnl -AC_CHECK_PROGS(cit_MPICC, $cit_mpicc_search_list) -])dnl _CIT_PROG_MPICC - - -# _CIT_PROG_MPICC_SEARCH_LIST -# --------------------------- -AC_DEFUN([_CIT_PROG_MPICC_SEARCH_LIST], [ -# $Id: cit_mpi.m4 7980 2007-09-18 01:01:59Z leif $ -cit_mpicc_search_list="mpicc hcc mpcc mpcc_r mpxlc cmpicc" -])dnl _CIT_PROG_MPICC_SEARCH_LIST - - -# CIT_PROG_MPICXX -# --------------- -# Call AC_PROG_CXX, but prefer MPI C++ wrappers to a bare compiler in -# the search list. Set MPICXX to the program/wrapper used to compile -# C++ MPI programs. Set CXX to the compiler used to compile ordinary -# C++ programs, and link shared libraries of all types (see the -# comment about the MPI library, below). Make sure that CXX and -# MPICXX both represent the same underlying C++ compiler. -AC_DEFUN([CIT_PROG_MPICXX], [ -# $Id: cit_mpi.m4 7980 2007-09-18 01:01:59Z leif $ -AC_BEFORE([$0], [AC_PROG_CXX]) -AC_ARG_VAR(MPICXX, [MPI C++ compiler command]) -AC_SUBST([MPICXX]) -test -z "$want_mpi" && want_mpi=yes -# The 'cit_compiler_search_list' is the result of merging the -# following: -# * MPI C++ wrappers -# * the Autoconf default (g++ c++ gpp aCC CC cxx cc++ cl -# FCC KCC RCC xlC_r xlC) -# * the range of values for config's COMPILER_CXX_NAME (aCC CC cl -# cxx ecpc g++ icpc KCC pgCC xlC xlc++_r xlC_r) -# Newer names are tried first (e.g., icpc before ecpc). -cit_compiler_search_list="g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlc++_r xlC_r xlC" -cit_compiler_search_list="$cit_compiler_search_list icpc ecpc pgCC" -cit_mpicxx_search_list="mpicxx mpic++ mpiCC hcp mpCC mpxlC mpxlC_r cmpic++" -# There are two C++ command variables, so there are four cases to -# consider: -# -# ./configure CXX=g++ MPICXX=mpicxx # save MPICXX as cit_MPICXX; MPICXX=$CXX -# ./configure CXX=g++ # MPICXX=$CXX, guess cit_MPICXX -# ./configure MPICXX=mpicxx # derive CXX -# ./configure # guess MPICXX and derive CXX -# -# In the cases where CXX is explicitly specified, the MPI C++ wrapper -# (cit_MPICXX, if known) is only used to gather compile/link flags (if -# needed). -if test "$want_mpi" = yes; then - if test -n "$CXX"; then - cit_MPICXX_underlying_CXX=$CXX - if test -n "$MPICXX"; then - # CXX=g++ MPICXX=mpicxx - cit_MPICXX=$MPICXX - MPICXX=$CXX - else - # CXX=g++ MPICXX=??? - AC_CHECK_PROGS(cit_MPICXX, $cit_mpicxx_search_list) - fi - else - if test -n "$MPICXX"; then - # CXX=??? MPICXX=mpicxx - cit_MPICXX=$MPICXX - CXX=$MPICXX # will be reevaluated below - else - # CXX=??? MPICXX=??? - cit_compiler_search_list="$cit_mpicxx_search_list $cit_compiler_search_list" - fi - fi -fi -AC_PROG_CXX($cit_compiler_search_list) -if test "$want_mpi" = yes; then - if test -z "$MPICXX"; then - MPICXX=$CXX - fi - if test -z "$cit_MPICXX"; then - case $MPICXX in - *mp* | hcp) - cit_MPICXX=$MPICXX - ;; - esac - fi - # The MPI library is typically static. Linking a shared object - # against static library is non-portable, and needlessly bloats our - # Python extension modules on the platforms where it does work. - # Unless CXX was set explicitly, attempt to set CXX to the underlying - # compiler command, so that we may link with the matching C++ - # compiler, but omit -lmpi/-lmpich from the link line. - if test -z "$cit_MPICXX_underlying_CXX"; then - if test -n "$cit_MPICXX"; then - AC_MSG_CHECKING([for the C++ compiler underlying $cit_MPICXX]) - CXX= - AC_LANG_PUSH(C++) - for cit_arg_show in CIT_MPI_COMPILE_INFO_SWITCHES - do - cit_cmd="$cit_MPICXX -c $cit_arg_show" - if $cit_cmd >/dev/null 2>&1; then - CXX=`$cit_cmd 2>/dev/null | sed 's/ .*//'` - if test -n "$CXX"; then - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [break 2], [CXX=]) - fi - fi - done - AC_LANG_POP(C++) - if test -n "$CXX"; then - AC_MSG_RESULT($CXX) - else - AC_MSG_RESULT(failed) - AC_MSG_FAILURE([can not determine the C++ compiler underlying $cit_MPICXX]) - fi - fi - cit_MPICXX_underlying_CXX=$CXX - fi -fi -])dnl CIT_PROG_MPICXX -dnl end of file - - -# CIT_CHECK_LIB_MPI -# ----------------- -AC_DEFUN([CIT_CHECK_LIB_MPI], [ -# $Id: cit_mpi.m4 7980 2007-09-18 01:01:59Z leif $ -AC_REQUIRE([_CIT_PROG_MPICC])dnl -AC_ARG_VAR(MPILIBS, [MPI linker flags, e.g. -L -lmpi]) -AC_SUBST(MPILIBS) -cit_mpi_save_CC=$CC -cit_mpi_save_CXX=$CXX -cit_mpi_save_LIBS=$LIBS -CC=$MPICC -CXX=$MPICXX -LIBS="$MPILIBS $LIBS" -# If MPILIBS is set, check to see if it works. -# If MPILIBS is not set, check to see if it is needed. -AC_CHECK_FUNC(MPI_Init, [], [ - if test -n "$MPILIBS"; then - AC_MSG_ERROR([function MPI_Init not found; check MPILIBS]) - fi - # MPILIBS is needed but was not set. - AC_LANG_CASE( - [C], [ - cit_mpicmd=$cit_MPICC - ], - [C++], [ - cit_mpicmd=$cit_MPICXX - test -z "$cit_mpicmd" && cit_mpicmd=$cit_MPICC - ] - ) - if test -n "$cit_mpicmd"; then - # Try to guess the correct value for MPILIBS using an MPI wrapper. - CIT_MPI_LIBS(cit_libs, $cit_mpicmd, [ - LIBS="$cit_libs $cit_mpi_save_LIBS" - unset ac_cv_func_MPI_Init - AC_CHECK_FUNC(MPI_Init, [ - MPILIBS=$cit_libs - export MPILIBS - ], [ - _CIT_CHECK_LIB_MPI_FAILED - ]) - ], [ - _CIT_CHECK_LIB_MPI_FAILED - ]) - else - # Desperate, last-ditch effort. - cit_libs= - for cit_lib in mpi mpich; do - AC_CHECK_LIB($cit_lib, MPI_Init, [ - cit_libs="-l$cit_lib" - MPILIBS=$cit_libs - export MPILIBS - break]) - done - if test -z "$cit_libs"; then - _CIT_CHECK_LIB_MPI_FAILED - fi - fi -]) -LIBS=$cit_mpi_save_LIBS -CXX=$cit_mpi_save_CXX -CC=$cit_mpi_save_CC -])dnl CIT_CHECK_LIB_MPI - - -# _CIT_CHECK_LIB_MPI_FAILED -# ------------------------- -AC_DEFUN([_CIT_CHECK_LIB_MPI_FAILED], [ -AC_MSG_ERROR([no MPI library found - - Set the MPICC, MPICXX, MPIINCLUDES, and MPILIBS environment variables - to specify how to build MPI programs. -]) -])dnl _CIT_CHECK_LIB_MPI_FAILED - - -# CIT_HEADER_MPI -# -------------- -AC_DEFUN([CIT_HEADER_MPI], [ -# $Id: cit_mpi.m4 7980 2007-09-18 01:01:59Z leif $ -AC_LANG_CASE( - [C], [ - AC_CHECK_HEADER([mpi.h], [], [AC_MSG_ERROR([header 'mpi.h' not found])]) - ], - [C++], [ - CIT_MPI_CHECK_CXX_LINK(cit_MPI_CPPFLAGS, [], - _CIT_TRIVIAL_MPI_PROGRAM, - [whether we can link a trivial C++ MPI program], - [], - AC_MSG_FAILURE([cannot link a trivial C++ MPI program using $CXX])) - CPPFLAGS="$cit_MPI_CPPFLAGS $CPPFLAGS" -]) -])dnl CIT_HEADER_MPI - - -# CIT_MPI_CHECK_CXX_LINK(INCLUDES, LIBS, PROGRAM, -# MSG, IF-WORKS, IF-NOT) -# ----------------------------------------------- -AC_DEFUN([CIT_MPI_CHECK_CXX_LINK], [ -# $Id: cit_mpi.m4 7980 2007-09-18 01:01:59Z leif $ -AC_LANG_ASSERT(C++) -AC_MSG_CHECKING($4) -CIT_MPI_CXX_LINK_IFELSE(cit_arg, $$1, $2, $3, -[ - if test -z "$cit_arg"; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT([yes, with $cit_arg]) - fi - $1="$cit_arg [$]$1" - $5 -], [ - AC_MSG_RESULT(no) - $6 -]) -]) - - -# CIT_MPI_CXX_LINK_IFELSE(DEFINES, -# INCLUDES, LIBS, PROGRAM, -# IF-WORKS, IF-NOT) -# ------------------------------------------------ -# Verify that the MPI library is link-compatible with CXX (which could -# be different than the C++ compiler used to build the MPI library) by -# attempting to compile and link PROGRAM. If there is a problem, -# attempt to work-around it by preventing MPI's C++ bindings from -# being #included. If successful, set DEFINES to the preprocessor -# flags (if any) needed to successfully compile and link PROGRAM and -# evaluate IF-WORKS; otherwise, evaluate IF-NOT. -AC_DEFUN([CIT_MPI_CXX_LINK_IFELSE], [ -# $Id: cit_mpi.m4 7980 2007-09-18 01:01:59Z leif $ -AC_LANG_ASSERT(C++) -$1= -cit_mpi_cxx_link_save_LIBS=$LIBS -cit_mpi_cxx_link_save_CPPFLAGS=$CPPFLAGS -LIBS="$3 $LIBS" -CPPFLAGS="$2 $cit_mpi_cxx_link_save_CPPFLAGS" -AC_LINK_IFELSE([$4], [$5], [ - for cit_skip_mpicxx_define in CIT_SKIP_MPICXX_DEFINES - do - CPPFLAGS="$cit_skip_mpicxx_define $2 $cit_mpi_cxx_link_save_CPPFLAGS" - AC_LINK_IFELSE([$4], [ - $1=$cit_skip_mpicxx_define - $5 - break - ], [ - $6 - ]) - done -]) -CPPFLAGS=$cit_mpi_cxx_link_save_CPPFLAGS -LIBS=$cit_mpi_cxx_link_save_LIBS -])dnl CIT_MPI_CXX_LINK_IFELSE - - -# _CIT_TRIVIAL_MPI_PROGRAM -# ------------------------ -AC_DEFUN([_CIT_TRIVIAL_MPI_PROGRAM], [ -AC_LANG_PROGRAM([[ -#include -#include -]], [[ - MPI_Init(0,0); - MPI_Finalize(); -]]) -])dnl _CIT_TRIVIAL_MPI_PROGRAM - - -# CIT_MPI_LIBS(LIBS, COMMAND, -# ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# ------------------------------------------------------- -# Guess the libraries used by the MPI wrapper. -AC_DEFUN([CIT_MPI_LIBS], [ -# $Id: cit_mpi.m4 7980 2007-09-18 01:01:59Z leif $ -AC_MSG_CHECKING([for the libraries used by $2]) -$1= -for cit_arg_show in CIT_MPI_LINK_INFO_SWITCHES -do - cit_cmd="$2 $cit_arg_show" - if $cit_cmd >/dev/null 2>&1; then - cit_args=`$cit_cmd 2>/dev/null` - test -z "$cit_args" && continue - for cit_arg in $cit_args - do - case $cit_arg in - -L* | -l* | -pthread* [)] $1="[$]$1 $cit_arg" ;; - esac - done - test -z "[$]$1" && continue - break - fi -done -if test -n "[$]$1"; then - AC_MSG_RESULT([[$]$1]) - $3 -else - AC_MSG_RESULT(failed) - $4 -fi -])dnl CIT_MPI_LIBS - - -# CIT_MPI_INCLUDES(INCLUDES, COMMAND, -# ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -# ---------------------------------------------------------- -# Guess the includes used by the MPI wrapper. -AC_DEFUN([CIT_MPI_INCLUDES], [ -# $Id: cit_mpi.m4 7980 2007-09-18 01:01:59Z leif $ -AC_MSG_CHECKING([for the includes used by $2]) -$1= -for cit_arg_show in CIT_MPI_COMPILE_INFO_SWITCHES -do - cit_cmd="$2 -c $cit_arg_show" - if $cit_cmd >/dev/null 2>&1; then - cit_args=`$cit_cmd 2>/dev/null` - test -z "$cit_args" && continue - for cit_arg in $cit_args - do - case $cit_arg in - -I* [)] $1="[$]$1 $cit_arg" ;; - esac - done - test -z "[$]$1" && continue - break - fi -done -if test -n "[$]$1"; then - AC_MSG_RESULT([[$]$1]) - $3 -else - AC_MSG_RESULT(failed) - $4 -fi -])dnl CIT_MPI_INCLUDES - - -# CIT_MPI_COMPILE_INFO_SWITCHES -# CIT_MPI_LINK_INFO_SWITCHES -# ----------------------------- -# The variety of flags used by MPICH, LAM/MPI, Open MPI, and ChaMPIon/Pro. -# NYI: mpxlc/mpcc (xlc?), mpcc_r (xlc_r?) -AC_DEFUN([CIT_MPI_COMPILE_INFO_SWITCHES], ["-show" "-showme" "-echo" "-compile_info"]) -AC_DEFUN([CIT_MPI_LINK_INFO_SWITCHES], ["-show" "-showme" "-echo" "-link_info"]) - - -# CIT_SKIP_MPICXX_DEFINES -# ----------------------- -# Switches to disable inclusion of C++ MPI bindings. -AC_DEFUN([CIT_SKIP_MPICXX_DEFINES], ["-DMPICH_SKIP_MPICXX" "-UHAVE_MPI_CPP" "-DLAM_WANT_MPI2CPP=0" "-DLAM_BUILDING=1" "-DOMPI_WANT_CXX_BINDINGS=0" "-DOMPI_BUILDING=1"]) - - -dnl end of file diff --git a/m4/cit_numpy.m4 b/m4/cit_numpy.m4 deleted file mode 100644 index f65222567..000000000 --- a/m4/cit_numpy.m4 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- Autoconf -*- - - -## --------------------------- ## -## Autoconf macros for Numpy. ## -## --------------------------- ## - -# CIT_NUMPY_PYTHON_MODULE -# Determine whether the numpy Python module is available. -AC_DEFUN([CIT_NUMPY_PYTHON_MODULE], [ -AC_REQUIRE([AM_PATH_PYTHON]) -AC_MSG_CHECKING(for numpy python module) -$PYTHON -c "import numpy" 2>/dev/null -if test $? == 0; then - AC_MSG_RESULT(found) -else - AC_MSG_FAILURE(not found) -fi -]) dnl CIT_NUMPY_PYTHON_MODULE - -# NUMPY_INCDIR -# ----------------- -# Determine the directory containing -AC_DEFUN([CIT_NUMPY_INCDIR], [ -AC_REQUIRE([AM_PATH_PYTHON]) -AC_CACHE_CHECK([for numpy include directory], - [_cv_numpy_incdir], - [_cv_numpy_incdir=`$PYTHON -c "import numpy; numpypath=numpy.__path__[[0]]; print '%s/core/include' % numpypath"`]) -AC_SUBST([NUMPY_INCDIR], [$_cv_numpy_incdir]) -])dnl CIT_NUMPY_INCDIR - - -dnl end of file diff --git a/m4/cit_petsc.m4 b/m4/cit_petsc.m4 deleted file mode 100644 index 9f8a22dd5..000000000 --- a/m4/cit_petsc.m4 +++ /dev/null @@ -1,383 +0,0 @@ -# -*- Autoconf -*- - - -## -------------------------- ## -## Autoconf macros for PETSc. ## -## -------------------------- ## - - -# CIT_PATH_PETSC([VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ----------------------------------------------------------------------- -# Check for the PETSc package. Requires Python. -AC_DEFUN([CIT_PATH_PETSC], [ -# $Id: cit_petsc.m4 17942 2011-02-22 20:47:56Z brad $ - -AC_REQUIRE([AM_PATH_PYTHON]) -AC_ARG_VAR(PETSC_DIR, [location of PETSc installation]) -AC_ARG_VAR(PETSC_ARCH, [PETSc configuration]) - -AC_MSG_CHECKING([for PETSc dir]) -if test -z "$PETSC_DIR"; then - AC_MSG_RESULT(no) - m4_default([$3], [AC_MSG_ERROR([PETSc not found; set PETSC_DIR])]) -elif test ! -d "$PETSC_DIR"; then - AC_MSG_RESULT(no) - m4_default([$3], [AC_MSG_ERROR([PETSc not found; PETSC_DIR=$PETSC_DIR is invalid])]) -elif test ! -d "$PETSC_DIR/include"; then - AC_MSG_RESULT(broken) - m4_default([$3], [AC_MSG_ERROR([PETSc include dir $PETSC_DIR/include not found; check PETSC_DIR])]) -elif test ! -f "$PETSC_DIR/include/petscversion.h"; then - AC_MSG_RESULT(broken) - m4_default([$3], [AC_MSG_ERROR([PETSc header file $PETSC_DIR/include/petscversion.h not found; check PETSC_DIR])]) -fi -AC_MSG_RESULT([$PETSC_DIR]) - -# In what follows, we consistenly check for the new config layout -# first, in case the user is using an old HG working copy with junk in -# it. - -AC_MSG_CHECKING([for PETSc arch]) -if test -z "$PETSC_ARCH"; then - if test -d "$PETSC_DIR/conf"; then - # new config layout; no default config (?) - AC_MSG_RESULT(no) - m4_default([$3], [AC_MSG_ERROR([set PETSC_ARCH])]) - elif test ! -f "$PETSC_DIR/bmake/petscconf"; then - # old config layout (2.3.3 and earlier) - AC_MSG_RESULT(error) - m4_default([$3], [AC_MSG_ERROR([PETSc file $PETSC_DIR/bmake/petscconf not found; check PETSC_DIR])]) - else - cat >petsc.py </dev/null` - rm -f petsc.py - fi -fi -AC_MSG_RESULT([$PETSC_ARCH]) - -AC_MSG_CHECKING([for PETSc config]) -if test -d "$PETSC_DIR/$PETSC_ARCH/conf"; then - if test -f "$PETSC_DIR/$PETSC_ARCH/conf/petscvariables"; then - cit_petsc_petscconf="$PETSC_DIR/$PETSC_ARCH/conf/petscvariables" - elif test -f "$PETSC_DIR/$PETSC_ARCH/conf/petscconf"; then - cit_petsc_petscconf="$PETSC_DIR/$PETSC_ARCH/conf/petscconf" - else - AC_MSG_RESULT(no) - m4_default([$3], [AC_MSG_ERROR([Could not find file with PETSc configuration settings; check PETSC_ARCH/conf])]) - fi - # Using conf/variables *should* be obsolete for new config. - #cit_petsc_variables="$PETSC_DIR/conf/variables" -elif test -d "$PESC_DIR/bmake/$PETSC_ARCH"; then - # old config layout - cit_petsc_petscconf="$PETSC_DIR/bmake/$PETSC_ARCH/petscconf" - cit_petsc_variables="$PETSC_DIR/bmake/common/variables" - if test ! -f "$cit_petsc_variables"; then - AC_MSG_RESULT(error) - m4_default([$3], [AC_MSG_ERROR([PETSc config file $cit_petsc_variables not found; check PETSC_DIR])]) - fi -else - AC_MSG_RESULT(no) - m4_default([$3], [AC_MSG_ERROR([PETSc config dir not found; check PETSC_ARCH])]) -fi -if test ! -f "$cit_petsc_petscconf"; then - AC_MSG_RESULT(no) - m4_default([$3], [AC_MSG_ERROR([PETSc config file $cit_petsc_petscconf not found; check PETSC_ARCH])]) -fi -AC_MSG_RESULT([$cit_petsc_petscconf]) - -AC_MSG_CHECKING([for PETSc version == $1]) -echo "PETSC_DIR = $PETSC_DIR" > petscconf -echo "PETSC_ARCH = $PETSC_ARCH" >> petscconf -cat $cit_petsc_petscconf $cit_petsc_variables >> petscconf -cat >petsc.py <conftest.sh 2>&AS_MESSAGE_LOG_FD])], - [], - [AC_MSG_RESULT(error) - AC_MSG_FAILURE([cannot parse PETSc configuration])]) -eval `cat conftest.sh` -rm -f conftest.sh petsc.py petscconf - -[eval `echo $1 | sed 's/\([^.]*\)[.]\([^.]*\)[.]\([^.]*\).*/petsc_1_major=\1; petsc_1_minor=\2; petsc_1_subminor=\3;/'`] -if test -z "$PETSC_VERSION_MAJOR" -o -z "$PETSC_VERSION_MINOR" -o -z "$PETSC_VERSION_SUBMINOR"; then - AC_MSG_RESULT(no) - m4_default([$3], [AC_MSG_ERROR([no suitable PETSc package found])]) -elif test "$PETSC_VERSION_MAJOR" -eq "$petsc_1_major" -a \ - "$PETSC_VERSION_MINOR" -eq "$petsc_1_minor" -a \ - "$PETSC_VERSION_SUBMINOR" -eq "$petsc_1_subminor" ; then - AC_MSG_RESULT(yes) - $2 -else - AC_MSG_RESULT([no ($PETSC_VERSION_MAJOR.$PETSC_VERSION_MINOR.$PETSC_VERSION_SUBMINOR)]) - m4_default([$3], [AC_MSG_ERROR([no suitable PETSc package found])]) -fi - -AC_SUBST([PETSC_VERSION_MAJOR]) -AC_SUBST([PETSC_VERSION_MINOR]) -AC_SUBST([PETSC_VERSION_SUBMINOR]) -AC_SUBST([PETSC_CC_INCLUDES]) -AC_SUBST([PETSC_FC_INCLUDES]) -AC_SUBST([PETSC_LIB]) -AC_SUBST([PETSC_FORTRAN_LIB]) -AC_SUBST([PETSC_CC]) -AC_SUBST([PETSC_CXX]) -AC_SUBST([PETSC_FC]) -AC_SUBST([PETSC_MPI_LIB]) -AC_SUBST([PETSC_MPI_INCLUDE]) -AC_SUBST([PETSC_SIEVE_FLAGS]) -])dnl CIT_PATH_PETSC - - -# CIT_CHECK_LIB_PETSC -# ------------------- -# Try to link against the PETSc libraries. If the current language is -# C++, determine the value of PETSC_CXX_LIB, which names the extra -# libraries needed when using a C++ compiler. (As of PETSc v2.3, -# PETSC_CXX_LIB will always be empty; see comment below.) -AC_DEFUN([CIT_CHECK_LIB_PETSC], [ -# $Id: cit_petsc.m4 17942 2011-02-22 20:47:56Z brad $ -AC_REQUIRE([CIT_PATH_PETSC])dnl -AC_SUBST(PETSC_CXX_LIB) -PETSC_CXX_LIB= -cit_petsc_save_CC=$CC -cit_petsc_save_LIBS=$LIBS -CC=$PETSC_CC -LIBS="$PETSC_LIB $LIBS" -_CIT_LINK_PETSC_IFELSE([], [ - AC_LANG_CASE( - [C++], [], - _CIT_CHECK_LIB_PETSC_FAILED - ) - # - # Try to guess the correct value for PETSC_CXX_LIB, assuming PETSC_CC - # is an MPI wrapper. - # - # In theory, when PETSC_CC is 'mpicc', *both* the MPI libraries and - # includes are effectively hidden, and must be extracted in order to - # use a C++ compiler (the PETSc configuration does not specify a C++ - # compiler command). - # - # But this path was only added for symmetry with CIT_HEADER_PETSC. - # Because, in practice, there is an asymmetry between includes and - # libs. When PETSC_CC is 'mpicc', the MPI includes are indeed hidden: - # PETSC_INCLUDE omits MPI includes. But PETSC_LIB always explicitly - # specifies the MPI library, even (redundantly) when PETSC_CC is - # 'mpicc'. So, as of PETSc v2.3 at least, this path is never taken. - CIT_MPI_LIBS(cit_libs, $PETSC_CC, [ - LIBS="$PETSC_LIB $cit_libs $cit_petsc_save_LIBS" - unset ac_cv_func_PetscInitialize - _CIT_LINK_PETSC_IFELSE([ - PETSC_CXX_LIB=$cit_libs - ], [ - _CIT_CHECK_LIB_PETSC_FAILED - ]) - ], [ - _CIT_CHECK_LIB_PETSC_FAILED - ]) -]) -LIBS=$cit_petsc_save_LIBS -CC=$cit_petsc_save_CC -])dnl CIT_CHECK_LIB_PETSC - - -# _CIT_CHECK_LIB_PETSC_FAILED -# --------------------------- -AC_DEFUN([_CIT_CHECK_LIB_PETSC_FAILED], [ -AC_MSG_ERROR([cannot link against PETSc libraries]) -])dnl _CIT_CHECK_LIB_PETSC_FAILED - - -# _CIT_LINK_PETSC_IFELSE([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ---------------------------------------------------------------- -AC_DEFUN([_CIT_LINK_PETSC_IFELSE], [ -# PetscInitialize() might have C++ linkage. If the current language -# is C++, allow for this possibility. -AC_LANG_CASE( - [C++], [ - AC_MSG_CHECKING([for PetscInitialize]) - AC_LINK_IFELSE(_CIT_CHECK_LIB_PETSC_PROGRAM([]), [ - AC_MSG_RESULT([yes (C++)]) - $1 - ], [ - AC_LINK_IFELSE(_CIT_CHECK_LIB_PETSC_PROGRAM([extern "C"]), [ - AC_MSG_RESULT([yes (C)]) - $1 - ], [ - AC_MSG_RESULT(no) - $2 - ]) - ]) - ], - [AC_CHECK_FUNC(PetscInitialize, [$1], [$2])] -) -])dnl _CIT_LINK_PETSC_IFELSE - - -# _CIT_CHECK_LIB_PETSC_PROGRAM -# ---------------------------- -AC_DEFUN([_CIT_CHECK_LIB_PETSC_PROGRAM], [ -AC_LANG_PROGRAM([[ -$1 int PetscInitialize(int *, char ***,const char *,const char *); -]], [[ - PetscInitialize(0, 0, 0, "checklib"); -]]) -])dnl _CIT_CHECK_LIB_PETSC_PROGRAM - - -# CIT_HEADER_PETSC -# ---------------- -# Try to use PETSc headers. If the current language is C++, determine -# the value of PETSC_CXX_INCLUDE, which names the extra include paths -# needed when using a C++ compiler... i.e., the MPI includes. When -# PETSC_CC is set to an MPI wrapper such as 'mpicc', the required MPI -# includes are effectively hidden, and must be extracted in order to -# use a C++ compiler (the PETSc configuration does not specify a C++ -# compiler command). -AC_DEFUN([CIT_HEADER_PETSC], [ -# $Id: cit_petsc.m4 17942 2011-02-22 20:47:56Z brad $ -AC_REQUIRE([CIT_PATH_PETSC])dnl -AC_REQUIRE([CIT_CHECK_LIB_PETSC])dnl -AC_SUBST(PETSC_CXX_INCLUDE) -PETSC_CXX_INCLUDE= -cit_petsc_save_CC=$CC -cit_petsc_save_CPPFLAGS=$CPPFLAGS -cit_petsc_save_LIBS=$LIBS -CC=$PETSC_CC -CPPFLAGS="$PETSC_CC_INCLUDES $CPPFLAGS" -AC_MSG_CHECKING([for petsc.h]) -dnl Use AC_TRY_COMPILE instead of AC_CHECK_HEADER because the -dnl latter also preprocesses using $CXXCPP. -AC_TRY_COMPILE([ -#include -], [], [ - AC_MSG_RESULT(yes) -], [ - AC_MSG_RESULT(no) - AC_LANG_CASE( - [C++], [], - _CIT_HEADER_PETSC_FAILED - ) - # Try to guess the correct value for PETSC_CXX_INCLUDE, assuming - # PETSC_CC is an MPI wrapper. - CIT_MPI_INCLUDES(cit_includes, $PETSC_CC, [ - AC_MSG_CHECKING([for petsc.h]) - CPPFLAGS="$PETSC_CC_INCLUDES $cit_includes $cit_petsc_save_CPPFLAGS" - AC_TRY_COMPILE([ -#include - ], [], [ - AC_MSG_RESULT(yes) - PETSC_CXX_INCLUDE=$cit_includes - ], [ - AC_MSG_RESULT(no) - _CIT_HEADER_PETSC_FAILED - ]) - ], [ - _CIT_HEADER_PETSC_FAILED - ]) -]) -AC_LANG_CASE([C++], [ - LIBS="$PETSC_LIB $PETSC_CXX_LIB $LIBS" - CIT_MPI_CHECK_CXX_LINK(PETSC_CXX_INCLUDE, [$PETSC_LIB], - _CIT_TRIVIAL_PETSC_PROGRAM, - [whether we can link a trivial C++ PETSc program], - [], - AC_MSG_FAILURE([cannot link a trivial C++ PETSc program using $CXX])) -]) -LIBS=$cit_petsc_save_LIBS -CPPFLAGS=$cit_petsc_save_CPPFLAGS -CC=$cit_petsc_save_CC -])dnl CIT_HEADER_PETSC - - -# _CIT_HEADER_PETSC_FAILED -# ------------------------ -AC_DEFUN([_CIT_HEADER_PETSC_FAILED], [ -AC_MSG_ERROR([header "petsc.h" not found]) -])dnl _CIT_HEADER_PETSC_FAILED - - -# _CIT_TRIVIAL_PETSC_PROGRAM -# -------------------------- -AC_DEFUN([_CIT_TRIVIAL_PETSC_PROGRAM], [ -AC_LANG_PROGRAM([[ -#include -]], [[ - PetscInitialize(0, 0, 0, "trivial"); - PetscFinalize(); -]]) -])dnl _CIT_TRIVIAL_PETSC_PROGRAM - - -# CIT_CHECK_LIB_PETSC_SIEVE -# ------------------------- -AC_DEFUN([CIT_CHECK_LIB_PETSC_SIEVE], [ -AC_MSG_CHECKING([for PETSc/Sieve]) -AC_LANG_PUSH(C++) -cit_petsc_save_LIBS=$LIBS -cit_petsc_save_CPPFLAGS=$CPPFLAGS -LIBS="$PETSC_LIB $PETSC_CXX_LIB $LIBS" -CPPFLAGS="$PETSC_CC_INCLUDES $PETSC_CXX_INCLUDE $CPPFLAGS" -AC_LINK_IFELSE(AC_LANG_PROGRAM([[ -#include -]], [[ - const int dim = 3; - ALE::Mesh mesh(PETSC_COMM_WORLD, dim); -]]), [ - AC_MSG_RESULT(yes) -], [ - AC_MSG_RESULT(no) - AC_MSG_FAILURE([cannot build a trivial C++ PETSc program which uses ALE::Sieve]) -]) -CPPFLAGS=$cit_petsc_save_CPPFLAGS -LIBS=$cit_petsc_save_LIBS -AC_LANG_POP(C++) -])dnl CIT_CHECK_LIB_PETSC_SIEVE - - -dnl end of file diff --git a/m4/cit_python.m4 b/m4/cit_python.m4 deleted file mode 100644 index 009f68ed9..000000000 --- a/m4/cit_python.m4 +++ /dev/null @@ -1,465 +0,0 @@ -# -*- Autoconf -*- - - -## --------------------------- ## -## Autoconf macros for Python. ## -## --------------------------- ## - - -# CIT_PYTHON_INCDIR -# ----------------- -# Determine the directory containing using distutils. -AC_DEFUN([CIT_PYTHON_INCDIR], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ -AC_REQUIRE([AM_PATH_PYTHON]) -AC_CACHE_CHECK([for $am_display_PYTHON include directory], - [PYTHON_INCDIR], - [PYTHON_INCDIR=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()" 2>/dev/null || - echo "$PYTHON_PREFIX/include/python$PYTHON_VERSION"`]) -AC_SUBST([PYTHON_INCDIR], [$PYTHON_INCDIR]) -])dnl CIT_PYTHON_INCDIR - - -# CIT_CHECK_PYTHON_HEADER -# ----------------------- -# Checking the existence of Python.h -AC_DEFUN([CIT_CHECK_PYTHON_HEADER], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ -AC_REQUIRE([CIT_PYTHON_INCDIR]) -cit_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="-I$PYTHON_INCDIR $cit_save_CPPFLAGS" -AC_CHECK_HEADER([Python.h], [], [ - AC_MSG_ERROR([Header file 'Python.h' not found; maybe you don't have the python development package, e.g. 'python-dev', installed?]) - ]) -CPPFLAGS=$cit_save_CPPFLAGS -])dnl CIT_CHECK_PYTHON_HEADER - - -# CIT_CHECK_PYTHON_SHARED -# ----------------------- -# Check whether -lpythonX.X is a shared library. -AC_DEFUN([CIT_CHECK_PYTHON_SHARED], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ -AC_REQUIRE([CIT_PYTHON_CONFIG]) -AC_MSG_CHECKING([whether -lpython$PYTHON_VERSION is a shared library]) -cit_save_CPPFLAGS=$CPPFLAGS -cit_save_LDFLAGS=$LDFLAGS -cit_save_LIBS=$LIBS -CPPFLAGS="$PYTHON_CPPFLAGS $cit_save_CPPFLAGS" -LDFLAGS="$PYTHON_LDFLAGS $cit_save_LDFLAGS" -LIBS="$PYTHON_LIBS $cit_save_LIBS" -AC_RUN_IFELSE([AC_LANG_PROGRAM([[ -#include "Python.h" -]], [[ - int status; - Py_Initialize(); - status = PyRun_SimpleString("import binascii") != 0; - Py_Finalize(); - return status; -]])], [ - AC_MSG_RESULT(yes) -], [ - AC_MSG_RESULT(no) - AC_MSG_ERROR([-lpython$PYTHON_VERSION is not a shared library]) -]) -CPPFLAGS=$cit_save_CPPFLAGS -LDFLAGS=$cit_save_LDFLAGS -LIBS=$cit_save_LIBS -])dnl CIT_CHECK_PYTHON_SHARED - - -# CIT_PYTHON_CONFIG -# ----------------- -AC_DEFUN([CIT_PYTHON_CONFIG], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ -AC_REQUIRE([AM_PATH_PYTHON]) -AC_MSG_CHECKING([$am_display_PYTHON config]) -cat >python-config.py </dev/null` -if test -n "$PYTHON_CPPFLAGS"; then - AC_MSG_RESULT(ok) -else - AC_MSG_ERROR(["failed - -Run '$PYTHON python-config.py' to see what went wrong. -"]) -fi -rm -f python-config.py -AC_SUBST([PYTHON_CPPFLAGS], [$PYTHON_CPPFLAGS]) -AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS]) -AC_SUBST([PYTHON_LIBS], [$PYTHON_LIBS]) -])dnl CIT_PYTHON_CONFIG - - -# CIT_PYTHON_SYSCONFIG -# -------------------- -AC_DEFUN([CIT_PYTHON_SYSCONFIG], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ -AC_REQUIRE([AM_PATH_PYTHON]) -AC_MSG_CHECKING([$am_display_PYTHON sysconfig]) -cat >sysconfig.py </dev/null` -if test -n "$PYTHON_INCDIR"; then - AC_MSG_RESULT(ok) -else - AC_MSG_ERROR(["failed - -Run '$PYTHON sysconfig.py' to see what went wrong. -"]) -fi -rm -f sysconfig.py -AC_SUBST([PYTHON_INCDIR], [$PYTHON_INCDIR]) -AC_SUBST([PYTHON_BLDLIBRARY], [$PYTHON_BLDLIBRARY]) -AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS]) -AC_SUBST([PYTHON_LDLAST], [$PYTHON_LDLAST]) -AC_SUBST([PYTHON_LDLIBRARY], [$PYTHON_LDLIBRARY]) -AC_SUBST([PYTHON_LIBDIR], [$PYTHON_LIBDIR]) -AC_SUBST([PYTHON_LIBP], [$PYTHON_LIBP]) -AC_SUBST([PYTHON_LIBPL], [$PYTHON_LIBPL]) -AC_SUBST([PYTHON_LIBS], [$PYTHON_LIBS]) -AC_SUBST([PYTHON_LINKFORSHARED], [$PYTHON_LINKFORSHARED]) -AC_SUBST([PYTHON_MODLIBS], [$PYTHON_MODLIBS]) -AC_SUBST([PYTHON_SYSLIBS], [$PYTHON_SYSLIBS]) -AC_SUBST([PYTHON_LA_LDFLAGS], [$PYTHON_LA_LDFLAGS]) -])dnl CIT_PYTHON_SYSCONFIG - - -# CIT_PYTHON_SITE -# --------------- -AC_DEFUN([CIT_PYTHON_SITE], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ -AC_REQUIRE([AM_PATH_PYTHON]) -AC_MSG_CHECKING([whether we are installing to Python's prefix]) -cit_python_prefix=`$PYTHON -c "import sys; print sys.prefix"` -if test "$cit_python_prefix" = "$prefix"; then - AC_MSG_RESULT(yes) - cit_cond_python_site=true -else - AC_MSG_RESULT(no) - cit_cond_python_site=false -fi -AC_MSG_CHECKING([whether we are installing to Python's exec prefix]) -cit_python_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` -cit_exec_prefix=$exec_prefix -test "x$cit_exec_prefix" = xNONE && cit_exec_prefix=$prefix -if test "$cit_python_exec_prefix" = "$cit_exec_prefix"; then - AC_MSG_RESULT(yes) - cit_cond_pyexec_site=true -else - AC_MSG_RESULT(no) - cit_cond_pyexec_site=false -fi -AM_CONDITIONAL([COND_PYTHON_SITE], [$cit_cond_python_site]) -AM_CONDITIONAL([COND_PYEXEC_SITE], [$cit_cond_pyexec_site]) -])dnl CIT_PYTHON_SITE - - -# CIT_CHECK_PYTHON_EGG(REQUIREMENT, -# [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]) -# -------------------------------------------------------------- - -# Check for REQUIREMENT using pkg_resources.require(). If the -# corresponding distribution is found, execute ACTION-IF-FOUND. -# Otherwise, execute ACTION-IF-NOT-FOUND. - -AC_DEFUN([CIT_CHECK_PYTHON_EGG], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ - -AC_MSG_CHECKING([for "$1"]) - -cat >check_python_egg.py <>sys.stderr, e - print "cit_egg_status=1" -else: - print "cit_egg_status=0" -] -END_OF_PYTHON - -AS_IF([AC_TRY_COMMAND([$PYTHON check_python_egg.py >conftest.sh 2>&AS_MESSAGE_LOG_FD])], - [], - [AC_MSG_RESULT(failed) - AC_MSG_FAILURE([cannot check for Python eggs])]) -eval `cat conftest.sh` -rm -f conftest.sh check_python_egg.py - -if test "$cit_egg_status" == 0; then - AC_MSG_RESULT(yes) - $2 -else - AC_MSG_RESULT(no) - m4_default([$3], [AC_MSG_ERROR([required Python package not found: $1])]) -fi - -])dnl CIT_CHECK_PYTHON_EGG - - -# CIT_PYTHON_EGG_SETUP -# -------------------- - -AC_DEFUN([CIT_PYTHON_EGG_SETUP], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ -AC_REQUIRE([AM_PATH_PYTHON]) - -cit_builddir=`pwd` -cit_save_PYTHONPATH="$PYTHONPATH" -PYTHONPATH="$cit_builddir/python:$PYTHONPATH"; export PYTHONPATH -cd $srcdir - -AC_MSG_NOTICE([downloading missing Python dependencies]) -AS_IF([AC_TRY_COMMAND([$PYTHON setup.py install_deps -f $cit_builddir/deps -zmxd $cit_builddir/deps >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])], - [], - [AC_MSG_FAILURE([cannot download missing Python dependencies])]) - -AC_MSG_NOTICE([building Python dependencies]) -AS_IF([AC_TRY_COMMAND([$PYTHON setup.py develop -H None -f $cit_builddir/deps -x -d $cit_builddir/python >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])], - [], - [AC_MSG_FAILURE([building Python dependencies])]) - -AC_MSG_CHECKING([for egg-related flags]) -AS_IF([AC_TRY_COMMAND([$PYTHON setup.py egg_flags >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])], - [AC_MSG_RESULT(ok) - . ./egg-flags.sh - rm -f egg-flags.sh - ], - [AC_MSG_RESULT(failed) - AC_MSG_FAILURE([cannot scan Python eggs for flags])]) - -cd $cit_builddir -PYTHONPATH="$cit_save_PYTHONPATH" -PYTHONPATH="${pythondir}:${pyexecdir}${cit_save_PYTHONPATH:+:${cit_save_PYTHONPATH}}" - -AC_SUBST(PYTHONPATH) -AC_SUBST(PYTHON_EGG_CFLAGS) -AC_SUBST(PYTHON_EGG_CPPFLAGS) -AC_SUBST(PYTHON_EGG_LDFLAGS) -AC_SUBST(PYTHON_EGG_LIBS) -AC_SUBST(PYTHON_EGG_PYXFLAGS) - -])dnl CIT_PYTHON_EGG_SETUP - - -# CIT_PROG_PYCONFIG -# ----------------- -# Provide a simple Python script which generates a Python module to -# expose our package configuration, similar to Python's -# distutils.sysconfig. -AC_DEFUN([CIT_PROG_PYCONFIG], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ -PYCONFIG='$(top_builddir)/pyconfig' -AC_SUBST(PYCONFIG) -ofile=pyconfig -cfgfile="${ofile}T" -trap "rm \"$cfgfile\"; exit 1" 1 2 15 -rm -f "$cfgfile" -AC_MSG_NOTICE([creating $ofile]) -cat >"$cfgfile" <>f, "#!/usr/bin/env python" -print >>f -print >>f, "config =", config_vars -print >>f -print >>f, "makefile =", makefile_vars -print >>f -print >>f, "# end of file" -f.close() - -# end of file] -END_OF_PYTHON -mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") -chmod +x "$ofile" -])dnl CIT_PROG_PYCONFIG - - -# CIT_PATH_NEMESIS -# ----------------- -AC_DEFUN([CIT_PATH_NEMESIS], [ -# $Id: cit_python.m4 17971 2011-02-24 17:22:51Z brad $ -AC_BEFORE([$0], [AM_PATH_PYTHON]) -AC_PATH_PROG(PYTHON, nemesis, no) -if test "$PYTHON" = no; then - AC_MSG_ERROR([program 'nemesis' not found]) -fi -])dnl CIT_PATH_NEMESIS - -# CIT_PYTHON_MODULE(name, version) -# ----------------- -# Determine whether module is available. -AC_DEFUN([CIT_PYTHON_MODULE],[ -AC_REQUIRE([AM_PATH_PYTHON]) -AC_MSG_CHECKING(for python module $1) -$PYTHON -c "import $1" 2>/dev/null -if test $? == 0; then - eval s=`$PYTHON -c "import $1; print $1.__""file__"` - AC_MSG_RESULT([found $s]) -else - AC_MSG_FAILURE(not found) -fi -if test -n "$2" ; then - AC_MSG_CHECKING([for $1 version]) - [eval `$PYTHON -c "import $1; print $1.__version__" | sed 's/\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)/avail_major=\1; avail_minor=\2; avail_patch=\3/'`] - [eval `echo $2 | sed 's/\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)\.\([0-9]\{1,\}\)/req_major=\1; req_minor=\2; req_patch=\3/' 2>/dev/null`] - if test -n "$avail_major" -a -n "$avail_minor" -a -n "$avail_patch"; then - if test $avail_major -lt $req_major ; then - AC_MSG_FAILURE([$1 version >= $2 is required. You have $avail_major.$avail_minor.$avail_patch.]) - elif test $avail_major -eq $req_major -a $avail_minor -lt $req_minor; then - AC_MSG_FAILURE([$1 version >= $2 is required. You have $avail_major.$avail_minor.$avail_patch.]) - elif test $avail_major -eq $req_major -a $avail_minor -eq $req_minor -a $avail_patch -lt $req_patch; then - AC_MSG_FAILURE([$1 version >= $2 is required. You have $avail_major.$avail_minor.$avail_patch.]) - else - AC_MSG_RESULT([$avail_major.$avail_minor.$avail_patch]) - fi - else - AC_MSG_FAILURE([Could not determine version of module $1. Version >= $2 is required.]) - fi -fi - -]) dnl CIT_PYTHON_MODULE - - - - -dnl end of file