-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.ac
75 lines (57 loc) · 1.7 KB
/
configure.ac
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
#
# Copyright (c) 2011-2023 Triad National Security, LLC
# All rights reserved.
#
# This file is part of the mpimemu project. See the LICENSE file at the
# top-level directory of this distribution.
#
AC_PREREQ([2.60])
AC_INIT([mpimemu], [1.4.2-alpha], [[email protected]])
# Check If AM_SILENT_RULES Rule Are Supported
# If So, Build Using AM_SILENT_RULES
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_SRCDIR([src])
# note: -Wall -Werror are automake options. they are NOT compiler flags
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
# checks for programs.
# note that we are checking for mpicc first, the next check will verify CC
AC_PROG_CC([mpicc cc])
# check for adequate mpi support
AC_MSG_CHECKING([if $CC can compile MPI applications])
AC_LINK_IFELSE([
AC_LANG_PROGRAM(
[[#include <mpi.h>]],
[[MPI_Finalize();]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([$CC cannot compile MPI applications. cannot continue.])]
)
AM_PROG_CC_C_O
# checks for libraries.
# none at this point
# checks for header files.
AC_CHECK_HEADERS([\
inttypes.h limits.h stdint.h stdlib.h string.h unistd.h stdbool.h time.h \
getopt.h ctype.h netdb.h sys/socket.h netinet/in.h arpa/inet.h
])
# checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
AC_TYPE_SIZE_T
# checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset strerror strtoul])
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT
# let the user know the configuration
cat << EOF
mpimemu configuration
+--------------------
|
| CC : $CC
| CFLAGS : $CFLAGS
| LDFLAGS : $LDFLAGS
| LIBS : $LIBS
| CPPFLAGS: $CPPFLAGS
| CPP : $CPP
EOF