-
Notifications
You must be signed in to change notification settings - Fork 23
/
configure.ac
202 lines (158 loc) · 5.51 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Copyright (c) 2011 FFLAS-FFPACK
# written by Brice Boyer (briceboyer) <boyer.brice@gmail.com>
# adapted from LinBox configuration
#
# ========LICENCE========
# This file is part of the library FFLAS-FFPACK.
#
# FFLAS-FFPACK is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# ========LICENCE========
#/
AC_PREREQ([2.67])
AC_INIT([FFLAS-FFPACK], [2.5.1],[ffpack-devel@googlegroups.com],[fflas-ffpack],
[https://github.com/linbox-team/fflas-ffpack])
AC_CONFIG_MACRO_DIR([macros])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([1.10 -Wall -Wno-portability foreign])
AX_PREFIX_CONFIG_H(fflas-ffpack/config.h, __FFLASFFPACK)
# Set CXXFLAGS to an empty string if not defined, and save it. We must do it
# before calling AC_PROG_CXX that sets it to '-O2 -g' if not defined
: ${CXXFLAGS=""}
ORIGINAL_CXXFLAGS="${CXXFLAGS}"
# We set the language to C++
AC_LANG([C++])
AC_PROG_CXX
#
AM_PROG_AR
# Libtool
AC_PROG_LIBTOOL
LT_PREREQ([2.4.3])
LT_INIT
# Look for headers
AC_HEADER_STDC
AC_CHECK_HEADERS([float.h limits.h stddef.h stdlib.h string.h sys/time.h stdint.h pthread.h])
#
AC_PROG_EGREP
AC_PROG_SED
#################################################
AS_BOX([ START FFLAS-FFPACK CONFIG ])
#################################################
AC_COMPILER_NAME
# We need a C++11 compiler now - AB 2014-12-12
# clang-3.8 does not support __float128 without explicitly passing it -std=c++11
AS_IF([test "x${CCNAM}" = "xclang38"],
[AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])],
[AX_CXX_COMPILE_STDCXX_11([ext],[mandatory])]
)
REQUIRED_FLAGS="${CXX11FLAGS}"
# Add the c++11 flags for the configure compilations as clang needs it to work properly with a glibc++ compiled with gcc
CXXFLAGS="${CXX11FLAGS} ${CXXFLAGS}"
AS_ECHO([---------------------------------------])
# Set OPTIM_FLAGS, DEBUG_FLAGS depending on compiler and command line arguments
SET_FLAGS
# Append -march=native or -mcpu=native (if recognized by the compiler) to
# OPTIM_FLAGS if not present in CXXFLAGS and not cross-compiling and
# --without-archnative is not set
ARCH_FLAGS
# Append -mfpmath=sse to OPTIM_FLAGS on i386 and i686 architecture with SSE
FPMATH_FLAGS
AS_ECHO([---------------------------------------])
# Machine characteristics
# Size of some types
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(__int64_t)
# Looking for int128
AC_CHECK_TYPE([__int128_t], [AC_DEFINE(HAVE_INT128, 1, [Define that compiler allows int128_t types])])
# check endianness of the architecture
AC_C_BIGENDIAN(
[AC_DEFINE(HAVE_BIG_ENDIAN, 1, [Define that architecture uses big endian storage])],
[AC_DEFINE(HAVE_LITTLE_ENDIAN, 1, [Define that architecture uses little endian storage])],
[])
AS_ECHO([---------------------------------------])
# Looking for OpenMP
AC_OPENMP
FF_CHECK_OMP
PARFLAGS="${OPENMP_CXXFLAGS}"
PARLIBS="${OPENMP_CXXFLAGS}"
AC_SUBST(PARFLAGS)
AC_SUBST(PARLIBS)
# Feature checks
FF_MISC
# Looking for Givaro. We get the flags for GMP at the same time
PKG_CHECK_MODULES([GIVARO],[givaro >= 4.1.2])
FF_CHECK_GIVARO_USABILITY()
AS_ECHO([---------------------------------------])
BLAS_FOUND=false
FF_CHECK_BLAS_CFLAGS
FF_CHECK_BLAS_LIBS
FF_CHECK_MKL
FF_CHECK_USER_BLAS
FF_CHECK_USER_LAPACK
FF_OPENBLAS_NUM_THREADS
# FF_CHECK_CUDA
AS_ECHO([---------------------------------------])
FF_DOC
FF_PRECOMPILE
AS_ECHO([---------------------------------------])
CXXFLAGS="${ORIGINAL_CXXFLAGS}"
FFLASFFPACK_CXXFLAGS="${REQUIRED_FLAGS} ${OPTIM_FLAGS} ${DEBUG_FLAGS}"
AC_SUBST(FFLASFFPACK_CXXFLAGS)
AS_ECHO(["FFLASFFPACK_CXXFLAGS = ${FFLASFFPACK_CXXFLAGS}"])
AC_SUBST(REQUIRED_FLAGS)
#################################################
AS_BOX([ END FFLAS-FFPACK CONFIG ])
#################################################
AC_CONFIG_FILES([
Makefile
macros/Makefile
macros/CodeChunk/Makefile
fflas-ffpack-config
fflas-ffpack/Makefile
fflas-ffpack/fflas/Makefile
fflas-ffpack/fflas/fflas_fgemm/Makefile
fflas-ffpack/fflas/fflas_sparse/Makefile
fflas-ffpack/fflas/fflas_sparse/coo/Makefile
fflas-ffpack/fflas/fflas_sparse/csr/Makefile
fflas-ffpack/fflas/fflas_sparse/ell/Makefile
fflas-ffpack/fflas/fflas_sparse/ell_simd/Makefile
fflas-ffpack/fflas/fflas_sparse/csr_hyb/Makefile
fflas-ffpack/fflas/fflas_sparse/sell/Makefile
fflas-ffpack/fflas/fflas_sparse/hyb_zo/Makefile
fflas-ffpack/fflas/fflas_igemm/Makefile
fflas-ffpack/fflas/fflas_simd/Makefile
fflas-ffpack/ffpack/Makefile
fflas-ffpack/field/Makefile
fflas-ffpack/utils/Makefile
fflas-ffpack/paladin/Makefile
fflas-ffpack/interfaces/Makefile
fflas-ffpack/interfaces/libs/Makefile
fflas-ffpack/checkers/Makefile
autotune/Makefile
doc/Makefile
tests/Makefile
tests/data/Makefile
benchmarks/Makefile
examples/Makefile
tutorials/Makefile
fflas-ffpack.pc
],[chmod +x fflas-ffpack-config])
AC_OUTPUT
echo "" > fflas-ffpack/fflas-ffpack-thresholds.h