-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathconfigure.ac.1
174 lines (147 loc) · 5.43 KB
/
configure.ac.1
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
AC_INIT([opencalphad], [master], [[email protected]], [opencalphad])
### minimum version of autoconf :
AC_PREREQ(2.50)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([config])
dnl Initialize automake. automake < 1.12 didn't have serial-tests and
dnl gives an error if it sees this, but for automake >= 1.13
dnl serial-tests is required so we have to include it. Solution is to
dnl test for the version of automake (by running an external command)
dnl and provide it if necessary. Note we have to do this entirely using
dnl m4 macros since automake queries this macro by running
dnl 'autoconf --trace ...'.
m4_define([serial_tests], [
m4_esyscmd([automake --version |
head -1 |
awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}'])])
# Automake specific stuff
AM_INIT_AUTOMAKE(
foreign
dist-bzip2
tar-ustar
serial_tests)
### initializes canonical host variables: host, host_cpu, host_vendor and host_os
AC_CANONICAL_HOST
AC_PROG_MAKE_SET
AC_PROG_INSTALL
# Checks for programs.
# store current user given compiler flags to avoid default setup via AC_PROG_FC
#OLD_FFLAGS=$FFLAGS
#OLD_FCFLAGS=$FCFLAGS
# store current user given compiler flags to avoid default setup via AC_PROG_CXX
OLD_CXXFLAGS=$CXXFLAGS
AC_PROG_CXXCPP
AC_PROG_CXX
AC_PROG_FC([gfortran])
AC_LANG(Fortran)
AC_PROG_LIBTOOL
# reset compiler flags to initial flags
CXXFLAGS=$OLD_CXXFLAGS
#FFLAGS=$OLD_FFLAGS
#FCFLAGS=$OLD_FCFLAGS
dnl enable silent rules
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
dnl--------------------------------------------------------------------
dnl enable-debug for compilling with debug options (no by default)
dnl--------------------------------------------------------------------
AC_ARG_ENABLE([debug],
[ --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])
if test "x$debug" = "xtrue"
then
FCFLAGS=" -g -ggdb -fcheck=all -ffpe-trap=invalid,zero,overflow "
fi
dnl--------------------------------------------------------------------
dnl enable-openmp for compilling with openmp options (no by default)
dnl--------------------------------------------------------------------
AC_ARG_ENABLE([openmp],
[ --enable-openmp Turn on debugging],
[case "${enableval}" in
yes) openmp=true ;;
no) openmp=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-openmp]) ;;
esac],[openmp=false])
AM_CONDITIONAL([OPENMP], [test x$openmp = xtrue])
if test "x$openmp" = "xtrue"
then
AC_OPENMP
OPENMPLIB="$OPENMP_FCFLAGS"
AC_SUBST(OPENMPLIB)
if test "x$OPENMPLIB" != "x"
then
OPENMP_FFLAGS="$OPENMP_FCFLAGS"
fi
AC_SUBST(OPENMP_FFLAGS)
AC_SUBST(OPENMP_FCFLAGS)
fi
dnl--------------------------------------------------------------------
dnl with-python for compiling python wrapper
dnl--------------------------------------------------------------------
pyOC=no
AC_ARG_WITH(python,
AC_HELP_STRING([--with-python],[compile python wrapper]),
[],[withval="no"])
if test "x$withval" == "xyes" ; then
pyOC=yes
AM_PATH_PYTHON([3.6])
fi
AM_CONDITIONAL(WITH_PYTHON, test "x$pyOC" = "xyes")
dnl--------------------------------------------------------------------
dnl with-lapack for compiling with user lapack library
dnl--------------------------------------------------------------------
lapack=no
AC_ARG_WITH(lapack,
AC_HELP_STRING([--with-lapack],[compile with user lapack library)]),
[],[withval="no"])
if test "x$withval" == "xyes" ; then
lapack=yes
fi
AM_CONDITIONAL(WITH_LAPACK, test "x$lapack" = "xyes")
dnl--------------------------------------------------------------------
dnl with-ochelp for compiling with browser help on Linux, command line
dnl editing and open files
dnl--------------------------------------------------------------------
ocHelp=no
AC_ARG_WITH(ochelp,
AC_HELP_STRING([--with-ochelp],[compile with browser help on Linux]),
[],[withval="no"])
if test "x$withval" == "xyes" ; then
ocHelp=yes
fi
AM_CONDITIONAL(WITH_OCHELP, test "x$ocHelp" = "xyes")
dnl--------------------------------------------------------------------
dnl with-xplot for compiling with Gnuplot
dnl--------------------------------------------------------------------
xplot=no
AC_ARG_WITH(xplot,
AC_HELP_STRING([--with-xplot],[compile with Gnuplot]),
[],[withval="no"])
if test "x$withval" == "xyes" ; then
xplot=yes
fi
AM_CONDITIONAL(WITH_OCPLOT, test "x$xplot" = "xyes")
#####################################################################
# Generate configuration file envOC.sh to set environment for running
# tests directly from source and build directory
#####################################################################
echo '# This script is generated by configure' > envOC.sh
echo '# Use it to set environment for running from build dir' >> envOC.sh
BUILDDIR=`pwd`
echo "export BUILDDIR=$BUILDDIR" >> envOC.sh
SRCDIR=`dirname $0`
cd $SRCDIR && SRCDIR=`pwd` && cd $BUILDDIR
echo "export SRCDIR=$SRCDIR" >> envOC.sh
echo "export OPENCALPHAD_ROOT=$SRCDIR" >> envOC.sh
echo "export OCHOME=$SRCDIR/doc/manual/" >> envOC.sh
echo "" >> envOC.sh
echo 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BUILDDIR/src/.libs:$BUILDDIR/src/utilities/.libs:$BUILDDIR/src/numlib/.libs:$BUILDDIR/src/models/.libs:$BUILDDIR/.libs:$BUILDDIR/src/minimizer/.libs' >> envOC.sh
echo 'PATH=$BUILDDIR:$PATH' >> envOC.sh
echo "export PATH" >> envOC.sh
echo "" >> envOC.sh
###################
AC_CONFIG_FILES([
Makefile])