-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfigure.ac
More file actions
118 lines (95 loc) · 3.08 KB
/
configure.ac
File metadata and controls
118 lines (95 loc) · 3.08 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
define([version_major], 0)
define([version_minor], 0)
define([version_revision], 1)
AC_DEFINE_UNQUOTED(LIBIOFLEX_MAJOR, ${version_major},[ioflex Major Version])
AC_SUBST(LIBIOFLEX_MAJOR)
AC_DEFINE_UNQUOTED(LIBIOFLEX_MINOR, ${version_minor},[ioflex Minor Version])
AC_SUBST(LIBIOFLEX_MINOR)
AC_DEFINE_UNQUOTED(LIBIOFLEX_REVISION, ${version_revision}, [ioflex Revision])
AC_SUBST(LIBIOFLEX_REVISION)
AC_INIT([libioflex],[version_major.version_minor.version_revision],[safadiaby9@gmail.com])
AC_LANG([C])
AM_INIT_AUTOMAKE([subdir-objects])
AC_PROG_CC([mpicc])
CC=mpicc
AC_USE_SYSTEM_EXTENSIONS([_GNU_SOURCE])
AC_CONFIG_FILES([Makefile
src/Makefile])
# MPI Implementation Mode
# --with-hints=romio|craympich|ompio (default is romio)
AC_ARG_WITH([hints],
AS_HELP_STRING([--with-hints=MODE], [Set mode: romio (default), cray-mpich, or ompio]),
[hints_val="$withval"],
[hints_val="romio"]) # Default is "a" if not specified
# Validate and define macros
case "$hints_val" in
romio)
AC_DEFINE([HINTS_ROMIO], [1], [Define if using hints romio])
;;
cray)
AC_DEFINE([HINTS_CRAY], [1], [Define if using hints cray])
;;
ompio)
AC_DEFINE([HINTS_OMPIO], [1], [Define if using hints ompio])
;;
*)
AC_MSG_ERROR([Invalid mode: $hints_val. Use --with-hints=romio, --with-hints=ompio or --with-hints=cray])
;;
esac
# Check for libconfuse
AC_ARG_WITH([libconfuse],
[AS_HELP_STRING([--with-libconfuse=DIR],[Use libconfuse library [default=yes]])],,
[withval=yes])
case "$withval" in
yes)
HAVE_CFG="yes"
AC_CHECK_HEADERS([confuse.h], [], [unset HAVE_CFG],
[[#ifdef HAVE_CFG_H
# include<confuse.h>
#endif
]])
AC_CHECK_LIB([confuse], [cfg_init],, [unset HAVE_CFG])
if test -z "$HAVE_CFG"; then
AC_MSG_ERROR([could not find libconfuse])
fi
;;
no)
AC_MSG_ERROR([libconfuse is required to build IOFlex])
;;
*)
HAVE_CFG="yes"
case "$withval" in
*,*)
cfg_inc="`echo $withval | cut -f1 -d,`"
cfg_lib="`echo $withval | cut -f1 -d, -s`"
;;
*)
if test -n "$withval"; then
cfg_inc="$withval/include"
cfg_lib="$withval/lib"
fi
;;
esac
if test "X$cfg_inc" = "X/usr/include"; then
cfg_inc=""
fi
if test "X$cfg_lib" = "X/usr/lib"; then
cfg_lib=""
fi
if test -n "$cfg_inc"; then
CFLAGS="$CFLAGS -I$cfg_inc"
fi
AC_CHECK_HEADERS([confuse.h], [], [unset HAVE_CFG])
if test -n "$cfg_lib"; then
LDFLAGS="$LDFLAGS -L$cfg_lib"
fi
AC_CHECK_LIB([confuse], [cfg_init],, [unset HAVE_CFG])
if test -z "$HAVE_CFG"; then
AC_MSG_ERROR([could not find libconfuse])
fi
;;
esac
AC_PREFIX_DEFAULT([`pwd`])
LT_INIT([disable-static])
AC_CHECK_LIB([dl], [dlsym], [], [AC_MSG_ERROR(libld is not installed)])
AC_OUTPUT