-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfigure.ac
143 lines (114 loc) · 3.75 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
AC_INIT([ApproxSVM], [1.0], [[email protected]],
[approxsvm],[https://github.com/claesenm/approxsvm/])
AC_CONFIG_SRCDIR([src/CLI.cpp])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign 1.5 no-define dist-bzip2 -Wall -Wno-portability subdir-objects])
#####
# BASIC CONFIGURATION
#####
# todo: make "-optimize" flag to enable "-O3 -march=native" and ATLAS/BLAS when available.
# todo: use static linking with -optimize!
####
# ATLAS: requires manual activation using --with-atlas
####
AC_CHECK_LIB([pthread],[main],[LIBS="-lpthread $LIBS"],[pthread_found=no])
AC_ARG_WITH([atlas],
[AS_HELP_STRING([--with-atlas],
[use ATLAS for matrix operations (overrides BLAS) @<:@default=no@:>@])],
[LIBS="-latlas -lpthread $LIBS"],
[with_atlas=no])
# todo: check for libpthread -> ptcblas in atlas
#[AC_SEARCH_LIBS([cblas_sdot], [ptcblas cblas],
LIBATLAS=
AS_IF([test "x$with_atlas" != xno],
[AC_SEARCH_LIBS([cblas_sdot], [cblas],
[AC_DEFINE([HAVE_LIBATLAS], [1], [Define if you have libatlas])],
[AC_MSG_FAILURE([--with-atlas was given, but test for atlas failed])],
[-latlas])
])
#LIBATLAS=
#AS_IF([test "x$with_atlas" != xno],
# [AC_CHECK_LIB([ptf77blas], [sdot_],
# [AC_DEFINE([HAVE_LIBATLAS], [1], [Define if you have libatlas])],
# [AC_MSG_FAILURE([--with-atlas was given, but test for atlas failed])],
# [])
#])
#LIBATLAS=
#AS_IF([test "x$with_atlas" != xno],
# [AC_CHECK_LIB([atlas], [ATL_sdot],
# [LIBS="-latlas $LIBS" #AC_SUBST([LIBATLAS], ["-latlas"])
# AC_DEFINE([HAVE_LIBATLAS], [1], [Define if you have libatlas])],
# [AC_MSG_FAILURE([--with-atlas was given, but test for atlas failed])],
# [])
#])
####
# BLAS: activated by default (when available) if ATLAS is not actived
####
AC_ARG_WITH([blas],
[AS_HELP_STRING([--with-blas],
[use BLAS for matrix operations @<:@default=check@:>@])],
[],
[with_blas=check])
#AS_IF([test "x$with_blas" != xno],
LIBBLAS=
AS_IF([test "x$with_atlas" == xno && test "x$with_blas" != xno],
[AC_CHECK_LIB([blas], [sdot_],
[LIBS="-lblas $LIBS" #AC_SUBST([LIBBLAS], ["-lblas"])
AC_DEFINE([HAVE_LIBBLAS], [1], [Define if you have libblas])],
[if test "x$with_blas" != xcheck; then
AC_MSG_FAILURE([--with-blas was given, but test for blas failed])
fi],
[])
])
# Library version, this is an LDFLAG for Libtool -version-info 0:0:0
# http://www.sourceware.org/autobook/autobook/autobook_91.html#SEC91
AC_SUBST([SHLIBVER],[0:0:0])
AC_SUBST([PACKAGE_VERSION])
####
# LIBTOOL STUFF
####
LT_INIT
AC_LIBOBJ
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRTOD
# Checks for header files.
AC_CHECK_HEADERS([float.h limits.h locale.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
# Check if we are working on Darwin
OS=shell uname
AM_CONDITIONAL(COMPILING_ON_DARWIN, [test x"$OS" = xDarwin])
# Extra flags
#AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [turn on debugging]),
#[case "${enableval}" in
# yes) debug=true ;;
# no) debug=false ;;
# *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
#esac],[debug=false])
#AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
#if test -z "$CXXFLAGS"; then
# CXXFLAGS=-O2
#fi
# Checks for library functions.
AC_CHECK_FUNCS([pow exp strtol strtoul strtof])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
# http://www.sourceware.org/autobook/autobook/autobook_86.html#SEC86
Xsed="sed -e s/^X//"
LTLIBOBJS=`echo X"$LIBOBJS"|\
[$Xsed -e "s,\.[^.]* ,.lo ,g;s,\.[^.]*$,.lo,"]`
AC_SUBST(LTLIBOBJS)
AC_OUTPUT