autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I fix 'missing template' problem ??


From: Dr. David Kirkby
Subject: How do I fix 'missing template' problem ??
Date: Sun, 13 Apr 2003 15:57:57 +0100

If I included the line:
AC_CONFIG_HEADER([config.h])
in configure.ac (as reccomended by 'autoscan')
I get errors about 'missing template' (see below). A search on the web
seems to suggest these are caused by using older versions of the auto*
tools, but I'm using automake 1.7, autoconf 2.57, GNU m4 version 1.4. 

If I leave out the line 'AC_CONFIG_HEADER([config.h])' from
configure.ac the problem does not occur, yet everything still works
okay. The easiest solution is of course to leave out that line, but
I'm interested what causes the problem.

sparrow /export/home/davek/atlc % autoreconf
autoheader: missing template: ENABLE_POSIX_THREADS
Use AC_DEFINE([ENABLE_POSIX_THREADS], [], [Description])autoheader:
missing template: HAVE_LIBGSL
autoheader: missing template: HAVE_THR_SETCONCURRENCY
autoreconf:
/usr/local/stow/autoconf-2.57-build-cc-Xc-fast/bin/autoheader failed
with exit status: 1

There were similar messages about 'ENABLE_MPI' but I commented those
lines out temporarily, so they are not shown above. 



Here is my current configure.ac


% cat configure.ac
# Process this file with autoconf to produce a configure script.


AC_INIT([atlc], [4.2.12], address@hidden)
AM_INIT_AUTOMAKE
AC_PREREQ([2.57])
AC_CONFIG_SRCDIR([atlc-4.2.12/tools/src/myfilelength.c])
AC_CONFIG_HEADER([config.h])


# Checks for programs.
AC_PROG_CXX # Test for C++ compiler characteristics
AC_ISC_POSIX

# AC_OUTPUT_COMMANDS([exit])

# Checks for libraries.
AC_CHECK_LIB([m],[log])


# check for optimised math library on SPARC
# AC_CHECK_LIB([mopt],[main])
# check for the optimised
# AC_CHECK_LIB([copt],[main])

# Checks for header files.

AC_CHECK_HEADERS([stdio.h math.h malloc.h stdlib.h string.h
strings.h])

# Checks for typedefs
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_SIZE_T

# checks for structures (none need to be tested)

# checks for compiler characteristics
AC_C_BIGENDIAN
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([size_t])

# checks for library functions
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_STRTOD
AC_CHECK_FUNCS([memset strchr strtol])
#AC_CHECK_FUNCS([memset pow sqrt strchr strtol])


# First give the user the chance to disable the gsl library. This
# was handy to do when configured with --with-mpi and it kept
# being unable to find the library. 
AC_ARG_WITH([gsl],
     AC_HELP_STRING([--with-gsl], [use gsl library (default is YES)]),
     [ac_cv_use_gsl=$withval], [ac_cv_use_gsl=yes])

# If the user has not chosen to disable gsl support, then check for 
# gsl support and see that it exists. 
# Check for the gsl library, using gsl.m4, supplied with gsl-1.3
if test "$ac_cv_use_gsl" = "yes"; then
  AM_PATH_GSL([0.5])
  # no_gsl gets defined in gsl.m4 if version is too old. 
  if test "$no_gsl" != "yes" ; then
    AC_DEFINE(HAVE_LIBGSL)
    LIBS="$GSL_LIBS $LIBS"
    CFLAGS="$GSL_CFLAGS $CFLAGS"
  fi
fi

# Multi-Processor Support checked with the macro m4/acx_pthread.m4
building_with_posix_threads="no"
AC_ARG_WITH(threads,
                   AC_HELP_STRING([--with-threads],
                   [support thread-based parallel computation, using a
POSIX thread library (default is NO)]))

if test "x$with_threads" = "xyes"; then
AC_CHECK_LIB(thread, thr_setconcurrency,
[AC_DEFINE(HAVE_THR_SETCONCURRENCY)])
ACX_PTHREAD([AC_DEFINE(ENABLE_POSIX_THREADS)])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
fi

# MPI and MPE Support
#AC_ARG_WITH(mpi,
AC_HELP_STRING([--with-mpi=[mpi_install_prefix]],[support MPI-based
parallel computation (needs MPICH installed)]))
#AC_ARG_WITH(mpe,
AC_HELP_STRING([--with-mpe=[mpi_install_prefix]],[implies --with-mpi
and additionally links in MPE logging support]))
 
 if test "x$with_mpi" != "x" \
 || test "x$with_mpe" != "x"; then

  if test "x$with_threads" = "xyes"; then
     AC_MSG_ERROR([it does not make sense to use --with-threads with
--with-mpi or --with-mpe])
  fi  
#  ACX_MPI(AC_DEFINE([ENABLE_MPI]),AC_MSG_ERROR([Could not determine
how to link MPI program]))
  CC="$MPICC"
  if test "x$with_mpe" = "xyes" ; then
    LIBS="$MPILIBS -lmpe $LIBS"
  else
    LIBS="$MPILIBS $LIBS"
  fi
  AC_CHECK_PROG(mpirun,mpirun,yes,no,$PATH)
  if test "x$mpirun" = "xyes"; then
    AC_MSG_NOTICE([Don't forget, 'mpirun' MUST be used to call atlc.
Don't run atlc directly!!])
  else
    AC_MSG_WARN([The program 'mpirun' needed to run atlc, can't be
found])
  fi
fi
echo miprun=$mpirun 
dnl Only use -Wall if we have gcc
if test "x$GCC" = "xyes"; then
  if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
      CFLAGS="$CFLAGS -Wall"
  fi
fi

AC_OUTPUT([\
Makefile                                        \
src/Makefile                                    \
m4/Makefile                                     \
src/non_gui/Makefile                            \
src/gui/Makefile                                \
man/Makefile                                    \
man/man1/Makefile                               \
examples/Makefile                               \
tools/Makefile                                  \
tools/src/Makefile                              \
tests/Makefile                                  \
docs/html-docs/Makefile                         \
docs/html-docs/jpgs/Makefile                    \
docs/qex-december-1996/Makefile                 \
docs/theory/Makefile                            \
docs/Makefile                                   ])

-- 
Dr. David Kirkby,
Senior Research Fellow,
Department of Medical Physics,
University College London,
11-20 Capper St, London, WC1E 6JA.
Tel: 020 7679 6408 Fax: 020 7679 6269
Internal telephone: ext 46408
e-mail address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]