configure.in 3.09 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
dnl **************************************************************
dnl PVFS2 AUTOCONF SCRIPT
dnl
dnl Process this file with autoconf to produce a configure script.
dnl You may need to use autoheader as well if changing any DEFINEs

dnl sanity checks, output header, location of scripts used here
AC_INIT(darshan.h)
AC_CONFIG_AUX_DIR(maint/config)
AC_CONFIG_HEADER(darshan-config.h)

AC_PROG_INSTALL

CHECK_ZLIB

AC_CHECK_PROG(HAVE_MPICC, mpicc, yes, no)
if test x$HAVE_MPICC != xyes; then
    AC_ARG_WITH(mpi,
    [  --with-mpi=<dir>        Location of the MPI installation],
        if test x$withval = xyes; then
            AC_MSG_ERROR(--with-mpi must be given a pathname)
        else
            MPICC="${withval}/bin/mpicc"
            GOT_MPICC="1"
        fi
    )
else
    GOT_MPICC="1"
    MPICC=mpicc
fi
AC_SUBST(MPICC)

AC_ARG_WITH(mem-align,
[  --with-mem-align=<num>  Memory alignment in bytes],
    if test x$withval = xyes; then
        AC_MSG_ERROR(--with-mem-align must be given a number in bytes)
    else
        AC_DEFINE_UNQUOTED(__CP_MEM_ALIGNMENT, ${withval}, Memory alignment in bytes)
        GOT_ALIGNMENT=1
    fi
)

AC_ARG_WITH(log-path,
[  --with-log-path=<path>  Location to store log files at run time],
    if test x$withval = xyes; then
        AC_MSG_ERROR(--with-log-path must be given a pathname)
    else
        AC_DEFINE_UNQUOTED(__CP_LOG_PATH, "${withval}", Location to store log files at run time)
        __CP_LOG_PATH="${withval}"
        GOT_LOG_PATH=1
    fi
)


saveCC="$CC"
CC="$MPICC"

if test x$GOT_MPICC != x1; then
    AC_MSG_ERROR(must provide --with-mpi=<path> argument to configure.)
fi
if test x$GOT_ALIGNMENT != x1; then
    AC_MSG_ERROR(must provide --with-mem-align=<num> argument to configure.)
fi
if test x$GOT_LOG_PATH != x1; then
    AC_MSG_ERROR(must provide --with-log-path=<path> argument to configure.)
fi

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)
    AC_MSG_ERROR($CC doesn't appear to be a valid MPI compiler)
)

# libc functions wrapped by darshan
CP_WRAPPERS="-Wl,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync"

if test "x$prefix" = xNONE; then
    darshan_lib_path=$ac_default_prefix/lib
else
    darshan_lib_path=$prefix/lib
fi
AC_SUBST(darshan_lib_path)
AC_SUBST(__CP_LOG_PATH)
AC_SUBST(CP_WRAPPERS)
AC_CHECK_SIZEOF([long int])
AC_OUTPUT(Makefile
compilers/mpicc-trace-bgp
compilers/mpif77-trace-bgp
compilers/mpif90-trace-bgp
compilers/mpixlc-trace-bgp
compilers/mpixlf77-trace-bgp
compilers/mpixlf90-trace-bgp
compilers/mpicc-trace-pcarns
compilers/mpicxx-trace-pcarns
compilers/mpif77-trace-pcarns
compilers/mpicxx-trace-bgp
compilers/mpixlcxx-trace-bgp
compilers/mpixlf2003-trace-bgp
darshan-mk-log-dirs.pl
)