source: pcp/configure.ac@ 60a9f9

Last change on this file since 60a9f9 was a0bcf1, checked in by Frederik Heber <heber@…>, 17 years ago

-initial commit
-Minimum set of files needed from ESPACK SVN repository
-Switch to three tantamount package parts instead of all relating to pcp (as at some time Ralf's might find inclusion as well)

  • Property mode set to 100644
File size: 5.6 KB
Line 
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT([ElectronicStructurePACKage], 1.1, heber@ins.uni-bonn.de, ESPACK)
6AC_CONFIG_AUX_DIR([config])
7AC_CONFIG_SRCDIR([src/pcp.c])
8AC_CONFIG_HEADER([config.h])
9
10AM_INIT_AUTOMAKE(dist-bzip2)
11
12AC_CANONICAL_HOST
13
14# Checks for programs.
15AC_PROG_CC
16AC_PROG_CXX
17AC_PATH_PROG([PERL],[perl])
18AC_PATH_PROG([TAR],[tar])
19AM_MISSING_PROG([DOXYGEN], [doxygen])
20
21dnl Check for MPI-Routines
22AC_ARG_ENABLE([mpi],
23 AS_HELP_STRING([--enable-mpi],[build MPI parallel version (default is yes if MPI code can be compiled)]),
24 [enable_mpi=$enableval], [enable_mpi=maybe])
25disabled_msg="MPI version disabled."
26if test x"$enable_mpi" = xyes -o x"$enable_mpi" = xmaybe
27then
28 AC_MSG_NOTICE([checking for MPI features])
29 ACX_MPI([enable_mpi=yes
30 CC=mpicc
31 CXX=mpicxx],
32 [err_msg="cannot find out how to compile MPI code."
33 if test x"$enable_mpi" = xyes
34 then
35 AC_MSG_ERROR([$err_msg])
36 else
37 AC_MSG_WARN([$err_msg $disabled_msg])
38 enable_mpi=no
39 fi])
40else
41 AC_MSG_NOTICE([$disabled_msg])
42fi
43#AC_ARG_VAR([MPILIBS],[necessary libraries to link MPI C code])
44AM_CONDITIONAL([MPIVER], [test x"$enable_mpi" = xyes])
45
46# Checks for typedefs, structures, and compiler characteristics.
47AC_TYPE_PID_T
48AC_TYPE_SIZE_T
49AC_TYPE_SIGNAL
50
51AC_C_CONST
52AC_C_INLINE
53AC_C_VOLATILE
54AC_C_RESTRICT
55
56# Checks for library functions.
57# use when adapted: AC_CHECK_FUNCS([floor ftruncate memmove memset mkdir modf pow realpath sqrt strchr strdup strerror strrchr strstr strtol statfs],[],[AC_MSG_WARN([Some functions not found. Compile may fail. Alternate methods may need to be implemented.])])
58AC_FUNC_MALLOC
59AC_FUNC_REALLOC
60AC_TYPE_SIGNAL
61
62# Checks for fftw libraries and find out version.
63AC_CHECK_LIB(m, sqrt, ,AC_MSG_ERROR([compatible libc math library not found]))
64AC_CHECK_FUNCS([alarm atexit floor pow sqrt strchr uname strstr strrchr])
65FFTW=notfound
66RFFTW=notfound
67AC_ARG_ENABLE([fftw],
68 AS_HELP_STRING([--enable-fftw],[build FFTW-2 version (default is yes if fftw2 code can be compiled)]),
69 [enable_fftw=$enableval], [enable_fftw=maybe])
70AC_ARG_ENABLE([dfftw],
71 AS_HELP_STRING([--enable-dfftw],[build double fftw2 version (default is fftw2)]),
72 [enable_dfftw=$enableval], [enable_dfftw=maybe])
73AC_ARG_ENABLE([fftw3],
74 AS_HELP_STRING([--enable-fftw3],[build FFTW-3 version (default is fftw2)]),
75 [enable_fftw3=$enableval], [enable_fftw3=maybe])
76
77# debugging info
78AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Output debugging information (default is no)]),
79 [enable_debug=$enableval], [enable_debug=maybe])
80if test x"$enable_debug" = xyes; then
81 AC_DEFINE(HAVE_DEBUG,1, ["Output debugging info"])
82 AC_SUBST(HAVE_DEBUG)
83fi
84
85# add replacement/saturation hydrogen or not
86AC_ARG_ENABLE([hydrogen],AS_HELP_STRING([--enable-hydrogen],[Adding saturation hydrogen (default is yes)]),
87 [enable_hydrogen=$enableval], [enable_hydrogen=yes])
88if test x"$enable_hydrogen" = xyes; then
89 AC_DEFINE(ADDHYDROGEN,1, ["Adding saturation hydrogen"])
90 AC_SUBST(ADDHYDROGEN)
91fi
92
93# Checks for header files.
94AC_HEADER_STDC
95AC_CHECK_HEADERS([sys/time.h unistd.h float.h stddef.h])
96AC_HEADER_STDBOOL
97
98# check for fftw headers and subsequently for libs
99# if FFTW=.. set on success condition, -l... is not appended
100# .._HEADER doesn't show up in configh.h, .._HEADERS does!
101FFTW=notfound
102if test x"$FFTW" = xnotfound -o x"$enable_fftw" = xyes; then
103 FFTW=FFTW
104 AC_CHECK_HEADERS(fftw.h,
105 [AC_CHECK_LIB(fftw, fftw_create_plan, , [FFTW=notfound], -lfftw)],
106 [FFTW=notfound]
107 )
108
109 AC_CHECK_HEADERS(rfftw.h,
110 [AC_CHECK_LIB(rfftw, rfftw_create_plan, , [FFTW=notfound],-lrfftw)],
111 [FFTW=notfound]
112 )
113fi
114if test x"$FFTW" = xnotfound -o x"$enable_dfftw" = xyes; then
115 FFTW=DFFTW
116 AC_CHECK_HEADERS(dfftw.h,
117 [AC_CHECK_LIB(dfftw, fftw_create_plan, , [FFTW=notfound],-ldfftw)],
118 [FFTW=notfound]
119 )
120
121 AC_CHECK_HEADERS(drfftw.h,
122 [AC_CHECK_LIB(drfftw, rfftw_create_plan, , [FFTW=notfound],-ldrfftw)],
123 [FFTW=notfound]
124 )
125fi
126if test x"$FFTW" = xnotfound -o x"$enable_fftw3" = xyes; then
127 FFTW=FFTW3
128 AC_CHECK_HEADERS(fftw3.h,
129 [AC_CHECK_LIB(fftw3, fftw_create_plan, , [FFTW=notfound],-lfftw3)],
130 [FFTW=notfound]
131 )
132fi
133# warn if not found
134if test x"$FFTW" = xnotfound; then
135 AC_MSG_WARN(["Missing lib(d)fftw(3) and/or lib(d)rfftw(3).\nIf exist but not in LD_.._PATH, use export LDFLAGS=-L.."])
136 AC_MSG_WARN(["Or missing header (d)fftw(3).h and/or (d)rfftw.h\nIf exist but not in PATH, use export CFLAGS=-I.."])
137fi
138# check for GNU Scientific Library
139#AC_CHECK_LIB(m,main)
140AC_CHECK_LIB(gslcblas,main)
141AC_CHECK_LIB(gsl,main)
142
143dnl Check for "extern inline", using a modified version
144dnl of the test for AC_C_INLINE from acspecific.mt
145dnl
146AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
147[ac_cv_c_extern_inline=no
148AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
149extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
150double foo (double x) { return x + 1.0; };],
151[ foo(1.0) ],
152[ac_cv_c_extern_inline="yes"])
153])
154
155if test "$ac_cv_c_inline" != no ; then
156 AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
157 AC_SUBST(HAVE_INLINE)
158fi
159
160AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])
161AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.