Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/superlu/files: superlu-4.3-autotools.patch
Date: Tue, 28 Feb 2012 14:21:05
Message-Id: 20120228142047.8D56B2004C@flycatcher.gentoo.org
1 jlec 12/02/28 14:20:47
2
3 Added: superlu-4.3-autotools.patch
4 Log:
5 Moved to autotools-utils, EAPI=4, fix blas/lapack detection and add USE=static-libs
6
7 (Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sci-libs/superlu/files/superlu-4.3-autotools.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/superlu/files/superlu-4.3-autotools.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/superlu/files/superlu-4.3-autotools.patch?rev=1.1&content-type=text/plain
14
15 Index: superlu-4.3-autotools.patch
16 ===================================================================
17 EXAMPLE/Makefile | 68 +++++++++---------
18 FORTRAN/Makefile | 14 ++--
19 Makefile.am | 4 +
20 SRC/Makefile.am | 110 +++++++++++++++++++++++++++++
21 ax_blas.m4 | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
22 configure.ac | 16 ++++
23 superlu.pc.in | 13 ++++
24 7 files changed, 385 insertions(+), 41 deletions(-)
25
26 diff --git a/EXAMPLE/Makefile b/EXAMPLE/Makefile
27 index c286ded..37950dc 100644
28 --- a/EXAMPLE/Makefile
29 +++ b/EXAMPLE/Makefile
30 @@ -1,4 +1,3 @@
31 -include ../make.inc
32
33 #######################################################################
34 # This makefile creates the example programs for the linear equation
35 @@ -32,7 +31,9 @@ include ../make.inc
36 #
37 #######################################################################
38
39 -HEADER = ../SRC
40 +HEADER = $(shell pkg-config --cflags superlu)
41 +LIBS = $(shell pkg-config --libs superlu)
42 +CDEFS = -DAdd_
43
44 SLINEXM = slinsol.o
45 SLINEXM1 = slinsol1.o
46 @@ -67,7 +68,6 @@ ZLINXEXM2 = zlinsolx2.o
47 ZITSOL = zitersol.o zfgmr.o
48 ZITSOL1 = zitersol1.o zfgmr.o
49
50 -
51 all: single double complex complex16
52
53 single: slinsol slinsol1 slinsolx slinsolx1 slinsolx2 sitersol sitersol1
54 @@ -77,97 +77,97 @@ complex: clinsol clinsol1 clinsolx clinsolx1 clinsolx2 citersol citersol1
55 complex16: zlinsol zlinsol1 zlinsolx zlinsolx1 zlinsolx2 zitersol zitersol1
56
57 slinsol: $(SLINEXM) $(SUPERLULIB)
58 - $(LOADER) $(LOADOPTS) $(SLINEXM) $(LIBS) -lm -o $@
59 + $(LD) $(LDFLAGS) $(SLINEXM) $(LIBS) -o $@
60
61 slinsol1: $(SLINEXM1) $(SUPERLULIB)
62 - $(LOADER) $(LOADOPTS) $(SLINEXM1) $(LIBS) -lm -o $@
63 + $(LD) $(LDFLAGS) $(SLINEXM1) $(LIBS) -o $@
64
65 slinsolx: $(SLINXEXM) $(SUPERLULIB)
66 - $(LOADER) $(LOADOPTS) $(SLINXEXM) $(LIBS) -lm -o $@
67 + $(LD) $(LDFLAGS) $(SLINXEXM) $(LIBS) -o $@
68
69 slinsolx1: $(SLINXEXM1) $(SUPERLULIB)
70 - $(LOADER) $(LOADOPTS) $(SLINXEXM1) $(LIBS) -lm -o $@
71 + $(LD) $(LDFLAGS) $(SLINXEXM1) $(LIBS) -o $@
72
73 slinsolx2: $(SLINXEXM2) $(SUPERLULIB)
74 - $(LOADER) $(LOADOPTS) $(SLINXEXM2) $(LIBS) -lm -o $@
75 + $(LD) $(LDFLAGS) $(SLINXEXM2) $(LIBS) -o $@
76
77 sitersol: $(SITSOL) $(SUPERLULIB)
78 - $(LOADER) $(LOADOPTS) $(SITSOL) $(LIBS) -lm -o $@
79 + $(LD) $(LDFLAGS) $(SITSOL) $(LIBS) -o $@
80
81 sitersol1: $(SITSOL1) $(SUPERLULIB)
82 - $(LOADER) $(LOADOPTS) $(SITSOL1) $(LIBS) -lm -o $@
83 + $(LD) $(LDFLAGS) $(SITSOL1) $(LIBS) -o $@
84
85 dlinsol: $(DLINEXM) $(SUPERLULIB)
86 - $(LOADER) $(LOADOPTS) $(DLINEXM) $(LIBS) -lm -o $@
87 + $(LD) $(LDFLAGS) $(DLINEXM) $(LIBS) -o $@
88
89 dlinsol1: $(DLINEXM1) $(SUPERLULIB)
90 - $(LOADER) $(LOADOPTS) $(DLINEXM1) $(LIBS) -lm -o $@
91 + $(LD) $(LDFLAGS) $(DLINEXM1) $(LIBS) -o $@
92
93 dlinsolx: $(DLINXEXM) $(SUPERLULIB)
94 - $(LOADER) $(LOADOPTS) $(DLINXEXM) $(LIBS) -lm -o $@
95 + $(LD) $(LDFLAGS) $(DLINXEXM) $(LIBS) -o $@
96
97 dlinsolx1: $(DLINXEXM1) $(SUPERLULIB)
98 - $(LOADER) $(LOADOPTS) $(DLINXEXM1) $(LIBS) -lm -o $@
99 + $(LD) $(LDFLAGS) $(DLINXEXM1) $(LIBS) -o $@
100
101 dlinsolx2: $(DLINXEXM2) $(SUPERLULIB)
102 - $(LOADER) $(LOADOPTS) $(DLINXEXM2) $(LIBS) -lm -o $@
103 + $(LD) $(LDFLAGS) $(DLINXEXM2) $(LIBS) -o $@
104
105 superlu: $(SUPERLUEXM) $(SUPERLULIB)
106 - $(LOADER) $(LOADOPTS) $(SUPERLUEXM) $(LIBS) -lm -o $@
107 + $(LD) $(LDFLAGS) $(SUPERLUEXM) $(LIBS) -o $@
108
109 ditersol: $(DITSOL) $(SUPERLULIB)
110 - $(LOADER) $(LOADOPTS) $(DITSOL) $(LIBS) -lm -o $@
111 + $(LD) $(LDFLAGS) $(DITSOL) $(LIBS) -o $@
112
113 ditersol1: $(DITSOL1) $(SUPERLULIB)
114 - $(LOADER) $(LOADOPTS) $(DITSOL1) $(LIBS) -lm -o $@
115 + $(LD) $(LDFLAGS) $(DITSOL1) $(LIBS) -o $@
116
117 clinsol: $(CLINEXM) $(SUPERLULIB)
118 - $(LOADER) $(LOADOPTS) $(CLINEXM) $(LIBS) -lm -o $@
119 + $(LD) $(LDFLAGS) $(CLINEXM) $(LIBS) -o $@
120
121 clinsol1: $(CLINEXM1) $(SUPERLULIB)
122 - $(LOADER) $(LOADOPTS) $(CLINEXM1) $(LIBS) -lm -o $@
123 + $(LD) $(LDFLAGS) $(CLINEXM1) $(LIBS) -o $@
124
125 clinsolx: $(CLINXEXM) $(SUPERLULIB)
126 - $(LOADER) $(LOADOPTS) $(CLINXEXM) $(LIBS) -lm -o $@
127 + $(LD) $(LDFLAGS) $(CLINXEXM) $(LIBS) -o $@
128
129 clinsolx1: $(CLINXEXM1) $(SUPERLULIB)
130 - $(LOADER) $(LOADOPTS) $(CLINXEXM1) $(LIBS) -lm -o $@
131 + $(LD) $(LDFLAGS) $(CLINXEXM1) $(LIBS) -o $@
132
133 clinsolx2: $(CLINXEXM2) $(SUPERLULIB)
134 - $(LOADER) $(LOADOPTS) $(CLINXEXM2) $(LIBS) -lm -o $@
135 + $(LD) $(LDFLAGS) $(CLINXEXM2) $(LIBS) -o $@
136
137 citersol: $(CITSOL) $(SUPERLULIB)
138 - $(LOADER) $(LOADOPTS) $(CITSOL) $(LIBS) -lm -o $@
139 + $(LD) $(LDFLAGS) $(CITSOL) $(LIBS) -o $@
140
141 citersol1: $(CITSOL1) $(SUPERLULIB)
142 - $(LOADER) $(LOADOPTS) $(CITSOL1) $(LIBS) -lm -o $@
143 + $(LD) $(LDFLAGS) $(CITSOL1) $(LIBS) -o $@
144
145 zlinsol: $(ZLINEXM) $(SUPERLULIB)
146 - $(LOADER) $(LOADOPTS) $(ZLINEXM) $(LIBS) -lm -o $@
147 + $(LD) $(LDFLAGS) $(ZLINEXM) $(LIBS) -o $@
148
149 zlinsol1: $(ZLINEXM1) $(SUPERLULIB)
150 - $(LOADER) $(LOADOPTS) $(ZLINEXM1) $(LIBS) -lm -o $@
151 + $(LD) $(LDFLAGS) $(ZLINEXM1) $(LIBS) -o $@
152
153 zlinsolx: $(ZLINXEXM) $(SUPERLULIB)
154 - $(LOADER) $(LOADOPTS) $(ZLINXEXM) $(LIBS) -lm -o $@
155 + $(LD) $(LDFLAGS) $(ZLINXEXM) $(LIBS) -o $@
156
157 zlinsolx1: $(ZLINXEXM1) $(SUPERLULIB)
158 - $(LOADER) $(LOADOPTS) $(ZLINXEXM1) $(LIBS) -lm -o $@
159 + $(LD) $(LDFLAGS) $(ZLINXEXM1) $(LIBS) -o $@
160
161 zlinsolx2: $(ZLINXEXM2) $(SUPERLULIB)
162 - $(LOADER) $(LOADOPTS) $(ZLINXEXM2) $(LIBS) -lm -o $@
163 + $(LD) $(LDFLAGS) $(ZLINXEXM2) $(LIBS) -o $@
164
165 zitersol: $(ZITSOL) $(SUPERLULIB)
166 - $(LOADER) $(LOADOPTS) $(ZITSOL) $(LIBS) -lm -o $@
167 + $(LD) $(LDFLAGS) $(ZITSOL) $(LIBS) -o $@
168
169 zitersol1: $(ZITSOL1) $(SUPERLULIB)
170 - $(LOADER) $(LOADOPTS) $(ZITSOL1) $(LIBS) -lm -o $@
171 + $(LD) $(LDFLAG) $(ZITSOL1) $(LIBS) -o $@
172
173 .c.o:
174 - $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE)
175 + $(CC) $(CFLAGS) $(CDEFS) $(HEADER) -c $< $(VERBOSE)
176
177 .f.o:
178 - $(FORTRAN) $(FFLAGS) -c $< $(VERBOSE)
179 + $(FC) $(FFLAGS) -c $< $(VERBOSE)
180
181 clean:
182 rm -f *.o *linsol *linsol1 *linsolx *linsolx1 *linsolx2 \
183 diff --git a/FORTRAN/Makefile b/FORTRAN/Makefile
184 index 23671a7..54da751 100644
185 --- a/FORTRAN/Makefile
186 +++ b/FORTRAN/Makefile
187 @@ -1,12 +1,12 @@
188 -include ../make.inc
189 +#include ../make.inc
190
191 #######################################################################
192 # This makefile creates the Fortran example interface to use the
193 # C routines in SuperLU.
194 #######################################################################
195
196 -HEADER = ../SRC
197 -LIBS = $(SUPERLULIB) $(BLASLIB) -lm
198 +HEADER = $(shell pkg-config --cflags superlu)
199 +LIBS = $(shell pkg-config --libs superlu)
200
201 # double real
202 F77EXM = f77_main.o hbcode1.o c_fortran_dgssv.o
203 @@ -17,19 +17,19 @@ ZF77EXM = z_f77_main.o zhbcode1.o c_fortran_zgssv.o
204 all: f77exm zf77exm
205
206 f77exm: $(F77EXM) $(SUPERLULIB)
207 - $(FORTRAN) $(LOADOPTS) $(F77EXM) $(LIBS) -o $@
208 + $(FC) $(LDFLAGS) $(F77EXM) $(LIBS) -o $@
209
210 zf77exm: $(ZF77EXM) $(SUPERLULIB)
211 $(FORTRAN) $(LOADOPTS) $(ZF77EXM) $(LIBS) -o $@
212
213 c_fortran_zgssv.o: c_fortran_zgssv.c
214 - $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE)
215 + $(CC) $(CFLAGS) $(CDEFS) $(HEADER) -c $< $(VERBOSE)
216
217 .c.o:
218 - $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE)
219 + $(CC) $(CFLAGS) $(CDEFS) $(HEADER) -c $< $(VERBOSE)
220
221 .f.o:
222 - $(FORTRAN) $(FFLAGS) -c $< $(VERBOSE)
223 + $(FC) $(FFLAGS) -c $< $(VERBOSE)
224
225 clean:
226 rm -f *.o f77exm zf77exm
227 diff --git a/Makefile.am b/Makefile.am
228 new file mode 100644
229 index 0000000..7e51046
230 --- /dev/null
231 +++ b/Makefile.am
232 @@ -0,0 +1,4 @@
233 +SUBDIRS = SRC
234 +
235 +pkgconfigdir = $(libdir)/pkgconfig
236 +pkgconfig_DATA = superlu.pc
237 diff --git a/SRC/Makefile.am b/SRC/Makefile.am
238 new file mode 100644
239 index 0000000..748e5e9
240 --- /dev/null
241 +++ b/SRC/Makefile.am
242 @@ -0,0 +1,110 @@
243 +AM_CPPFLAGS = -DAdd_
244 +
245 +### headers
246 +noinst_HEADERS = \
247 + colamd.h \
248 + html_mainpage.h
249 +
250 +src_includedir = $(includedir)/superlu
251 +src_include_HEADERS = \
252 + slu_cdefs.h \
253 + slu_ddefs.h \
254 + slu_sdefs.h \
255 + slu_zdefs.h \
256 + slu_Cnames.h \
257 + slu_dcomplex.h \
258 + slu_scomplex.h \
259 + slu_util.h \
260 + superlu_enum_consts.h \
261 + supermatrix.h
262 +
263 +### LAPACK
264 +LAAUX = lsame.c xerbla.c
265 +SLASRC = slacon.c
266 +DLASRC = dlacon.c
267 +CLASRC = clacon.c scsum1.c icmax1.c
268 +ZLASRC = zlacon.c dzsum1.c izmax1.c
269 +
270 +
271 +##################################
272 +# Do not optimize these routines #
273 +##################################
274 +CFLAGS_SAV=@CFLAGS@
275 +CFLAGS=
276 +noinst_LTLIBRARIES = libnoopt.la
277 +libnoopt_la_SOURCES = slamch.c dlamch.c superlu_timer.c
278 +libnoopt_la_CFLAGS = -O0
279 +
280 +### SuperLU
281 +ALLAUX = util.c memory.c get_perm_c.c mmd.c \
282 + sp_coletree.c sp_preorder.c sp_ienv.c relax_snode.c \
283 + heap_relax_snode.c colamd.c \
284 + ilu_relax_snode.c ilu_heap_relax_snode.c mark_relax.c \
285 + mc64ad.f qselect.f
286 +
287 +SLUSRC = \
288 + sgssv.c sgssvx.c \
289 + ssp_blas2.c ssp_blas3.c sgscon.c \
290 + slangs.c sgsequ.c slaqgs.c spivotgrowth.c \
291 + sgsrfs.c sgstrf.c sgstrs.c scopy_to_ucol.c \
292 + ssnode_dfs.c ssnode_bmod.c \
293 + spanel_dfs.c spanel_bmod.c sreadhb.c \
294 + scolumn_dfs.c scolumn_bmod.c spivotL.c spruneL.c \
295 + smemory.c sutil.c smyblas2.c \
296 + sgsisx.c sgsitrf.c sldperm.c \
297 + ilu_sdrop_row.c ilu_ssnode_dfs.c \
298 + ilu_scolumn_dfs.c ilu_spanel_dfs.c ilu_scopy_to_ucol.c \
299 + ilu_spivotL.c sdiagonal.c
300 +
301 +DLUSRC = \
302 + dgssv.c dgssvx.c \
303 + dsp_blas2.c dsp_blas3.c dgscon.c \
304 + dlangs.c dgsequ.c dlaqgs.c dpivotgrowth.c \
305 + dgsrfs.c dgstrf.c dgstrs.c dcopy_to_ucol.c \
306 + dsnode_dfs.c dsnode_bmod.c \
307 + dpanel_dfs.c dpanel_bmod.c dreadhb.c \
308 + dcolumn_dfs.c dcolumn_bmod.c dpivotL.c dpruneL.c \
309 + dmemory.c dutil.c dmyblas2.c \
310 + dgsisx.c dgsitrf.c \
311 + dldperm.c \
312 + ilu_ddrop_row.c ilu_dsnode_dfs.c \
313 + ilu_dcolumn_dfs.c ilu_dpanel_dfs.c ilu_dcopy_to_ucol.c \
314 + ilu_dpivotL.c ddiagonal.c
315 +
316 +CLUSRC = \
317 + scomplex.c cgssv.c cgssvx.c csp_blas2.c csp_blas3.c cgscon.c \
318 + clangs.c cgsequ.c claqgs.c cpivotgrowth.c \
319 + cgsrfs.c cgstrf.c cgstrs.c ccopy_to_ucol.c \
320 + csnode_dfs.c csnode_bmod.c \
321 + cpanel_dfs.c cpanel_bmod.c creadhb.c \
322 + ccolumn_dfs.c ccolumn_bmod.c cpivotL.c cpruneL.c \
323 + cmemory.c cutil.c cmyblas2.c \
324 + cgsisx.c cgsitrf.c cldperm.c \
325 + ilu_cdrop_row.c ilu_csnode_dfs.c \
326 + ilu_ccolumn_dfs.c ilu_cpanel_dfs.c ilu_ccopy_to_ucol.c \
327 + ilu_cpivotL.c cdiagonal.c
328 +
329 +ZLUSRC = \
330 + dcomplex.c zgssv.c zgssvx.c zsp_blas2.c zsp_blas3.c zgscon.c \
331 + zlangs.c zgsequ.c zlaqgs.c zpivotgrowth.c \
332 + zgsrfs.c zgstrf.c zgstrs.c zcopy_to_ucol.c \
333 + zsnode_dfs.c zsnode_bmod.c \
334 + zpanel_dfs.c zpanel_bmod.c zreadhb.c \
335 + zcolumn_dfs.c zcolumn_bmod.c zpivotL.c zpruneL.c \
336 + zmemory.c zutil.c zmyblas2.c \
337 + zgsisx.c zgsitrf.c zldperm.c \
338 + ilu_zdrop_row.c ilu_zsnode_dfs.c \
339 + ilu_zcolumn_dfs.c ilu_zpanel_dfs.c ilu_zcopy_to_ucol.c \
340 + ilu_zpivotL.c zdiagonal.c
341 +
342 +lib_LTLIBRARIES = libsuperlu.la
343 +libsuperlu_la_SOURCES = \
344 + $(NOOPTAUX) \
345 + $(ALLAUX) $(LAAUX) \
346 + $(SLUSRC) $(SLASRC) \
347 + $(DLUSRC) $(DLASRC) \
348 + $(CLUSRC) $(CLASRC) \
349 + $(ZLUSRC) $(ZLASRC)
350 +libsuperlu_la_CFLAGS = $(CFLAGS_SAV)
351 +libsuperlu_la_LIBADD = $(BLAS_LIBS) libnoopt.la
352 +libsuperlu_la_LDFLAGS = -no-undefined -version-info 4:2:0
353 diff --git a/ax_blas.m4 b/ax_blas.m4
354 new file mode 100644
355 index 0000000..e4f96cb
356 --- /dev/null
357 +++ b/ax_blas.m4
358 @@ -0,0 +1,201 @@
359 +# ===========================================================================
360 +# http://www.gnu.org/software/autoconf-archive/ax_blas.html
361 +# ===========================================================================
362 +#
363 +# SYNOPSIS
364 +#
365 +# AX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
366 +#
367 +# DESCRIPTION
368 +#
369 +# This macro looks for a library that implements the BLAS linear-algebra
370 +# interface (see http://www.netlib.org/blas/). On success, it sets the
371 +# BLAS_LIBS output variable to hold the requisite library linkages.
372 +#
373 +# To link with BLAS, you should link with:
374 +#
375 +# $BLAS_LIBS $LIBS $FLIBS
376 +#
377 +# in that order. FLIBS is the output variable of the
378 +# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is
379 +# sometimes necessary in order to link with F77 libraries. Users will also
380 +# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same
381 +# reason.
382 +#
383 +# Many libraries are searched for, from ATLAS to CXML to ESSL. The user
384 +# may also use --with-blas=<lib> in order to use some specific BLAS
385 +# library <lib>. In order to link successfully, however, be aware that you
386 +# will probably need to use the same Fortran compiler (which can be set
387 +# via the F77 env. var.) as was used to compile the BLAS library.
388 +#
389 +# ACTION-IF-FOUND is a list of shell commands to run if a BLAS library is
390 +# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is
391 +# not found. If ACTION-IF-FOUND is not specified, the default action will
392 +# define HAVE_BLAS.
393 +#
394 +# LICENSE
395 +#
396 +# Copyright (c) 2008 Steven G. Johnson <stevenj@××××××××.edu>
397 +#
398 +# This program is free software: you can redistribute it and/or modify it
399 +# under the terms of the GNU General Public License as published by the
400 +# Free Software Foundation, either version 3 of the License, or (at your
401 +# option) any later version.
402 +#
403 +# This program is distributed in the hope that it will be useful, but
404 +# WITHOUT ANY WARRANTY; without even the implied warranty of
405 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
406 +# Public License for more details.
407 +#
408 +# You should have received a copy of the GNU General Public License along
409 +# with this program. If not, see <http://www.gnu.org/licenses/>.
410 +#
411 +# As a special exception, the respective Autoconf Macro's copyright owner
412 +# gives unlimited permission to copy, distribute and modify the configure
413 +# scripts that are the output of Autoconf when processing the Macro. You
414 +# need not follow the terms of the GNU General Public License when using
415 +# or distributing such scripts, even though portions of the text of the
416 +# Macro appear in them. The GNU General Public License (GPL) does govern
417 +# all other use of the material that constitutes the Autoconf Macro.
418 +#
419 +# This special exception to the GPL applies to versions of the Autoconf
420 +# Macro released by the Autoconf Archive. When you make and distribute a
421 +# modified version of the Autoconf Macro, you may extend this special
422 +# exception to the GPL to apply to your modified version as well.
423 +
424 +#serial 11
425 +
426 +AU_ALIAS([ACX_BLAS], [AX_BLAS])
427 +AC_DEFUN([AX_BLAS], [
428 +AC_PREREQ(2.50)
429 +AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
430 +ax_blas_ok=no
431 +
432 +AC_ARG_WITH(blas,
433 + [AS_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])])
434 +case $with_blas in
435 + yes | "") ;;
436 + no) ax_blas_ok=disable ;;
437 + -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;;
438 + *) BLAS_LIBS="-l$with_blas" ;;
439 +esac
440 +
441 +# Get fortran linker names of BLAS functions to check for.
442 +AC_F77_FUNC(sgemm)
443 +AC_F77_FUNC(dgemm)
444 +
445 +ax_blas_save_LIBS="$LIBS"
446 +LIBS="$LIBS $FLIBS"
447 +
448 +# First, check BLAS_LIBS environment variable
449 +if test $ax_blas_ok = no; then
450 +if test "x$BLAS_LIBS" != x; then
451 + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
452 + AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS])
453 + AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes], [BLAS_LIBS=""])
454 + AC_MSG_RESULT($ax_blas_ok)
455 + LIBS="$save_LIBS"
456 +fi
457 +fi
458 +
459 +# BLAS linked to by default? (happens on some supercomputers)
460 +if test $ax_blas_ok = no; then
461 + save_LIBS="$LIBS"; LIBS="$LIBS"
462 + AC_MSG_CHECKING([if $sgemm is being linked in already])
463 + AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes])
464 + AC_MSG_RESULT($ax_blas_ok)
465 + LIBS="$save_LIBS"
466 +fi
467 +
468 +# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
469 +if test $ax_blas_ok = no; then
470 + AC_CHECK_LIB(atlas, ATL_xerbla,
471 + [AC_CHECK_LIB(f77blas, $sgemm,
472 + [AC_CHECK_LIB(cblas, cblas_dgemm,
473 + [ax_blas_ok=yes
474 + BLAS_LIBS="-lcblas -lf77blas -latlas"],
475 + [], [-lf77blas -latlas])],
476 + [], [-latlas])])
477 +fi
478 +
479 +# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
480 +if test $ax_blas_ok = no; then
481 + AC_CHECK_LIB(blas, $sgemm,
482 + [AC_CHECK_LIB(dgemm, $dgemm,
483 + [AC_CHECK_LIB(sgemm, $sgemm,
484 + [ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
485 + [], [-lblas])],
486 + [], [-lblas])])
487 +fi
488 +
489 +# BLAS in Intel MKL library?
490 +if test $ax_blas_ok = no; then
491 + AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl"])
492 +fi
493 +
494 +# BLAS in Apple vecLib library?
495 +if test $ax_blas_ok = no; then
496 + save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
497 + AC_MSG_CHECKING([for $sgemm in -framework vecLib])
498 + AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
499 + AC_MSG_RESULT($ax_blas_ok)
500 + LIBS="$save_LIBS"
501 +fi
502 +
503 +# BLAS in Alpha CXML library?
504 +if test $ax_blas_ok = no; then
505 + AC_CHECK_LIB(cxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lcxml"])
506 +fi
507 +
508 +# BLAS in Alpha DXML library? (now called CXML, see above)
509 +if test $ax_blas_ok = no; then
510 + AC_CHECK_LIB(dxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-ldxml"])
511 +fi
512 +
513 +# BLAS in Sun Performance library?
514 +if test $ax_blas_ok = no; then
515 + if test "x$GCC" != xyes; then # only works with Sun CC
516 + AC_CHECK_LIB(sunmath, acosp,
517 + [AC_CHECK_LIB(sunperf, $sgemm,
518 + [BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
519 + ax_blas_ok=yes],[],[-lsunmath])])
520 + fi
521 +fi
522 +
523 +# BLAS in SCSL library? (SGI/Cray Scientific Library)
524 +if test $ax_blas_ok = no; then
525 + AC_CHECK_LIB(scs, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lscs"])
526 +fi
527 +
528 +# BLAS in SGIMATH library?
529 +if test $ax_blas_ok = no; then
530 + AC_CHECK_LIB(complib.sgimath, $sgemm,
531 + [ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
532 +fi
533 +
534 +# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
535 +if test $ax_blas_ok = no; then
536 + AC_CHECK_LIB(blas, $sgemm,
537 + [AC_CHECK_LIB(essl, $sgemm,
538 + [ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
539 + [], [-lblas $FLIBS])])
540 +fi
541 +
542 +# Generic BLAS library?
543 +if test $ax_blas_ok = no; then
544 + AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"])
545 +fi
546 +
547 +AC_SUBST(BLAS_LIBS)
548 +
549 +LIBS="$ax_blas_save_LIBS"
550 +
551 +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
552 +if test x"$ax_blas_ok" = xyes; then
553 + ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])
554 + :
555 +else
556 + ax_blas_ok=no
557 + $2
558 +fi
559 +])dnl AX_BLAS
560 diff --git a/configure.ac b/configure.ac
561 new file mode 100644
562 index 0000000..f6707be
563 --- /dev/null
564 +++ b/configure.ac
565 @@ -0,0 +1,16 @@
566 +# -*- Autoconf -*-
567 +AC_PREREQ(2.59)
568 +AC_INIT(superlu, 4.3, xsli@×××.gov)
569 +AM_INIT_AUTOMAKE([foreign])
570 +AC_CONFIG_HEADER([config.h])
571 +AC_PROG_INSTALL
572 +AC_PROG_LIBTOOL
573 +AC_PROG_F77
574 +sinclude(ax_blas.m4)
575 +AX_BLAS
576 +if test x"$BLAS_LIBS" = x; then
577 + AC_MSG_ERROR([Cannot find blas libraries])
578 +fi
579 +AC_CHECK_LIB([m], [floor])
580 +AC_CONFIG_FILES([Makefile SRC/Makefile superlu.pc])
581 +AC_OUTPUT
582 diff --git a/superlu.pc.in b/superlu.pc.in
583 new file mode 100644
584 index 0000000..7bf9942
585 --- /dev/null
586 +++ b/superlu.pc.in
587 @@ -0,0 +1,13 @@
588 +prefix=@prefix@
589 +exec_prefix=@exec_prefix@
590 +libdir=@libdir@
591 +includedir=@includedir@
592 +
593 +Name: @PACKAGE_NAME@
594 +Description: Sparse LU factorization library
595 +Version: @PACKAGE_VERSION@
596 +URL: http://crd.lbl.gov/~xiaoye/SuperLU/
597 +Libs: -L${libdir} -lsuperlu
598 +Libs.private: -lm @FLIBS@
599 +Requires: blas
600 +Cflags: -I${includedir}/superlu