source: trunk/configure.ac @ 922

Last change on this file since 922 was 922, checked in by Jari Häkkinen, 14 years ago

Fixes #190. configure now checks for quite Nan. Check for this removed in test program.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id: configure.ac 922 2007-10-01 18:22:52Z jari $
4
5# Copyright (C) 2003 Daniel Dalevi, Jari Häkkinen
6# Copyright (C) 2004 Jari Häkkinen
7# Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson
8#
9# This file is part of the yat library, http://trac.thep.lu.se/trac/yat
10#
11# The yat library is free software; you can redistribute it
12# and/or modify it under the terms of the GNU General Public License as
13# published by the Free Software Foundation; either version 2 of the
14# License, or (at your option) any later version.
15#
16# The yat library is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19# General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24# 02111-1307, USA.
25#
26# Developers search for FIXME
27#
28# If you grabbed the source from CVS you should, at top-level, execute:
29# ./bootstrap
30# or maybe one should use autoreconf! FIXME: Can the 'bootstrap'
31# script be replaced with autoreconf?
32
33AC_PREREQ(2.57)
34AC_INIT([[yat]],[0.4pre],[jari@thep.lu.se])
35AC_CONFIG_SRCDIR([yat/utility/matrix.h])
36AC_CONFIG_AUX_DIR([autotools])
37AC_PREFIX_DEFAULT([/usr/local])
38
39AM_CONFIG_HEADER([config.h])
40AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION,$PACKAGE_BUGREPORT)
41
42# Set default programming language
43AC_LANG(C++)
44
45# Checks for programs.
46AC_PROG_CXX
47AC_PROG_INSTALL
48
49# Checks for libraries.
50
51# Checks for header files.
52AC_CHECK_HEADERS([unistd.h])
53
54# Checks for typedefs, structures, and compiler characteristics.
55AC_HEADER_STDBOOL
56AC_C_CONST
57AC_C_INLINE
58AC_TYPE_SIZE_T
59
60# Checks for library functions.
61AC_PROG_LIBTOOL
62AC_FUNC_ERROR_AT_LINE
63AC_HEADER_STDC
64AC_CHECK_FUNCS([pow sqrt])
65
66CXXFLAGS="-Wall -pedantic"
67CPPFLAGS="-DHAVE_INLINE=1"
68AC_ARG_ENABLE(debug,
69  [AS_HELP_STRING([--enable-debug],[turn on debug options and code])])
70if test "${enable_debug}" = "yes" ; then
71  CXXFLAGS="$CXXFLAGS -g -O"
72  CPPFLAGS="$CPPFLAGS -DYAT_DEBUG=1"
73else
74  CXXFLAGS="$CXXFLAGS -O3"
75  CPPFLAGS="$CPPFLAGS -DNDEBUG -DGSL_RANGE_CHECK_OFF"
76fi
77
78AC_CHECK_LIB(m,main,[MATH_LIB="-lm" LIBS="-lm $LIBS"])
79AC_CHECK_LIB(atlas,ATL_ctrsv,
80  [CBLAS_LIB="-lcblas -latlas"],
81  AC_CHECK_LIB(gslcblas,cblas_sdsdot, \
82    [CBLAS_LIB="-lgslcblas" LIBS="-lgslcblas $LIBS"]))
83AC_CHECK_LIB(gsl,main,[GSL_LIB="-lgsl"])
84AC_SUBST(GSL_LIB)
85AC_SUBST(CBLAS_LIB)
86AC_SUBST(MATH_LIB)
87
88# check for quiet_NaN support in OS
89AC_MSG_CHECKING([for std::numeric_limits<>::quiet_NaN()])
90AC_COMPILE_IFELSE(
91  [AC_LANG_PROGRAM(
92    [#include <limits>
93     extern void f(double);],
94    [f(std::numeric_limits<double>::quiet_NaN())])],
95  [quiet_nan=yes],
96  [quiet_nan=no])
97AC_MSG_RESULT($quiet_nan)
98if test "${quiet_nan}" = "no" ; then
99  AC_MSG_FAILURE([
100    Support for quiet NAN required.
101    Yat will not work on this system!])
102fi
103
104# yat specific settings
105YAT_LIB="libyat.la"
106YAT_LIB_LOCATION="yat"
107AC_SUBST(YAT_LIB)
108AC_SUBST(YAT_LIB_LOCATION)
109
110AC_CONFIG_FILES([Makefile
111     doc/Makefile
112     test/Makefile
113     test/data/Makefile
114     yat/Makefile
115     yat/classifier/Makefile
116     yat/random/Makefile
117     yat/regression/Makefile
118     yat/statistics/Makefile
119     yat/utility/Makefile])
120
121AC_OUTPUT
122
123# Some more messages.
124AC_MSG_NOTICE([])
125AC_MSG_NOTICE([ Ready to compile the yat library])
126AC_MSG_NOTICE([ The following compilers and flags will be used:])
127AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++])
128AC_MSG_NOTICE([  CPPFLAGS=\"$CPPFLAGS\"])
129AC_MSG_NOTICE([  CXXFLAGS=\"$CXXFLAGS\"])
130AC_MSG_NOTICE([  LIBS=\"$LIBS\"])
131AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++])
132AC_MSG_NOTICE([])
133AC_MSG_NOTICE([ Now type 'make ; make check'.])
Note: See TracBrowser for help on using the repository browser.