forked from emgertz/OOQP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
123 lines (101 loc) · 2.85 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([src/Abstract/Data.C])
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_TARGET
if test "$srcdir" = .; then
ooqp_src=src
else
ooqp_src="$srcdir/src"
fi
AC_SUBST(ooqp_src)
dnl Checks for programs.
AC_PROG_INSTALL
dnl Use native cc first
if test -z "$CC"; then
AC_CHECK_PROG(CC,cc,cc)
fi
dnl And optimize, unless told otherwise
if test -z "$CFLAGS"; then CFLAGS=-O; fi
AC_PROG_CC
dnl Use native CC first
if test -z "$CXX"; then
AC_CHECK_PROG(CXX,CC,CC)
fi
dnl And optimize, unless told otherwise
if test -z "$CXXFLAGS"; then CXXFLAGS=-O; fi
AC_PROG_CXX
AC_ARG_WITH(fortran, [--with-fortran: use a FORTRAN compiler (instead of
f2c],,
with_fortran=yes )
if test "$with_fortran" != "yes"; then
dnl Any compilitions of fortran files will fail
FC=false
F77=false
dnl We cannot test the libraries and so just assume they are Ok
if test -z "$FLIBS"; then
FLIBS=libf2c.a
fi
else
dnl If FC is set, but F77 is not, assume that FC points to the F77
dnl compiler.
if test -z "$F77"; then
if test -n "$FC"; then
F77="$FC"
export F77
fi
fi
dnl Optimize, unless told otherwise
if test -z "$FFLAGS"; then FFLAGS=-O; fi
AC_PROG_F77
dnl Checks for libraries.
AC_F77_LIBRARY_LDFLAGS
fi
dnl End of --with-fortran
if test -z "$BLAS"; then
AC_MSG_WARN([BLAS environment variable was not set. Defaulting to '-lblas -llapack'.])
BLAS='-lblas -llapack'
fi
AC_SUBST(BLAS)
if test -z "$MA27LIB"; then
AC_MSG_WARN([MA27LIB environment variable was not set.])
AC_MSG_WARN([Defaulting to libma27.a])
MA27LIB=libma27.a
fi
AC_SUBST(MA27LIB)
if test -z "$MA57LIB"; then
AC_MSG_WARN([MA57LIB environment variable was not set.])
AC_MSG_WARN([Defaulting to 'libma57.a libfakemetis.a'.])
MA57LIB='libma57.a libfakemetis.a'
fi
AC_SUBST(MA57LIB)
AC_LANG([C++])
AC_PROG_RANLIB
AC_LANG([C++])
dnl Checks for header files.
AC_SUBST(INCLUDES)
AC_HEADER_STDC
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_CHECK_FUNCS(getrusage)
dnl Checks for Petsc version
if test ! -d "$PETSC_DIR"; then
petsc_enabled='no # Petsc support has been disabled'
AC_MSG_WARN([Petsc support has been disabled.])
AC_MSG_WARN([If you intend to use Petsc, set PETSC_DIR and])
AC_MSG_WARN([PETSC_ARCH and run configure again.])
else
petsc_enabled='yes'
if test -f $PETSC_DIR/bmake/common/variables; then
dnl This is a new version of Petsc!
petsc_common_variables='${PETSC_DIR}/bmake/common/variables'
else
petsc_common_variables='${PETSC_DIR}/bmake/${PETSC_ARCH}/base_variables'
fi
fi
AC_SUBST(petsc_enabled)
AC_SUBST(petsc_common_variables)
AC_SUBST(PETSC_DIR)
AC_CONFIG_SUBDIRS(src/Mex src/Ampl)
AC_CONFIG_FILES([GNUmakefile PetscMakefile])
AC_OUTPUT