summaryrefslogtreecommitdiff
path: root/src/configure.ac
blob: f0c5ca0c18d00bd50e8097ac52f14689faedccd1 (plain)
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
##
##  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
##  Copyright (C) 2007-2008 - INRIA - Bruno JOFRET
##
##  This file must be used under the terms of the CeCILL.
##  This source file is licensed as described in the file COPYING, which
##  you should have received as part of this distribution.  The terms
##  are also available at
##  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
##
##

AC_INIT([sci2cLibrary],[0.1],[])
AC_CONFIG_AUX_DIR(config)
AC_PREREQ(2.55)

RM='rm -f'
SCIDIR=$srcdir
SCIDIRFULL=`cd $SCIDIR && pwd`

AC_CONFIG_HEADERS([includes/machine.h])


AM_PROG_INSTALL_STRIP
AC_PROG_LN_S
#AC_PACKAGE_VERSION([4.0])

AC_CANONICAL_HOST

AM_MAINTAINER_MODE
AM_INIT_AUTOMAKE([-Wall foreign]) # Not using -Werror because we override {C,F}FLAGS in order to disable optimisation

### LibTool
AC_PROG_LIBTOOL
### Fortran Compiler
AC_PROG_F77
### C Compiler
AC_PROG_CC
### C++ Compiler
AC_PROG_CXX

# for "subdir-objects"
AM_PROG_CC_C_O
AC_PROG_F77_C_O

### Need to check for math lib and symbols
AC_SEARCH_LIBS(atan, m, LIBMATH="-lm")
AC_SUBST(LIBMATH)


#################################
## all the --with-* argument help
#################################
AC_ARG_WITH(stdc99,
   AC_HELP_STRING([--with-stdc99],[Enable standard C99 (Used in complex implementation)]))
if test "$with_stdc99" = yes; then
   AC_CHECK_HEADERS([complex.h])
   CFLAGS="$CFLAGS -std=c99"
fi

AC_ARG_WITH(blas,
   AC_HELP_STRING([--with-blas],[Enable call to blas library (Used in matrix operations)]))
if test "$with_blas" = no; then
   CFLAGS="$CFLAGS -DWITHOUT_BLAS"
fi

AC_ARG_ENABLE(debug,
   AC_HELP_STRING([--enable-debug],[Use verbose messages through compilation process]))
if test "$enable_debug" = yes; then
   CFLAGS="$CFLAGS -Wall -Wextra -pedantic -Wconversion -Wformat -Wshadow \
   -Wpointer-arith -Wcast-align -Wmissing-prototypes \
   -Wmissing-declarations"
fi

AC_ARG_ENABLE(stopOnWarning,
   AC_HELP_STRING([--enable-stop-on-warning],[Stop the compilation on the first warning found in the C/C++ code]))
if test "$enable_stop_on_warning" = yes; then
   CFLAGS="$CFLAGS -Werror"
fi

###########�FORTRAN FLAGS ######################

######################
######## With F77 / G77 / GFortran ...
######################

if test -n "$F77"; then
	  FFLAGS="$FFLAGS -g -Wall "
fi

###########�C FLAGS ######################

######################
######## With GCC ...
######################
if test "$CC" = "gcc"; then
     CFLAGS="$CFLAGS"
     # used to be -O
     # -D_FORTIFY_SOURCE=2
else
		## CC compiler (not GCC)
		     CFLAGS="-g"
fi


##############################################################
## test for functions in standard C library and C math library
##############################################################

# Provided by math.h
#AC_CHECK_FUNCS([pow] [sqrt] [finite] [floor])

#AC_CHECK_FUNC([exp10],,[
#				AC_DEFINE([log_10_],[2.3025850929940456840179914546844],[Provide a macro to do exp10])
#				AC_DEFINE([exp10(x)],[exp( (log_10_) * (x) )],[Provide a macro to do exp10])
#				])

########################
## test for header files
########################

AC_HEADER_STDBOOL

#################
## FFTW
#################

AC_ARG_WITH(fftw,
    [  --with-fftw	           compile with the FFTW 3 library ])
if test "$with_fftw" = yes; then
  # AC_FFTW()
  echo
fi

#################
## atlas
#################

