configure.ac 4 KB
Newer Older
1 2 3 4
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
5
AC_INIT([codes-base], [0.4.0], [http://trac.mcs.anl.gov/projects/codes/newticket],[],[http://www.mcs.anl.gov/projects/codes/])
6 7 8 9 10 11 12 13 14

AC_CANONICAL_TARGET
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([foreign subdir-objects -Wall])

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

15
AC_CONFIG_SRCDIR([doc/BUILD_STEPS])
16
AC_CONFIG_HEADERS([codes_base_config.h])
17 18 19 20 21 22 23 24 25 26 27 28 29

AX_PROG_BISON([],[AC_MSG_WARN([Could not find bison])])
AX_PROG_FLEX([],[AC_MSG_WARN([Could not find flex])])
AC_SUBST([BISON])
AC_SUBST([FLEX])

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_RANLIB

30 31
PKG_PROG_PKG_CONFIG

Jonathan Jenkins's avatar
Jonathan Jenkins committed
32 33 34
# Check for C99
AC_PROG_CC_C99

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
AC_REQUIRE_CPP

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h unistd.h execinfo.h pthread.h malloc.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T

# Checks for library functions.
AC_CHECK_FUNCS([memset])
AC_CHECK_LIB([pthread],[pthread_create],,[AC_MSG_ERROR([Could not find pthread_create!])])
AC_CHECK_LIB([m],[sqrt],,[AC_MSG_ERROR([Could not find sqrt!])])


AX_PROG_BISON_CLFEATURES([],[AC_MSG_WARN([Could not find bison])],
[bison_ok="yes"], [bison_ok="no"])
AC_SUBST([bison_ok])

dnl Check to see if CC is an MPI compiler
AC_MSG_CHECKING(whether the mpicc compiler works)
AC_TRY_COMPILE([#include <mpi.h>], [int ret = MPI_Init(0, (void*)0)],
    AC_MSG_RESULT(yes),
    AC_MSG_RESULT(no)
70
    AC_MSG_ERROR(CC doesnt appear to be a valid MPI compiler.  See INSTALL document or try adding CC=mpicc to your configure command line.)
71 72
)

73 74
PKG_CHECK_MODULES([ROSS], [ross], [],
                  [AC_MSG_ERROR([Could not find working ross installation])])
75

76 77 78 79
# check for Darshan
AC_ARG_WITH([darshan],[AS_HELP_STRING([--with-darshan@<:@=DIR@:>@],
                        [location of Darshan installation])])
if test "x${with_darshan}" != "x" ; then
80
    AC_CHECK_FILE([${with_darshan}/lib/pkgconfig/darshan-util.pc],
81
                  AM_CONDITIONAL(USE_DARSHAN, true),
82
                  AC_MSG_ERROR(Could not find darshan-util.pc))
83
    DARSHAN_LIBS+=`PKG_CONFIG_PATH=${with_darshan}/lib/pkgconfig pkg-config darshan-util --static --libs`
84
    DARSHAN_CFLAGS=`PKG_CONFIG_PATH=${with_darshan}/lib/pkgconfig pkg-config darshan-util --cflags`
85
    AC_SUBST(DARSHAN_LIBS)
86
    AC_SUBST(DARSHAN_CFLAGS) 
87 88 89 90
else
    AM_CONDITIONAL(USE_DARSHAN, false)
fi

91 92 93 94 95
# check for Recorder
AM_CONDITIONAL(USE_RECORDER, true)
RECORDER_CPPFLAGS="-DUSE_RECORDER=1"
AC_SUBST(RECORDER_CPPFLAGS)

96 97 98 99 100 101 102 103 104 105 106
#check for Dumpi
AC_ARG_WITH([dumpi],[AS_HELP_STRING([--with-dumpi@<:@=DIR@:>@],
                        [location of Dumpi installation])])
if test "x${with_dumpi}" != "x" ; then
	AC_CHECK_FILE([${with_dumpi}/lib/libundumpi.la],
                  AM_CONDITIONAL(USE_DUMPI, true),
                  AC_MSG_ERROR(Could not find libundumpi.la))
	DUMPI_CFLAGS="-I${with_dumpi}/include"
#	DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/common" 
#	DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libdumpi"
#	DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libundumpi"
107
	DUMPI_LIBS="-L${with_dumpi}/lib/ -lundumpi"
108 109 110 111 112 113
	AC_SUBST(DUMPI_LIBS)
	AC_SUBST(DUMPI_CFLAGS)
else
	AM_CONDITIONAL(USE_DUMPI, false)
fi

114 115 116 117 118 119 120 121 122 123 124 125 126
dnl ======================================================================
dnl  Try harder to be valgrind safe
dnl ======================================================================
AC_ARG_ENABLE(valgrind-clean,
        [AS_HELP_STRING(
                [--enable-valgrind-clean],
                [Try harder to avoid valgrind warnings])
        ])

AS_IF([test "x$enable_valgrind_clean" = "xyes"], [
      AC_DEFINE([VALGRIND], [1], [If enabling valgrind-clean build])
])

127

128
dnl AC_CONFIG_FILES([src/iokernellang/codesparser.y])
129 130 131

AC_CONFIG_FILES([Makefile])

132
AC_OUTPUT([maint/codes-base.pc])
133