Mercurial > forge
changeset 3704:73e45abbc82a octave-forge
Changes because of a new release 2.9.13.
author | treichl |
---|---|
date | Thu, 26 Jul 2007 19:56:05 +0000 |
parents | 10ee2dd27175 |
children | cfcd8f243cbc |
files | admin/MacOSX/solvedeps/SuiteSparse-3.0.0.diff admin/MacOSX/solvedeps/f2c-19991025.diff admin/MacOSX/solvedeps/octave-2.9.12.diff admin/MacOSX/solvedeps/solvedeps-2.9.12.sh |
diffstat | 4 files changed, 1222 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/admin/MacOSX/solvedeps/SuiteSparse-3.0.0.diff Thu Jul 26 19:56:05 2007 +0000 @@ -0,0 +1,175 @@ +--- ./SuiteSparse/Makefile 2007-05-08 00:28:44.000000000 +0200 ++++ ./SuiteSparse/Makefile 2007-06-25 22:39:26.000000000 +0200 +@@ -7,7 +7,7 @@ + # Compile the default rules for each package + default: + ( cd UFconfig/xerbla ; $(MAKE) ) +- ( cd metis-4.0 ; $(MAKE) ) ++# ( cd metis-4.0 ; $(MAKE) ) + ( cd AMD ; $(MAKE) ) + ( cd CAMD ; $(MAKE) ) + ( cd COLAMD ; $(MAKE) ) +@@ -41,7 +41,7 @@ + # Remove all files not in the original distribution + purge: + ( cd UFconfig/xerbla ; $(MAKE) purge ) +- ( cd metis-4.0 ; $(MAKE) realclean ) ++# ( cd metis-4.0 ; $(MAKE) realclean ) + ( cd AMD ; $(MAKE) purge ) + ( cd CAMD ; $(MAKE) purge ) + ( cd COLAMD ; $(MAKE) purge ) +@@ -61,7 +61,7 @@ + # Remove all files not in the original distribution, but keep the libraries + clean: + ( cd UFconfig/xerbla ; $(MAKE) clean ) +- ( cd metis-4.0 ; $(MAKE) clean ) ++# ( cd metis-4.0 ; $(MAKE) clean ) + ( cd AMD ; $(MAKE) clean ) + ( cd CAMD ; $(MAKE) clean ) + ( cd COLAMD ; $(MAKE) clean ) +diff -u -u SuiteSparse/UFconfig/UFconfig.mk SuiteSparse/UFconfig/UFconfig.mk +--- ./SuiteSparse/UFconfig/UFconfig.mk.orig 2007-06-25 22:30:10.000000000 +0200 ++++ ./SuiteSparse/UFconfig/UFconfig.mk 2007-06-25 22:31:51.000000000 +0200 +@@ -32,8 +32,6 @@ + # C compiler and compiler flags: These will normally not give you optimal + # performance. You should select the optimization parameters that are best + # for your system. On Linux, use "CFLAGS = -O3 -fexceptions" for example. +-CC = cc +-CFLAGS = -O + + # ranlib, and ar, for generating libraries + RANLIB = ranlib +@@ -114,8 +112,8 @@ + # The path is relative to where it is used, in CHOLMOD/Lib, CHOLMOD/MATLAB, etc. + # You may wish to use an absolute path. METIS is optional. Compile + # CHOLMOD with -DNPARTITION if you do not wish to use METIS. +-METIS_PATH = ../../metis-4.0 +-METIS = ../../metis-4.0/libmetis.a ++# METIS_PATH = ../../metis-4.0 ++# METIS = ../../metis-4.0/libmetis.a + + # If you use CHOLMOD_CONFIG = -DNPARTITION then you must use the following + # options: +@@ -193,7 +191,7 @@ + # CFLAGS = -O3 -fexceptions \ + -Wall -W -Werror -Wshadow -Wmissing-prototypes -Wstrict-prototypes \ + -Wredundant-decls -Wnested-externs -Wdisabled-optimization -ansi +-CFLAGS = -O3 -fexceptions -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE ++ + # CFLAGS = -O3 + + # consider: +@@ -252,11 +250,15 @@ + # Macintosh + #------------------------------------------------------------------------------ + +-# CC = gcc +-# CFLAGS = -O3 -fno-common -no-cpp-precomp -fexceptions +-# LIB = -lstdc++ +-# BLAS = -framework Accelerate +-# LAPACK = -framework Accelerate ++: ${CC = $CC} ++: ${CFLAGS = $CFLAGS} ++OPTFLAGS = $(CFLAGS) ++F77 = f2c ++F77FLAGS = ++F77LIB = ++LIB = -lstdc++ ++BLAS = -framework Accelerate ++LAPACK = -framework Accelerate + + #------------------------------------------------------------------------------ + # IBM RS 6000 +diff -u -u _SuiteSparse/CSparse/Lib/Makefile SuiteSparse/CSparse/Lib/Makefile +--- ./SuiteSparse/CSparse/Lib/Makefile 2007-05-05 22:46:13.000000000 +0200 ++++ ./SuiteSparse/CSparse/Lib/Makefile 2007-06-12 18:08:29.000000000 +0200 +@@ -1,9 +1,7 @@ + # Modify the "-O" optimization option for best performance (-O3 on Linux): +-CC = cc +-CFLAGS = -O -I../Include ++include ../../UFconfig/UFconfig.mk + +-AR = ar cr +-RANLIB = ranlib ++C = $(CC) $(CFLAGS) $(CONFIG) -I../Include -I../../UFconfig + + all: libcsparse.a + +@@ -20,7 +18,7 @@ + $(CS): ../Include/cs.h Makefile + + %.o: ../Source/%.c ../Include/cs.h +- $(CC) $(CFLAGS) -c $< ++ $(C) -c $< + + libcsparse.a: $(CS) + $(AR) libcsparse.a $(CS) +diff -u -u _SuiteSparse/CSparse/Makefile SuiteSparse/CSparse/Makefile +--- ./SuiteSparse/CSparse/Makefile 2007-05-05 22:37:37.000000000 +0200 ++++ ./SuiteSparse/CSparse/Makefile 2007-06-12 18:12:06.000000000 +0200 +@@ -2,9 +2,8 @@ + + C: + ( cd Lib ; $(MAKE) ) +- ( cd Demo ; $(MAKE) ) + +-all: C tcov ++all: C + + library: + ( cd Lib ; $(MAKE) ) +diff -u -u _SuiteSparse/CXSparse/Makefile SuiteSparse/CXSparse/Makefile +--- ./SuiteSparse/CXSparse/Makefile 2007-05-05 22:37:37.000000000 +0200 ++++ ./SuiteSparse/CXSparse/Makefile 2007-06-12 18:15:05.000000000 +0200 +@@ -2,9 +2,8 @@ + + C: + ( cd Lib ; $(MAKE) ) +- ( cd Demo ; $(MAKE) ) + +-all: C tcov ++all: C + + library: + ( cd Lib ; $(MAKE) ) +diff -u -u _SuiteSparse/CXSparse/Lib/Makefile SuiteSparse/CXSparse/Lib/Makefile +--- ./SuiteSparse/CXSparse/Lib/Makefile 2007-05-05 23:03:41.000000000 +0200 ++++ ./SuiteSparse/CXSparse/Lib/Makefile 2007-06-12 18:16:59.000000000 +0200 +@@ -1,10 +1,7 @@ + # Modify the "-O" optimization option for best performance (-O3 on Linux): +-CC = cc +-CFLAGS = -O +-I = -I../../UFconfig -I../Include ++include ../../UFconfig/UFconfig.mk + +-AR = ar cr +-RANLIB = ranlib ++C = $(CC) $(CFLAGS) $(CONFIG) -I../Include -I../../UFconfig + + all: libcxsparse.a + +@@ -71,19 +68,19 @@ + $(CS): ../Include/cs.h Makefile + + cs_convert.o: ../Source/cs_convert.c +- $(CC) $(CFLAGS) $(I) -c $< -o $@ ++ $(C) -c $< -o $@ + + %_di.o : ../Source/%.c +- $(CC) $(CFLAGS) $(I) -c $< -o $@ ++ $(C) -c $< -o $@ + + %_dl.o : ../Source/%.c +- $(CC) $(CFLAGS) $(I) -DCS_LONG -c $< -o $@ ++ $(C) -DCS_LONG -c $< -o $@ + + %_ci.o : ../Source/%.c +- $(CC) $(CFLAGS) $(I) -DCS_COMPLEX -c $< -o $@ ++ $(C) -DCS_COMPLEX -c $< -o $@ + + %_cl.o : ../Source/%.c +- $(CC) $(CFLAGS) $(I) -DCS_LONG -DCS_COMPLEX -c $< -o $@ ++ $(C) -DCS_LONG -DCS_COMPLEX -c $< -o $@ + + libcxsparse.a: $(CS) + $(AR) libcxsparse.a $(CS)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/admin/MacOSX/solvedeps/f2c-19991025.diff Thu Jul 26 19:56:05 2007 +0000 @@ -0,0 +1,44 @@ +diff -u -u _f2c/src/makefile f2c/src/makefile +--- ./f2c/src/makefile 2000-10-06 23:19:41.000000000 +0200 ++++ ./f2c/src/makefile 2007-06-11 19:26:19.000000000 +0200 +@@ -1,10 +1,10 @@ + # Makefile for f2c, a Fortran 77 to C converter + + .SUFFIXES: .c .o +-CC = cc +-CFLAGS = -O ++: ${CC = cc} ++: ${CFLAGS = -O} + SHELL = /bin/sh +-YACC = yacc ++: ${YACC = yacc} + YFLAGS = + + .c.o: +--- ./f2c/libf2c/makefile 2000-10-06 23:19:47.000000000 +0200 ++++ ./f2c/libf2c/makefile 2007-06-11 19:30:29.000000000 +0200 +@@ -10,9 +10,9 @@ + # -DNON_UNIX_STDIO + # to the CLFAGS = line below. + .SUFFIXES: .c .o +-CC = cc ++: ${CC = cc} + SHELL = /bin/sh +-CFLAGS = -O ++: ${CFLAGS = -O} + + # compile, then strip unnecessary symbols + .c.o: +@@ -70,10 +70,10 @@ + ### If your system lacks ranlib, you don't need it; see README. + + f77vers.o: f77vers.c +- $(CC) -c f77vers.c ++ $(CC) $(CFLAGS) -c f77vers.c + + i77vers.o: i77vers.c +- $(CC) -c i77vers.c ++ $(CC) $(CFLAGS) -c i77vers.c + + # To get an "f2c.h" for use with "f2c -C++", first "make hadd" + hadd: f2c.h0 f2ch.add
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/admin/MacOSX/solvedeps/octave-2.9.12.diff Thu Jul 26 19:56:05 2007 +0000 @@ -0,0 +1,515 @@ +diff -u -u ./octave-2.9.12/Makeconf.in ./octave-2.9.12/Makeconf.in +--- ./octave-2.9.12/Makeconf.in 2007-05-22 18:33:06.000000000 +0200 ++++ ./octave-2.9.12/Makeconf.in 2007-06-01 22:17:41.000000000 +0200 +@@ -351,8 +351,6 @@ + # LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, PATH, ... + library_path_var = @library_path_var@ + +-MKOCTFILE_DL_LDFLAGS = @MKOCTFILE_DL_LDFLAGS@ +- + NO_OCT_FILE_STRIP = @NO_OCT_FILE_STRIP@ + + # The following pattern rules and the substitution functions require +@@ -500,7 +498,7 @@ + -e "s|%OCTAVE_CONF_LIBREADLINE%|\"${LIBREADLINE}\"|" \ + -e "s|%OCTAVE_CONF_LIBS%|\"${LIBS}\"|" \ + -e "s|%OCTAVE_CONF_LN_S%|\"${LN_S}\"|" \ +- -e "s|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"${MKOCTFILE_DL_LDFLAGS}\"|" \ ++ -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"@MKOCTFILE_DL_LDFLAGS@\"|' \ + -e "s|%OCTAVE_CONF_OCTINCLUDEDIR%|\"${octincludedir}\"|" \ + -e "s|%OCTAVE_CONF_OCTLIBDIR%|\"${octlibdir}\"|" \ + -e "s|%OCTAVE_CONF_PREFIX%|\"${prefix}\"|" \ +diff -u -u ./octave-2.9.12/configure.in ./octave-2.9.12/configure.in +--- ./octave-2.9.12/configure.in 2007-04-26 21:00:48.000000000 +0200 ++++ ./octave-2.9.12/configure.in 2007-06-01 22:20:28.000000000 +0200 +@@ -1102,7 +1102,7 @@ + ;; + *-*-darwin*) + DL_LDFLAGS='-bundle -bundle_loader $(TOPDIR)/src/octave $(LDFLAGS)' +- MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader $(bindir)/octave-$(version)$(EXEEXT)' ++ MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader $$BINDIR/octave-$$OCTAVE_VERSION$$EXEEXT' + SH_LDFLAGS='-dynamiclib -single_module $(LDFLAGS)' + CXXPICFLAG= + CPICFLAG= +@@ -1774,9 +1774,9 @@ + dnl "broken shell backslash quoting" or somesuch. + dnl + case "$canonical_host_type" in +- *-*-darwin*) +- UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\",g'` +- ;; ++ #*-*-darwin*) ++ # UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\",g'` ++ #;; + *) + UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\",g'` + ;; +diff -u -u octave-2.9.12/mkoctfile.in octave-2.9.12/mkoctfile.in +--- octave-2.9.12/mkoctfile.in 2007-02-16 12:14:44.000000000 +0100 ++++ octave-2.9.12/mkoctfile.in 2007-06-30 17:17:50.000000000 +0200 +@@ -12,30 +12,35 @@ + OCTAVE_VERSION=%OCTAVE_CONF_VERSION% + OCTAVE_PREFIX=%OCTAVE_CONF_PREFIX% + +-DEFAULT_OCTINCLUDEDIR=%OCTAVE_CONF_OCTINCLUDEDIR% ++DEFAULT_BINDIR=%OCTAVE_BINDIR% + DEFAULT_INCLUDEDIR=%OCTAVE_CONF_INCLUDEDIR% ++DEFAULT_OCTINCLUDEDIR=%OCTAVE_CONF_OCTINCLUDEDIR% + DEFAULT_OCTLIBDIR=%OCTAVE_CONF_OCTLIBDIR% + + if [ -n "$OCTAVE_HOME" ]; then +- DEFAULT_OCTINCLUDEDIR="`echo $DEFAULT_OCTINCLUDEDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`" ++ DEFAULT_BINDIR="`echo $DEFAULT_BINDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`" + DEFAULT_INCLUDEDIR="`echo $DEFAULT_INCLUDEDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`" ++ DEFAULT_OCTINCLUDEDIR="`echo $DEFAULT_OCTINCLUDEDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`" + DEFAULT_OCTLIBDIR="`echo $DEFAULT_OCTLIBDIR | $SED "s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`" + fi + +-: ${OCTINCLUDEDIR=$DEFAULT_OCTINCLUDEDIR} ++: ${BINDIR=$DEFAULT_BINDIR} + : ${INCLUDEDIR=$DEFAULT_INCLUDEDIR} ++: ${OCTINCLUDEDIR=$DEFAULT_OCTINCLUDEDIR} + : ${OCTLIBDIR=$DEFAULT_OCTLIBDIR} + +-DEFAULT_INCFLAGS="-I$OCTINCLUDEDIR -I$OCTINCLUDEDIR/octave" ++DEFAULT_INCFLAGS="-I'$OCTINCLUDEDIR' -I'$OCTINCLUDEDIR/octave'" + if [ "$INCLUDEDIR" != /usr/include ]; then +- DEFAULT_INCFLAGS="$DEFAULT_INCFLAGS -I$INCLUDEDIR" ++ DEFAULT_INCFLAGS="$DEFAULT_INCFLAGS -I'$INCLUDEDIR'" + fi + +-DEFAULT_LFLAGS="-L$OCTLIBDIR" ++DEFAULT_LFLAGS="-L'$OCTLIBDIR'" + + # Default values for these variables are filled in when Octave is + # compiled. + ++: ${EXEEXT=%OCTAVE_CONF_EXEEXT%} ++ + : ${CPPFLAGS=%OCTAVE_CONF_CPPFLAGS%} + : ${INCFLAGS=$DEFAULT_INCFLAGS} + : ${F2C=%OCTAVE_CONF_F2C%} +diff -u -r1.8 SparseCmplxQR.cc +--- ./octave-2.9.12/liboctave/SparseCmplxQR.cc 10 Apr 2007 21:13:22 -0000 1.8 ++++ ./octave-2.9.12/liboctave/SparseCmplxQR.cc 2 Jun 2007 07:16:18 -0000 +@@ -27,14 +27,22 @@ + #include "lo-error.h" + #include "SparseCmplxQR.h" + ++#if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER < 2)) || (CS_VER < 2)) ++typedef double _Complex cs_complex_t; ++ + // Why did g++ 4.x stl_vector.h make +-// OCTAVE_LOCAL_BUFFER (double _Complex, buf, n) ++// OCTAVE_LOCAL_BUFFER (cs_complex_t, buf, n) + // an error ? + #define OCTAVE_C99_COMPLEX(buf, n) \ + OCTAVE_LOCAL_BUFFER (double, buf ## tmp, (2 * (n))); \ +- double _Complex *buf = reinterpret_cast<double _Complex *> (buf ## tmp); ++ cs_complex_t *buf = reinterpret_cast<cs_complex_t *> (buf ## tmp); + +-#define OCTAVE_C99_ZERO (0. + 0.iF); ++#else ++#define OCTAVE_C99_COMPLEX(buf, n) \ ++ OCTAVE_LOCAL_BUFFER (cs_complex_t, buf, (n)); ++#endif ++ ++#define OCTAVE_C99_ZERO (0. + 0.iF) + + SparseComplexQR::SparseComplexQR_rep::SparseComplexQR_rep + (GCC_ATTR_UNUSED const SparseComplexMatrix& a, GCC_ATTR_UNUSED int order) +@@ -49,7 +57,7 @@ + // Prevents the methods below making a copy of the data. + A.p = const_cast<octave_idx_type *>(a.cidx ()); + A.i = const_cast<octave_idx_type *>(a.ridx ()); +- A.x = const_cast<double _Complex *>(reinterpret_cast<const double _Complex *> ++ A.x = const_cast<cs_complex_t *>(reinterpret_cast<const cs_complex_t *> + (a.data ())); + A.nz = -1; + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; +@@ -180,8 +188,8 @@ + octave_idx_type b_nc = b.cols(); + octave_idx_type nc = N->L->n; + octave_idx_type nr = nrows; +- const double _Complex *bvec = +- reinterpret_cast<const double _Complex *>(b.fortran_vec()); ++ const cs_complex_t *bvec = ++ reinterpret_cast<const cs_complex_t *>(b.fortran_vec()); + ComplexMatrix ret(b_nr,b_nc); + Complex *vec = ret.fortran_vec(); + if (nr < 1 || nc < 1 || nr != b_nr) +@@ -196,10 +204,10 @@ + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_ipvec) +- (S->pinv, bvec + idx, reinterpret_cast<double _Complex *>(buf), b_nr); ++ (S->pinv, bvec + idx, reinterpret_cast<cs_complex_t *>(buf), b_nr); + #else + CXSPARSE_ZNAME (_ipvec) +- (b_nr, S->Pinv, bvec + idx, reinterpret_cast<double _Complex *>(buf)); ++ (b_nr, S->Pinv, bvec + idx, reinterpret_cast<cs_complex_t *>(buf)); + #endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + for (volatile octave_idx_type i = 0; i < nm; i++) +@@ -207,7 +215,7 @@ + OCTAVE_QUIT; + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + CXSPARSE_ZNAME (_happly) +- (N->L, i, N->B[i], reinterpret_cast<double _Complex *>(buf)); ++ (N->L, i, N->B[i], reinterpret_cast<cs_complex_t *>(buf)); + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + } + for (octave_idx_type i = 0; i < b_nr; i++) +@@ -240,7 +248,7 @@ + if (! q.ok ()) + return ComplexMatrix(); + x.resize(nc, b_nc); +- double _Complex *vec = reinterpret_cast<double _Complex *> ++ cs_complex_t *vec = reinterpret_cast<cs_complex_t *> + (x.fortran_vec()); + OCTAVE_C99_COMPLEX (buf, q.S()->m2); + OCTAVE_LOCAL_BUFFER (Complex, Xx, b_nr); +@@ -254,10 +262,10 @@ + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_ipvec) +- (q.S()->pinv, reinterpret_cast<double _Complex *>(Xx), buf, nr); ++ (q.S()->pinv, reinterpret_cast<cs_complex_t *>(Xx), buf, nr); + #else + CXSPARSE_ZNAME (_ipvec) +- (nr, q.S()->Pinv, reinterpret_cast<double _Complex *>(Xx), buf); ++ (nr, q.S()->Pinv, reinterpret_cast<cs_complex_t *>(Xx), buf); + #endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + for (volatile octave_idx_type j = 0; j < nc; j++) +@@ -285,14 +293,20 @@ + if (! q.ok ()) + return ComplexMatrix(); + x.resize(nc, b_nc); +- double _Complex *vec = reinterpret_cast<double _Complex *> ++ cs_complex_t *vec = reinterpret_cast<cs_complex_t *> + (x.fortran_vec()); + volatile octave_idx_type nbuf = (nc > q.S()->m2 ? nc : q.S()->m2); + OCTAVE_C99_COMPLEX (buf, nbuf); + OCTAVE_LOCAL_BUFFER (Complex, Xx, b_nr); ++#if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER >= 2)) || (CS_VER > 2)) ++ OCTAVE_LOCAL_BUFFER (double, B, nr); ++ for (octave_idx_type i = 0; i < nr; i++) ++ B[i] = q.N()->B [i]; ++#else + OCTAVE_LOCAL_BUFFER (Complex, B, nr); + for (octave_idx_type i = 0; i < nr; i++) + B[i] = conj (reinterpret_cast<Complex *>(q.N()->B) [i]); ++#endif + for (volatile octave_idx_type i = 0, idx = 0; i < b_nc; i++, idx+=nc) + { + OCTAVE_QUIT; +@@ -303,10 +317,10 @@ + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_pvec) +- (q.S()->q, reinterpret_cast<double _Complex *>(Xx), buf, nr); ++ (q.S()->q, reinterpret_cast<cs_complex_t *>(Xx), buf, nr); + #else + CXSPARSE_ZNAME (_pvec) +- (nr, q.S()->Q, reinterpret_cast<double _Complex *>(Xx), buf); ++ (nr, q.S()->Q, reinterpret_cast<cs_complex_t *>(Xx), buf); + #endif + CXSPARSE_ZNAME (_utsolve) (q.N()->U, buf); + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; +@@ -315,8 +329,12 @@ + OCTAVE_QUIT; + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + ++#if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER >= 2)) || (CS_VER > 2)) ++ CXSPARSE_ZNAME (_happly) (q.N()->L, j, B[j], buf); ++#else + CXSPARSE_ZNAME (_happly) +- (q.N()->L, j, reinterpret_cast<double _Complex *>(B)[j], buf); ++ (q.N()->L, j, reinterpret_cast<cs_complex_t *>(B)[j], buf); ++#endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + } + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; +@@ -372,10 +390,10 @@ + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_ipvec) +- (q.S()->pinv, reinterpret_cast<double _Complex *>(Xx), buf, nr); ++ (q.S()->pinv, reinterpret_cast<cs_complex_t *>(Xx), buf, nr); + #else + CXSPARSE_ZNAME (_ipvec) +- (nr, q.S()->Pinv, reinterpret_cast<double _Complex *>(Xx), buf); ++ (nr, q.S()->Pinv, reinterpret_cast<cs_complex_t *>(Xx), buf); + #endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + for (volatile octave_idx_type j = 0; j < nc; j++) +@@ -389,10 +407,10 @@ + CXSPARSE_ZNAME (_usolve) (q.N()->U, buf); + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_ipvec) +- (q.S()->q, buf, reinterpret_cast<double _Complex *>(Xx), nc); ++ (q.S()->q, buf, reinterpret_cast<cs_complex_t *>(Xx), nc); + #else + CXSPARSE_ZNAME (_ipvec) +- (nc, q.S()->Q, buf, reinterpret_cast<double _Complex *>(Xx)); ++ (nc, q.S()->Q, buf, reinterpret_cast<cs_complex_t *>(Xx)); + #endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + +@@ -430,9 +448,16 @@ + volatile octave_idx_type nbuf = (nc > q.S()->m2 ? nc : q.S()->m2); + OCTAVE_LOCAL_BUFFER (Complex, Xx, (b_nr > nc ? b_nr : nc)); + OCTAVE_C99_COMPLEX (buf, nbuf); ++ ++#if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER >= 2)) || (CS_VER > 2)) ++ OCTAVE_LOCAL_BUFFER (double, B, nr); ++ for (octave_idx_type i = 0; i < nr; i++) ++ B[i] = q.N()->B [i]; ++#else + OCTAVE_LOCAL_BUFFER (Complex, B, nr); + for (octave_idx_type i = 0; i < nr; i++) + B[i] = conj (reinterpret_cast<Complex *>(q.N()->B) [i]); ++#endif + for (volatile octave_idx_type i = 0, idx = 0; i < b_nc; i++, idx+=nc) + { + OCTAVE_QUIT; +@@ -443,10 +468,10 @@ + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_pvec) +- (q.S()->q, reinterpret_cast<double _Complex *>(Xx), buf, nr); ++ (q.S()->q, reinterpret_cast<cs_complex_t *>(Xx), buf, nr); + #else + CXSPARSE_ZNAME (_pvec) +- (nr, q.S()->Q, reinterpret_cast<double _Complex *>(Xx), buf); ++ (nr, q.S()->Q, reinterpret_cast<cs_complex_t *>(Xx), buf); + #endif + CXSPARSE_ZNAME (_utsolve) (q.N()->U, buf); + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; +@@ -454,17 +479,21 @@ + { + OCTAVE_QUIT; + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; ++#if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER >= 2)) || (CS_VER > 2)) ++ CXSPARSE_ZNAME (_happly) (q.N()->L, j, B[j], buf); ++#else + CXSPARSE_ZNAME (_happly) +- (q.N()->L, j, reinterpret_cast<double _Complex *>(B)[j], buf); ++ (q.N()->L, j, reinterpret_cast<cs_complex_t *>(B)[j], buf); ++#endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + } + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_pvec) +- (q.S()->pinv, buf, reinterpret_cast<double _Complex *>(Xx), nc); ++ (q.S()->pinv, buf, reinterpret_cast<cs_complex_t *>(Xx), nc); + #else + CXSPARSE_ZNAME (_pvec) +- (nc, q.S()->Pinv, buf, reinterpret_cast<double _Complex *>(Xx)); ++ (nc, q.S()->Pinv, buf, reinterpret_cast<cs_complex_t *>(Xx)); + #endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + +@@ -506,8 +535,8 @@ + octave_idx_type nc = a.cols(); + octave_idx_type b_nc = b.cols(); + octave_idx_type b_nr = b.rows(); +- const double _Complex *bvec = +- reinterpret_cast<const double _Complex *>(b.fortran_vec()); ++ const cs_complex_t *bvec = ++ reinterpret_cast<const cs_complex_t *>(b.fortran_vec()); + ComplexMatrix x; + + if (nr < 1 || nc < 1 || nr != b_nr) +@@ -519,7 +548,7 @@ + if (! q.ok ()) + return ComplexMatrix(); + x.resize(nc, b_nc); +- double _Complex *vec = reinterpret_cast<double _Complex *> ++ cs_complex_t *vec = reinterpret_cast<cs_complex_t *> + (x.fortran_vec()); + OCTAVE_C99_COMPLEX (buf, q.S()->m2); + for (volatile octave_idx_type i = 0, idx = 0, bidx = 0; i < b_nc; +@@ -560,13 +589,19 @@ + if (! q.ok ()) + return ComplexMatrix(); + x.resize(nc, b_nc); +- double _Complex *vec = reinterpret_cast<double _Complex *> ++ cs_complex_t *vec = reinterpret_cast<cs_complex_t *> + (x.fortran_vec()); + volatile octave_idx_type nbuf = (nc > q.S()->m2 ? nc : q.S()->m2); + OCTAVE_C99_COMPLEX (buf, nbuf); ++#if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER >= 2)) || (CS_VER > 2)) ++ OCTAVE_LOCAL_BUFFER (double, B, nr); ++ for (octave_idx_type i = 0; i < nr; i++) ++ B[i] = q.N()->B [i]; ++#else + OCTAVE_LOCAL_BUFFER (Complex, B, nr); + for (octave_idx_type i = 0; i < nr; i++) + B[i] = conj (reinterpret_cast<Complex *>(q.N()->B) [i]); ++#endif + for (volatile octave_idx_type i = 0, idx = 0, bidx = 0; i < b_nc; + i++, idx+=nc, bidx+=b_nr) + { +@@ -585,8 +620,12 @@ + { + OCTAVE_QUIT; + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; ++#if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER >= 2)) || (CS_VER > 2)) ++ CXSPARSE_ZNAME (_happly) (q.N()->L, j, B[j], buf); ++#else + CXSPARSE_ZNAME (_happly) +- (q.N()->L, j, reinterpret_cast<double _Complex *>(B)[j], buf); ++ (q.N()->L, j, reinterpret_cast<cs_complex_t *>(B)[j], buf); ++#endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + } + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; +@@ -642,10 +681,10 @@ + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_ipvec) +- (q.S()->pinv, reinterpret_cast<double _Complex *>(Xx), buf, nr); ++ (q.S()->pinv, reinterpret_cast<cs_complex_t *>(Xx), buf, nr); + #else + CXSPARSE_ZNAME (_ipvec) +- (nr, q.S()->Pinv, reinterpret_cast<double _Complex *>(Xx), buf); ++ (nr, q.S()->Pinv, reinterpret_cast<cs_complex_t *>(Xx), buf); + #endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + for (volatile octave_idx_type j = 0; j < nc; j++) +@@ -659,10 +698,10 @@ + CXSPARSE_ZNAME (_usolve) (q.N()->U, buf); + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_ipvec) +- (q.S()->q, buf, reinterpret_cast<double _Complex *>(Xx), nc); ++ (q.S()->q, buf, reinterpret_cast<cs_complex_t *>(Xx), nc); + #else + CXSPARSE_ZNAME (_ipvec) +- (nc, q.S()->Q, buf, reinterpret_cast<double _Complex *>(Xx)); ++ (nc, q.S()->Q, buf, reinterpret_cast<cs_complex_t *>(Xx)); + #endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + +@@ -700,9 +739,15 @@ + volatile octave_idx_type nbuf = (nc > q.S()->m2 ? nc : q.S()->m2); + OCTAVE_LOCAL_BUFFER (Complex, Xx, (b_nr > nc ? b_nr : nc)); + OCTAVE_C99_COMPLEX (buf, nbuf); ++#if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER >= 2)) || (CS_VER > 2)) ++ OCTAVE_LOCAL_BUFFER (double, B, nr); ++ for (octave_idx_type i = 0; i < nr; i++) ++ B[i] = q.N()->B [i]; ++#else + OCTAVE_LOCAL_BUFFER (Complex, B, nr); + for (octave_idx_type i = 0; i < nr; i++) + B[i] = conj (reinterpret_cast<Complex *>(q.N()->B) [i]); ++#endif + for (volatile octave_idx_type i = 0, idx = 0; i < b_nc; i++, idx+=nc) + { + OCTAVE_QUIT; +@@ -713,10 +758,10 @@ + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_pvec) +- (q.S()->q, reinterpret_cast<double _Complex *>(Xx), buf, nr); ++ (q.S()->q, reinterpret_cast<cs_complex_t *>(Xx), buf, nr); + #else + CXSPARSE_ZNAME (_pvec) +- (nr, q.S()->Q, reinterpret_cast<double _Complex *>(Xx), buf); ++ (nr, q.S()->Q, reinterpret_cast<cs_complex_t *>(Xx), buf); + #endif + CXSPARSE_ZNAME (_utsolve) (q.N()->U, buf); + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; +@@ -724,17 +769,21 @@ + { + OCTAVE_QUIT; + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; ++#if defined(CS_VER) && (((CS_VER == 2) && (CS_SUBVER >= 2)) || (CS_VER > 2)) ++ CXSPARSE_ZNAME (_happly) (q.N()->L, j, B[j], buf); ++#else + CXSPARSE_ZNAME (_happly) +- (q.N()->L, j, reinterpret_cast<double _Complex *>(B)[j], buf); ++ (q.N()->L, j, reinterpret_cast<cs_complex_t *>(B)[j], buf); ++#endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + } + BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + #if defined(CS_VER) && (CS_VER >= 2) + CXSPARSE_ZNAME (_pvec) +- (q.S()->pinv, buf, reinterpret_cast<double _Complex *>(Xx), nc); ++ (q.S()->pinv, buf, reinterpret_cast<cs_complex_t *>(Xx), nc); + #else + CXSPARSE_ZNAME (_pvec) +- (nc, q.S()->Pinv, buf, reinterpret_cast<double _Complex *>(Xx)); ++ (nc, q.S()->Pinv, buf, reinterpret_cast<cs_complex_t *>(Xx)); + #endif + END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; + +diff -u -r1.7 -r1.8 +--- ./octave-2.9.12/liboctave/oct-sparse.h 10 Jan 2007 18:20:18 -0000 1.7 ++++ ./octave-2.9.12/liboctave/oct-sparse.h 24 May 2007 00:50:33 -0000 1.8 +@@ -28,10 +28,6 @@ + #include <config.h> + #endif + +-#ifdef __cplusplus +-extern "C" { +-#endif +- + #if defined (HAVE_SUITESPARSE_UMFPACK_H) + #include <suitesparse/umfpack.h> + #elif defined (HAVE_UFSPARSE_UMFPACK_H) +@@ -103,8 +99,4 @@ + #endif + #endif + +-#ifdef __cplusplus +-} +-#endif +- + #endif + +diff -u -r1.5 spline.m +--- ./octave-2.9.12/scripts/polynomial/spline.m 22 Jan 2007 17:28:17 -0000 1.5 ++++ ./octave-2.9.12/scripts/polynomial/spline.m 2 Jun 2007 19:33:44 -0000 +@@ -218,22 +218,22 @@ + %! %-------------------------------------------------------- + %! % confirm that interpolated function matches the original + +-%!shared x,y +-%! x = [0:10]; y = sin(x); +-%!assert (spline(x,y,x), y); +-%!assert (spline(x,y,x'), y'); +-%!assert (spline(x',y',x'), y'); +-%!assert (spline(x',y',x), y); ++%!shared x,y,abserr ++%! x = [0:10]; y = sin(x); abserr = 1e-14; ++%!assert (spline(x,y,x), y, abserr); ++%!assert (spline(x,y,x'), y', abserr); ++%!assert (spline(x',y',x'), y', abserr); ++%!assert (spline(x',y',x), y, abserr); + %!assert (isempty(spline(x',y',[]))); + %!assert (isempty(spline(x,y,[]))); +-%!assert (spline(x,[y;y],x), [spline(x,y,x);spline(x,y,x)]) ++%!assert (spline(x,[y;y],x), [spline(x,y,x);spline(x,y,x)],abserr) + %! y = cos(x) + i*sin(x); +-%!assert ( spline(x,y,x), y ) +-%!assert ( real(spline(x,y,x)), real(y) ); +-%!assert ( real(spline(x,y,x.')), real(y).' ); +-%!assert ( real(spline(x.',y.',x.')), real(y).' ); +-%!assert ( real(spline(x.',y,x)), real(y) ); +-%!assert ( imag(spline(x,y,x)), imag(y) ); +-%!assert ( imag(spline(x,y,x.')), imag(y).' ); +-%!assert ( imag(spline(x.',y.',x.')), imag(y).' ); +-%!assert ( imag(spline(x.',y,x)), imag(y) ); ++%!assert (spline(x,y,x), y, abserr) ++%!assert (real(spline(x,y,x)), real(y), abserr); ++%!assert (real(spline(x,y,x.')), real(y).', abserr); ++%!assert (real(spline(x.',y.',x.')), real(y).', abserr); ++%!assert (real(spline(x.',y,x)), real(y), abserr); ++%!assert (imag(spline(x,y,x)), imag(y), abserr); ++%!assert (imag(spline(x,y,x.')), imag(y).', abserr); ++%!assert (imag(spline(x.',y.',x.')), imag(y).', abserr); ++%!assert (imag(spline(x.',y,x)), imag(y), abserr);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/admin/MacOSX/solvedeps/solvedeps-2.9.12.sh Thu Jul 26 19:56:05 2007 +0000 @@ -0,0 +1,488 @@ +#!/bin/sh +# Copyright (C) 2007, Thomas Treichl and Paul Kienzle +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +# You're not free in choosing another compiler than XCode's - so this +# is set up automatically. By default we use f2c that is compiled as +# the first program if used input argument '--all'. + +# This is the name of the file that is used for displaying outputs +# while configuring, compiling and installing. Use /dev/stdout to +# display all messages in the running terminal. +MSGFILE=/dev/stdout #/tmp/message.log # /dev/stdout + +# This is the name of the directory where all dependencies are +# installed. The string "-ppc" or "-i386" is added to the end of the +# given pathname, eg. /tmp/abc becomes /tmp/abc-pcc etc. +INSTDIR=/tmp/dependencies + +F2CPACK=http://www.llnl.gov/casc/Overture/henshaw/software/f2c.tar.gz +F2CDIFF=./f2c.diff +# You can try to set up gfortran instead of f2c but it is very +# difficult to do that. A good starting point for this would be +# eg. http://gcc.gnu.org/wiki/GFortranBinariesMacOS. + +READLINEPACK=http://ftp.gnu.org/pub/gnu/readline/readline-5.2.tar.gz + +PCREPACK=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.0.tar.gz + +LIBZPACK=ftp://ftp.hdfgroup.org/lib-external/zlib/1.2/src/zlib-1.2.1.tar.gz + +HDF5PACK=http://ftp.debian.org/debian/pool/main/h/hdf5/hdf5_1.6.5.orig.tar.gz +HDF5DIFF=http://ftp.debian.org/debian/pool/main/h/hdf5/hdf5_1.6.5-5.diff.gz + +FFTWPACK=http://ftp.debian.org/debian/pool/main/f/fftw3/fftw3_3.1.2.orig.tar.gz +FFTWDIFF=http://ftp.debian.org/debian/pool/main/f/fftw3/fftw3_3.1.2-2.diff.gz + +CURLPACK=http://curl.haxx.se/download/curl-7.16.2.tar.gz + +GLPKPACK=http://ftp.gnu.org/gnu/glpk/glpk-4.17.tar.gz + +SPARSEPACK=http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-3.0.0.tar.gz +SPARSEDIFF=./SuiteSparse.diff + +OCTAVEPACK=ftp://ftp.octave.org/pub/octave/bleeding-edge/octave-2.9.12.tar.gz +OCTAVEDIFF=./octave-2.9.12.diff + +########################################################################## +##### Don't modify anything downwards here ##### +########################################################################## + +# Function: evalfailexit +# Input args: ${1} is the string that has to be evaluated +# ${MSGFILE} is used for output of messages +# Output args: - +# Description: Evaluates the ${1} string, prints a message and exits on fail +evalfailexit() { + if ( ! eval "${1} 2>&1 >${MSGFILE}" ); then + echo "buildoctave.sh: Building Octave.app has failed" + echo "The command that failed was" + echo " ${1}" + exit 1 + fi +} + +# Function: getsource +# Input args: ${1} is the web adress for the file that is downloaded +# Output args: - +# Description: Downloads the source file that is given as ${1} +getsource() { + # Check if we do already have downloaded the ${1}.* file + local vfile=${1##*/} # echo ${vfile} + if [ ! -f ${vfile} ]; then + echo "solvedeps.sh: Downloading \"${vfile}\" ..." + evalfailexit "curl -s -S ${1} -o ${vfile}" + fi +} + +# Function: unpack +# Input args: ${1} is the name of the file that has to be extracted +# Output args: - +# Description: Extracts the source file that is given as ${1} +unpack () { + if [ ${1##*.tar.} == "gz" ]; then + # We really do know that ${1}.tar.gz extracts to ${1} + vlocal=${1%.tar.gz} + if [ ! -d ${vlocal} ]; then + echo "solvedeps.sh: Extracting \"${1}\" ..." + evalfailexit "tar -xzf ${1}" + fi + elif [ ${1##*.} == "dmg" ]; then + echo "solvedeps.sh: No implementation for \".dmg\" at the moment" + exit 1 + fi +} + +########################################################################## +##### Functions for building the Octave dependencies ##### +########################################################################## + +create_f2c () { + local vf2cpack=${F2CPACK##*/} # echo ${vf2cpack} + local vf2cfile=${vf2cpack%.tar.gz*} # echo ${vf2cfile} + local vf2cdiff=${F2CDIFF##*/} # echo ${vf2cdiff} + getsource ${F2CPACK} + unpack ${vf2cpack} + + echo "solvedeps.sh: Creating installation directories ..." + evalfailexit "install -d ${INSTDIR}{,/bin,/lib,/include}" + + echo "solvedeps.sh: Applying the patch ${vf2cdiff} ..." + evalfailexit "patch -p0 < ${vf2cdiff}" + + echo "solvedeps.sh: Making ${vf2cfile}/src ..." + export CC=${CC}; export CFLAGS=${CFLAGS}; export LDFLAGS=${LDFLAGS} + + cd ${vf2cfile}/src + evalfailexit "${MAKE}" + evalfailexit "mv f2c ${INSTDIR}/bin" + + echo "solvedeps.sh: Making ${vf2cfile}/libf2c ..." + cd ../libf2c + evalfailexit "${MAKE}" + evalfailexit "mv f2c.h ${INSTDIR}/include" + evalfailexit "mv libf2c.a ${INSTDIR}/lib" +} + +create_readline () { + local vreadpack=${READLINEPACK##*/} # echo ${vreadpack} + local vreadfile=${vreadpack%.tar.gz*} # echo ${vfilename} + + getsource ${READLINEPACK} + unpack ${vreadpack} + cd ${vreadfile} + echo "solvedeps.sh: Configuring ${vreadfile} ..." + evalfailexit "./configure ${1}" + echo "solvedeps.sh: Making ${vreadfile} ..." + evalfailexit "${MAKE}" + echo "solvedeps.sh: Make install ${vreadfile} ..." + evalfailexit "make install" +} + +create_pcre () { + local vpcrepack=${PCREPACK##*/} # echo ${vpcrepack} + local vpcrefile=${vpcrepack%.tar.gz*} # echo ${vpcrefile} + + getsource ${PCREPACK} + unpack ${vpcrepack} + cd ${vpcrefile} + echo "solvedeps.sh: Configuring ${vpcrefile} ..." + evalfailexit "./configure ${1}" + echo "solvedeps.sh: Making ${vpcrefile} ..." + evalfailexit "${MAKE}" + echo "solvedeps.sh: Make install ${vpcrefile} ..." + evalfailexit "make install" +} + +create_libz () { +# The link /Developer/SDKs/MacOSX10.3.9.sdk/usr/lib/libz.dylib has +# to be removed, otherwise the SDK internal libz is found and this +# is a bug. + local vlibzpack=${LIBZPACK##*/} # echo ${vlibzpack} + local vlibzfile=${vlibzpack%.tar.gz*} # echo ${vlibzfile} + + getsource ${LIBZPACK} + unpack ${vlibzpack} + + echo "solvedeps.sh: Configuring ${vlibzfile} ..." + cd ${vlibzfile} + export CC=${CC} + export CFLAGS=${CFLAGS} + export PREFIX=${INSTDIR} + evalfailexit "./configure --shared --prefix=${INSTDIR}" + echo "solvedeps.sh: Making ${vlibzfile} ..." + evalfailexit "${MAKE}" + evalfailexit "make install" + echo "solvedeps.sh: Make install ${vlibzfile} ..." + evalfailexit "install -c -S libz.a ${INSTDIR}/lib" + evalfailexit "install -c -S crc32.h inffast.h inflate.h trees.h zutil.h ${INSTDIR}/include" + evalfailexit "install -c -S deflate.h inffixed.h inftrees.h zconf.h zlib.h ${INSTDIR}/include" +} + +create_hdf5 () { +# CF. http://www.llnl.gov/visit/1.6/BUILD_NOTES_MacOSX about building +# the hdf5 library for MacOSX - it fails but it is already enough when +# compilation fails. Also "make -j 2" may fail with this package if +# cross-compiled. + local vhdf5pack=${HDF5PACK##*/} # echo ${vhdf5pack} + local vhdf5file=${vhdf5pack%.orig.tar.gz*} # echo ${vhdf5file} + local vhdf5diff=${HDF5DIFF##*/} # echo ${vhdf5diff} + local vdiffname=${vhdf5diff%.gz*} # echo ${vdiffname} + + getsource ${HDF5PACK} + unpack ${vhdf5pack} + getsource ${HDF5DIFF} + evalfailexit "gunzip ${vhdf5diff}" + evalfailexit "patch -p0 < ${vdiffname}" + + cd `echo ${vhdf5file} | sed "s/_/-/g"` + echo "solvedependencies.sh: Configuring ${vhdf5file} ..." + export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} + evalfailexit "./configure CFLAGS=\"${CFLAGS}\" --prefix=${INSTDIR} --disable-cxx" + echo "solvedependencies.sh: Making ${vhdf5file} ..." + evalfailexit "make" + echo "solvedependencies.sh: Make install ${vhdf5file} ..." + evalfailexit "make install" +} + +create_fftw () { + local vfftwpack=${FFTWPACK##*/} # echo ${vfftwpack} + local vfftwfile=${vfftwpack%.orig.tar.gz*} # echo ${vfilename} + local vfftwdiff=${FFTWDIFF##*/} # echo ${vfftwdiff} + local vdiffname=${vfftwdiff%.gz*} # echo ${vdiffname} + + getsource ${FFTWPACK} + unpack ${vfftwpack} + getsource ${FFTWDIFF} + evalfailexit "mv fftw-3.1.2 fftw3-3.1.2" + evalfailexit "gunzip ${vfftwdiff}" + evalfailexit "patch -p0 < ${vdiffname}" + + cd `echo ${vfftwfile} | sed "s/_/-/g"` + echo "solvedeps.sh: Configuring ${vfilename} ..." + evalfailexit "./configure ${1} --enable-shared" + echo "solvedeps.sh: Making ${vfilename} ..." + evalfailexit "${MAKE}" + echo "solvedeps.sh: Make install ${vfilename} ..." + evalfailexit "make install" + cd .. +} + +create_curl () { + local vcurlpack=${CURLPACK##*/} # echo ${vcurlpack} + local vcurlfile=${vcurlpack%.tar.gz*} # echo ${vcurlfile} + + getsource ${CURLPACK} + unpack ${vcurlpack} + cd ${vcurlfile} + echo "solvedeps.sh: Configuring ${vcurlfile} ..." + evalfailexit "./configure ${1}" + echo "solvedeps.sh: Making ${vcurlfile} ..." + evalfailexit "${MAKE}" + echo "solvedeps.sh: Make install ${vcurlfile} ..." + evalfailexit "make install" +} + +create_glpk () { + local vglpkpack=${GLPKPACK##*/} # echo ${vglpkpack} + local vglpkfile=${vglpkpack%.tar.gz*} # echo ${vglpkfile} + + getsource ${GLPKPACK} + unpack ${vglpkpack} + cd ${vglpkfile} + echo "solvedeps.sh: Configuring ${vglpkfile} ..." + evalfailexit "./configure ${1}" + echo "solvedeps.sh: Making ${vglpkfile} ..." + evalfailexit "${MAKE}" + echo "solvedeps.sh: Make install ${vglpkfile} ..." + evalfailexit "make install" +} + +create_sparse() { + local vsparsepack=${SPARSEPACK##*/} # echo ${vsparsepack} + local vsparsefile=${vsparsepack%.tar.gz*} # echo ${vsparsefile} + local vsparsediff=${SPARSEDIFF##*/} # echo ${vsparsediff} + + getsource ${SPARSEPACK} + unpack ${vsparsepack} + + export CC="${CC}" + export CFLAGS="${CFLAGS} -O3 -fno-common -no-cpp-precomp -fexceptions -D_POSIX_C_SOURCE -D__NOEXTENSIONS__ -DNPARTITION" + export PREFIX=${INSTDIR} + + echo "solvedeps.sh: Applying patch ${vsparsediff} ..." + evalfailexit "patch -p0 < SuiteSparse.diff" + + evalfailexit "mv SuiteSparse ${vsparsefile}" + cd ${vsparsefile} + evalfailexit "make" + cd CXSparse + evalfailexit "make" + cd .. + + echo "solvedeps.sh: Checking for target directories ..." + evalfailexit "install -d ${INSTDIR}{,/bin,/lib,/include}" + evalfailexit "install -c -S UFconfig/UFconfig.h ${INSTDIR}/include" + + echo "solvedeps.sh: Installing UMFPACK files in ${INSTDIR}" + evalfailexit "install -c -S UMFPACK/Include/*.h ${INSTDIR}/include" + evalfailexit "install -c -S UMFPACK/Lib/libumfpack.a ${INSTDIR}/lib" + evalfailexit "ranlib ${INSTDIR}/lib/libumfpack.a" + + echo "solvedeps.sh: Installing AMD files in ${INSTDIR}" + evalfailexit "install -c -S AMD/Include/*.h ${INSTDIR}/include" + evalfailexit "install -c -S AMD/Lib/libamd.a ${INSTDIR}/lib" + evalfailexit "ranlib ${INSTDIR}/lib/libamd.a" + + echo "solvedeps.sh: Installing CAMD files in ${INSTDIR}" + evalfailexit "install -c -S CAMD/Include/*.h ${INSTDIR}/include" + evalfailexit "install -c -S CAMD/Lib/libcamd.a ${INSTDIR}/lib" + evalfailexit "ranlib ${INSTDIR}/lib/libcamd.a" + + echo "solvedeps.sh: Installing COLAMD files in ${INSTDIR}" + evalfailexit "install -c -S COLAMD/Include/*.h ${INSTDIR}/include" + evalfailexit "install -c -S COLAMD/Lib/libcolamd.a ${INSTDIR}/lib" + evalfailexit "ranlib ${INSTDIR}/lib/libcolamd.a" + + echo "solvedeps.sh: Installing CCOLAMD files in ${INSTDIR}" + evalfailexit "install -c -S CCOLAMD/Include/*.h ${INSTDIR}/include" + evalfailexit "install -c -S CCOLAMD/Lib/libccolamd.a ${INSTDIR}/lib" + evalfailexit "ranlib ${INSTDIR}/lib/libccolamd.a" + + echo "solvedeps.sh: Installing CXSPARSE files in ${INSTDIR}" + evalfailexit "install -c -S CXSparse/Include/*.h ${INSTDIR}/include" + evalfailexit "install -c -S CXSparse/Lib/libcxsparse.a ${INSTDIR}/lib" + evalfailexit "ranlib ${INSTDIR}/lib/libcxsparse.a" + + echo "solvedeps.sh: Installing CHOLMOD files in ${INSTDIR}" + evalfailexit "install -c -S CHOLMOD/Include/*h ${INSTDIR}/include" + evalfailexit "install -c -S CHOLMOD/Lib/libcholmod.a ${INSTDIR}/lib" + evalfailexit "ranlib ${INSTDIR}/lib/libcholmod.a" +} + +create_octave() { + local voctavepack=${OCTAVEPACK##*/} # echo ${voctavepack} + local voctavefile=${voctavepack%.tar.gz*} # echo ${voctavefile} + local voctavediff=${OCTAVEDIFF##*/} # echo ${voctavediff} + local voctversion=${voctavefile##*-} # echo ${voctversion} + + getsource ${OCTAVEPACK} + unpack ${voctavepack} + + echo "solvedeps.sh: Applying patch ${voctavediff} ..." + evalfailexit "patch -p0 < ${voctavediff}" + + echo "solvedeps.sh: Calling Octave's autogen.sh ..." + cd ${voctavefile} + evalfailexit "./autogen.sh" + + echo "solvedeps.sh: Configuring ${voctavefile} ..." + evalfailexit "./configure ${1} --enable-shared --with-f2c" + echo "solvedeps.sh: Making ${voctavefile} ..." + evalfailexit "${MAKE}" + echo "solvedeps.sh: Make install ${voctavefile} ..." + evalfailexit "make install" + + echo "solvedeps.sh: Removing special strings in mkoctfile-${voctversion} ..." + sed "s:${CFLAGS}::g;s:${LDFLAGS}::g;s:${ARCH}::g" \ + < ${INSTDIR}/bin/mkoctfile-${voctversion} > /tmp/mkoctfile-${voctversion} + evalfailexit "install -c -S /tmp/mkoctfile-${voctversion} ${INSTDIR}/bin/mkoctfile-${voctversion}" + evalfailexit "rm -f /tmp/mkoctfile-${voctversion}" + + echo "solvedeps.sh: Removing special strings in octave-bug-${voctversion} ..." + sed "s:${CFLAGS}::g;s:${LDFLAGS}::g;s:${ARCH}::g" \ + < ${INSTDIR}/bin/octave-bug-${voctversion} > /tmp/octave-bug-${voctversion} + evalfailexit "install -c -S /tmp/octave-bug-${voctversion} ${INSTDIR}/bin/octave-bug-${voctversion}" + evalfailexit "rm -f /tmp/octave-bug-${voctversion}" +} + +# This is the main bash routine +if [ $# -ne 2 ]; then + echo "Usage: solvedeps.sh LIBRARY ARCHITECTURE" + exit 1 +else + case "${2}" in + --ppc) + INSTDIR=${INSTDIR}-ppc + ARCH="-arch ppc" + BUILDARCH="--host=powerpc-apple-darwin7.9.1" + MACOSX_DEPLOYMENT_TARGET=10.3 + + CC="MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc" + CXX="MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} g++" + CPP="MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} cpp" + + CFLAGS="${ARCH} -isysroot /Developer/SDKs/MacOSX10.3.9.sdk -I${INSTDIR}/include" + CXXFLAGS="${ARCH} -isysroot /Developer/SDKs/MacOSX10.3.9.sdk -I${INSTDIR}/include" + CPPFLAGS="${ARCH} -isysroot /Developer/SDKs/MacOSX10.3.9.sdk -I${INSTDIR}/include" + LDFLAGS="${ARCH} -Wl,-headerpad_max_install_names,-syslibroot,/Developer/SDKs/MacOSX10.3.9.sdk -L${INSTDIR}/lib" + ;; + + --i386) + INSTDIR=${INSTDIR}-i386 + ARCH="-arch i386" + BUILDARCH="" + MACOSX_DEPLOYMENT_TARGET=10.4 + + CC="MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc" + CXX="MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} g++" + CPP="MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} cpp" + + CFLAGS="${ARCH} -I${INSTDIR}/include" + CXXFLAGS="${ARCH} -I${INSTDIR}/include" + CPPFLAGS="${ARCH} -I${INSTDIR}/include" + LDFLAGS="${ARCH} -L${INSTDIR}/lib" + ;; + + *) + echo "solvedeps.sh: Unknown input argument ${2}" + exit 1 + ;; + + esac + + # CONFFLAGS="CC=\"${CC}\" CXX=\"${CXX}\" CPP=\"${CPP}\"" + CONFFLAGS="CFLAGS=\"${CFLAGS}\" CPPFLAGS=\"${CPPFLAGS}\"" + CONFFLAGS="${CONFFLAGS} CXXFLAGS=\"${CXXFLAGS}\" LDFLAGS=\"${LDFLAGS}\"" + CONFFLAGS="${CONFFLAGS} --prefix=${INSTDIR} ${BUILDARCH}" + + MAKE="make" + export PATH="${INSTDIR}/bin:${PATH}" + + case "${1}" in + --f2c) + create_f2c "${CONFFLAGS}" + ;; + + --readline) + create_readline "${CONFFLAGS}" + ;; + + --pcre) + create_pcre "${CONFFLAGS}" + ;; + + --zlib) + create_libz "${CONFFLAGS}" + ;; + + --hdf5) + create_hdf5 "${CONFFLAGS}" + ;; + + --fftw) + create_fftw "${CONFFLAGS}" + ;; + + --curl) + create_curl "${CONFFLAGS}" + ;; + + --glpk) + create_glpk "${CONFFLAGS}" + ;; + + --sparse) + create_sparse "${CONFFLAGS}" + ;; + + --octave) + create_octave "${CONFFLAGS}" + ;; + + --all) + # Calling this script again and again to make sure that all + # settings have been deleted that were set for the library or + # the binary that has been compiled before... + ./solvedeps.sh --f2c ${2} + ./solvedeps.sh --readline ${2} + ./solvedeps.sh --pcre ${2} + ./solvedeps.sh --zlib ${2} + ./solvedeps.sh --hdf5 ${2} + ./solvedeps.sh --fftw ${2} + ./solvedeps.sh --curl ${2} + ./solvedeps.sh --glpk ${2} + ./solvedeps.sh --sparse ${2} + ./solvedeps.sh --octave ${2} + ;; + + *) + echo "solvedeps.sh: Unknown input argument ${1}" + exit 1 + ;; + + esac +fi