-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
161 lines (141 loc) · 3.79 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
# information on the package
AC_INIT([PCx], [1.1],,[http://pages.cs.wisc.edu/~swright/PCx/])
#AC_CONFIG_SRCDIR([src/foo.c])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([F2C/abort_.c])
#AC_CONFIG_HEADERS([config.h])
# 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 ..
#Compiling F2C
echo 'Checking for F2C Library';
if test -z "$F2C_LIB"; then
if test -d F2C; then
F2C_LIB=../F2C/libf2c.a
echo "F2C lib found";
else
echo "No directory ./F2C";
fi
fi
AC_SUBST(F2C_LIB)
# 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 /usr/bin/uname; then
PCx_ARCH=`/usr/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" == "Darwin"; then
PCx_ARCH="darwin"
elif test "$PCx_ARCH" != "IRIX" && "$PCx_ARCH" != "IRIX64"; then
PCx_ARCH=`/usr/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=`/usr/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"
elif test "$LARCH" == "Darwin" ; then
PCx_ARCH = "darwin"
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
# Checks for programs
echo "Testing for a C compiler"
AC_PROG_CC
#echo "Testing for a FORTRAN compiler"
#AC_PROG_FC
# 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 F2C/Makefile Ng-Peyton/Makefile SRC/Makefile])
AC_OUTPUT