-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
106 lines (88 loc) · 2.97 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
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
# -*- shell-script -*-
#
# Copyright 2017-2018 UT-Battelle, LLC.
# All rights reserved.
# See COPYING in top-level directory.
#
# Additional copyrights may follow
#
# $HEADER$
#
AC_INIT([moc], [0.1], [[email protected]])
AC_CONFIG_SRCDIR([include/moc.h])
AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects foreign tar-ustar])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
CFLAGS="$CFLAGS -std=c99"
AC_PROG_CC([clang gcc])
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AM_PROG_CC_C_O
m4_pattern_allow([AM_PROG_AR], [AM_PROG_AR])
LT_INIT
CPPFLAGS_save="$CPPFLAGS"
LIBS_save="$LIBS"
top_srcdir=`pwd`
AC_SUBST([CPPFLAGS],["-I$top_srcdir/include $CPPFLAGS_save"])
dnl# mpi
AC_MSG_CHECKING([MPI installation])
AC_ARG_WITH(mpi,
[AS_HELP_STRING([--with-mpi=PATH],
[Absolute path to the install directory for MPI])],
[MPI_INSTALL_DIR="${withval}"],
[MPI_INSTALL_DIR=""])
MPI_INC=""
MPI_LIB=""
if test "x$MPI_INSTALL_DIR" = "x" ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
MPI_INC="-I$MPI_INSTALL_DIR/include"
MPI_LIB="-L$MPI_INSTALL_DIR/lib"
fi
CPPFLAGS_save="$CPPFLAGS"
LIBS_save="$LIBS"
AC_SUBST([CPPFLAGS],["$MPI_INC $CPPFLAGS_save"])
AC_SUBST([LIBS],["$MPI_LIB $LIBS_save -lmpi"])
AC_CHECK_HEADERS([mpi.h],[AC_DEFINE(HAVE_MPI)],[AC_MSG_ERROR([Cannot find MPI])])
AC_CHECK_LIB([mpi], [MPI_Init],,AC_MSG_ERROR([Cannot use MPI lib]))
dnl# pmix
AC_MSG_CHECKING([PMIx installation])
AC_ARG_WITH(pmix,
[AS_HELP_STRING([--with-pmix=PATH],
[Absolute path to the install directory for PMIx])],
[PMIX_INSTALL_DIR="${withval}"],
[PMIX_INSTALL_DIR=""])
PMIX_INC=""
PMIX_LIB=""
if test "x$PMIX_INSTALL_DIR" = "x" ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
PMIX_INC="-I$PMIX_INSTALL_DIR/include"
PMIX_LIB="-L$PMIX_INSTALL_DIR/lib"
fi
CPPFLAGS_save="$CPPFLAGS"
LIBS_save="$LIBS"
AC_SUBST([CPPFLAGS],["$PMIX_INC $CPPFLAGS_save -std=c99"])
AC_SUBST([LIBS],["$PMIX_LIB $LIBS_save -lpmix"])
AC_CHECK_HEADERS([pmix.h],[AC_DEFINE(HAVE_PMIX)],[AC_MSG_ERROR([Cannot find PMIX])])
AC_CHECK_LIB([pmix], [PMIx_Init],,AC_MSG_ERROR([Cannot use PMIx lib]))
dnl# Static vs. dynamic mode
AC_ARG_ENABLE([dynamic-coord],
[AS_HELP_STRING([--enable-dynamic-coord],
[Switch the MOC library to dynamic mode, allowing the coordination of Open MPI and a compatible modified version of LLVM])],
[case "${enableval}" in
yes) coord_mode="dynamic" ;;
no) coord_mode="static" ;;
*) AC_MSG_ERROR([Bad value ${enableval} for --enable-dynamic-coord]) ;;
esac],[coord_mode="static"])
if test "x$coord_mode" = "xstatic" ; then
AC_DEFINE([STATIC_COORD])
else
AC_DEFINE([DYNAMIC_COORD])
fi
AM_CONDITIONAL(USE_CLANG, test "x$CC" = "xclang")
AM_CONDITIONAL(USE_CC, test "x$CC" = "xgcc")
AC_CONFIG_FILES([Makefile include/Makefile src/Makefile test/Makefile])
AC_OUTPUT