aboutsummaryrefslogtreecommitdiff
path: root/libraries/KLU/autotoolize.diff
blob: 690e34a9ed7bec25df01a30ef372417a8cb1f816 (plain)
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
diff --git a/Demo/Makefile.am b/Demo/Makefile.am
new file mode 100644
--- /dev/null
+++ b/Demo/Makefile.am
@@ -0,0 +1,44 @@
+AM_CPPFLAGS = -I$(top_srcdir)/Include $(AMD_CFLAGS) $(BTF_CFLAGS) $(COLAMD_CFLAGS) $(CHOLMOD_CFLAGS)
+LDADD = $(top_builddir)/Source/libklu.la
+
+EXTRA_DIST = \
+	klu_simple.out \
+	kludemo.out
+
+# Disable the .out implicit pattern rule.  Prevents GNU make from
+# adding bogus dependencies for the .out files listed above.
+%.out: %
+
+check_PROGRAMS = klu_simple kludemo kluldemo
+
+TESTS = klu_simple
+
+klu_simple_SOURCES = klu_simple.c
+
+kludemo_SOURCES = kludemo.c
+kludemo_LDADD = $(LDADD) $(CHOLMOD_LIBS) -lm
+
+kluldemo_SOURCES = kluldemo.c
+kluldemo_LDADD = $(LDADD) $(CHOLMOD_LIBS) -lm
+
+MATRICES = \
+	../Matrix/1c.mtx \
+	../Matrix/arrowc.mtx \
+	../Matrix/arrow.mtx \
+	../Matrix/impcol_a.mtx \
+	../Matrix/w156.mtx \
+	../Matrix/ctina.mtx
+
+check-local: kludemo kluldemo $(MATRICES)
+	-./kludemo < ../Matrix/1c.mtx
+	-./kludemo < ../Matrix/arrowc.mtx
+	-./kludemo < ../Matrix/arrow.mtx
+	-./kludemo < ../Matrix/impcol_a.mtx
+	-./kludemo < ../Matrix/w156.mtx
+	-./kludemo < ../Matrix/ctina.mtx
+	-./kluldemo < ../Matrix/1c.mtx
+	-./kluldemo < ../Matrix/arrowc.mtx
+	-./kluldemo < ../Matrix/arrow.mtx
+	-./kluldemo < ../Matrix/impcol_a.mtx
+	-./kluldemo < ../Matrix/w156.mtx
+	-./kluldemo < ../Matrix/ctina.mtx
diff --git a/Doc/Makefile.am b/Doc/Makefile.am
new file mode 100644
--- /dev/null
+++ b/Doc/Makefile.am
@@ -0,0 +1,41 @@
+# Generating KLU_UserGuide.pdf seems to be broken, so
+# just distribute the copy that came in the tarball.
+EXTRA_DIST = \
+	ChangeLog \
+	lesser.txt \
+	palamadai_e.pdf \
+	KLU_UserGuide.pdf
+
+dist_noinst_DATA = KLU_UserGuide.tex KLU_UserGuide.bib
+pdf_DATA = KLU_UserGuide.pdf palamadai_e.pdf
+
+#SRC = \
+#	klu_h.tex \
+#	btf_h.tex \
+#	klu_simple_c.tex
+#
+#klu_h.tex: ../Include/klu.h
+#	echo '\\begin{verbatim}' > $@
+#	expand -8 $< >> $@
+#	echo '\end{verbatim}' >> $@
+#
+## FIXME:  Probably shouldn't rely on this location for btf.h.
+#btf_h.tex: /usr/include/btf.h
+#	echo '\\begin{verbatim}' > $@
+#	expand -8 $< >> $@
+#	echo '\end{verbatim}' >> $@
+#
+#klu_simple_c.tex: ../Demo/klu_simple.c
+#	echo '\\begin{verbatim}' > $@
+#	expand -8 $< >> $@
+#	echo '\end{verbatim}' >> $@
+#
+#KLU_UserGuide.pdf: KLU_UserGuide.tex KLU_UserGuide.bib $(SRC)
+#	pdflatex KLU_UserGuide
+#	bibtex KLU_UserGuide
+#	pdflatex KLU_UserGuide
+#	pdflatex KLU_UserGuide
+#
+#clean-local:
+#	-$(RM) *.aux *.bbl *.blg *.log *.toc
+#	-$(RM) $(SRC)
diff --git a/Include/Makefile.am b/Include/Makefile.am
new file mode 100644
--- /dev/null
+++ b/Include/Makefile.am
@@ -0,0 +1,2 @@
+pkgincludedir = $(includedir)/klu
+pkginclude_HEADERS = klu.h klu_internal.h klu_version.h
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,5 @@
+SUBDIRS = Include Source User Matrix Demo Doc
+EXTRA_DIST = README.txt
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = klu.pc
diff --git a/Matrix/Makefile.am b/Matrix/Makefile.am
new file mode 100644
--- /dev/null
+++ b/Matrix/Makefile.am
@@ -0,0 +1,11 @@
+dist_noinst_DATA = \
+	1c.mtx \
+	GD99_cc.mtx \
+	arrow.mtx \
+	arrowc.mtx \
+	ctina.mtx \
+	impcol_a.mtx \
+	one.mtx \
+	onec.mtx \
+	two.mtx \
+	w156.mtx
diff --git a/Source/Makefile.am b/Source/Makefile.am
new file mode 100644
--- /dev/null
+++ b/Source/Makefile.am
@@ -0,0 +1,40 @@
+AM_CPPFLAGS = -I$(top_srcdir)/Include $(AMD_CFLAGS) $(BTF_CFLAGS) $(COLAMD_CFLAGS)
+
+noinst_LTLIBRARIES = libklud.la libkluz.la libklul.la libkluzl.la
+
+KLUSRC = \
+	klu.c \
+	klu_diagnostics.c \
+	klu_dump.c \
+	klu_extract.c \
+	klu_factor.c \
+	klu_free_numeric.c \
+	klu_kernel.c \
+	klu_refactor.c \
+	klu_scale.c \
+	klu_solve.c \
+	klu_sort.c \
+	klu_tsolve.c
+
+CKLUSRC = \
+	klu_analyze.c \
+	klu_analyze_given.c \
+	klu_defaults.c \
+	klu_free_symbolic.c \
+	klu_memory.c
+
+libklud_la_SOURCES = $(KLUSRC) $(CKLUSRC)
+
+libkluz_la_SOURCES = $(KLUSRC)
+libkluz_la_CPPFLAGS = $(AM_CPPFLAGS) -DCOMPLEX
+
+libklul_la_SOURCES = $(KLUSRC) $(CKLUSRC)
+libklul_la_CPPFLAGS = $(AM_CPPFLAGS) -DDLONG
+
+libkluzl_la_SOURCES = $(KLUSRC)
+libkluzl_la_CPPFLAGS = $(AM_CPPFLAGS) -DDLONG -DCOMPLEX
+
+lib_LTLIBRARIES = libklu.la
+libklu_la_SOURCES =
+libklu_la_LIBADD = libklud.la libkluz.la libklul.la libkluzl.la $(AMD_LIBS) $(BTF_LIBS) $(COLAMD_LIBS)
+libklu_la_LDFLAGS = -no-undefined -version-info 2:2:1
diff --git a/User/Makefile.am b/User/Makefile.am
new file mode 100644
--- /dev/null
+++ b/User/Makefile.am
@@ -0,0 +1,11 @@
+AM_CPPFLAGS = -I$(top_srcdir)/Include $(AMD_CFLAGS) $(BTF_CFLAGS) $(COLAMD_CFLAGS) $(CHOLMOD_CFLAGS) $(UFCONFIG_CFLAGS)
+
+EXTRA_DIST = README.txt
+
+pkgincludedir = $(includedir)/klu
+pkginclude_HEADERS = klu_cholmod.h
+
+lib_LTLIBRARIES = libklu_cholmod.la
+libklu_cholmod_la_SOURCES = klu_cholmod.c klu_l_cholmod.c
+libklu_cholmod_la_LIBADD = $(CHOLMOD_LIBS)
+libklu_cholmod_la_LDFLAGS = -no-undefined -version-info 2:2:1
diff --git a/configure.ac b/configure.ac
new file mode 100644
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,49 @@
+AC_PREREQ([2.68])
+AC_INIT([KLU],[1.1.2],[davis@cise.ufl.edu])
+AC_CONFIG_SRCDIR([Source/klu.c])
+AC_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE([foreign])
+LT_INIT
+
+AC_PROG_INSTALL
+AC_PROG_CC
+
+LIBS_SAVED=$LIBS
+
+AC_CHECK_LIB([m], [sqrt])
+
+AC_CHECK_HEADERS([limits.h stdlib.h])
+
+PKG_PROG_PKG_CONFIG
+PKG_CHECK_MODULES([UFCONFIG],[ufconfig],
+	[],
+	[AC_MSG_ERROR([cannot find ufconfig])])
+PKG_CHECK_MODULES([AMD],[amd],
+	[],
+	[AC_MSG_ERROR([cannot find amd])])
+PKG_CHECK_MODULES([BTF],[btf],
+	[],
+	[AC_MSG_ERROR([cannot find btf])])
+PKG_CHECK_MODULES([COLAMD],[colamd],
+	[],
+	[AC_MSG_ERROR([cannot find colamd])])
+PKG_CHECK_MODULES([CHOLMOD],[cholmod],
+	[],
+	[AC_MSG_ERROR([cannot find cholmod])])
+
+AC_TYPE_SIZE_T
+
+AC_CHECK_FUNCS([sqrt])
+
+LIBS=$LIBS_SAVED
+
+AC_CONFIG_FILES([
+	klu.pc
+	Makefile
+	Demo/Makefile
+	Doc/Makefile
+	Include/Makefile
+	Matrix/Makefile
+	Source/Makefile
+	User/Makefile])
+AC_OUTPUT
diff --git a/klu.pc.in b/klu.pc.in
new file mode 100644
--- /dev/null
+++ b/klu.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Description: Sparse LU factorization for circuit simulation
+Version: @PACKAGE_VERSION@
+Requires.private: amd btf colamd
+Libs: -L${libdir} -lklu
+Libs.private: -lm
+Cflags: -I${includedir}/klu