comparison main/sparse/Makefile @ 0:6b33357c7561 octave-forge

Initial revision
author pkienzle
date Wed, 10 Oct 2001 19:54:49 +0000
parents
children e34650e2b2b4
comparison
equal deleted inserted replaced
-1:000000000000 0:6b33357c7561
1 # Makefile and README for octave SuperLU routines
2 # $Id$
3 #
4 # $Log$
5 # Revision 1.1 2001/10/10 19:54:49 pkienzle
6 # Initial revision
7 #
8 # Revision 1.7 2001/04/04 02:13:46 aadler
9 # complete complex_sparse, templates, fix memory leaks
10 #
11 # Revision 1.6 2001/03/30 04:36:30 aadler
12 # added multiply, solve, and sparse creation
13 #
14 # Revision 1.5 2001/03/15 15:47:58 aadler
15 # cleaned up duplicated code by using "defined" templates.
16 # used default numerical conversions
17 #
18 # Revision 1.4 2001/03/06 03:20:12 aadler
19 # added automatic numeric_conversion_function
20 #
21 # Revision 1.3 2001/02/27 03:01:51 aadler
22 # added rudimentary complex matrix support
23 #
24 # Revision 1.2 2000/12/18 03:31:16 aadler
25 # Split code to multiple files
26 # added sparse inverse
27 #
28 # Revision 1.1 2000/11/11 02:47:11 aadler
29 # DLD functions for sparse support in octave
30 #
31 # Revision 1.2 2000/05/02 00:10:34 andy
32 # mods to work with 2.1.30
33 #
34 #
35 # INSTRUCTIONS
36 #
37 # 0. Check that you have the following files:
38 # a Makefile
39 # b make_sparse.cc
40 # c make_sparse.h
41 # d sp_test.m
42 # e fem_test.m
43 # f superlu2.0patch.diff
44 #
45 # 0a. This is tested to work with octave-2.1.32
46 # It works with >2.1.30 if you apply the mkoctfile patch
47 # at
48 #
49 # 0b. If you already have a SuperLU subdirectory with
50 # SuperLU/SRC and SuperLU/CBLAS then ignore
51 # steps 1-3
52 #
53 # 1. Download SuperLU from one of the following sites
54 # http://www.netlib.org/scalapack/prototype
55 # ftp://ftp.cs.berkeley/pub/src/lapack/SuperLU
56 # http://www.nersc.gov/~xiaoye/SuperLU/
57 #
58 # 2. Unpack SuperLU into the directory you'll be building the
59 # octave sparse functions from
60 #
61 # 3. Apply the patch
62 # patch -p0 < superlu2.0patch.diff
63 #
64 # 4. Build the octave sparse functions
65 # make in the octave sparse functions directory
66 # NOTE: do not run the SuperLU makefiles -
67 # it doesn't build the right objects into the library
68 #
69 # This makefile assumes that the SuperLU package has been unpacked
70 # in this directory. It compiles files directly from their locations
71 # in the SuperLU source. You do not need to use SuperLU makefiles.
72 #
73 # SuperLU is available from http://www.netlib.org/scalapack/prototype
74 # ftp://ftp.cs.berkeley/pub/src/lapack/SuperLU
75 #
76 #
77 # AUTHOR: Andy Adler <adler@ncf.ca>
78 #
79 # COPYRIGHT:
80 # Copyright (C) 1998-2000 Andy Adler
81 #
82 # This program is free software; you can redistribute it and/or
83 # modify it under the terms of the GNU General Public License as
84 # published by the Free Software Foundation; either version 2 of
85 # the License, or (at your option) any later version.
86 # This program is distributed in the hope that it will be useful,
87 # but WITHOUT ANY WARRANTY; without even the implied warranty of
88 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
89 # GNU General Public License for more details.
90 # You should have received a copy of the GNU General Public
91 # License along with this program; if not, write to the Free Software
92 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
93
94 sinclude ../../Makeconf
95
96 NAME = make_sparse
97 OBJLINKS = spfind.oct sparse.oct full.oct splu.oct nnz.oct spinv.oct
98 SUPERLU = SuperLU
99 OCTVER = -2.1.32
100 OCTAVE = octave$(OCTVER)
101 ifndef MKOCTFILE
102 MKOCTFILE= mkoctfile$(OCTVER)
103 endif
104
105 AR = ar
106 CPP = c++
107 CC = gcc
108 STRIP = strip
109
110 S_INC= -I$(SUPERLU)/SRC/ \
111 -I$(SUPERLU)/CBLAS
112
113 # CCDEFS = -DVERBOSE
114 # CCDEFS = -DVERBOSE -DUSE_DMALLOC -DANDYS_SEGFAULT_OVERRIDE -DVERBOSE
115 # DLIBS = -ldmallocxx -ldmalloc
116 # CCDEFS = -DVERBOSE -v
117 # CCDEFS = -v
118 # CCDEFS = -DANDYS_SEGFAULT_OVERRIDE -DVERBOSE
119
120
121
122 # Special defines for SuperLU
123 # 1. we need to define Add_ so that blas links up with the
124 # octave definitions
125 # 2. we need to override USER_ABORT(msg), USER_MALLOC(size)
126 # and USER_FREE(addr) to provide our own implemetations
127 SUPERLU_DEFS = -DAdd_ -O3 \
128 -D"USER_MALLOC(size)=oct_sparse_malloc(size)" \
129 -D"USER_ABORT(msg)=oct_sparse_fatalerr(msg)" \
130 -D"USER_FREE(addr)=oct_sparse_free(addr)"
131
132 #use these defs when testing with dmalloc
133 #SUPERLU_DEFS = -DAdd_ -O3 \
134 # -D"USER_MALLOC(size)=_malloc_leap(__FILE__, __LINE__, size)" \
135 # -D"USER_ABORT(msg)=oct_sparse_fatalerr(msg)" \
136 # -D"USER_FREE(addr)=if(addr) _free_leap(__FILE__, __LINE__, addr)"
137
138 OCTOBJ= sparse_ops.o make_sparse.o sparse_full.o sparse_inv.o \
139 complex_sparse_ops.o
140
141 LIBSUPERLU = libsuperlu.a
142
143 S_SRC = $(SUPERLU)/SRC
144 S_CBLAS= $(SUPERLU)/CBLAS
145
146 ALLAUX = $(S_SRC)/superlu_timer.o $(S_SRC)/lsame.o \
147 $(S_SRC)/util.o $(S_SRC)/memory.o \
148 $(S_SRC)/get_perm_c.o $(S_SRC)/mmd.o \
149 $(S_SRC)/sp_coletree.o $(S_SRC)/sp_preorder.o \
150 $(S_SRC)/sp_ienv.o $(S_SRC)/relax_snode.o \
151 $(S_SRC)/xerbla.o $(S_SRC)/colamd.o
152
153 DZLAUX = $(S_SRC)/dlamch.o \
154 $(S_CBLAS)/dmyblas2.o $(S_CBLAS)/zmyblas2.o
155
156 DLUSRC = $(S_SRC)/dgssv.o $(S_SRC)/dgssvx.o \
157 $(S_SRC)/dsp_blas2.o $(S_SRC)/dsp_blas3.o \
158 $(S_SRC)/dgscon.o $(S_SRC)/dlacon.o \
159 $(S_SRC)/dlangs.o $(S_SRC)/dgsequ.o \
160 $(S_SRC)/dlaqgs.o $(S_SRC)/dpivotgrowth.o \
161 $(S_SRC)/dgsrfs.o $(S_SRC)/dgstrf.o \
162 $(S_SRC)/dgstrs.o $(S_SRC)/dcopy_to_ucol.o \
163 $(S_SRC)/dsnode_dfs.o $(S_SRC)/dsnode_bmod.o \
164 $(S_SRC)/dpanel_dfs.o $(S_SRC)/dpanel_bmod.o \
165 $(S_SRC)/dreadhb.o $(S_SRC)/dcolumn_dfs.o \
166 $(S_SRC)/dcolumn_bmod.o $(S_SRC)/dpivotL.o \
167 $(S_SRC)/dpruneL.o $(S_SRC)/dmemory.o \
168 $(S_SRC)/dutil.o
169
170 ZLUSRC = $(S_SRC)/zgssv.o $(S_SRC)/zgssvx.o \
171 $(S_SRC)/zsp_blas2.o $(S_SRC)/zsp_blas3.o \
172 $(S_SRC)/zgscon.o $(S_SRC)/zlacon.o \
173 $(S_SRC)/zlangs.o $(S_SRC)/zgsequ.o \
174 $(S_SRC)/zlaqgs.o $(S_SRC)/zpivotgrowth.o \
175 $(S_SRC)/zgsrfs.o $(S_SRC)/zgstrf.o \
176 $(S_SRC)/zgstrs.o $(S_SRC)/zcopy_to_ucol.o \
177 $(S_SRC)/zsnode_dfs.o $(S_SRC)/zsnode_bmod.o \
178 $(S_SRC)/zpanel_dfs.o $(S_SRC)/zpanel_bmod.o \
179 $(S_SRC)/zreadhb.o $(S_SRC)/zcolumn_dfs.o \
180 $(S_SRC)/zcolumn_bmod.o $(S_SRC)/zpivotL.o \
181 $(S_SRC)/zpruneL.o $(S_SRC)/zmemory.o \
182 $(S_SRC)/zutil.o $(S_SRC)/dcomplex.o
183
184 S_DOUBLE= $(DLUSRC) $(ALLAUX) $(DZLAUX) $(ZLUSRC)
185
186 all: $(NAME).oct # test
187
188 $(S_DOUBLE):%.o:%.c
189 $(CC) $(S_INC) $(CDEFS) $(SUPERLU_DEFS) -c $< -o $@
190
191 $(OCTOBJ): make_sparse.h
192 sparse_ops.o complex_sparse_ops.o: sparse_ops.h
193
194 $(OCTOBJ): %.o: %.cc
195 $(MKOCTFILE) -c $< $(S_INC) $(CCDEFS) -o $@
196
197 $(LIBSUPERLU): $(S_DOUBLE)
198 $(AR) -r $(LIBSUPERLU) $(S_DOUBLE)
199
200 $(NAME).oct: $(OCTOBJ) $(LIBSUPERLU)
201 $(MKOCTFILE) $(OCTOBJ) -o $(NAME).oct -lsuperlu -L. $(DLIBS)
202 $(STRIP) $(NAME).oct
203 for i in $(OBJLINKS); do ln -sf $(NAME).oct $$i ; done
204
205 test: $(NAME).oct
206 export DMALLOC_OPTIONS=debug=0x4f47d03,inter=100,log=logfile
207 @echo
208 @echo "Testing sparse functions ..."
209 @echo
210 $(OCTAVE) -qf sp_test.m 2>/dev/null
211 @echo
212 @echo "Testing sparse solution for a Finite Element Model ..."
213 @echo
214 $(OCTAVE) -qf fem_test.m
215
216 clean:
217 -$(RM) $(NAME).oct $(OBJLINKS) $(OCTOBJ) $(S_DOUBLE) $(LIBSUPERLU) octave-core core *~
218