# check user arguments
USER_ATLAS_LIB_PATH=""

AC_ARG_WITH(atlas-library,
     [  --with-atlas-library=DIR  Atlas library files are in DIR and we use Atlas ],
     [  USER_ATLAS_LIB_PATH=$withval
     CC_OPTIONS="$CC_OPTIONS -DWITH_ATLAS"],
     )
if test "$USER_ATLAS_LIB_PATH" = ""; then
	WHICH_BLAS="STD_BLAS"
 	IN_ATLAS=LOCAL
else
 	echo "Using Atlas library"
 	WHICH_BLAS="ATLAS_LAPACKBLAS"
 	ATLAS_DIR=$USER_ATLAS_LIB_PATH
 	IN_ATLAS=ATLAS
 	AC_DEFINE([WITH_ATLAS],[],[With the Atlas Lib])
fi

#######################
###### Creation of the header file (machine.h)
#######################

AC_CONFIG_FILES([
Makefile
lib/blas/Makefile
lib/lapack/Makefile
type/Makefile
matrixOperations/Makefile
matrixOperations/addition/Makefile
matrixOperations/subtraction/Makefile
matrixOperations/multiplication/Makefile
matrixOperations/cat/Makefile
implicitList/Makefile
elementaryFunctions/Makefile
elementaryFunctions/cos/Makefile
elementaryFunctions/cosh/Makefile
elementaryFunctions/acos/Makefile
elementaryFunctions/acosh/Makefile
elementaryFunctions/sin/Makefile
elementaryFunctions/sinh/Makefile
elementaryFunctions/asin/Makefile
elementaryFunctions/asinh/Makefile
elementaryFunctions/tan/Makefile
elementaryFunctions/tanh/Makefile
elementaryFunctions/atan/Makefile
elementaryFunctions/atanh/Makefile
elementaryFunctions/log/Makefile
elementaryFunctions/log1p/Makefile
elementaryFunctions/log10/Makefile
elementaryFunctions/exp/Makefile
elementaryFunctions/exp10/Makefile
elementaryFunctions/sqrt/Makefile
elementaryFunctions/lnp1m1/Makefile
elementaryFunctions/pow/Makefile
auxiliaryFunctions/Makefile
auxiliaryFunctions/abs/Makefile
auxiliaryFunctions/find/Makefile
auxiliaryFunctions/isempty/Makefile
auxiliaryFunctions/isnan/Makefile
auxiliaryFunctions/rand/Makefile
auxiliaryFunctions/sign/Makefile
auxiliaryFunctions/size/Makefile
auxiliaryFunctions/length/Makefile
auxiliaryFunctions/type/Makefile
auxiliaryFunctions/pythag/Makefile
statisticsFunctions/Makefile
statisticsFunctions/mean/Makefile
statisticsFunctions/sum/Makefile
])


AC_OUTPUT

echo ""

echo "Sci2C is configured as follows. Please verify that this configuration"
echo "matches your expectations."
echo ""
echo "Host system type : $host"
echo ""
echo "                  Option                        Value"
echo "-------------------------------------------------------------------------"
echo "Options:"
echo "Atlas library (--with-atlas-library) ............ : $USER_ATLAS_LIB_PATH"
echo "Use FFTW (--with-fftw) .......................... : $with_fftw"

echo ""

echo ""
echo "Options used to compile and link:"
echo "  PREFIX           = $PREFIX_DIR"
echo "  EXEC-PREFIX      = $EXEC_PREFIX_DIR"
echo "  CC               = $CC"
echo "  CFLAGS           = $CFLAGS"
#echo "  CPP              = $CPP"
#echo "  CPPFLAGS         = $CPPFLAGS"
echo "  PCFLAGS          = $PCFLAGS"
echo "  DEFS             = $DEFS"
echo "  LD               = $LD"
echo "  LDFLAGS          = $LDFLAGS"
echo "  LIBS             = $LIBS"
echo "  LIBMATH          = $LIBMATH"
echo "  CXX              = $CXX"
echo "  CXXFLAGS         = $CXXFLAGS"
echo "  F77              = $F77"
echo "  FFLAGS           = $FFLAGS"
echo "  F77_LDFLAGS      = $F77_LDFLAGS"
echo ""