[5b2946] | 1 | dnl AC_CHECK_CCA()
|
---|
| 2 | dnl detects the cca tools environment
|
---|
| 3 | dnl author: Joseph Kenny, jpkenny@sandia.gov
|
---|
| 4 | dnl
|
---|
| 5 | dnl predefined variables:
|
---|
| 6 | dnl CCAFE_CONFIG full path to ccafe-config (optional)
|
---|
| 7 | dnl ENABLE_PYTHON enable python bindings (yes/no)
|
---|
| 8 | dnl
|
---|
| 9 | dnl output variables:
|
---|
| 10 | dnl CCAFE_CONFIG CCAFE_INCLUDE CCAFE_LIB CCAFE_SHARE CCAFE_BIN
|
---|
| 11 | dnl CCAFE_MPI_ENABLE CCAFE_MPI_INCLUDE CCAFE_MPI_LIB CCAFE_MPI_BIN
|
---|
| 12 | dnl CCA_SPEC_BABEL_CONFIG CCA_SPEC_BABEL_INCLUDE
|
---|
| 13 | dnl CCA_SPEC_BABEL_LIB CCA_SPEC_BABEL_SHARE
|
---|
| 14 | dnl CCA_SPEC_CLASSIC_CONFIG CCA_SPEC_CLASSIC_INCLUDE
|
---|
| 15 | dnl CCA_SPEC_CLASSIC_LIB CCA_SPEC_CLASSIC_SHARE
|
---|
| 16 | dnl BABEL_CONFIG BABEL_INCLUDE BABEL_LIB BABEL_SHARE BABEL_BIN
|
---|
| 17 | dnl BABEL_CC BABEL_CFLAGS BABEL_CXX BABEL_CXXFLAGS
|
---|
| 18 | dnl BABEL_LIBTOOL
|
---|
| 19 | dnl BABEL_PYTHON_ENABLE CCAFE_PYTHON_ENABLE
|
---|
| 20 | dnl BABEL_PYTHON BABEL_PYTHON_VERSION
|
---|
| 21 | dnl BABEL_PYTHON_LIB BABEL_PYTHON_INCLUDE
|
---|
| 22 |
|
---|
| 23 | AC_DEFUN([AC_CHECK_CCA],[
|
---|
| 24 |
|
---|
| 25 | # ccaffeine gives us everything else
|
---|
| 26 | AC_ARG_WITH(ccafe-config,
|
---|
| 27 | [ --with-ccafe-config path to the ccafe-config script.],
|
---|
| 28 | [ CCAFE_CONFIG=$withval ],
|
---|
| 29 | [ if test -z $CCAFE_CONFIG || test ! -x $CCAFE_CONFIG; then
|
---|
| 30 | AC_PATH_PROG(CCAFE_CONFIG,ccafe-config,"not-found")
|
---|
| 31 | fi
|
---|
| 32 | ]
|
---|
| 33 | )
|
---|
| 34 | if ! test -x $CCAFE_CONFIG; then
|
---|
| 35 | AC_MSG_ERROR([ccaffeine not found, use --with-ccafe-config])
|
---|
| 36 | fi
|
---|
| 37 | CCAFE_INCLUDE=`$CCAFE_CONFIG --var CCAFE_pkgincludedir`
|
---|
| 38 | CCAFE_LIB=`$CCAFE_CONFIG --var CCAFE_pkglibdir`
|
---|
| 39 | CCAFE_SHARE=`$CCAFE_CONFIG --var CCAFE_pkgdatadir`
|
---|
| 40 | CCAFE_BIN=`$CCAFE_CONFIG --var CCAFE_bindir`
|
---|
| 41 | AC_SUBST(CCAFE_CONFIG)
|
---|
| 42 | AC_SUBST(CCAFE_INCLUDE)
|
---|
| 43 | AC_SUBST(CCAFE_LIB)
|
---|
| 44 | AC_SUBST(CCAFE_SHARE)
|
---|
| 45 | AC_SUBST(CCAFE_BIN)
|
---|
| 46 |
|
---|
| 47 | # check for cca-spec-babel
|
---|
| 48 | CCA_SPEC_BABEL_CONFIG=`$CCAFE_CONFIG --var CCAFE_CCA_SPEC_BABEL_CONFIG`
|
---|
| 49 | if test -z $CCA_SPEC_BABEL_CONFIG || ! test -x $CCA_SPEC_BABEL_CONFIG; then
|
---|
| 50 | AC_MSG_ERROR([can't find cca-spec-babel-config])
|
---|
| 51 | fi
|
---|
| 52 | CCA_SPEC_BABEL_INCLUDE=`$CCA_SPEC_BABEL_CONFIG --var CCASPEC_pkgincludedir`
|
---|
| 53 | CCA_SPEC_BABEL_LIB=`$CCA_SPEC_BABEL_CONFIG --var CCASPEC_pkglibdir`
|
---|
| 54 | CCA_SPEC_BABEL_SHARE=`$CCA_SPEC_BABEL_CONFIG --var CCASPEC_pkgdatadir`
|
---|
| 55 | AC_SUBST(CCA_SPEC_BABEL_CONFIG)
|
---|
| 56 | AC_SUBST(CCA_SPEC_BABEL_INCLUDE)
|
---|
| 57 | AC_SUBST(CCA_SPEC_BABEL_LIB)
|
---|
| 58 | AC_SUBST(CCA_SPEC_BABEL_SHARE)
|
---|
| 59 |
|
---|
| 60 | # check for cca-spec-classic
|
---|
| 61 | CCA_SPEC_CLASSIC_ROOT=`$CCAFE_CONFIG --var CCAFE_CLASSIC_CCA_ROOT`
|
---|
| 62 | CCA_SPEC_CLASSIC_CONFIG="$CCA_SPEC_CLASSIC_ROOT/bin/cca-spec-classic-config"
|
---|
| 63 | if test -z $CCA_SPEC_CLASSIC_CONFIG || test ! -e $CCA_SPEC_CLASSIC_CONFIG; then
|
---|
| 64 | AC_MSG_ERROR([can't find cca-spec-classic-config])
|
---|
| 65 | fi
|
---|
| 66 | CCA_SPEC_CLASSIC_INCLUDE=`$CCA_SPEC_CLASSIC_CONFIG --var CLASSIC_pkgincludedir`
|
---|
| 67 | CCA_SPEC_CLASSIC_LIB=`$CCA_SPEC_CLASSIC_CONFIG --var CLASSIC_pkglibdir`
|
---|
| 68 | CCA_SPEC_CLASSIC_SHARE=`$CCA_SPEC_CLASSIC_CONFIG --var CLASSIC_pkgdatadir`
|
---|
| 69 | AC_SUBST(CCA_SPEC_CLASSIC_CONFIG)
|
---|
| 70 | AC_SUBST(CCA_SPEC_CLASSIC_INCLUDE)
|
---|
| 71 | AC_SUBST(CCA_SPEC_CLASSIC_LIB)
|
---|
| 72 | AC_SUBST(CCA_SPEC_CLASSIC_SHARE)
|
---|
| 73 |
|
---|
| 74 | # check for babel
|
---|
| 75 | BABEL_CONFIG=`$CCA_SPEC_BABEL_CONFIG --var CCASPEC_BABEL_BABEL_CONFIG`
|
---|
| 76 | if test ! -x $BABEL_CONFIG; then
|
---|
| 77 | AC_MSG_ERROR([can't find babel-config])
|
---|
| 78 | fi
|
---|
| 79 | BABEL_INCLUDE=`$BABEL_CONFIG --includedir`
|
---|
| 80 | BABEL_LIB=`$BABEL_CONFIG --libdir`
|
---|
| 81 | BABEL_SHARE=`$BABEL_CONFIG --datadir`
|
---|
| 82 | BABEL_BIN=`$BABEL_CONFIG --bindir`
|
---|
| 83 | AC_SUBST(BABEL_CONFIG)
|
---|
| 84 | AC_SUBST(BABEL_INCLUDE)
|
---|
| 85 | AC_SUBST(BABEL_LIB)
|
---|
| 86 | AC_SUBST(BABEL_SHARE)
|
---|
| 87 | AC_SUBST(BABEL_BIN)
|
---|
| 88 |
|
---|
| 89 | # check for babel compilers
|
---|
| 90 | BABEL_CC=`$BABEL_CONFIG --query-var=CC`
|
---|
| 91 | BABEL_CFLAGS=`$BABEL_CONFIG --query-var=CFLAGS`
|
---|
| 92 | BABEL_CXX=`$BABEL_CONFIG --query-var=CXX`
|
---|
| 93 | BABEL_CXXFLAGS=`$BABEL_CONFIG --query-var=CXXFLAGS`
|
---|
| 94 | AC_SUBST(BABEL_CC)
|
---|
| 95 | AC_SUBST(BABEL_CFLAGS)
|
---|
| 96 | AC_SUBST(BABEL_CXX)
|
---|
| 97 | AC_SUBST(BABEL_CXXFLAGS)
|
---|
| 98 |
|
---|
| 99 | # might as well use babel's libtool
|
---|
| 100 | BABEL_BIN=`$BABEL_CONFIG --bindir`
|
---|
| 101 | BABEL_LIBTOOL=$BABEL_BIN/babel-libtool
|
---|
| 102 | if test -z $BABEL_LIBTOOL || ! test -x $BABEL_LIBTOOL; then
|
---|
| 103 | AC_MSG_ERROR([can't find babel-libtool])
|
---|
| 104 | fi
|
---|
| 105 | AC_SUBST(BABEL_LIBTOOL)
|
---|
| 106 |
|
---|
| 107 | # check mpi configuration
|
---|
| 108 | CCAFE_MPI_INCLUDE=`$CCAFE_CONFIG --var CCAFE_MPI_INC`
|
---|
| 109 | CCAFE_MPI_LIB=`$CCAFE_CONFIG --var CCAFE_MPI_LIBDIR`
|
---|
| 110 | CCAFE_MPI_BIN=`$CCAFE_CONFIG --var CCAFE_MPI_BIN`
|
---|
| 111 | if test -z "$CCAFE_MPI_INCLUDE"; then
|
---|
| 112 | CCAFE_MPI_ENABLE="no"
|
---|
| 113 | AC_MSG_WARN([Ccaffeine not configured for MPI])
|
---|
| 114 | else
|
---|
| 115 | CCAFE_MPI_ENABLE="yes"
|
---|
| 116 | CCAFE_MPI_INCLUDE=`echo $CCAFE_MPI_INCLUDE | sed 's/^\-I//'`
|
---|
| 117 | fi
|
---|
| 118 | AC_SUBST(CCAFE_MPI_ENABLE)
|
---|
| 119 | AC_SUBST(CCAFE_MPI_INCLUDE)
|
---|
| 120 | AC_SUBST(CCAFE_MPI_LIB)
|
---|
| 121 | AC_SUBST(CCAFE_MPI_BIN)
|
---|
| 122 |
|
---|
| 123 | if test $ENABLE_PYTHON == "yes"; then
|
---|
| 124 | # check for babel python
|
---|
| 125 | BABEL_PYTHON_ENABLE=`$BABEL_CONFIG --query-var=SUPPORT_PYTHON`
|
---|
| 126 | if test $BABEL_PYTHON_ENABLE == "false"; then
|
---|
| 127 | AC_MSG_ERROR([Babel not properly configured for python])
|
---|
| 128 | fi
|
---|
| 129 | # check that ccafe is configured for python
|
---|
| 130 | if ! test -d $CCAFE_ROOT/lib/python$PYTHON_VERSION/site-packages/ccaffeine; then
|
---|
| 131 | AC_MSG_ERROR([Ccaffeine not properly configured for Python])
|
---|
| 132 | else
|
---|
| 133 | CCAFE_PYTHON_ENABLE="yes"
|
---|
| 134 | fi
|
---|
| 135 | BABEL_PYTHON=`$BABEL_CONFIG --query-var=WHICH_PYTHON`
|
---|
| 136 | BABEL_PYTHON_VERSION=`$BABEL_CONFIG --query-var=PYTHON_VERSION`
|
---|
| 137 | BABEL_PYTHON_LIB=`$BABEL_CONFIG --query-var=PYTHONLIB`/site-packages
|
---|
| 138 | BABEL_PYTHON_INCLUDE=`$BABEL_CONFIG --query-var=PYTHONINC`
|
---|
| 139 | AC_SUBST(BABEL_PYTHON)
|
---|
| 140 | AC_SUBST(BABEL_PYTHON_VERSION)
|
---|
| 141 | AC_SUBST(BABEL_PYTHON_LIB)
|
---|
| 142 | AC_SUBST(BABEL_PYTHON_INCLUDE)
|
---|
| 143 | else
|
---|
| 144 | BABEL_PYTHON_ENABLE="no"
|
---|
| 145 | CCAFE_PYTHON_ENABLE="no"
|
---|
| 146 | fi
|
---|
| 147 |
|
---|
| 148 | echo -e "\nCCA Tools Configuration:"
|
---|
| 149 | echo -e "---------------------------------------------------------------"
|
---|
| 150 | echo -e "ccafe config:\n $CCAFE_CONFIG"
|
---|
| 151 | echo -e "ccafe include:\n $CCAFE_INCLUDE"
|
---|
| 152 | echo -e "ccafe lib:\n $CCAFE_LIB"
|
---|
| 153 | echo -e "ccafe share:\n $CCAFE_SHARE"
|
---|
| 154 | echo -e "ccafe bin:\n $CCAFE_BIN"
|
---|
| 155 | echo -e "ccafe python enabled:\n $CCAFE_PYTHON_ENABLE"
|
---|
| 156 | echo -e "ccafe mpi enabled\n $CCAFE_MPI_ENABLE"
|
---|
| 157 | if test $CCAFE_MPI_ENABLE == "yes"; then
|
---|
| 158 | echo -e "ccafe mpi include:\n $CCAFE_MPI_INCLUDE"
|
---|
| 159 | echo -e "ccafe mpi lib:\n $CCAFE_MPI_LIB"
|
---|
| 160 | echo -e "ccafe mpi bin:\n $CCAFE_MPI_BIN"
|
---|
| 161 | fi
|
---|
| 162 | echo -e "cca-spec-babel-config:\n $CCA_SPEC_BABEL_CONFIG"
|
---|
| 163 | echo -e "cca-spec-babel include:\n $CCA_SPEC_BABEL_INCLUDE"
|
---|
| 164 | echo -e "cca-spec-babel lib:\n $CCA_SPEC_BABEL_LIB"
|
---|
| 165 | echo -e "cca-spec-babel share:\n $CCA_SPEC_BABEL_SHARE"
|
---|
| 166 | echo -e "cca-spec-classic-config:\n $CCA_SPEC_CLASSIC_CONFIG"
|
---|
| 167 | echo -e "cca-spec-classic include:\n $CCA_SPEC_CLASSIC_INCLUDE"
|
---|
| 168 | echo -e "cca-spec-classic lib:\n $CCA_SPEC_CLASSIC_LIB"
|
---|
| 169 | echo -e "cca-spec-classic share:\n $CCA_SPEC_CLASSIC_SHARE"
|
---|
| 170 | echo -e "babel-config:\n $BABEL_CONFIG"
|
---|
| 171 | echo -e "babel include:\n $BABEL_INCLUDE"
|
---|
| 172 | echo -e "babel lib:\n $BABEL_LIB"
|
---|
| 173 | echo -e "babel share:\n $BABEL_SHARE"
|
---|
| 174 | echo -e "babel bin:\n $BABEL_BIN"
|
---|
| 175 | echo -e "babel C compiler:\n $BABEL_CC"
|
---|
| 176 | echo -e "babel C++ compiler:\n $BABEL_CXX"
|
---|
| 177 | echo -e "babel CFLAGS:\n $BABEL_CFLAGS"
|
---|
| 178 | echo -e "babel CXXFLAGS:\n $BABEL_CXXFLAGS"
|
---|
| 179 | echo -e "babel libtool:\n $BABEL_LIBTOOL"
|
---|
| 180 | echo -e "babel python enabled:\n $BABEL_PYTHON_ENABLE\n"
|
---|
| 181 |
|
---|
| 182 | ])
|
---|
| 183 |
|
---|