source: trunk/configure.ac @ 923

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

Changed references to CVS to refer to subversion. Moved FIXME items to the ticketing system.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id: configure.ac 923 2007-10-01 18:29:35Z 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# If you grabbed the source from the subversion repository you should,
27# at top-level, execute:
28#     ./bootstrap
29
30AC_PREREQ(2.57)
31AC_INIT([[yat]],[0.4pre],[jari@thep.lu.se])
32AC_CONFIG_SRCDIR([yat/utility/matrix.h])
33AC_CONFIG_AUX_DIR([autotools])
34AC_PREFIX_DEFAULT([/usr/local])
35
36AM_CONFIG_HEADER([config.h])
37AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION,$PACKAGE_BUGREPORT)
38
39# Set default programming language
40AC_LANG(C++)
41
42# Checks for programs.
43AC_PROG_CXX
44AC_PROG_INSTALL
45
46# Checks for libraries.
47
48# Checks for header files.
49AC_CHECK_HEADERS([unistd.h])
50
51# Checks for typedefs, structures, and compiler characteristics.
52AC_HEADER_STDBOOL
53AC_C_CONST
54AC_C_INLINE
55AC_TYPE_SIZE_T
56
57# Checks for library functions.
58AC_PROG_LIBTOOL
59AC_FUNC_ERROR_AT_LINE
60AC_HEADER_STDC
61AC_CHECK_FUNCS([pow sqrt])
62
63CXXFLAGS="-Wall -pedantic"
64CPPFLAGS="-DHAVE_INLINE=1"
65AC_ARG_ENABLE(debug,
66  [AS_HELP_STRING([--enable-debug],[turn on debug options and code])])
67if test "${enable_debug}" = "yes" ; then
68  CXXFLAGS="$CXXFLAGS -g -O"
69  CPPFLAGS="$CPPFLAGS -DYAT_DEBUG=1"
70else
71  CXXFLAGS="$CXXFLAGS -O3"
72  CPPFLAGS="$CPPFLAGS -DNDEBUG -DGSL_RANGE_CHECK_OFF"
73fi
74
75AC_CHECK_LIB(m,main,[MATH_LIB="-lm" LIBS="-lm $LIBS"])
76AC_CHECK_LIB(atlas,ATL_ctrsv,
77  [CBLAS_LIB="-lcblas -latlas"],
78  AC_CHECK_LIB(gslcblas,cblas_sdsdot, \
79    [CBLAS_LIB="-lgslcblas" LIBS="-lgslcblas $LIBS"]))
80AC_CHECK_LIB(gsl,main,[GSL_LIB="-lgsl"])
81AC_SUBST(GSL_LIB)
82AC_SUBST(CBLAS_LIB)
83AC_SUBST(MATH_LIB)
84
85# check for quiet_NaN support in OS
86AC_MSG_CHECKING([for std::numeric_limits<>::quiet_NaN()])
87AC_COMPILE_IFELSE(
88  [AC_LANG_PROGRAM(
89    [#include <limits>
90     extern void f(double);],
91    [f(std::numeric_limits<double>::quiet_NaN())])],
92  [quiet_nan=yes],
93  [quiet_nan=no])
94AC_MSG_RESULT($quiet_nan)
95if test "${quiet_nan}" = "no" ; then
96  AC_MSG_FAILURE([
97    Support for quiet NAN required.
98    Yat will not work on this system!])
99fi
100
101# yat specific settings
102YAT_LIB="libyat.la"
103YAT_LIB_LOCATION="yat"
104AC_SUBST(YAT_LIB)
105AC_SUBST(YAT_LIB_LOCATION)
106
107AC_CONFIG_FILES([Makefile
108     doc/Makefile
109     test/Makefile
110     test/data/Makefile
111     yat/Makefile
112     yat/classifier/Makefile
113     yat/random/Makefile
114     yat/regression/Makefile
115     yat/statistics/Makefile
116     yat/utility/Makefile])
117
118AC_OUTPUT
119
120# Some more messages.
121AC_MSG_NOTICE([])
122AC_MSG_NOTICE([ Ready to compile the yat library])
123AC_MSG_NOTICE([ The following compilers and flags will be used:])
124AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++])
125AC_MSG_NOTICE([  CPPFLAGS=\"$CPPFLAGS\"])
126AC_MSG_NOTICE([  CXXFLAGS=\"$CXXFLAGS\"])
127AC_MSG_NOTICE([  LIBS=\"$LIBS\"])
128AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++])
129AC_MSG_NOTICE([])
130AC_MSG_NOTICE([ Now type 'make ; make check'.])
Note: See TracBrowser for help on using the repository browser.