-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
129 lines (112 loc) · 3.28 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
AC_PREREQ(2.62)
AC_INIT(DIDA, 1.0.1, hmohamadi@bcgsc.ca, dida,
http://www.bcgsc.ca/platform/bioinfo/software/dida)
# add 'foreign' to allow README.md instead of README
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_SRCDIR([dida.cpp])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_RANLIB
# Checks for header files.
AC_CHECK_HEADERS([dlfcn.h fcntl.h float.h limits.h \
stddef.h stdint.h stdlib.h sys/param.h zlib.h])
AC_HEADER_STDBOOL
AC_HEADER_STDC
# Checks for library functions.
AC_CHECK_FUNCS([dup2 gethostname getopt_long getpagesize \
memset strdup strerror strtoul])
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_VPRINTF
# Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_CHECK_TYPES([ptrdiff_t])
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
# Check for the math library.
AC_CHECK_LIB([m], [sqrt])
AC_CHECK_FUNCS([pow sqrt])
AC_CHECK_FUNC(ceilf, [], AC_DEFINE(ceilf, [ceil],
[Define if the system does not provide ceilf]))
# Check for the dynamic linking library.
AC_CHECK_LIB([dl], [dlsym])
# zlib (optional)
AC_CHECK_LIB([z], [gzwrite])
AM_CONDITIONAL([HAVE_LIBZ],
[test $ac_cv_header_zlib_h = yes -a $ac_cv_lib_z_gzwrite = yes])
# Check for OpenMP.
AC_LANG_PUSH([C++])
AC_OPENMP
if test -z $OPENMP_CXXFLAGS; then
AC_MSG_ERROR([DIDA must be compiled with a C++ compiler that supports OpenMP threading.])
fi
AC_LANG_POP([C++])
# MPI
AC_ARG_WITH(mpi, AS_HELP_STRING([--with-mpi=PATH],
[specify prefix directory for the installed MPI parallel
computing library]))
if test "$with_mpi" -a -d "$with_mpi"; then
mpi_cppflags="-isystem$with_mpi/include"
mpi_ldflags="-L$with_mpi/lib"
fi
AC_ARG_ENABLE(mpich, AS_HELP_STRING([--enable-mpich],
[use MPICH (default is to use Open MPI)]))
AC_ARG_ENABLE(lammpi, AS_HELP_STRING([--enable-lammpi],
[use LAM/MPI (default is to use Open MPI)]))
# Find the absolute path to the source.
my_abs_srcdir=$(cd $srcdir; pwd)
# Set compiler flags
AC_SUBST(CPPFLAGS,
"-I$my_abs_srcdir $mpi_cppflags $OPENMP_CXXFLAGS $CPPFLAGS")
AC_SUBST(LDFLAGS, "$mpi_ldflags $OPENMP_CXXFLAGS $LDFLAGS")
# Check for the MPI parallel computing library.
libs="$LIBS"
AC_DEFINE(MPICH_SKIP_MPICXX, 1,
[Define to disable MPICH C++ bindings])
AC_DEFINE(OMPI_SKIP_MPICXX, 1,
[Define to disable OpenMPI C++ bindings])
AC_CHECK_HEADERS([mpi.h])
if test "$enable_mpich"; then
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([mpl], [MPL_env2int])
AC_CHECK_LIB([mpich], [MPI_Init])
ac_cv_lib_mpi_MPI_Init=$ac_cv_lib_mpich_MPI_Init
elif test "$enable_lammpi"; then
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([lam], [lam_mutex_lock])
AC_CHECK_LIB([mpi], [MPI_Init])
AC_LANG_PUSH([C++])
AC_CHECK_LIB([lammpi++], [main])
AC_LANG_POP([C++])
else
AC_CHECK_LIB([mpi], [MPI_Init])
fi
if test $ac_cv_header_mpi_h != yes -o $ac_cv_lib_mpi_MPI_Init != yes; then
AC_MSG_ERROR([DIDA must be compiled with MPI support.])
fi
AC_SUBST(AM_CXXFLAGS, '-Wall -Wextra -Werror')
AC_SUBST(MPI_LIBS, "$LIBS")
LIBS="$libs"
AC_CONFIG_FILES([
lib/gzstream-1.5/Makefile
Makefile
])
AC_OUTPUT