-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
171 lines (156 loc) · 4.42 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
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
# information on the package
AC_INIT([PCx], [1.1],,[http://pages.cs.wisc.edu/~swright/PCx/])
# Uncompress files in mps folder
echo "Uncompress files in mps folder. It will take some minutes."
cd mps
for f in `ls *.bz2`; do
if test ! -e ${f/\.bz2/}; then
echo " Uncompress $f."
bunzip2 -c $f > ${f/\.bz2/}
fi
done
cd ..
# Get the machine's PCx environmental variable, PCx_ARCH.
#
# It was copied from the PETSc package
# http://www.mcs.anl.gov/petsc/petsc.html
if test -e /bin/uname; then
PCx_ARCH=`/bin/uname -s`
if test "$PCx_ARCH" == "AIX"; then
PCx_ARCH="rs6000"
elif test "$PCx_ARCH" == "HP-UX"; then
PCx_ARCH="hpux"
elif test "$PCx_ARCH" == "Linux"; then
PCx_ARCH="linux"
elif test "$PCx_ARCH" == "FreeBSD"; then
PCx_ARCH="freebsd"
elif test "$PCx_ARCH" != "IRIX" && "$PCx_ARCH" != "IRIX64"; then
PCx_ARCH=`/bin/uname -m`
fi
elif test -e /usr/bin/uname; then
PCx_ARCH=`/usr/bin/uname`
if test "$PCx_ARCH" == "FreeBSD"; then
PCx_ARCH="freebsd"
else
echo "Unable to determine machines architecture"
PCx_ARCH="unknown"
fi
else
echo "Unable to determine machines architecture"
PCx_ARCH="unknown"
fi
SunOSTest=`expr "$PCx_ARCH" : "\(....\)"`
if test "$SunOSTest" == "sun4"; then
PCx_ARCH=sun4
Version=`/bin/uname -r`
MajorVersion=`expr "$Version" : "\(.\)"`
if test "$MajorVersion" == 5; then
PCx_ARCH="solaris"
fi
elif test "$PCx_ARCH" == "AIX"; then
PCx_ARCH="rs6000"
elif test "$PCx_ARCH" == "RIOS"; then
PCx_ARCH="rs6000"
elif test "$PCx_ARCH" == "sun4m"; then
PCx_ARCH="sun4"
elif test "$PCx_ARCH" == "iris4d"; then
PCx_ARCH="IRIX"
elif test "$PCx_ARCH" == "Linux"; then
PCx_ARCH="linux"
elif test "$PCx_ARCH" == "CRAY Y-MP"; then
PCx_ARCH="t3d"
fi
AC_SUBST(PCx_ARCH)
# Configure the Cholesky solver
echo 'Cheking for IBM WSSMP Cholesky solver';
if test -z "$WSSMP_LIB"; then
if test -f wssmp/libwssmpp2.a; then
WSSMP_LIB=../wssmp/libwssmpp2.a
echo 'WSSMP library found. Using `../wssmp/libwssmpp2.a`';
else
if test -f wssmp/libwssmp.a; then
WSSMP_LIB=../wssmp/libwssmp.a;
echo 'WSSMP library found. Using `../wssmp/libwssmp.a`';
else
echo 'WSSMP library not found in ./wssmp/';
fi
fi
fi
AC_SUBST(WSSMP_LIB)
echo 'Checking for Ng Peyton Cholesky solver';
if test -z "$NG_LIB"; then
if test -d Ng-Peyton; then
NG_LIB=../Ng-Peyton/cholesky.a
echo "Ng-Peyton found";
else
echo "No directory ./Ng-Peyton";
fi
fi
AC_SUBST(NG_LIB)
echo 'Checking for user-supplied solver';
if test ! -f ./SRC/mysolver.c; then
echo 'File ./SRC/mysolver.c not present';
fi
if test ! -f ./mysolver/libmysolver.a; then
echo 'Library ./mysolver/libmysolver.a not present';
fi
echo 'Checking for the Matlab Interface';
if test -z "$NG_LIB" ; then
echo "The Matlab Interface depends of Ng Peyton Cholesky solver";
fi
# Configure target dir
TARGETDIR=.
AC_SUBST(TARGETDIR)
# Library
AC_CONFIG_MACRO_DIR([m4])
AM_DISABLE_SHARED
AM_PROG_LIBTOOL
# More options
AC_ARG_ENABLE([warnings],
AS_HELP_STRING([--disable-warnings], [Disable warnings]),
[CFLAGS="";
FCFLAGS=""],
[CFLAGS="-Wall ";
FCFLAGS="-Wall "])
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [Enable debug features]),
[CFLAGS+="-g -O0 -DDEBUG ";
FCFLAGS+="-g -O0 "],
[CFLAGS+="-O3 ";
FCFLAGS+="-O3 "])
AC_ARG_ENABLE([profile],
AS_HELP_STRING([--enable-profile], [Enable profile features]),
[CFLAGS+="-pg ";
FCFLAGS+="-pg "],
[])
AC_ARG_ENABLE([timing],
AS_HELP_STRING([--enable-timing], [Enable full native timing profile in log file]),
[CFLAGS+="-DTIMING_PROFILE "],
[])
AC_ARG_ENABLE([verbose],
AS_HELP_STRING([--enable-verbose], [Enable verbose features]),
[CFLAGS+="-DPREPROCESS_VERBOSE "],
[])
AC_ARG_VAR(DECIMAL_WIDTH,
Width of the decimal part of time in log (no more than 6))
DECIMAL_WIDTH=${DECIMAL_WIDTH-6}
echo $DECIMAL_WIDTH
CFLAGS+="-DDECIMAL_WIDTH=$DECIMAL_WIDTH "
#AC_SUBST(DECIMAL_WIDTH)
# Checks for programs
echo "Testing for a C compiler"
# Since we need '-z muldefs' we will prefer gcc
AC_PROG_CC([gcc])
echo "Testing for a FORTRAN compiler"
# We need gfortran since f77 didn't support '-z muldefs'
AC_PROG_FC([gfortran])
# Checks for libraries
# Checks for header files
# Checks for types
# Checks for structures
# Checks for compiler characteristics
# Checks for library functions
# Checks for system
# Services
AC_CONFIG_FILES([Makefile Ng-Peyton/Makefile SRC/Makefile])
AC_OUTPUT