diff --git a/SuiteSparse/AMD/Demo/Makefile b/SuiteSparse/AMD/Demo/Makefile index 6f7cca448..c6584c0e3 100644 --- a/SuiteSparse/AMD/Demo/Makefile +++ b/SuiteSparse/AMD/Demo/Makefile @@ -4,13 +4,14 @@ default: amd_simple amd_demo amd_demo2 amd_l_demo -include ../../SuiteSparse_config/SuiteSparse_config.mk +gak: + echo $(SUITESPARSE) -C = $(CC) $(CF) -I../Include -I../../SuiteSparse_config +include ../../SuiteSparse_config/SuiteSparse_config.mk -INC = ../Include/amd.h ../../SuiteSparse_config/SuiteSparse_config.h +C = $(CC) $(CF) -I../../include -LIB2 = ../../SuiteSparse_config/libsuitesparseconfig.a $(LIB) +LIB2 = $(LDFLAGS) -L../../lib -lamd -lsuitesparseconfig $(LDLIBS) library: ( cd ../../SuiteSparse_config ; $(MAKE) ) @@ -25,23 +26,24 @@ f77lib: dist: -amd_demo: amd_demo.c library $(INC) - $(C) -o amd_demo amd_demo.c ../Lib/libamd.a $(LIB2) +amd_demo: amd_demo.c library + $(C) -o amd_demo amd_demo.c $(LIB2) ./amd_demo > my_amd_demo.out - diff amd_demo.out my_amd_demo.out -amd_l_demo: amd_l_demo.c library $(INC) - $(C) -o amd_l_demo amd_l_demo.c ../Lib/libamd.a $(LIB2) +amd_l_demo: amd_l_demo.c library + $(C) -o amd_l_demo amd_l_demo.c $(LIB2) ./amd_l_demo > my_amd_l_demo.out - diff amd_l_demo.out my_amd_l_demo.out -amd_demo2: amd_demo2.c library $(INC) - $(C) -o amd_demo2 amd_demo2.c ../Lib/libamd.a $(LIB2) +amd_demo2: amd_demo2.c library + $(C) -o amd_demo2 amd_demo2.c $(LIB2) ./amd_demo2 > my_amd_demo2.out - diff amd_demo2.out my_amd_demo2.out -amd_simple: amd_simple.c library $(INC) - $(C) -o amd_simple amd_simple.c ../Lib/libamd.a $(LIB2) +amd_simple: amd_simple.c library + echo $(LD_LIBRARY_PATH) + $(C) -o amd_simple amd_simple.c $(LIB2) ./amd_simple > my_amd_simple.out - diff amd_simple.out my_amd_simple.out @@ -79,7 +81,7 @@ amd_f77cross: amd_f77cross.f amd_f77wrapper.o ../Lib/libamd.a #------------------------------------------------------------------------------ clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) purge: distclean @@ -91,4 +93,5 @@ distclean: clean - $(RM) amd_f77demo my_amd_f77demo.out - $(RM) amd_f77simple my_amd_f77simple.out - $(RM) amd_f77cross my_amd_f77cross.out - - $(RM) -r *.dSYM + - $(RM) -r $(PURGE) + diff --git a/SuiteSparse/AMD/Demo/amd_demo.out b/SuiteSparse/AMD/Demo/amd_demo.out index a6a9d7194..823a875af 100644 --- a/SuiteSparse/AMD/Demo/amd_demo.out +++ b/SuiteSparse/AMD/Demo/amd_demo.out @@ -1,7 +1,7 @@ -AMD version 2.4.1, date: Oct 10, 2014 +AMD version 2.4.4, date: Feb 1, 2016 AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from amd_order: 0 (should be 0) -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/SuiteSparse/AMD/Demo/amd_demo2.out b/SuiteSparse/AMD/Demo/amd_demo2.out index 7cd13cd14..73be9409d 100644 --- a/SuiteSparse/AMD/Demo/amd_demo2.out +++ b/SuiteSparse/AMD/Demo/amd_demo2.out @@ -1,7 +1,7 @@ AMD demo, with a jumbled version of the 24-by-24 Harwell/Boeing matrix, can_24: -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -144,7 +144,7 @@ Plot of symmetric matrix to be ordered by amd_order: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from amd_order: 1 (should be 1) -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 102 diff --git a/SuiteSparse/AMD/Demo/amd_l_demo.out b/SuiteSparse/AMD/Demo/amd_l_demo.out index 24f3f36b0..f7fb1dfd6 100644 --- a/SuiteSparse/AMD/Demo/amd_l_demo.out +++ b/SuiteSparse/AMD/Demo/amd_l_demo.out @@ -1,7 +1,7 @@ -AMD version 2.4.1, date: Oct 10, 2014 +AMD version 2.4.4, date: Feb 1, 2016 AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from amd_l_order: 0 (should be 0) -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/SuiteSparse/AMD/Doc/AMD_UserGuide.pdf b/SuiteSparse/AMD/Doc/AMD_UserGuide.pdf index b89f5d31c..cf4dced3d 100644 Binary files a/SuiteSparse/AMD/Doc/AMD_UserGuide.pdf and b/SuiteSparse/AMD/Doc/AMD_UserGuide.pdf differ diff --git a/SuiteSparse/AMD/Doc/AMD_UserGuide.tex b/SuiteSparse/AMD/Doc/AMD_UserGuide.tex index f0e7af8d3..b1ebab4c5 100644 --- a/SuiteSparse/AMD/Doc/AMD_UserGuide.tex +++ b/SuiteSparse/AMD/Doc/AMD_UserGuide.tex @@ -32,7 +32,7 @@ This work was supported by the EPSRC under grant GR/R46441. }} -\date{VERSION 2.4.1, Oct 10, 2014} +\date{VERSION 2.4.4, Feb 1, 2016} \maketitle %------------------------------------------------------------------------------ @@ -50,33 +50,30 @@ AMD is available under alternate licences; contact T. Davis for details. {\bf AMD License:} - Your use or distribution of AMD or any modified version of - AMD implies that you agree to this License. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA - - Permission is hereby granted to use or copy this program under the - terms of the GNU LGPL, provided that the Copyright, this License, - and the Availability of the original version is retained on all copies. - User documentation of any code that uses this code or any modified - version of this code must cite the Copyright, this License, the - Availability note, and "Used by permission." Permission to modify - the code and to distribute modified code is granted, provided the - Copyright, this License, and the Availability note are retained, - and a notice that the code was modified is included. +At the user's option, you may use AMD under either the LGPL +version 2.1 license, or the BSD 3-clause license. You may not use both +licenses, nor may you mix-and-match clauses from each license. To use a +license, in the documentation for your application simply state either of the +following, replacing with the name of your application: + + \begin{quote} + AMD, Copyright (c), 1996-2015, Timothy A. Davis, + Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. + Used in under the BSD 3-clause license. + \end{quote} + +or + + \begin{quote} + AMD, Copyright (c), 1996-2015, Timothy A. Davis, + Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. + Used in under the LGPL v2.1 license. + \end{quote} + +In the event that your package includes another package by another +author, and and use AMD under different licenses, you may select +one license to apply to both uses of AMD in the combined application. +See the Doc/License.txt file for the details of each license. {\bf Availability:} http://www.suitesparse.com @@ -690,11 +687,13 @@ \section{Installation} file. You can edit that file to customize the compilation. The default settings will work on most systems. Sample configuration files are provided -for Linux, Sun Solaris, SGI IRIX, IBM AIX, and the DEC/Compaq Alpha. +for Mac, Linux, Sun Solaris, and IBM AIX. +The system you are on is detected automatically. To compile and install the C-callable AMD library, go to the {\tt AMD} directory and type {\tt make}. -The library will be placed in {\tt AMD/Lib/libamd.a}. +A dynamic library is placed in +in {\tt AMD/Lib/libamd.so.*}, ({\tt *.dylib} for the Mac). Three demo programs of the AMD ordering routine will be compiled and tested in the {\tt AMD/Demo} directory. The outputs of these demo programs will then be compared with output @@ -714,13 +713,23 @@ \section{Installation} then you should type {\tt make purge} and then {\tt make} to recompile. When you compile your program that uses the C-callable AMD library, -you need to add the {\tt AMD/Lib/libamd.a} library +you need to add the {\tt AMD/Lib/libamd.*} library and you need to tell your compiler to look in the {\tt AMD/Include} directory for include files. To compile a Fortran program that calls the Fortran AMD library, you need to add the {\tt AMD/Lib/libamdf77.a} library. See {\tt AMD/Demo/Makefile} for an example. +By doing {\tt make}, all compiled dynamic libraries are also copied into {\tt +SuiteSparse/lib} the include files are coped into {\tt SuiteSparse/include}, +and documentation is copied into {\tt SuiteSparse/doc}. + +Alternatively, you can install the shared library +and include files in /usr/local/lib and /usr/local/include, and +the documenation in /usr/local/doc. +Just do {\tt make} then {\tt make install}. +Now you can simply use {\tt -lamd} when you compile your own program. + If all you want to use is the AMD2 mexFunction in MATLAB, you can skip the use of the {\tt make} command entirely. Simply type {\tt amd\_make} in MATLAB while in the {\tt AMD/MATLAB} directory. diff --git a/SuiteSparse/AMD/Doc/ChangeLog b/SuiteSparse/AMD/Doc/ChangeLog index 89dd78333..bf181372b 100644 --- a/SuiteSparse/AMD/Doc/ChangeLog +++ b/SuiteSparse/AMD/Doc/ChangeLog @@ -1,3 +1,16 @@ +Feb 1, 2016: version 2.4.4 + + * update to Makefiles + +Jan 30, 2016: version 2.4.3 + + * modifications to Makefiles + +Jan 1, 2016: version 2.4.2 + + * modified Makefile to create shared libraries + No change to C code except version number + Oct 10, 2014: version 2.4.1 modified MATLAB/amd_make.m. No change to C code except version number. diff --git a/SuiteSparse/AMD/Doc/Makefile b/SuiteSparse/AMD/Doc/Makefile index 0fea14308..3fd03a5ce 100644 --- a/SuiteSparse/AMD/Doc/Makefile +++ b/SuiteSparse/AMD/Doc/Makefile @@ -11,19 +11,19 @@ include ../../SuiteSparse_config/SuiteSparse_config.mk #------------------------------------------------------------------------------ clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) purge: distclean distclean: clean - - $(RM) *.aux *.bbl *.blg *.log *.toc + - $(RM) -r $(PURGE) #------------------------------------------------------------------------------ # Create the User Guide and Quick Start Guide #------------------------------------------------------------------------------ AMD_UserGuide.pdf: AMD_UserGuide.tex AMD_UserGuide.bib ../Include/amd.h - echo '\\begin{verbatim}' > amd_h.tex + echo '\begin{verbatim}' > amd_h.tex expand -8 ../Include/amd.h >> amd_h.tex echo '\end{verbatim}' >> amd_h.tex pdflatex AMD_UserGuide diff --git a/SuiteSparse/AMD/Include/amd.h b/SuiteSparse/AMD/Include/amd.h index c80de1a60..8c4b69a10 100644 --- a/SuiteSparse/AMD/Include/amd.h +++ b/SuiteSparse/AMD/Include/amd.h @@ -386,11 +386,11 @@ void amd_l_info (double Info [ ]) ; * Versions 1.1 and earlier of AMD do not include a #define'd version number. */ -#define AMD_DATE "Oct 10, 2014" +#define AMD_DATE "Feb 1, 2016" #define AMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define AMD_MAIN_VERSION 2 #define AMD_SUB_VERSION 4 -#define AMD_SUBSUB_VERSION 1 +#define AMD_SUBSUB_VERSION 4 #define AMD_VERSION AMD_VERSION_CODE(AMD_MAIN_VERSION,AMD_SUB_VERSION) #ifdef __cplusplus diff --git a/SuiteSparse/AMD/Lib/Makefile b/SuiteSparse/AMD/Lib/Makefile index ac3424e1c..fbbc19324 100644 --- a/SuiteSparse/AMD/Lib/Makefile +++ b/SuiteSparse/AMD/Lib/Makefile @@ -1,69 +1,119 @@ #------------------------------------------------------------------------------- -# AMD Makefile for compiling on Unix systems (for original Make ONLY) +# AMD Lib/Makefile #------------------------------------------------------------------------------- -# This is a very ugly Makefile, and is only provided for those who do not -# have GNU make. Note that it is not used if you have GNU make. It ignores -# dependency checking and just compiles everything. +LIBRARY = libamd +VERSION = 2.4.4 +SO_VERSION = 2 -default: everything +default: library include ../../SuiteSparse_config/SuiteSparse_config.mk +# AMD depends on SuiteSparse_config +LDLIBS += -lsuitesparseconfig + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + C = $(CC) $(CF) -I../Include -I../../SuiteSparse_config -everything: - $(C) -DDINT -c ../Source/amd_aat.c -o amd_i_aat.o - $(C) -DDINT -c ../Source/amd_1.c -o amd_i_1.o - $(C) -DDINT -c ../Source/amd_2.c -o amd_i_2.o - $(C) -DDINT -c ../Source/amd_dump.c -o amd_i_dump.o - $(C) -DDINT -c ../Source/amd_postorder.c -o amd_i_postorder.o - $(C) -DDINT -c ../Source/amd_post_tree.c -o amd_i_post_tree.o - $(C) -DDINT -c ../Source/amd_defaults.c -o amd_i_defaults.o - $(C) -DDINT -c ../Source/amd_order.c -o amd_i_order.o - $(C) -DDINT -c ../Source/amd_control.c -o amd_i_control.o - $(C) -DDINT -c ../Source/amd_info.c -o amd_i_info.o - $(C) -DDINT -c ../Source/amd_valid.c -o amd_i_valid.o - $(C) -DDINT -c ../Source/amd_preprocess.c -o amd_i_preprocess.o - $(C) -DDLONG -c ../Source/amd_aat.c -o amd_l_aat.o - $(C) -DDLONG -c ../Source/amd_1.c -o amd_l_1.o - $(C) -DDLONG -c ../Source/amd_2.c -o amd_l_2.o - $(C) -DDLONG -c ../Source/amd_dump.c -o amd_l_dump.o - $(C) -DDLONG -c ../Source/amd_postorder.c -o amd_l_postorder.o - $(C) -DDLONG -c ../Source/amd_post_tree.c -o amd_l_post_tree.o - $(C) -DDLONG -c ../Source/amd_defaults.c -o amd_l_defaults.o - $(C) -DDLONG -c ../Source/amd_order.c -o amd_l_order.o - $(C) -DDLONG -c ../Source/amd_control.c -o amd_l_control.o - $(C) -DDLONG -c ../Source/amd_info.c -o amd_l_info.o - $(C) -DDLONG -c ../Source/amd_valid.c -o amd_l_valid.o - $(C) -DDLONG -c ../Source/amd_preprocess.c -o amd_l_preprocess.o - $(ARCHIVE) ../Lib/libamd.a \ - amd_i_aat.o amd_i_1.o amd_i_2.o amd_i_dump.o \ - amd_i_postorder.o amd_i_post_tree.o amd_i_defaults.o amd_i_order.o \ - amd_i_control.o amd_i_info.o amd_i_valid.o amd_l_aat.o amd_l_1.o \ - amd_l_2.o amd_l_dump.o amd_l_postorder.o amd_l_post_tree.o \ - amd_l_defaults.o amd_l_order.o amd_l_control.o amd_l_info.o \ - amd_l_valid.o amd_i_preprocess.o amd_l_preprocess.o - - $(RANLIB) ../Lib/libamd.a - -#------------------------------------------------------------------------------- -# compile the Fortran versions and the libamdf77.a library -#------------------------------------------------------------------------------- - -fortran: +#------------------------------------------------------------------------------- +# source files +#------------------------------------------------------------------------------- + +AMD = amd_aat amd_1 amd_2 amd_dump amd_postorder amd_defaults \ + amd_post_tree \ + amd_order amd_control amd_info amd_valid amd_preprocess + +INC = ../Include/amd.h ../Include/amd_internal.h \ + ../../SuiteSparse_config/SuiteSparse_config.h + +#------------------------------------------------------------------------------- +# object files for each version +#------------------------------------------------------------------------------- + +AMDI = $(addsuffix .o, $(subst amd_,amd_i_,$(AMD))) +AMDL = $(addsuffix .o, $(subst amd_,amd_l_,$(AMD))) +OBJ = $(AMDI) $(AMDL) + +#------------------------------------------------------------------------------- +# compile each int and long routine (with no real/complex version) +#------------------------------------------------------------------------------- + +amd_i_%.o: ../Source/amd_%.c $(INC) + $(C) -DDINT -c $< -o $@ + +amd_l_%.o: ../Source/amd_%.c $(INC) + $(C) -DDLONG -c $< -o $@ + +#------------------------------------------------------------------------------- +# Create the static library (C versions only) +#------------------------------------------------------------------------------- + +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ + +#------------------------------------------------------------------------------- +# compile the Fortran versions and the libamdf77.a library (static only) +#------------------------------------------------------------------------------- + +fortran: libamdf77.a + +AMDF77 = amd.o amdbar.o + +amd.o: ../Source/amd.f $(F77) $(F77FLAGS) -c ../Source/amd.f -o amd.o + +amdbar.o: ../Source/amdbar.f $(F77) $(F77FLAGS) -c ../Source/amdbar.f -o amdbar.o - $(ARCHIVE) ../Lib/libamdf77.a amd.o amdbar.o - - $(RANLIB) ../Lib/libamdf77.a + +libamdf77.a: $(AMDF77) + $(ARCHIVE) libamdf77.a $^ + - $(RANLIB) libamdf77.a + +#------------------------------------------------------------------------------- +# install (shared C version only) +#------------------------------------------------------------------------------- + +# install AMD +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/amd.h $(INSTALL_INCLUDE) + $(CP) ../Doc/AMD_UserGuide.pdf $(INSTALL_DOC) + $(CP) ../README.txt $(INSTALL_DOC)/AMD_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/amd.h + chmod 644 $(INSTALL_DOC)/AMD_UserGuide.pdf + chmod 644 $(INSTALL_DOC)/AMD_README.txt + +# uninstall AMD +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/amd.h + $(RM) $(INSTALL_DOC)/AMD_UserGuide.pdf + $(RM) $(INSTALL_DOC)/AMD_README.txt #------------------------------------------------------------------------------- # Remove all but the files in the original distribution #------------------------------------------------------------------------------- clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) purge: distclean distclean: clean - - $(RM) ../Lib/libamd.a ../Lib/libamdf77.a + - $(RM) -r $(PURGE) + diff --git a/SuiteSparse/AMD/Makefile b/SuiteSparse/AMD/Makefile index 0b1e01b83..4ec4ad2af 100644 --- a/SuiteSparse/AMD/Makefile +++ b/SuiteSparse/AMD/Makefile @@ -1,8 +1,9 @@ #------------------------------------------------------------------------------ -# AMD Makefile (for GNU Make or original make) +# AMD Makefile #------------------------------------------------------------------------------ -VERSION = 2.4.1 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all @@ -60,14 +61,9 @@ lib: library # install AMD install: - $(CP) Lib/libamd.a $(INSTALL_LIB)/libamd.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libamd.$(VERSION).a libamd.a ) - $(CP) Include/amd.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libamd* - chmod 644 $(INSTALL_INCLUDE)/amd.h + ( cd Lib ; $(MAKE) install ) # uninstall AMD uninstall: - $(RM) $(INSTALL_LIB)/libamd*.a - $(RM) $(INSTALL_INCLUDE)/amd.h + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/AMD/README.txt b/SuiteSparse/AMD/README.txt index f6c970d1f..fa6c63f87 100644 --- a/SuiteSparse/AMD/README.txt +++ b/SuiteSparse/AMD/README.txt @@ -19,6 +19,7 @@ Quick start (Unix, or Windows with Cygwin): unused *.o files (keeps the compiled libraries and demo programs). See the User Guide (Doc/AMD_UserGuide.pdf), or ../SuiteSparse_config/SuiteSparse_config.mk for more details. + To install do "make install" Quick start (for MATLAB users); @@ -189,9 +190,6 @@ Files and directories in the AMD distribution: MATLAB directory: --------------------------------------------------------------------------- - GNUmakefile a nice Makefile, for GNU make - Makefile an ugly Unix Makefile (for older make's) - Contents.m for "help amd2" listing of toolbox contents amd2.m MATLAB help file for AMD @@ -205,9 +203,8 @@ Files and directories in the AMD distribution: can_24.mat input file for AMD demo --------------------------------------------------------------------------- - Lib directory: libamd.a and libamdf77.a libraries placed here + Lib directory: libamd.a and libamd.so library placed here --------------------------------------------------------------------------- - GNUmakefile a nice Makefile, for GNU make - Makefile an ugly Unix Makefile (for older make's) - libamd.def AMD definitions for Windows + Makefile Makefile for both shared and static libraries + diff --git a/SuiteSparse/BTF/Doc/ChangeLog b/SuiteSparse/BTF/Doc/ChangeLog index 6848f9e00..61d91f5f7 100644 --- a/SuiteSparse/BTF/Doc/ChangeLog +++ b/SuiteSparse/BTF/Doc/ChangeLog @@ -1,3 +1,16 @@ +Feb 1, 2016: version 1.2.4 + + * update to Makefiles + +Jan 30, 2016: version 1.2.3 + + * modifications to Makefiles + +Jan 1, 2016: version 1.2.2 + + * modified Makefile to create shared libraries + No change to C code except version number + Oct 10, 2014: version 1.2.1 modified MATLAB/btf_make.m. No change to C code except version number. diff --git a/SuiteSparse/BTF/Include/btf.h b/SuiteSparse/BTF/Include/btf.h index 8435e4d4f..c055249b9 100644 --- a/SuiteSparse/BTF/Include/btf.h +++ b/SuiteSparse/BTF/Include/btf.h @@ -254,11 +254,11 @@ SuiteSparse_long btf_l_order (SuiteSparse_long, SuiteSparse_long *, * #endif */ -#define BTF_DATE "Oct 10, 2014" +#define BTF_DATE "Feb 1, 2016" #define BTF_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define BTF_MAIN_VERSION 1 #define BTF_SUB_VERSION 2 -#define BTF_SUBSUB_VERSION 1 +#define BTF_SUBSUB_VERSION 4 #define BTF_VERSION BTF_VERSION_CODE(BTF_MAIN_VERSION,BTF_SUB_VERSION) #ifdef __cplusplus diff --git a/SuiteSparse/BTF/Lib/Makefile b/SuiteSparse/BTF/Lib/Makefile index 0069c9333..29a8afa4d 100644 --- a/SuiteSparse/BTF/Lib/Makefile +++ b/SuiteSparse/BTF/Lib/Makefile @@ -1,9 +1,24 @@ -default: all +#------------------------------------------------------------------------------- +# BTF Lib/Makefile +#------------------------------------------------------------------------------- -ccode: all +LIBRARY = libbtf +VERSION = 1.2.4 +SO_VERSION = 1 + +default: library include ../../SuiteSparse_config/SuiteSparse_config.mk +# BTF depends on SuiteSparse_config +LDLIBS += -lsuitesparseconfig + +ccode: all + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + # for testing only: # TEST = -DTESTING @@ -15,14 +30,12 @@ I = -I../Include -I../../SuiteSparse_config all: library -library: libbtf.a - OBJ = btf_order.o btf_maxtrans.o btf_strongcomp.o \ btf_l_order.o btf_l_maxtrans.o btf_l_strongcomp.o -libbtf.a: $(OBJ) - $(ARCHIVE) libbtf.a $(OBJ) - - $(RANLIB) libbtf.a +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ $(OBJ): $(INC) @@ -50,10 +63,35 @@ btf_l_strongcomp.o: ../Source/btf_strongcomp.c #------------------------------------------------------------------------------- +# install BTF +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/btf.h $(INSTALL_INCLUDE) + $(CP) ../README.txt $(INSTALL_DOC)/BTF_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/btf.h + chmod 644 $(INSTALL_DOC)/BTF_README.txt + +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/btf.h + $(RM) $(INSTALL_DOC)/BTF_README.txt + +#------------------------------------------------------------------------------- + purge: distclean distclean: clean - - $(RM) libbtf.a + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) diff --git a/SuiteSparse/BTF/Makefile b/SuiteSparse/BTF/Makefile index 59bd62d9f..39438a642 100644 --- a/SuiteSparse/BTF/Makefile +++ b/SuiteSparse/BTF/Makefile @@ -2,7 +2,8 @@ # BTF Makefile #------------------------------------------------------------------------------ -VERSION = 1.2.1 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: library @@ -23,14 +24,8 @@ purge: distclean # install BTF install: - $(CP) Lib/libbtf.a $(INSTALL_LIB)/libbtf.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libbtf.$(VERSION).a libbtf.a ) - $(CP) Include/btf.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libbtf*.a - chmod 644 $(INSTALL_INCLUDE)/btf.h + ( cd Lib ; $(MAKE) install ) # uninstall BTF uninstall: - $(RM) $(INSTALL_LIB)/libbtf*.a - $(RM) $(INSTALL_INCLUDE)/btf.h - + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/BTF/README.txt b/SuiteSparse/BTF/README.txt index 88eb64e26..05e0198f8 100644 --- a/SuiteSparse/BTF/README.txt +++ b/SuiteSparse/BTF/README.txt @@ -1,4 +1,4 @@ -BTF, by Timothy A. Davis, Copyright (C) 2004-2012, University of Florida +BTF, by Timothy A. Davis, Copyright (C) 2004-2016, University of Florida BTF is also available under other licenses; contact the author for details. http://www.suitesparse.com @@ -14,8 +14,10 @@ Requires SuiteSparse_config, in the ../SuiteSparse_config directory relative to this directory. KLU relies on the BTF package to permute the matrix prior to factorization. -To compile the libbtf.a library, type "make". The compiled library is located -in BTF/Lib/libbtf.a. Compile code that uses BTF with -IBTF/Include. +To compile the libbtf.a and libbtf.so library (*.dylib on the Mac), type +"make". The compiled library is located in BTF/Lib. Compile code that uses +BTF with -IBTF/Include. Type "make install" to install the library in +/usr/local/lib and /usr/local/include, and "make uninstall" to remove it. Type "make clean" to remove all but the compiled library, and "make distclean" to remove all files not in the original distribution. diff --git a/SuiteSparse/CAMD/Demo/Makefile b/SuiteSparse/CAMD/Demo/Makefile index 352b7687e..65d4f1e90 100644 --- a/SuiteSparse/CAMD/Demo/Makefile +++ b/SuiteSparse/CAMD/Demo/Makefile @@ -6,11 +6,9 @@ default: camd_simple camd_demo camd_demo2 camd_l_demo include ../../SuiteSparse_config/SuiteSparse_config.mk -C = $(CC) $(CF) -I../Include -I../../SuiteSparse_config +C = $(CC) $(CF) -I../../include -INC = ../Include/camd.h ../../SuiteSparse_config/SuiteSparse_config.h - -LIB2 = ../../SuiteSparse_config/libsuitesparseconfig.a $(LIB) +LIB2 = $(LDFLAGS) -L../../lib -lcamd -lsuitesparseconfig $(LDLIBS) library: ( cd ../../SuiteSparse_config ; $(MAKE) ) @@ -22,23 +20,23 @@ library: dist: -camd_demo: camd_demo.c library $(INC) - $(C) -o camd_demo camd_demo.c ../Lib/libcamd.a $(LIB2) +camd_demo: camd_demo.c library + $(C) -o camd_demo camd_demo.c $(LIB2) ./camd_demo > my_camd_demo.out - diff camd_demo.out my_camd_demo.out -camd_l_demo: camd_l_demo.c library $(INC) - $(C) -o camd_l_demo camd_l_demo.c ../Lib/libcamd.a $(LIB2) +camd_l_demo: camd_l_demo.c library + $(C) -o camd_l_demo camd_l_demo.c $(LIB2) ./camd_l_demo > my_camd_l_demo.out - diff camd_l_demo.out my_camd_l_demo.out -camd_demo2: camd_demo2.c library $(INC) - $(C) -o camd_demo2 camd_demo2.c ../Lib/libcamd.a $(LIB2) +camd_demo2: camd_demo2.c library + $(C) -o camd_demo2 camd_demo2.c $(LIB2) ./camd_demo2 > my_camd_demo2.out - diff camd_demo2.out my_camd_demo2.out -camd_simple: camd_simple.c library $(INC) - $(C) -o camd_simple camd_simple.c ../Lib/libcamd.a $(LIB2) +camd_simple: camd_simple.c library + $(C) -o camd_simple camd_simple.c $(LIB2) ./camd_simple > my_camd_simple.out - diff camd_simple.out my_camd_simple.out @@ -47,7 +45,7 @@ camd_simple: camd_simple.c library $(INC) #------------------------------------------------------------------------------ clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) purge: distclean @@ -56,4 +54,5 @@ distclean: clean - $(RM) camd_l_demo my_camd_l_demo.out - $(RM) camd_demo2 my_camd_demo2.out - $(RM) camd_simple my_camd_simple.out - - $(RM) -r *.dSYM + - $(RM) -r $(PURGE) + diff --git a/SuiteSparse/CAMD/Demo/camd_demo.out b/SuiteSparse/CAMD/Demo/camd_demo.out index 1d55cfde5..fe0065ad5 100644 --- a/SuiteSparse/CAMD/Demo/camd_demo.out +++ b/SuiteSparse/CAMD/Demo/camd_demo.out @@ -1,7 +1,7 @@ -CAMD version 2.4, date: Oct 10, 2014 +CAMD version 2.4, date: Feb 1, 2016 CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -camd version 2.4, Oct 10, 2014: approximate minimum degree ordering: +camd version 2.4, Feb 1, 2016: approximate minimum degree ordering: dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from camd_order: 0 (should be 0) -CAMD version 2.4.1, Oct 10, 2014, results: +CAMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/SuiteSparse/CAMD/Demo/camd_demo2.out b/SuiteSparse/CAMD/Demo/camd_demo2.out index 2de9360d2..addc095f3 100644 --- a/SuiteSparse/CAMD/Demo/camd_demo2.out +++ b/SuiteSparse/CAMD/Demo/camd_demo2.out @@ -1,7 +1,7 @@ CAMD demo, with a jumbled version of the 24-by-24 Harwell/Boeing matrix, can_24: -camd version 2.4, Oct 10, 2014: approximate minimum degree ordering: +camd version 2.4, Feb 1, 2016: approximate minimum degree ordering: dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -144,7 +144,7 @@ Plot of symmetric matrix to be ordered by camd_order: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from camd_order: 1 (should be 1) -CAMD version 2.4.1, Oct 10, 2014, results: +CAMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 102 diff --git a/SuiteSparse/CAMD/Demo/camd_l_demo.out b/SuiteSparse/CAMD/Demo/camd_l_demo.out index f58fbe31a..c203375c1 100644 --- a/SuiteSparse/CAMD/Demo/camd_l_demo.out +++ b/SuiteSparse/CAMD/Demo/camd_l_demo.out @@ -1,7 +1,7 @@ -CAMD version 2.4, date: Oct 10, 2014 +CAMD version 2.4, date: Feb 1, 2016 CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -camd version 2.4, Oct 10, 2014: approximate minimum degree ordering: +camd version 2.4, Feb 1, 2016: approximate minimum degree ordering: dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from camd_l_order: 0 (should be 0) -CAMD version 2.4.1, Oct 10, 2014, results: +CAMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/SuiteSparse/CAMD/Doc/CAMD_UserGuide.pdf b/SuiteSparse/CAMD/Doc/CAMD_UserGuide.pdf index 2aaa15169..36d9a6bd5 100644 Binary files a/SuiteSparse/CAMD/Doc/CAMD_UserGuide.pdf and b/SuiteSparse/CAMD/Doc/CAMD_UserGuide.pdf differ diff --git a/SuiteSparse/CAMD/Doc/CAMD_UserGuide.tex b/SuiteSparse/CAMD/Doc/CAMD_UserGuide.tex index 5a401240c..68ce78784 100644 --- a/SuiteSparse/CAMD/Doc/CAMD_UserGuide.tex +++ b/SuiteSparse/CAMD/Doc/CAMD_UserGuide.tex @@ -34,7 +34,7 @@ This work was supported by the EPSRC under grant GR/R46441. }} -\date{VERSION 2.4.1, Oct 10, 2014} +\date{VERSION 2.4.4, Feb 1, 2016} \maketitle %------------------------------------------------------------------------------ @@ -542,12 +542,14 @@ \section{Installation} file. You can edit that file to customize the compilation. The default settings will work on most systems. Sample configuration files are provided -for Linux, Sun Solaris, SGI IRIX, IBM AIX, and the DEC/Compaq Alpha. +for Mac, Linux, Sun Solaris, and IBM AIX. +The system you are on is detected automatically. To compile and install the C-callable CAMD library, go to the {\tt CAMD} directory and type {\tt make}. -The library will be placed in {\tt CAMD/Lib/libcamd.a}. -Three demo programs of the CAMD ordering routine will be compiled and tested in +A dynamic library is placed in +in {\tt AMD/Lib/libcamd.so.*}, ({\tt *.dylib} for the Mac). +Three demo programs of the AMD ordering routine will be compiled and tested in the {\tt CAMD/Demo} directory. The outputs of these demo programs will then be compared with output files in the distribution. @@ -560,12 +562,22 @@ \section{Installation} then you should type {\tt make purge} and then {\tt make} to recompile. When you compile your program that uses the C-callable CAMD library, -you need to add the {\tt CAMD/Lib/libcamd.a} library +you need to add the {\tt CAMD/Lib/libcamd.*} library and you need to tell your compiler to look in the {\tt CAMD/Include} directory for include files. See {\tt CAMD/Demo/Makefile} for an example. +By doing {\tt make}, all compiled dynamic libraries are also copied into {\tt +SuiteSparse/lib} the include files are coped into {\tt SuiteSparse/include}, +and documentation is copied into {\tt SuiteSparse/doc}. + +Alternatively, you can install the shared library +and include files in /usr/local/lib and /usr/local/include, and +the documenation in /usr/local/doc. +Just do {\tt make} then {\tt make install}. +Now you can simply use {\tt -lcamd} when you compile your own program. + If all you want to use is the CAMD mexFunction in MATLAB, you can skip the use of the {\tt make} command entirely. Simply type {\tt camd\_make} in MATLAB while in the {\tt CAMD/MATLAB} directory. diff --git a/SuiteSparse/CAMD/Doc/ChangeLog b/SuiteSparse/CAMD/Doc/ChangeLog index 71dcb6d52..e4d4c9e6b 100644 --- a/SuiteSparse/CAMD/Doc/ChangeLog +++ b/SuiteSparse/CAMD/Doc/ChangeLog @@ -1,3 +1,16 @@ +Feb 1, 2016: version 2.4.4 + + * update to Makefiles + +Jan 30, 2016: version 2.4.3 + + * modifications to Makefiles + +Jan 1, 2016: version 2.4.2 + + * modified Makefile to create shared libraries + No change to C code except version number + Oct 10, 2014: version 2.4.1 modified MATLAB/camd_make.m. No change to C code except version number. diff --git a/SuiteSparse/CAMD/Doc/Makefile b/SuiteSparse/CAMD/Doc/Makefile index a77ab6fef..aa53d7f88 100644 --- a/SuiteSparse/CAMD/Doc/Makefile +++ b/SuiteSparse/CAMD/Doc/Makefile @@ -11,21 +11,19 @@ include ../../SuiteSparse_config/SuiteSparse_config.mk #------------------------------------------------------------------------------ clean: - - $(RM) -r $(CLEAN) - - $(RM) camd_temp + - $(RM) -r camd_temp $(CLEAN) purge: distclean distclean: clean - - $(RM) *.aux *.bbl *.blg *.log *.toc - - $(RM) -r *.dSYM + - $(RM) -r $(PURGE) #------------------------------------------------------------------------------ # Create the User Guide and Quick Start Guide #------------------------------------------------------------------------------ CAMD_UserGuide.pdf: CAMD_UserGuide.tex CAMD_UserGuide.bib ../Include/camd.h - echo '\\begin{verbatim}' > camd_h.tex + echo '\begin{verbatim}' > camd_h.tex expand -8 ../Include/camd.h >> camd_h.tex echo '\end{verbatim}' >> camd_h.tex pdflatex CAMD_UserGuide diff --git a/SuiteSparse/CAMD/Doc/cdiff b/SuiteSparse/CAMD/Doc/cdiff old mode 100644 new mode 100755 diff --git a/SuiteSparse/CAMD/Doc/docdiff b/SuiteSparse/CAMD/Doc/docdiff old mode 100644 new mode 100755 diff --git a/SuiteSparse/CAMD/Include/camd.h b/SuiteSparse/CAMD/Include/camd.h index 1602f1718..c92e0411c 100644 --- a/SuiteSparse/CAMD/Include/camd.h +++ b/SuiteSparse/CAMD/Include/camd.h @@ -393,11 +393,11 @@ void camd_l_info (double Info [ ]) ; * #endif */ -#define CAMD_DATE "Oct 10, 2014" +#define CAMD_DATE "Feb 1, 2016" #define CAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define CAMD_MAIN_VERSION 2 #define CAMD_SUB_VERSION 4 -#define CAMD_SUBSUB_VERSION 1 +#define CAMD_SUBSUB_VERSION 4 #define CAMD_VERSION CAMD_VERSION_CODE(CAMD_MAIN_VERSION,CAMD_SUB_VERSION) #ifdef __cplusplus diff --git a/SuiteSparse/CAMD/Lib/Makefile b/SuiteSparse/CAMD/Lib/Makefile index 08b1b4c7f..1eb04b208 100644 --- a/SuiteSparse/CAMD/Lib/Makefile +++ b/SuiteSparse/CAMD/Lib/Makefile @@ -1,57 +1,100 @@ #------------------------------------------------------------------------------- -# CAMD Makefile for compiling on Unix systems (for original Make ONLY) +# CAMD Lib/Makefile #------------------------------------------------------------------------------- -# This is a very ugly Makefile, and is only provided for those who do not -# have GNU make. Note that it is not used if you have GNU make. It ignores -# dependency checking and just compiles everything. +LIBRARY = libcamd +VERSION = 2.4.4 +SO_VERSION = 2 -default: everything +default: library include ../../SuiteSparse_config/SuiteSparse_config.mk +# CAMD depends on SuiteSparse_config +LDLIBS += -lsuitesparseconfig + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + C = $(CC) $(CF) -I../Include -I../../SuiteSparse_config -everything: - $(C) -DDINT -c ../Source/camd_aat.c -o camd_i_aat.o - $(C) -DDINT -c ../Source/camd_1.c -o camd_i_1.o - $(C) -DDINT -c ../Source/camd_2.c -o camd_i_2.o - $(C) -DDINT -c ../Source/camd_dump.c -o camd_i_dump.o - $(C) -DDINT -c ../Source/camd_postorder.c -o camd_i_postorder.o - $(C) -DDINT -c ../Source/camd_defaults.c -o camd_i_defaults.o - $(C) -DDINT -c ../Source/camd_order.c -o camd_i_order.o - $(C) -DDINT -c ../Source/camd_control.c -o camd_i_control.o - $(C) -DDINT -c ../Source/camd_info.c -o camd_i_info.o - $(C) -DDINT -c ../Source/camd_valid.c -o camd_i_valid.o - $(C) -DDINT -c ../Source/camd_preprocess.c -o camd_i_preprocess.o - $(C) -DDLONG -c ../Source/camd_aat.c -o camd_l_aat.o - $(C) -DDLONG -c ../Source/camd_1.c -o camd_l_1.o - $(C) -DDLONG -c ../Source/camd_2.c -o camd_l_2.o - $(C) -DDLONG -c ../Source/camd_dump.c -o camd_l_dump.o - $(C) -DDLONG -c ../Source/camd_postorder.c -o camd_l_postorder.o - $(C) -DDLONG -c ../Source/camd_defaults.c -o camd_l_defaults.o - $(C) -DDLONG -c ../Source/camd_order.c -o camd_l_order.o - $(C) -DDLONG -c ../Source/camd_control.c -o camd_l_control.o - $(C) -DDLONG -c ../Source/camd_info.c -o camd_l_info.o - $(C) -DDLONG -c ../Source/camd_valid.c -o camd_l_valid.o - $(C) -DDLONG -c ../Source/camd_preprocess.c -o camd_l_preprocess.o - $(ARCHIVE) libcamd.a \ - camd_i_aat.o camd_i_1.o camd_i_2.o camd_i_dump.o \ - camd_i_postorder.o camd_i_defaults.o camd_i_order.o \ - camd_i_control.o camd_i_info.o camd_i_valid.o camd_l_aat.o \ - camd_l_1.o camd_l_2.o camd_l_dump.o camd_l_postorder.o \ - camd_l_defaults.o camd_l_order.o camd_l_control.o camd_l_info.o \ - camd_l_valid.o camd_i_preprocess.o camd_l_preprocess.o - - $(RANLIB) libcamd.a +#------------------------------------------------------------------------------- +# source files +#------------------------------------------------------------------------------- + +CAMD = camd_aat camd_1 camd_2 camd_dump camd_postorder camd_defaults \ + camd_order camd_control camd_info camd_valid camd_preprocess + +INC = ../Include/camd.h ../Include/camd_internal.h \ + ../../SuiteSparse_config/SuiteSparse_config.h + +#------------------------------------------------------------------------------- +# object files for each version +#------------------------------------------------------------------------------- + +CAMDI = $(addsuffix .o, $(subst camd_,camd_i_,$(CAMD))) +CAMDL = $(addsuffix .o, $(subst camd_,camd_l_,$(CAMD))) +OBJ = $(CAMDI) $(CAMDL) + +#------------------------------------------------------------------------------- +# compile each int and long routine (with no real/complex version) +#------------------------------------------------------------------------------- + +camd_i_%.o: ../Source/camd_%.c $(INC) + $(C) -DDINT -c $< -o $@ + +camd_l_%.o: ../Source/camd_%.c $(INC) + $(C) -DDLONG -c $< -o $@ + +#------------------------------------------------------------------------------- +# Create the static and shared libraries (C versions only) +#------------------------------------------------------------------------------- + +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ + +#------------------------------------------------------------------------------- +# install (shared C version only) +#------------------------------------------------------------------------------- + +# install CAMD +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/camd.h $(INSTALL_INCLUDE) + $(CP) ../Doc/CAMD_UserGuide.pdf $(INSTALL_DOC) + $(CP) ../README.txt $(INSTALL_DOC)/CAMD_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/camd.h + chmod 644 $(INSTALL_DOC)/CAMD_UserGuide.pdf + chmod 644 $(INSTALL_DOC)/CAMD_README.txt + +# uninstall CAMD +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/camd.h + $(RM) $(INSTALL_DOC)/CAMD_UserGuide.pdf + $(RM) $(INSTALL_DOC)/CAMD_README.txt #------------------------------------------------------------------------------- # Remove all but the files in the original distribution #------------------------------------------------------------------------------- clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) purge: distclean distclean: clean - - $(RM) libcamd.a + - $(RM) -r $(PURGE) + diff --git a/SuiteSparse/CAMD/Makefile b/SuiteSparse/CAMD/Makefile index 9c87731da..cd6d5abcd 100644 --- a/SuiteSparse/CAMD/Makefile +++ b/SuiteSparse/CAMD/Makefile @@ -2,7 +2,8 @@ # CAMD Makefile #------------------------------------------------------------------------------ -VERSION = 2.4.1 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all @@ -50,14 +51,9 @@ lib: library # install CAMD install: - $(CP) Lib/libcamd.a $(INSTALL_LIB)/libcamd.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libcamd.$(VERSION).a libcamd.a ) - $(CP) Include/camd.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libcamd*.a - chmod 644 $(INSTALL_INCLUDE)/camd.h + ( cd Lib ; $(MAKE) install ) # uninstall CAMD uninstall: - $(RM) $(INSTALL_LIB)/libcamd*.a - $(RM) $(INSTALL_INCLUDE)/camd.h + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/CAMD/README.txt b/SuiteSparse/CAMD/README.txt index 53bf19969..27c01a0de 100644 --- a/SuiteSparse/CAMD/README.txt +++ b/SuiteSparse/CAMD/README.txt @@ -18,7 +18,7 @@ Quick start (Unix, or Windows with Cygwin): you do not have MATLAB). When done, type "make clean" to remove unused *.o files (keeps the compiled libraries and demo programs). See the User Guide (Doc/CAMD_UserGuide.pdf), or ../SuiteSparse_config/SuiteSparse_config.mk - for more details. + for more details. To install do "make install". Quick start (for MATLAB users); @@ -195,9 +195,9 @@ Files and directories in the CAMD distribution: can_24.mat input file for CAMD demo --------------------------------------------------------------------------- - Lib directory: libcamd.a library placed here + Lib directory: libcamd.a and libcamd.so library placed here --------------------------------------------------------------------------- - GNUmakefile a nice Makefile, for GNU make - Makefile an ugly Unix Makefile (for older make's) - libcamd.def CAMD definitions for Windows + Makefile Makefile for both shared and static libraries + old/ old version of Makefiles + diff --git a/SuiteSparse/CCOLAMD/Demo/Makefile b/SuiteSparse/CCOLAMD/Demo/Makefile index 0a2950ad1..c0ad95683 100644 --- a/SuiteSparse/CCOLAMD/Demo/Makefile +++ b/SuiteSparse/CCOLAMD/Demo/Makefile @@ -2,15 +2,17 @@ # compile the CCOLAMD demo #----------------------------------------------------------------------------- -default: ccolamd_example ccolamd_l_example +default: all include ../../SuiteSparse_config/SuiteSparse_config.mk -I = -I../Include -I../../SuiteSparse_config +I = -I../../include C = $(CC) $(CF) $(I) -LIB2 = ../../SuiteSparse_config/libsuitesparseconfig.a $(LIB) +LIB2 = $(LDFLAGS) -L../../lib -lccolamd -lsuitesparseconfig $(LDLIBS) + +all: library ccolamd_example ccolamd_l_example library: ( cd ../../SuiteSparse_config ; $(MAKE) ) @@ -22,13 +24,13 @@ library: dist: -ccolamd_example: ccolamd_example.c library - $(C) -o ccolamd_example ccolamd_example.c ../Lib/libccolamd.a $(LIB2) +ccolamd_example: ccolamd_example.c + $(C) -o ccolamd_example ccolamd_example.c $(LIB2) - ./ccolamd_example > my_ccolamd_example.out - diff ccolamd_example.out my_ccolamd_example.out -ccolamd_l_example: ccolamd_l_example.c library - $(C) -o ccolamd_l_example ccolamd_l_example.c ../Lib/libccolamd.a $(LIB2) +ccolamd_l_example: ccolamd_l_example.c + $(C) -o ccolamd_l_example ccolamd_l_example.c $(LIB2) - ./ccolamd_l_example > my_ccolamd_l_example.out - diff ccolamd_l_example.out my_ccolamd_l_example.out @@ -37,11 +39,11 @@ ccolamd_l_example: ccolamd_l_example.c library #------------------------------------------------------------------------------ clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) purge: distclean distclean: clean - $(RM) ccolamd_example ccolamd_l_example - $(RM) my_ccolamd_example.out my_ccolamd_l_example.out - - $(RM) -r *.dSYM + - $(RM) -r $(PURGE) diff --git a/SuiteSparse/CCOLAMD/Demo/ccolamd_example.out b/SuiteSparse/CCOLAMD/Demo/ccolamd_example.out index a4ad86fd4..7da87e260 100644 --- a/SuiteSparse/CCOLAMD/Demo/ccolamd_example.out +++ b/SuiteSparse/CCOLAMD/Demo/ccolamd_example.out @@ -15,7 +15,7 @@ Column 3, with 2 entries: row 1 row 3 -ccolamd version 2.9, Oct 10, 2014: OK. +ccolamd version 2.9, Feb 1, 2016: OK. ccolamd: number of dense or empty rows ignored: 0 ccolamd: number of dense or empty columns ignored: 0 ccolamd: number of garbage collections performed: 0 @@ -38,7 +38,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -csymamd version 2.9, Oct 10, 2014: OK. +csymamd version 2.9, Feb 1, 2016: OK. csymamd: number of dense or empty rows ignored: 0 csymamd: number of dense or empty columns ignored: 0 csymamd: number of garbage collections performed: 0 diff --git a/SuiteSparse/CCOLAMD/Demo/ccolamd_l_example.out b/SuiteSparse/CCOLAMD/Demo/ccolamd_l_example.out index 118c9b730..d7f129b77 100644 --- a/SuiteSparse/CCOLAMD/Demo/ccolamd_l_example.out +++ b/SuiteSparse/CCOLAMD/Demo/ccolamd_l_example.out @@ -15,7 +15,7 @@ Column 3, with 2 entries: row 1 row 3 -ccolamd version 2.9, Oct 10, 2014: OK. +ccolamd version 2.9, Feb 1, 2016: OK. ccolamd: number of dense or empty rows ignored: 0 ccolamd: number of dense or empty columns ignored: 0 ccolamd: number of garbage collections performed: 0 @@ -38,7 +38,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -csymamd version 2.9, Oct 10, 2014: OK. +csymamd version 2.9, Feb 1, 2016: OK. csymamd: number of dense or empty rows ignored: 0 csymamd: number of dense or empty columns ignored: 0 csymamd: number of garbage collections performed: 0 diff --git a/SuiteSparse/CCOLAMD/Doc/ChangeLog b/SuiteSparse/CCOLAMD/Doc/ChangeLog index 49643905b..08727e515 100644 --- a/SuiteSparse/CCOLAMD/Doc/ChangeLog +++ b/SuiteSparse/CCOLAMD/Doc/ChangeLog @@ -1,3 +1,17 @@ +Feb 1, 2016: version 2.9.4 + + * update to Makefiles + +Jan 30, 2016: version 2.9.3 + + * modifications to Makefiles + +Jan 1, 2016: version 2.9.2 + + * modified Makefile to create shared libraries + No change to C code except version number. + The empty file ccolamd_global.c removed. + Oct 10, 2014: version 2.9.1 modified MATLAB/ccolamd_make.m. No change to C code except version number. diff --git a/SuiteSparse/CCOLAMD/Include/ccolamd.h b/SuiteSparse/CCOLAMD/Include/ccolamd.h index 8e2fe1daa..a48c4de08 100644 --- a/SuiteSparse/CCOLAMD/Include/ccolamd.h +++ b/SuiteSparse/CCOLAMD/Include/ccolamd.h @@ -42,11 +42,11 @@ extern "C" { * #endif */ -#define CCOLAMD_DATE "Oct 10, 2014" +#define CCOLAMD_DATE "Feb 1, 2016" #define CCOLAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define CCOLAMD_MAIN_VERSION 2 #define CCOLAMD_SUB_VERSION 9 -#define CCOLAMD_SUBSUB_VERSION 1 +#define CCOLAMD_SUBSUB_VERSION 4 #define CCOLAMD_VERSION \ CCOLAMD_VERSION_CODE(CCOLAMD_MAIN_VERSION,CCOLAMD_SUB_VERSION) diff --git a/SuiteSparse/CCOLAMD/Lib/Makefile b/SuiteSparse/CCOLAMD/Lib/Makefile index 8a471d533..48ba1a679 100644 --- a/SuiteSparse/CCOLAMD/Lib/Makefile +++ b/SuiteSparse/CCOLAMD/Lib/Makefile @@ -1,32 +1,71 @@ #------------------------------------------------------------------------------- -# CCOLAMD Makefile +# CCOLAMD Lib/Makefile #------------------------------------------------------------------------------- -default: libccolamd.a +LIBRARY = libccolamd +VERSION = 2.9.4 +SO_VERSION = 2 + +default: library include ../../SuiteSparse_config/SuiteSparse_config.mk +# CCOLAMD depends on SuiteSparse_config +LDLIBS += -lsuitesparseconfig + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + I = -I../Include -I../../SuiteSparse_config INC = ../Include/ccolamd.h ../../SuiteSparse_config/SuiteSparse_config.h SRC = ../Source/ccolamd.c -# creates libccolamd.a, a C-callable COLAMD library -libccolamd.a: $(SRC) $(INC) +OBJ = ccolamd.o ccolamd_l.o + +ccolamd.o: $(SRC) $(INC) $(CC) $(CF) $(I) -c ../Source/ccolamd.c + +ccolamd_l.o: $(SRC) $(INC) $(CC) $(CF) $(I) -c ../Source/ccolamd.c -DDLONG -o ccolamd_l.o - $(ARCHIVE) libccolamd.a ccolamd.o ccolamd_l.o - - $(RANLIB) libccolamd.a -ccode: libccolamd.a +# creates libccolamd.a, a C-callable CCOLAMD library +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ -library: libccolamd.a +ccode: library clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) purge: distclean distclean: clean - - $(RM) libccolamd.a + - $(RM) -r $(PURGE) + +# install CCOLAMD +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/ccolamd.h $(INSTALL_INCLUDE) + $(CP) ../README.txt $(INSTALL_DOC)/CCOLAMD_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/ccolamd.h + chmod 644 $(INSTALL_DOC)/CCOLAMD_README.txt + +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/ccolamd.h + $(RM) $(INSTALL_DOC)/CCOLAMD_README.txt + diff --git a/SuiteSparse/CCOLAMD/Makefile b/SuiteSparse/CCOLAMD/Makefile index 83111cadb..f04181d60 100644 --- a/SuiteSparse/CCOLAMD/Makefile +++ b/SuiteSparse/CCOLAMD/Makefile @@ -2,7 +2,8 @@ # CCOLAMD Makefile #------------------------------------------------------------------------------ -VERSION = 2.9.1 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all @@ -43,14 +44,8 @@ lib: library # install CCOLAMD install: - $(CP) Lib/libccolamd.a $(INSTALL_LIB)/libccolamd.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libccolamd.$(VERSION).a libccolamd.a ) - $(CP) Include/ccolamd.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libccolamd*.a - chmod 644 $(INSTALL_INCLUDE)/ccolamd.h + ( cd Lib ; $(MAKE) install ) # uninstall CCOLAMD uninstall: - $(RM) $(INSTALL_LIB)/libccolamd*.a - $(RM) $(INSTALL_INCLUDE)/ccolamd.h - + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/CCOLAMD/README.txt b/SuiteSparse/CCOLAMD/README.txt index 130563722..9073553ed 100644 --- a/SuiteSparse/CCOLAMD/README.txt +++ b/SuiteSparse/CCOLAMD/README.txt @@ -1,5 +1,5 @@ CCOLAMD: constrained column approximate minimum degree ordering -Copyright (C) 2005-2013, Univ. of Florida. Authors: Timothy A. Davis, +Copyright (C) 2005-2016, Univ. of Florida. Authors: Timothy A. Davis, Sivasankaran Rajamanickam, and Stefan Larimore. Closely based on COLAMD by Davis, Stefan Larimore, in collaboration with Esmond Ng, and John Gilbert. http://www.suitesparse.com @@ -25,11 +25,14 @@ library and to run a short demo. Other "make" targets: - make mex compiles MATLAB mexFunctions only - make libccolamd.a compiles a C-callable library containing ccolamd - make clean removes all files not in the distribution, except for - libccolamd.a + make library compiles a C-callable library containing ccolamd + make clean removes all files not in the distribution + but keeps the compiled libraries. make distclean removes all files not in the distribution + make install installs the library in /usr/local/lib and + /usr/local/include + make uninstall uninstalls the library from /usr/local/lib and + /usr/local/include To use ccolamd and csymamd within an application written in C, all you need are ccolamd.c and ccolamd.h, which are the C-callable ccolamd/csymamd codes. @@ -138,4 +141,3 @@ CCOLAMD files: ./Source: ccolamd.c primary source code - ccolamd_global.c globally defined function pointers (malloc, free, ...) diff --git a/SuiteSparse/CHOLMOD/Check/cholmod_check.c b/SuiteSparse/CHOLMOD/Check/cholmod_check.c index 4fa9cd256..8455b0ec0 100644 --- a/SuiteSparse/CHOLMOD/Check/cholmod_check.c +++ b/SuiteSparse/CHOLMOD/Check/cholmod_check.c @@ -2577,7 +2577,7 @@ int CHOLMOD(dump_partition) SuiteSparse_long n, Int *Cp, Int *Ci, - Int *Cnw, + Int *Cnw, /* can be NULL */ Int *Part, SuiteSparse_long sepsize, cholmod_common *Common @@ -2591,7 +2591,8 @@ int CHOLMOD(dump_partition) chek [2] = 0 ; for (j = 0 ; j < n ; j++) { - PRINT2 (("--------j "ID" in part "ID" nw "ID"\n", j, Part [j], Cnw[j])); + PRINT2 (("--------j "ID" in part "ID" nw "ID"\n", j, Part [j], + Cnw ? (Cnw[j]):1)); which = Part [j] ; for (p = Cp [j] ; p < Cp [j+1] ; p++) { @@ -2619,7 +2620,7 @@ int CHOLMOD(dump_partition) PRINT0 (("Part out of range\n")) ; ok = FALSE ; } - chek [which] += Cnw [j] ; + chek [which] += (Cnw ? (Cnw [j]) : 1) ; } PRINT1 (("sepsize %ld check "ID" "ID" "ID"\n", sepsize, chek[0], chek[1],chek[2])); diff --git a/SuiteSparse/CHOLMOD/Check/cholmod_write.c b/SuiteSparse/CHOLMOD/Check/cholmod_write.c index eb578f9fd..516c0d3ba 100644 --- a/SuiteSparse/CHOLMOD/Check/cholmod_write.c +++ b/SuiteSparse/CHOLMOD/Check/cholmod_write.c @@ -22,6 +22,7 @@ #ifndef NCHECK +#include "cholmod_config.h" #include "cholmod_internal.h" #include "cholmod_check.h" #include "cholmod_matrixops.h" diff --git a/SuiteSparse/CHOLMOD/Cholesky/cholmod_analyze.c b/SuiteSparse/CHOLMOD/Cholesky/cholmod_analyze.c index 62f860649..f649e2079 100644 --- a/SuiteSparse/CHOLMOD/Cholesky/cholmod_analyze.c +++ b/SuiteSparse/CHOLMOD/Cholesky/cholmod_analyze.c @@ -33,7 +33,7 @@ * AMD: approximate minumum degree (AMD for the symmetric case, * COLAMD for the AA' case). * METIS: nested dissection with METIS_NodeND - * NESDIS: nested dissection using METIS_NodeComputeSeparator, + * NESDIS: nested dissection using METIS_ComputeVertexSeparator, * typically followed by a constrained minimum degree * (CAMD for the symmetric case, CCOLAMD for the AA' case). * @@ -697,7 +697,7 @@ cholmod_factor *CHOLMOD(analyze_p2) /* -------------------------------------------------------------- */ /* this method is based on METIS' node bissection routine - * (METIS_NodeComputeSeparator). In contrast to METIS_NodeND, + * (METIS_ComputeVertexSeparator). In contrast to METIS_NodeND, * it calls CAMD or CCOLAMD on the whole graph, instead of MMD * on just the leaves. */ #ifndef NPARTITION diff --git a/SuiteSparse/CHOLMOD/Core/cholmod_error.c b/SuiteSparse/CHOLMOD/Core/cholmod_error.c index e14887ae8..19bd47a0c 100644 --- a/SuiteSparse/CHOLMOD/Core/cholmod_error.c +++ b/SuiteSparse/CHOLMOD/Core/cholmod_error.c @@ -55,15 +55,33 @@ int CHOLMOD(error) { if (status > 0 && Common->print > 1) { - SuiteSparse_config.printf_func ("CHOLMOD warning: %s\n", - message) ; + SuiteSparse_config.printf_func ("CHOLMOD warning:") ; + if (message != NULL) + { + SuiteSparse_config.printf_func (" %s.", message) ; + } + if (file != NULL) + { + SuiteSparse_config.printf_func (" file: %s", file) ; + SuiteSparse_config.printf_func (" line: %d", line) ; + } + SuiteSparse_config.printf_func ("\n") ; fflush (stdout) ; fflush (stderr) ; } else if (Common->print > 0) { - SuiteSparse_config.printf_func ("CHOLMOD error: %s\n", - message) ; + SuiteSparse_config.printf_func ("CHOLMOD error:") ; + if (message != NULL) + { + SuiteSparse_config.printf_func (" %s.", message) ; + } + if (file != NULL) + { + SuiteSparse_config.printf_func (" file: %s", file) ; + SuiteSparse_config.printf_func (" line: %d", line) ; + } + SuiteSparse_config.printf_func ("\n") ; fflush (stdout) ; fflush (stderr) ; } diff --git a/SuiteSparse/CHOLMOD/Demo/Makefile b/SuiteSparse/CHOLMOD/Demo/Makefile index 894aaee27..f44fb505d 100644 --- a/SuiteSparse/CHOLMOD/Demo/Makefile +++ b/SuiteSparse/CHOLMOD/Demo/Makefile @@ -9,44 +9,10 @@ default: all include ../../SuiteSparse_config/SuiteSparse_config.mk -#------------------------------------------------------------------------------- -# the optional Partition module requires METIS, CAMD, and CCOLAMD. -# CAMD and CCOLAMD can be installed without METIS, but are optional. -I_WITH_PARTITION = -LIB_WITH_PARTITION = -CONFIG = -DNPARTITION -DNCAMD -# check if CAMD/CCOLAMD and METIS are requested and available -ifeq (,$(findstring -DNCAMD, $(CHOLMOD_CONFIG))) - # CAMD and CCOLAMD are requested. See if they are available - ifeq (../../CAMD, $(wildcard ../../CAMD)) - ifeq (../../CCOLAMD, $(wildcard ../../CCOLAMD)) - # CAMD and CCOLAMD are requested and available - LIB_WITH_PARTITION = \ - ../../CCOLAMD/Lib/libccolamd.a ../../CAMD/Lib/libcamd.a - I_WITH_PARTITION = \ - -I../../CCOLAMD/Include -I../../CAMD/Include - CONFIG = -DNPARTITION - # check if METIS is requested and available - ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG))) - # METIS is requested. See if it is available - ifeq ($(METIS_PATH), $(wildcard $(METIS_PATH))) - # METIS is available - LIB_WITH_PARTITION = $(METIS) \ - ../../CCOLAMD/Lib/libccolamd.a ../../CAMD/Lib/libcamd.a - I_WITH_PARTITION = -I$(METIS_PATH)/Lib \ - -I../../CCOLAMD/Include -I../../CAMD/Include - CONFIG = - endif - endif - endif - endif -endif - #------------------------------------------------------------------------------- -LIB2 = ../Lib/libcholmod.a ../../AMD/Lib/libamd.a ../../COLAMD/Lib/libcolamd.a \ - ../../SuiteSparse_config/libsuitesparseconfig.a \ - $(LIB_WITH_PARTITION) $(LAPACK) $(BLAS) $(XERBLA) $(LIB) +LIB2 = $(LDFLAGS) -L../../lib -lcholmod -lamd -lcolamd -lsuitesparseconfig \ + $(LIB_WITH_PARTITION) $(LAPACK) $(BLAS) $(LDLIBS) #------------------------------------------------------------------------------- # With the CUDA BLAS: @@ -55,7 +21,7 @@ LIB2 += $(CUDART_LIB) $(CUBLAS_LIB) endif #------------------------------------------------------------------------------- -C = $(CC) $(CF) $(CHOLMOD_CONFIG) $(CONFIG) +C = $(CC) $(CF) $(CHOLMOD_CONFIG) $(CONFIG_PARTITION) code: library cholmod_demo cholmod_l_demo cholmod_simple @@ -84,40 +50,39 @@ purge: clean - $(RM) cholmod_demo cholmod_l_demo readhb readhb2 reade - $(RM) cholmod_simple - $(RM) timelog.m - - $(RM) -r *.dSYM + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) #------------------------------------------------------------------------------- -# See below if you compile with -DNPARTITION -library: - ( cd ../../SuiteSparse_config/xerbla ; $(MAKE) ) +library: metis ( cd ../../SuiteSparse_config ; $(MAKE) ) ( cd ../Lib ; $(MAKE) ) ( cd ../../AMD ; $(MAKE) library ) ( cd ../../COLAMD ; $(MAKE) library ) -ifneq (,$(findstring -DCAMD, $(CONFIG))) +ifneq (,$(findstring -DNCAMD, $(CONFIG_PARTITION))) else ( cd ../../CCOLAMD ; $(MAKE) library ) ( cd ../../CAMD ; $(MAKE) library ) endif -ifneq (,$(findstring -DNPARTITION, $(CONFIG))) -else - ( cd $(METIS_PATH) && $(MAKE) ) -endif + +metis: ../../include/metis.h + +../../include/metis.h: + - ( cd ../.. && $(MAKE) metis ) #------------------------------------------------------------------------------- -I = -I../Include -I../../SuiteSparse_config +I = -I../../include $(CUDA_INC) -cholmod_demo: library cholmod_demo.c cholmod_demo.h +cholmod_demo: cholmod_demo.c cholmod_demo.h $(C) -o cholmod_demo $(I) cholmod_demo.c $(LIB2) -cholmod_simple: library cholmod_simple.c +cholmod_simple: cholmod_simple.c $(C) -o cholmod_simple $(I) cholmod_simple.c $(LIB2) -cholmod_l_demo: library cholmod_l_demo.c cholmod_demo.h +cholmod_l_demo: cholmod_l_demo.c cholmod_demo.h $(C) -o cholmod_l_demo $(I) cholmod_l_demo.c $(LIB2) readhb: readhb.f diff --git a/SuiteSparse/CHOLMOD/Demo/cholmod_demo.c b/SuiteSparse/CHOLMOD/Demo/cholmod_demo.c index 88ec4e235..ca313092a 100644 --- a/SuiteSparse/CHOLMOD/Demo/cholmod_demo.c +++ b/SuiteSparse/CHOLMOD/Demo/cholmod_demo.c @@ -59,7 +59,7 @@ int main (int argc, char **argv) anz, axbnorm, rnorm2, resid2, rcond ; FILE *f ; cholmod_sparse *A ; - cholmod_dense *X = NULL, *B, *W, *R ; + cholmod_dense *X = NULL, *B, *W, *R = NULL ; double one [2], zero [2], minusone [2], beta [2], xlnz ; cholmod_common Common, *cm ; cholmod_factor *L ; @@ -97,7 +97,7 @@ int main (int argc, char **argv) cm = &Common ; cholmod_start (cm) ; - CHOLMOD_FUNCTION_DEFAULTS (cm) ; /* just for testing (not required) */ + CHOLMOD_FUNCTION_DEFAULTS ; /* just for testing (not required) */ /* use default parameter settings, except for the error handler. This * demo program terminates if an error occurs (out of memory, not positive @@ -137,10 +137,13 @@ int main (int argc, char **argv) fclose (ff) ; ff = NULL ; } - anorm = cholmod_norm_sparse (A, 0, cm) ; xtype = A->xtype ; + anorm = 1 ; +#ifndef NMATRIXOPS + anorm = cholmod_norm_sparse (A, 0, cm) ; printf ("norm (A,inf) = %g\n", anorm) ; printf ("norm (A,1) = %g\n", cholmod_norm_sparse (A, 1, cm)) ; +#endif cholmod_print_sparse (A, "A", cm) ; if (A->nrow > A->ncol) @@ -191,8 +194,11 @@ int main (int argc, char **argv) #endif cholmod_print_dense (B, "B", cm) ; + bnorm = 1 ; +#ifndef NMATRIXOPS bnorm = cholmod_norm_dense (B, 0, cm) ; /* max norm */ printf ("bnorm %g\n", bnorm) ; +#endif /* ---------------------------------------------------------------------- */ /* analyze and factorize */ @@ -265,6 +271,7 @@ int main (int argc, char **argv) for (method = 0 ; method <= 3 ; method++) { double x = n ; + resid [method] = -1 ; /* not yet computed */ if (method == 0) { @@ -433,7 +440,9 @@ int main (int argc, char **argv) fclose (timelog) ; } +#ifndef NMATRIXOPS resid [3] = resid [3] / cholmod_norm_dense (X, 1, cm) ; +#endif cholmod_free_dense (&Ywork, cm) ; cholmod_free_dense (&Ework, cm) ; @@ -449,6 +458,7 @@ int main (int argc, char **argv) if (method < 3) { +#ifndef NMATRIXOPS if (A->stype == 0) { @@ -457,6 +467,7 @@ int main (int argc, char **argv) W = cholmod_allocate_dense (A->ncol, 1, A->ncol, xtype, cm) ; cholmod_sdmult (A, 2, one, zero, X, W, cm) ; /* R = B - beta*X */ + cholmod_free_dense (&R, cm) ; R = cholmod_zeros (n, 1, xtype, cm) ; Rx = R->x ; Xx = X->x ; @@ -483,14 +494,19 @@ int main (int argc, char **argv) else { /* Ax=b was factorized and solved, R = B-A*X */ + cholmod_free_dense (&R, cm) ; R = cholmod_copy_dense (B, cm) ; cholmod_sdmult (A, 0, minusone, one, X, R, cm) ; } + rnorm = -1 ; + xnorm = 1 ; rnorm = cholmod_norm_dense (R, 0, cm) ; /* max abs. entry */ xnorm = cholmod_norm_dense (X, 0, cm) ; /* max abs. entry */ - axbnorm = (anorm * xnorm + bnorm + ((n == 0) ? 1 : 0)) ; resid [method] = rnorm / axbnorm ; +#else + printf ("residual not computed (requires CHOLMOD/MatrixOps)\n") ; +#endif } } @@ -501,6 +517,7 @@ int main (int argc, char **argv) /* ---------------------------------------------------------------------- */ resid2 = -1 ; +#ifndef NMATRIXOPS if (A->stype != 0 && A->xtype == CHOLMOD_REAL) { cholmod_dense *R2 ; @@ -518,11 +535,13 @@ int main (int argc, char **argv) cholmod_free_dense (&R, cm) ; /* compute the new residual, R = B-A*X */ + cholmod_free_dense (&R, cm) ; R = cholmod_copy_dense (B, cm) ; cholmod_sdmult (A, 0, minusone, one, X, R, cm) ; rnorm2 = cholmod_norm_dense (R, 0, cm) ; resid2 = rnorm2 / axbnorm ; } +#endif cholmod_free_dense (&R, cm) ; diff --git a/SuiteSparse/CHOLMOD/Demo/cholmod_l_demo.c b/SuiteSparse/CHOLMOD/Demo/cholmod_l_demo.c index 5ad4f7650..de55c4adb 100644 --- a/SuiteSparse/CHOLMOD/Demo/cholmod_l_demo.c +++ b/SuiteSparse/CHOLMOD/Demo/cholmod_l_demo.c @@ -58,7 +58,7 @@ int main (int argc, char **argv) anz, axbnorm, rnorm2, resid2, rcond ; FILE *f ; cholmod_sparse *A ; - cholmod_dense *X = NULL, *B, *W, *R ; + cholmod_dense *X = NULL, *B, *W, *R = NULL ; double one [2], zero [2], minusone [2], beta [2], xlnz ; cholmod_common Common, *cm ; cholmod_factor *L ; @@ -99,7 +99,7 @@ int main (int argc, char **argv) cm = &Common ; cholmod_l_start (cm) ; - CHOLMOD_FUNCTION_DEFAULTS (cm) ; /* just for testing (not required) */ + CHOLMOD_FUNCTION_DEFAULTS ; /* just for testing (not required) */ /* cm->useGPU = 1; */ cm->prefer_zomplex = prefer_zomplex ; @@ -142,9 +142,12 @@ int main (int argc, char **argv) fclose (ff) ; ff = NULL ; } + anorm = 1 ; +#ifndef NMATRIXOPS anorm = cholmod_l_norm_sparse (A, 0, cm) ; printf ("norm (A,inf) = %g\n", anorm) ; printf ("norm (A,1) = %g\n", cholmod_l_norm_sparse (A, 1, cm)) ; +#endif if (prefer_zomplex && A->xtype == CHOLMOD_COMPLEX) { @@ -261,8 +264,11 @@ int main (int argc, char **argv) #endif cholmod_l_print_dense (B, "B", cm) ; + bnorm = 1 ; +#ifndef NMATRIXOPS bnorm = cholmod_l_norm_dense (B, 0, cm) ; /* max norm */ printf ("bnorm %g\n", bnorm) ; +#endif /* ---------------------------------------------------------------------- */ /* analyze and factorize */ @@ -515,7 +521,9 @@ int main (int argc, char **argv) fclose (timelog) ; } +#ifndef NMATRIXOPS resid [3] = resid [3] / cholmod_l_norm_dense (X, 1, cm) ; +#endif cholmod_l_free_dense (&Ywork, cm) ; cholmod_l_free_dense (&Ework, cm) ; @@ -531,6 +539,7 @@ int main (int argc, char **argv) if (method < 3) { +#ifndef NMATRIXOPS if (A->stype == 0) { /* (AA'+beta*I)x=b is the linear system that was solved */ @@ -538,6 +547,7 @@ int main (int argc, char **argv) W = cholmod_l_allocate_dense (A->ncol, 1, A->ncol, xtype, cm) ; cholmod_l_sdmult (A, 2, one, zero, X, W, cm) ; /* R = B - beta*X */ + cholmod_l_free_dense (&R, cm) ; R = cholmod_l_zeros (n, 1, xtype, cm) ; Rx = R->x ; Rz = R->z ; @@ -576,6 +586,7 @@ int main (int argc, char **argv) else { /* Ax=b was factorized and solved, R = B-A*X */ + cholmod_l_free_dense (&R, cm) ; R = cholmod_l_copy_dense (B, cm) ; cholmod_l_sdmult (A, 0, minusone, one, X, R, cm) ; } @@ -584,6 +595,9 @@ int main (int argc, char **argv) axbnorm = (anorm * xnorm + bnorm + ((n == 0) ? 1 : 0)) ; resid [method] = rnorm / axbnorm ; +#else + printf ("residual not computed (requires CHOLMOD/MatrixOps)\n") ; +#endif } } @@ -594,6 +608,7 @@ int main (int argc, char **argv) /* ---------------------------------------------------------------------- */ resid2 = -1 ; +#ifndef NMATRIXOPS if (A->stype != 0 && A->xtype == CHOLMOD_REAL) { cholmod_dense *R2 ; @@ -611,11 +626,13 @@ int main (int argc, char **argv) cholmod_l_free_dense (&R, cm) ; /* compute the new residual, R = B-A*X */ + cholmod_l_free_dense (&R, cm) ; R = cholmod_l_copy_dense (B, cm) ; cholmod_l_sdmult (A, 0, minusone, one, X, R, cm) ; rnorm2 = cholmod_l_norm_dense (R, 0, cm) ; resid2 = rnorm2 / axbnorm ; } +#endif cholmod_l_free_dense (&R, cm) ; diff --git a/SuiteSparse/CHOLMOD/Demo/cholmod_simple.c b/SuiteSparse/CHOLMOD/Demo/cholmod_simple.c index fa60641ff..baba01235 100644 --- a/SuiteSparse/CHOLMOD/Demo/cholmod_simple.c +++ b/SuiteSparse/CHOLMOD/Demo/cholmod_simple.c @@ -36,9 +36,13 @@ int main (void) cholmod_factorize (A, L, &c) ; /* factorize */ x = cholmod_solve (CHOLMOD_A, L, b, &c) ; /* solve Ax=b */ r = cholmod_copy_dense (b, &c) ; /* r = b */ +#ifndef NMATRIXOPS cholmod_sdmult (A, 0, m1, one, x, r, &c) ; /* r = r-Ax */ printf ("norm(b-Ax) %8.1e\n", cholmod_norm_dense (r, 0, &c)) ; /* print norm(r) */ +#else + printf ("residual norm not computed (requires CHOLMOD/MatrixOps)\n") ; +#endif cholmod_free_factor (&L, &c) ; /* free matrices */ cholmod_free_sparse (&A, &c) ; cholmod_free_dense (&r, &c) ; diff --git a/SuiteSparse/CHOLMOD/Demo/gpu.sh b/SuiteSparse/CHOLMOD/Demo/gpu.sh old mode 100644 new mode 100755 diff --git a/SuiteSparse/CHOLMOD/Doc/ChangeLog b/SuiteSparse/CHOLMOD/Doc/ChangeLog index 9addb64ea..26defc6bc 100644 --- a/SuiteSparse/CHOLMOD/Doc/ChangeLog +++ b/SuiteSparse/CHOLMOD/Doc/ChangeLog @@ -1,3 +1,30 @@ +Feb 1, 2016: version 3.0.9 + + * update to Makefiles + * minor change to CHOLMOD/Check/cholmod_write.c, when compiling with + -DNGPL + * more verbose error reporting + * Demos now compile with -DNGPL, but they don't compute all residuals + (requires the GPL CHOLMOD/MatrixOps package) + +Jan 30, 2016: version 3.0.8 + + * better Makefiles for creating and installing shared libraries + * CHOLMOD now uses METIS 5.1.0, which is distributed with SuiteSparse + * correction to mexFunctions required for MATLAB R2015b, + for sparse empty matrices and NULL mxGetPr + +Jan 1, 2016: version 3.0.7 + + * modified Makefile to create shared libraries + No change to C code except version number + +July 14, 2015: version 3.0.6 + + * NGPL did not disable MatrixOps, Modify, and Supernodal modules, + contradicting its definition in the User Guide. Fixed in this release. + * added MATLAB interface for row add/delete (lurowmod mexFunction) + Jan 19, 2015: version 3.0.5 * minor bug fix to cholmod_symmetry.c for the 'quick return' diff --git a/SuiteSparse/CHOLMOD/Doc/Makefile b/SuiteSparse/CHOLMOD/Doc/Makefile index d274db615..90e749812 100644 --- a/SuiteSparse/CHOLMOD/Doc/Makefile +++ b/SuiteSparse/CHOLMOD/Doc/Makefile @@ -2,7 +2,7 @@ default: all include ../../SuiteSparse_config/SuiteSparse_config.mk -all: UserGuide.pdf purge +all: CHOLMOD_UserGuide.pdf purge I = \ ../Include/cholmod.h \ @@ -36,6 +36,7 @@ M = \ ../MATLAB/ldlsolve.m \ ../MATLAB/ldlsplit.m \ ../MATLAB/ldlupdate.m \ + ../MATLAB/ldlrowmod.m \ ../MATLAB/metis.m \ ../MATLAB/nesdis.m \ ../MATLAB/resymbol.m \ @@ -46,7 +47,7 @@ M = \ ../MATLAB/mwrite.m \ ../MATLAB/symbfact2.m -UserGuide.pdf: UserGuide.tex UserGuide.bib $(I) $(C) $(M) Makefile getproto rule.awk header.tex footer.tex getmproto mfooter.tex mheader.tex mfile.awk +CHOLMOD_UserGuide.pdf: CHOLMOD_UserGuide.tex UserGuide.bib $(I) $(C) $(M) Makefile getproto rule.awk header.tex footer.tex getmproto mfooter.tex mheader.tex mfile.awk ./getmproto ../MATLAB/analyze.m > _analyze_m.tex ./getmproto ../MATLAB/bisect.m > _bisect_m.tex ./getmproto ../MATLAB/chol2.m > _chol2_m.tex @@ -61,6 +62,7 @@ UserGuide.pdf: UserGuide.tex UserGuide.bib $(I) $(C) $(M) Makefile getproto rule ./getmproto ../MATLAB/ldlsolve.m > _ldlsolve_m.tex ./getmproto ../MATLAB/ldlsplit.m > _ldlsplit_m.tex ./getmproto ../MATLAB/ldlupdate.m > _ldlupdate_m.tex + ./getmproto ../MATLAB/ldlrowmod.m > _ldlrowmod_m.tex ./getmproto ../MATLAB/metis.m > _metis_m.tex ./getmproto ../MATLAB/mread.m > _mread_m.tex ./getmproto ../MATLAB/spsym.m > _spsym_m.tex @@ -215,17 +217,17 @@ UserGuide.pdf: UserGuide.tex UserGuide.bib $(I) $(C) $(M) Makefile getproto rule ./getproto '/long cholmod_bisect/, /\*\) ;/' ../Include/cholmod_partition.h > _bisect.tex ./getproto '/long cholmod_metis_bisector/, /\*\) ;/' ../Include/cholmod_partition.h > _metis_bisector.tex ./getproto '/long cholmod_collapse_septree/, /\*\) ;/' ../Include/cholmod_partition.h > _collapse_septree.tex - pdflatex UserGuide - bibtex UserGuide - pdflatex UserGuide - pdflatex UserGuide + pdflatex CHOLMOD_UserGuide + bibtex CHOLMOD_UserGuide + pdflatex CHOLMOD_UserGuide + pdflatex CHOLMOD_UserGuide distclean: purge purge: clean - - $(RM) _temp.awk _*.tex *.dvi *.aux *.log *.lof *.lot *.toc *.bak - - $(RM) *.bbl *.blg - - $(RM) -r *.dSYM + - $(RM) _temp.awk _*.tex + - $(RM) -r $(PURGE) clean: - $(RM) -r $(CLEAN) + diff --git a/SuiteSparse/CHOLMOD/Doc/getmproto b/SuiteSparse/CHOLMOD/Doc/getmproto old mode 100644 new mode 100755 diff --git a/SuiteSparse/CHOLMOD/Doc/getproto b/SuiteSparse/CHOLMOD/Doc/getproto old mode 100644 new mode 100755 diff --git a/SuiteSparse/CHOLMOD/Include/cholmod_core.h b/SuiteSparse/CHOLMOD/Include/cholmod_core.h index 42c4e59c9..6ce301c2f 100644 --- a/SuiteSparse/CHOLMOD/Include/cholmod_core.h +++ b/SuiteSparse/CHOLMOD/Include/cholmod_core.h @@ -246,11 +246,11 @@ #define CHOLMOD_HAS_VERSION_FUNCTION -#define CHOLMOD_DATE "Jan 7, 2015" +#define CHOLMOD_DATE "Feb 1, 2016" #define CHOLMOD_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define CHOLMOD_MAIN_VERSION 3 #define CHOLMOD_SUB_VERSION 0 -#define CHOLMOD_SUBSUB_VERSION 5 +#define CHOLMOD_SUBSUB_VERSION 9 #define CHOLMOD_VERSION \ CHOLMOD_VER_CODE(CHOLMOD_MAIN_VERSION,CHOLMOD_SUB_VERSION) @@ -775,6 +775,9 @@ typedef struct cholmod_common_struct /* METIS workarounds */ /* ---------------------------------------------------------------------- */ + /* These workarounds were put into place for METIS 4.0.1. They are safe + to use with METIS 5.1.0, but they might not longer be necessary. */ + double metis_memory ; /* This is a parameter for CHOLMOD's interface to * METIS, not a parameter to METIS itself. METIS * uses an amount of memory that is difficult to estimate precisely @@ -817,7 +820,7 @@ typedef struct cholmod_common_struct * greater than Common->metis_nswitch (default 3000) or more and with * density of Common->metis_dswitch (default 0.66) or more. * cholmod_nested_dissection has no problems with the same matrix, even - * though it uses METIS_NodeComputeSeparator on this matrix. If this + * though it uses METIS_ComputeVertexSeparator on this matrix. If this * seg fault does not affect you, set metis_nswitch to zero or less, * and CHOLMOD will not switch to AMD based just on the density of the * matrix (it will still switch to AMD if the metis_memory parameter diff --git a/SuiteSparse/CHOLMOD/Include/cholmod_partition.h b/SuiteSparse/CHOLMOD/Include/cholmod_partition.h index 1e8ecd3ca..204cb3daf 100644 --- a/SuiteSparse/CHOLMOD/Include/cholmod_partition.h +++ b/SuiteSparse/CHOLMOD/Include/cholmod_partition.h @@ -21,7 +21,7 @@ * cholmod_nested_dissection CHOLMOD nested dissection ordering * cholmod_metis METIS nested dissection ordering (METIS_NodeND) * cholmod_bisect graph partitioner (currently based on METIS) - * cholmod_metis_bisector direct interface to METIS_NodeComputeSeparator + * cholmod_metis_bisector direct interface to METIS_ComputeVertexSeparator * * Requires the Core and Cholesky modules, and three packages: METIS, CAMD, * and CCOLAMD. Optionally used by the Cholesky module. @@ -122,16 +122,21 @@ SuiteSparse_long cholmod_l_bisect (cholmod_sparse *, SuiteSparse_long *, /* -------------------------------------------------------------------------- */ /* Find a set of nodes that bisects the graph of A or AA' (direct interface - * to METIS_NodeComputeSeparator). */ + * to METIS_ComputeVertexSeperator). */ SuiteSparse_long cholmod_metis_bisector /* returns separator size */ ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to bisect */ - int *Anw, /* size A->nrow, node weights */ - int *Aew, /* size nz, edge weights */ + int *Anw, /* size A->nrow, node weights, can be NULL, */ + /* which means the graph is unweighted. */ + int *Aew, /* size nz, edge weights (silently ignored). */ + /* This option was available with METIS 4, but not */ + /* in METIS 5. This argument is now unused, but */ + /* it remains for backward compatibilty, so as not */ + /* to change the API for cholmod_metis_bisector. */ /* ---- output --- */ - int *Partition, /* size A->nrow. see cholmod_bisect above. */ + int *Partition, /* size A->nrow */ /* --------------- */ cholmod_common *Common ) ; diff --git a/SuiteSparse/CHOLMOD/Lib/Makefile b/SuiteSparse/CHOLMOD/Lib/Makefile index 3893d3948..65e1e33cd 100644 --- a/SuiteSparse/CHOLMOD/Lib/Makefile +++ b/SuiteSparse/CHOLMOD/Lib/Makefile @@ -1,66 +1,54 @@ #=============================================================================== -# CHOLOMD/Lib/Makefile: for compiling the CHOLMOD library +# CHOLMOD/Lib/Makefile: for compiling the CHOLMOD library #=============================================================================== -default: all +LIBRARY = libcholmod +VERSION = 3.0.9 +SO_VERSION = 3 + +default: library ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk +# CHOLMOD depends on AMD, SuiteSparse_config, LAPACK, BLAS, +# and optionally METIS, CAMD, and CCOLAMD if the Partition Module is in use +LDLIBS += -lamd -lcolamd -lsuitesparseconfig \ + $(LIB_WITH_PARTITION) $(LAPACK) $(BLAS) + +SO_OPTS += $(CFOPENMP) + #------------------------------------------------------------------------------- -# the optional Partition module requires METIS, CAMD, and CCOLAMD. -# CAMD and CCOLAMD can be installed without METIS, but are optional. -I_WITH_PARTITION = -LIB_WITH_PARTITION = -CONFIG = -DNPARTITION -DNCAMD -# check if CAMD/CCOLAMD and METIS are requested and available -ifeq (,$(findstring -DNCAMD, $(CHOLMOD_CONFIG))) - # CAMD and CCOLAMD are requested. See if they are available - ifeq (../../CAMD, $(wildcard ../../CAMD)) - ifeq (../../CCOLAMD, $(wildcard ../../CCOLAMD)) - # CAMD and CCOLAMD are requested and available - LIB_WITH_PARTITION = \ - ../../CCOLAMD/Lib/libccolamd.a ../../CAMD/Lib/libcamd.a - I_WITH_PARTITION = \ - -I../../CCOLAMD/Include -I../../CAMD/Include - CONFIG = -DNPARTITION - # check if METIS is requested and available - ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG))) - # METIS is requested. See if it is available - ifeq ($(METIS_PATH), $(wildcard $(METIS_PATH))) - # METIS is available - LIB_WITH_PARTITION = $(METIS) \ - ../../CCOLAMD/Lib/libccolamd.a ../../CAMD/Lib/libcamd.a - I_WITH_PARTITION = -I$(METIS_PATH)/Lib \ - -I../../CCOLAMD/Include -I../../CAMD/Include - CONFIG = - endif - endif - endif - endif +# With the CUDA BLAS: +ifneq ($(GPU_CONFIG),) +LDLIBS += $(CUDART_LIB) $(CUBLAS_LIB) endif +#------------------------------------------------------------------------------- + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) #------------------------------------------------------------------------------- I = -I../../AMD/Include -I../../AMD/Source -I../../COLAMD/Include \ - $(I_WITH_PARTITION) -I../Include -I../../SuiteSparse_config + $(I_WITH_PARTITION) -I../Include -I../../SuiteSparse_config \ + $(CUDA_INC) #------------------------------------------------------------------------------- -C = $(CC) $(CF) $(CHOLMOD_CONFIG) $(CONFIG) - -all: libcholmod.a +C = $(CC) $(CF) $(CHOLMOD_CONFIG) $(CONFIG_PARTITION) -library: libcholmod.a +all: library purge: distclean distclean: clean - - $(RM) libcholmod.a + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) #------------------------------------------------------------------------------- # ../Include/ directory contains all include files: @@ -164,9 +152,9 @@ DL = $(LCORE) $(LCHECK) $(LCHOLESKY) $(LMATRIXOPS) $(LMODIFY) $(LSUPERNODAL) \ # to compile just the double/int version, use OBJ = $(DI) OBJ = $(DI) $(DL) -libcholmod.a: $(OBJ) - $(ARCHIVE) libcholmod.a $(OBJ) - - $(RANLIB) libcholmod.a +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ $(OBJ): $(INC) @@ -534,7 +522,7 @@ cholmod_l_super_solve.o: ../Supernodal/cholmod_super_solve.c \ #------------------------------------------------------------------------------- cholmod_gpu_kernels.o: ../GPU/cholmod_gpu_kernels.cu - $(NVCC) -I../../SuiteSparse_config -Xcompiler -fPIC -O3 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=sm_35 -c ../GPU/cholmod_gpu_kernels.cu + $(NVCC) $(I) $(NVCCFLAGS) -c ../GPU/cholmod_gpu_kernels.cu cholmod_gpu.o: ../GPU/cholmod_gpu.c $(C) -c $(I) $< @@ -542,3 +530,33 @@ cholmod_gpu.o: ../GPU/cholmod_gpu.c cholmod_l_gpu.o: ../GPU/cholmod_gpu.c $(C) -DDLONG -c $(I) $< -o $@ +#------------------------------------------------------------------------------- + +# install CHOLMOD +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/cholmod*.h $(INSTALL_INCLUDE) + $(RM) $(INSTALL_INCLUDE)/cholmod_internal.h + $(CP) ../Doc/CHOLMOD_UserGuide.pdf $(INSTALL_DOC) + $(CP) ../README.txt $(INSTALL_DOC)/CHOLMOD_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/cholmod*.h + chmod 644 $(INSTALL_DOC)/CHOLMOD_UserGuide.pdf + chmod 644 $(INSTALL_DOC)/CHOLMOD_README.txt + +# uninstall CHOLMOD +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/cholmod*.h + $(RM) $(INSTALL_DOC)/CHOLMOD_UserGuide.pdf + $(RM) $(INSTALL_DOC)/CHOLMOD_README.txt + diff --git a/SuiteSparse/CHOLMOD/MATLAB/Contents.m b/SuiteSparse/CHOLMOD/MATLAB/Contents.m index d0a2e259e..ee4871e0a 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/Contents.m +++ b/SuiteSparse/CHOLMOD/MATLAB/Contents.m @@ -5,13 +5,14 @@ % lchol - sparse A=L*L' factorization. % ldlchol - sparse A=LDL' factorization % ldlupdate - multiple-rank update or downdate of a sparse LDL' factorization. +% ldlrowmod - add/delete row from a sparse LDL' factorization. % resymbol - recomputes the symbolic Cholesky factorization of the matrix A. % ldlsolve - solve LDL'x=b using a sparse LDL' factorization % ldlsplit - split an LDL' factorization into L and D. % metis - nested dissection ordering via METIS_NodeND. % nesdis - nested dissection ordering via CHOLMOD's nested dissection. % septree - prune a separator tree. -% bisect - computes a node separator based on METIS_NodeComputeSeparator. +% bisect - computes a node separator based on METIS_ComputeVertexSeparator. % analyze - order and analyze a matrix using CHOLMOD's best-effort ordering. % etree2 - sparse elimination tree. % sparse2 - replacement for SPARSE @@ -25,6 +26,7 @@ % cholmod_install - compile and install CHOLMOD, AMD, COLAMD, CCOLAMD, CAMD % cholmod_make - compiles the CHOLMOD mexFunctions % graph_demo - graph partitioning demo +% cholmod_updown_demo - a demo of update/downdate and row add/delete functions % % % Example: @@ -33,4 +35,4 @@ % Note: cholmod has been renamed cholmod2, so as not to conflict with itself % (the MATLAB built-in cholmod function). -% Copyright 2006-2007, Timothy A. Davis, http://www.suitesparse.com +% Copyright 2006-2015, Timothy A. Davis, http://www.suitesparse.com diff --git a/SuiteSparse/CHOLMOD/MATLAB/README.txt b/SuiteSparse/CHOLMOD/MATLAB/README.txt index 5fa96e3aa..245b1c58b 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/README.txt +++ b/SuiteSparse/CHOLMOD/MATLAB/README.txt @@ -4,41 +4,8 @@ Using CHOLMOD in MATLAB http://www.suitesparse.com See Contents.m for a description of each CHOLMOD function. -To compile CHOLMOD for use in MATLAB, you may optionally use METIS. If you -do not use METIS, compile CHOLMOD with the -DNPARTITION flag. - -There are two ways of compiling the CHOLMOD mexFunctions. The 2nd one is best. - -(1) Using the Unix "make" command. This will compile the AMD, COLAMD, CCOLAMD, - and CHOLMOD libraries (*.a). You must first add -fexceptions to the - CFLAGS definition in SuiteSparse_config/SuiteSparse_config.mk first - (for Linux). Otherwise, - MATLAB will not be able to handle exceptions properly (CHOLMOD may terminate - MATLAB if it encounters an error). The METIS library must also be compiled - with -fexceptions (see metis-4.0/Makefile.in). - For other operating systems, see your default MATLAB mexopts.sh file - (type "mex -v"). Next, simply type "make" in the operating system command - window in this directory. - - On Linux (with gcc), you must compile all codes with the -fexceptions flag. - See option (2) if you have problems compiling METIS. - -(2) using the "cholmod_make" m-file in MATLAB. First, place a copy of - METIS 4.0.1 in the ../../metis-4.0 directory (the same directory that - contains AMD, COLAMD, CCOLAMD, and CHOLMOD). - Then, type "cholmod_make" in the MATLAB command window. - All source files (including METIS) will be compiled with the MATLAB mex - commnand. This works on all operating systems, including Windows. - You can use an alternate location for METIS, if you pass the pathname - as the first argument to cholmod_make, as in - - cholmod_make ('path to your copy of metis-4.0 goes here') ; - - Option (2) is better because it allows for several workarounds for METIS. - With Option (1), METIS terminates MATLAB if it runs out of memory. That - does not happen with Option (2). - -You should also add CHOLMOD/MATLAB to your MATLAB path. +To compile CHOLMOD for use in MATLAB, simply type cholmod_install at +the MATLAB command line, while in the CHOLMOD/MATLAB directory. cholmod_demo is a short demo program for CHOLMOD. Type "cholmod_demo" in your MATLAB command window to test your newly compiling CHOLMOD functions. @@ -53,16 +20,23 @@ Using AMD, CCOLAMD, and COLAMD in MATLAB The following steps are not required to use CHOLMOD in MATLAB. -To use AMD in MATLAB, go to the AMD/MATLAB directory and either type "amd_make" -in the MATLAB command window, or type "make" in the Unix shell. Add AMD/MATLAB -to your MATLAB path. +To use AMD in MATLAB, go to the AMD/MATLAB directory and either type "amd_install" +in the MATLAB command window, or type "make" in the Unix shell. -To use CCOLAMD in MATLAB, go to the CCOLAMD directory and either type -"ccolamd_demo" in the MATLAB command window, or type "make" in the Unix shell. -Add CCOLAMD to your MATLAB path. +To use CCOLAMD in MATLAB, go to the CCOLAMD directory and type ccolamd_install. COLAMD is already an integral part of MATLAB, but you can upgrade to the most -recent version. Go to the COLAMD directory and either type "colamd_demo" in -the MATLAB command window, or type "make" in the Unix shell. -Add COLAMD to your MATLAB path. +recent version. Go to the COLAMD directory and type "colamd_install" in + +---------------------------------------- +To install all of SuiteSparse for MATLAB +---------------------------------------- + +To install all these packages and more, simply go the the top level folder of +SuiteSparse. You should see the SuiteSparse_install.m file there. Type +SuiteSparse_install in the MATLAB command window. + +After installing SuiteSparse, your path has been updated, but the changes +will not be saved for your next MATLAB session unless you save your path. +Type 'pathtool' and click 'save'. diff --git a/SuiteSparse/CHOLMOD/MATLAB/Test/cholmod_test.m b/SuiteSparse/CHOLMOD/MATLAB/Test/cholmod_test.m index 0d281e24f..34f805df0 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/Test/cholmod_test.m +++ b/SuiteSparse/CHOLMOD/MATLAB/Test/cholmod_test.m @@ -112,7 +112,7 @@ function cholmod_test (nmat, do_diary) try - cholmod_demo ; waitbar ( 1/tt, h, 'CHOLMOD graph demo'); + cholmod_demo ; waitbar ( 2/tt, h, 'CHOLMOD graph demo'); if (do_metis) graph_demo ; end diff --git a/SuiteSparse/CHOLMOD/MATLAB/Test/test0.m b/SuiteSparse/CHOLMOD/MATLAB/Test/test0.m index 96c1cdfd9..b9ee1a841 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/Test/test0.m +++ b/SuiteSparse/CHOLMOD/MATLAB/Test/test0.m @@ -206,7 +206,6 @@ function test0 (nmat) else fprintf (' no fill-in\n') ; end - clear LD % check the factorization, LD2 has LDL' factorization of S+C*C' [L,D] = ldlsplit (LD2) ; @@ -275,11 +274,52 @@ function test0 (nmat) err2 = norm (S2*x-b,1) / norm (S,1) ; fprintf ('MATLAB residual: %6.1e (sparse b)\n', err2) ; + % ---------------------------------------------------------------------- + % test the row delete + k = max (1, fix (n/2)) ; + tic + LD6 = ldlrowmod (LD,k) ; + t6 = toc ; + fprintf ('\nCHOLMOD time: ldlrowmod, delete %10.4f nnz(L) %d', ... + t6, nnz (LD6)) ; + + I = speye (n) ; + S2 = S ; + S2 (k,:) = I (k,:) ; + S2 (:,k) = I (:,k) ; + + % check the factorization, LD6 has LDL' factorization of S2 + [L,D] = ldlsplit (LD6) ; + err = ldl_normest (S2, L, D) / lnorm ; + if (err > 1e-6) + error ('!') ; + end + + % test the row add, by adding the row back in again + Ck = S (:,k) ; + S2 (:,k) = Ck ; + S2 (k,:) = Ck' ; + + tic + LD7 = ldlrowmod (LD6,k,Ck) ; + t7 = toc ; + fprintf ('\nCHOLMOD time: ldlrowmod, add %10.4f nnz(L) %d', ... + t7, nnz (LD7)) ; + + % check the factorization, LD7 has LDL' factorization of S + [L,D] = ldlsplit (LD7) ; + err = ldl_normest (S, L, D) / lnorm ; + if (err > 1e-6) + error ('!') ; + end + + % ---------------------------------------------------------------------- + % catch % fprintf ('failed\n') ; % end - clear A S C L R LD LD2 LD3 D p q C1 C2 LD3 S2 LD4 b x LD5 + clear A S C L R LD LD2 LD3 D p q C1 C2 LD3 S2 LD4 b x LD5 I LDL6 LD7 Ck end diff --git a/SuiteSparse/CHOLMOD/MATLAB/bisect.c b/SuiteSparse/CHOLMOD/MATLAB/bisect.c index 14394788e..afb431958 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/bisect.c +++ b/SuiteSparse/CHOLMOD/MATLAB/bisect.c @@ -13,7 +13,7 @@ * -------------------------------------------------------------------------- */ /* Find an node separator of an undirected graph, using - * METIS_NodeComputeSeparator. + * METIS_ComputeVertexSeparator. * * Usage: * diff --git a/SuiteSparse/CHOLMOD/MATLAB/bisect.m b/SuiteSparse/CHOLMOD/MATLAB/bisect.m index 13ec084e4..c47e3b424 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/bisect.m +++ b/SuiteSparse/CHOLMOD/MATLAB/bisect.m @@ -1,5 +1,5 @@ function p = bisect (A, mode) %#ok -%BISECT computes a node separator based on METIS_NodeComputeSeparator. +%BISECT computes a node separator based on METIS_ComputeVertexSeparator. % % Example: % s = bisect(A) bisects A. Uses tril(A) and assumes A is symmetric. diff --git a/SuiteSparse/CHOLMOD/MATLAB/cholmod_demo.m b/SuiteSparse/CHOLMOD/MATLAB/cholmod_demo.m index 61a6ffc01..980b98f8e 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/cholmod_demo.m +++ b/SuiteSparse/CHOLMOD/MATLAB/cholmod_demo.m @@ -115,15 +115,35 @@ function try_matrix (A) t2, 1e-6 * fl / t2) ; tic -LD = ldlupdate (LD,C) ; +LD2 = ldlupdate (LD,C) ; t3 = toc ; fprintf ('CHOLMOD ldlupdate(sparse(A),C) time: %6.2f (rank-1, C dense)\n', t3) ; -[L,D] = ldlsplit (LD) ; -L = full (L) ; +[L,D] = ldlsplit (LD2) ; +% L = full (L) ; err = norm ((S+C*C') - L*D*L', 1) / norm (S,1) ; fprintf ('err: %g\n', err) ; +k = max (1,fix(n/2)) ; +tic +LD3 = ldlrowmod (LD, k) ; +t4 = toc ; +fprintf ('CHOLMOD ldlrowmod(LD,k) time: %6.2f\n', t4) ; + +[L,D] = ldlsplit (LD3) ; +S2 = S ; +I = speye (n) ; +S2 (k,:) = I (k,:) ; +S2 (:,k) = I (:,k) ; +err = norm (S2 - L*D*L', 1) / norm (S,1) ; +fprintf ('err: %g\n', err) ; + +LD4 = ldlchol (S2) ; +[L,D] = ldlsplit (LD4) ; +% L = full (L) ; +err = norm (S2 - L*D*L', 1) / norm (S,1) ; +fprintf ('err: %g\n', err) ; + tic R = chol (S) ; %#ok s1 = toc ; diff --git a/SuiteSparse/CHOLMOD/MATLAB/cholmod_install.m b/SuiteSparse/CHOLMOD/MATLAB/cholmod_install.m index 5f50730a8..a34f56a87 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/cholmod_install.m +++ b/SuiteSparse/CHOLMOD/MATLAB/cholmod_install.m @@ -2,13 +2,13 @@ function cholmod_install (metis_path) %CHOLMOD_INSTALL compile and install CHOLMOD, AMD, COLAMD, CCOLAMD, CAMD % % Example: -% cholmod_install % compiles using ../../metis-4.0 +% cholmod_install % compiles using METIS % cholmod_install ('/my/metis') % using non-default path to METIS % cholmod_install ('no metis') % do not use METIS at all % % CHOLMOD relies on AMD and COLAMD, for its ordering options, and can % optionally use CCOLAMD, CAMD, and METIS as well. By default, CCOLAMD, CAMD, -% and METIS are used. METIS is assumed to be in the ../../metis-4.0 directory. +% and METIS are used. % % See http://www-users.cs.umn.edu/~karypis/metis for a copy of METIS 4.0.1. % @@ -16,12 +16,12 @@ function cholmod_install (metis_path) % % See also analyze, bisect, chol2, cholmod2, etree2, lchol, ldlchol, ldlsolve, % ldlupdate, metis, spsym, nesdis, septree, resymbol, sdmult, sparse2, -% symbfact2, mread, mwrite, amd2, colamd2, camd, ccolamd +% symbfact2, mread, mwrite, amd2, colamd2, camd, ccolamd, ldlrowmod -% Copyright 2006-2007, Timothy A. Davis +% Copyright 2006-2015, Timothy A. Davis if (nargin < 1) - metis_path = '../../metis-4.0' ; + metis_path = '../../metis-5.1.0' ; end % compile CHOLMOD and add to the path diff --git a/SuiteSparse/CHOLMOD/MATLAB/cholmod_make.m b/SuiteSparse/CHOLMOD/MATLAB/cholmod_make.m index 5daf8b89b..984751b47 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/cholmod_make.m +++ b/SuiteSparse/CHOLMOD/MATLAB/cholmod_make.m @@ -5,19 +5,13 @@ function cholmod_make (metis_path) % cholmod_make % % CHOLMOD relies on AMD and COLAMD, and optionally CCOLAMD, CAMD, and METIS. -% All but METIS are distributed with CHOLMOD. To compile CHOLMOD to use METIS -% you must first place a copy of the metis-4.0 directory (METIS version 4.0.1) -% in same directory that contains the AMD, COLAMD, CCOLAMD, and CHOLMOD -% directories. See http://www-users.cs.umn.edu/~karypis/metis for a copy of -% METIS 4.0.1. -% % You must type the cholmod_make command while in the CHOLMOD/MATLAB directory. % % See also analyze, bisect, chol2, cholmod2, etree2, lchol, ldlchol, ldlsolve, % ldlupdate, metis, spsym, nesdis, septree, resymbol, sdmult, sparse2, -% symbfact2, mread, mwrite +% symbfact2, mread, mwrite, ldlrowmod -% Copyright 2006-2007, Timothy A. Davis, http://www.suitesparse.com +% Copyright 2006-2015, Timothy A. Davis, http://www.suitesparse.com details = 0 ; % 1 if details of each command are to be printed @@ -61,29 +55,15 @@ function cholmod_make (metis_path) % Determine if METIS is available if (nargin < 1) - metis_path = '../../metis-4.0' ; + metis_path = '../../metis-5.1.0' ; end -have_metis = exist ([metis_path '/Lib'], 'dir') ; +have_metis = exist (metis_path, 'dir') ; - % fix the METIS 4.0.1 rename.h file if (have_metis) - fprintf ('Compiling CHOLMOD with METIS for MATLAB Version %s\n', v) ; - f = fopen ('rename.h', 'w') ; - if (f == -1) - error ('unable to create rename.h in current directory') ; - end - fprintf (f, '/* do not edit this file; generated by cholmod_make */\n') ; - fprintf (f, '#undef log2\n') ; - fprintf (f, '#include "%s/Lib/rename.h"\n', metis_path) ; - fprintf (f, '#undef log2\n') ; - fprintf (f, '#define log2 METIS__log2\n') ; - fprintf (f, '#include "mex.h"\n') ; - fprintf (f, '#define malloc mxMalloc\n') ; - fprintf (f, '#define free mxFree\n') ; - fprintf (f, '#define calloc mxCalloc\n') ; - fprintf (f, '#define realloc mxRealloc\n') ; - fclose (f) ; - include = [include ' -I' metis_path '/Lib'] ; + fprintf ('Compiling CHOLMOD with METIS 5.1.0 for MATLAB Version %s\n', v) ; + include = [include ' -I' metis_path '/include'] ; + include = [include ' -I' metis_path '/GKlib'] ; + include = [include ' -I' metis_path '/libmetis'] ; else fprintf ('Compiling CHOLMOD without METIS for MATLAB Version %s\n', v) ; include = ['-DNPARTITION ' include] ; @@ -98,10 +78,7 @@ function cholmod_make (metis_path) % fine the LAPACK and BLAS libraries, which is a real portability nightmare. if (pc) - if (verLessThan ('matlab', '6.5')) - % MATLAB 6.1 and earlier: use the version supplied here - lapack = 'lcc_lib/libmwlapack.lib' ; - elseif (verLessThan ('matlab', '7.5')) + if (verLessThan ('matlab', '7.5')) lapack = 'libmwlapack.lib' ; else lapack = 'libmwlapack.lib libmwblas.lib' ; @@ -156,64 +133,73 @@ function cholmod_make (metis_path) '../../CAMD/Source/camd_preprocess', ... '../../CAMD/Source/camd_valid', ... '../../COLAMD/Source/colamd', ... - '../../COLAMD/Source/colamd_global', ... - '../../CCOLAMD/Source/ccolamd', ... - '../../CCOLAMD/Source/ccolamd_global' } ; + '../../CCOLAMD/Source/ccolamd' } ; if (have_metis) + metis_src = { - 'Lib/balance', ... - 'Lib/bucketsort', ... - 'Lib/ccgraph', ... - 'Lib/coarsen', ... - 'Lib/compress', ... - 'Lib/debug', ... - 'Lib/estmem', ... - 'Lib/fm', ... - 'Lib/fortran', ... - 'Lib/frename', ... - 'Lib/graph', ... - 'Lib/initpart', ... - 'Lib/kmetis', ... - 'Lib/kvmetis', ... - 'Lib/kwayfm', ... - 'Lib/kwayrefine', ... - 'Lib/kwayvolfm', ... - 'Lib/kwayvolrefine', ... - 'Lib/match', ... - 'Lib/mbalance2', ... - 'Lib/mbalance', ... - 'Lib/mcoarsen', ... - 'Lib/memory', ... - 'Lib/mesh', ... - 'Lib/meshpart', ... - 'Lib/mfm2', ... - 'Lib/mfm', ... - 'Lib/mincover', ... - 'Lib/minitpart2', ... - 'Lib/minitpart', ... - 'Lib/mkmetis', ... - 'Lib/mkwayfmh', ... - 'Lib/mkwayrefine', ... - 'Lib/mmatch', ... - 'Lib/mmd', ... - 'Lib/mpmetis', ... - 'Lib/mrefine2', ... - 'Lib/mrefine', ... - 'Lib/mutil', ... - 'Lib/myqsort', ... - 'Lib/ometis', ... - 'Lib/parmetis', ... - 'Lib/pmetis', ... - 'Lib/pqueue', ... - 'Lib/refine', ... - 'Lib/separator', ... - 'Lib/sfm', ... - 'Lib/srefine', ... - 'Lib/stat', ... - 'Lib/subdomains', ... - 'Lib/timing', ... - 'Lib/util' } ; + 'GKlib/b64', ... + 'GKlib/blas', ... + 'GKlib/csr', ... + 'GKlib/error', ... + 'GKlib/evaluate', ... + 'GKlib/fkvkselect', ... + 'GKlib/fs', ... + 'GKlib/getopt', ... + 'GKlib/gkregex', ... + 'GKlib/graph', ... + 'GKlib/htable', ... + 'GKlib/io', ... + 'GKlib/itemsets', ... + 'GKlib/mcore', ... + 'GKlib/memory', ... + 'GKlib/omp', ... + 'GKlib/pdb', ... + 'GKlib/pqueue', ... + 'GKlib/random', ... + 'GKlib/rw', ... + 'GKlib/seq', ... + 'GKlib/sort', ... + 'GKlib/string', ... + 'GKlib/timers', ... + 'GKlib/tokenizer', ... + 'GKlib/util', ... + 'libmetis/auxapi', ... + 'libmetis/balance', ... + 'libmetis/bucketsort', ... + 'libmetis/checkgraph', ... + 'libmetis/coarsen', ... + 'libmetis/compress', ... + 'libmetis/contig', ... + 'libmetis/debug', ... + 'libmetis/fm', ... + 'libmetis/fortran', ... + 'libmetis/frename', ... + 'libmetis/gklib', ... + 'libmetis/graph', ... + 'libmetis/initpart', ... + 'libmetis/kmetis', ... + 'libmetis/kwayfm', ... + 'libmetis/kwayrefine', ... + 'libmetis/mcutil', ... + 'libmetis/mesh', ... + 'libmetis/meshpart', ... + 'libmetis/minconn', ... + 'libmetis/mincover', ... + 'libmetis/mmd', ... + 'libmetis/ometis', ... + 'libmetis/options', ... + 'libmetis/parmetis', ... + 'libmetis/pmetis', ... + 'libmetis/refine', ... + 'libmetis/separator', ... + 'libmetis/sfm', ... + 'libmetis/srefine', ... + 'libmetis/stat', ... + 'libmetis/timing', ... + 'libmetis/util', ... + 'libmetis/wspace', ... + } ; for i = 1:length (metis_src) metis_src {i} = [metis_path '/' metis_src{i}] ; @@ -283,6 +269,7 @@ function cholmod_make (metis_path) 'ldlchol', ... 'ldlsolve', ... 'ldlupdate', ... + 'ldlrowmod', ... 'metis', ... 'spsym', ... 'nesdis', ... @@ -318,14 +305,28 @@ function cholmod_make (metis_path) for f = source ff = f {1} ; - slash = strfind (ff, '/') ; - if (isempty (slash)) - slash = 1 ; + if (isequal (ff, [metis_path '/GKlib/util'])) + % special case, since a file with the same name also exists in libmetis + copyfile ([ff '.c'], 'GKlib_util.c', 'f') ; + ff = 'GKlib_util' ; + o = 'GKlib_util' ; + elseif (isequal (ff, [metis_path '/GKlib/graph'])) + % special case, since a file with the same name also exist in libmetis + copyfile ([ff '.c'], 'GKlib_graph.c', 'f') ; + ff = 'GKlib_graph' ; + o = 'GKlib_graph' ; else - slash = slash (end) + 1 ; + slash = strfind (ff, '/') ; + if (isempty (slash)) + slash = 1 ; + else + slash = slash (end) + 1 ; + end + o = ff (slash:end) ; end - o = ff (slash:end) ; - obj = [obj ' ' o obj_extension] ; %#ok + % fprintf ('%s\n', o) ; + o = [o obj_extension] ; + obj = [obj ' ' o] ; %#ok s = sprintf ('mex %s -DDLONG -O %s -c %s.c', flags, include, ff) ; kk = do_cmd (s, kk, details) ; end @@ -342,6 +343,14 @@ function cholmod_make (metis_path) do_cmd (s, kk, details) ; fprintf ('\nCHOLMOD successfully compiled\n') ; +% remove the renamed METIS files, if they exist +if (exist ('GKlib_util.c', 'file')) + delete ('GKlib_util.c') ; +end +if (exist ('GKlib_graph.c', 'file')) + delete ('GKlib_graph.c') ; +end + %------------------------------------------------------------------------------ function kk = do_cmd (s, kk, details) %DO_CMD: evaluate a command, and either print it or print a "." diff --git a/SuiteSparse/CHOLMOD/MATLAB/cholmod_matlab.c b/SuiteSparse/CHOLMOD/MATLAB/cholmod_matlab.c index b9078d4e8..64172c697 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/cholmod_matlab.c +++ b/SuiteSparse/CHOLMOD/MATLAB/cholmod_matlab.c @@ -55,16 +55,6 @@ void sputil_config (Long spumoni, cholmod_common *cm) /* error handler */ cm->error_handler = sputil_error_handler ; -#ifndef NPARTITION -#if defined(METIS_VERSION) -#if (METIS_VERSION >= METIS_VER(4,0,2)) - /* METIS 4.0.2 uses function pointers for malloc and free */ - METIS_malloc = Suiteparse_config.malloc_func ; - METIS_free = Suiteparse_config.free_func ; -#endif -#endif -#endif - /* Turn off METIS memory guard. It is not needed, because mxMalloc will * safely terminate the mexFunction and free any workspace without killing * all of MATLAB. This assumes cholmod_make was used to compile CHOLMOD @@ -383,14 +373,15 @@ mxArray *sputil_put_sparse mxArray *Amatlab ; cholmod_sparse *A ; A = *Ahandle ; + if (!A || A->x == NULL) mexErrMsgTxt ("invalid sparse matrix") ; Amatlab = mxCreateSparse (0, 0, 0, (A->xtype != CHOLMOD_REAL) ? mxCOMPLEX: mxREAL) ; mxSetM (Amatlab, A->nrow) ; mxSetN (Amatlab, A->ncol) ; mxSetNzmax (Amatlab, A->nzmax) ; - mxFree (mxGetJc (Amatlab)) ; - mxFree (mxGetIr (Amatlab)) ; - mxFree (mxGetPr (Amatlab)) ; + MXFREE (mxGetJc (Amatlab)) ; + MXFREE (mxGetIr (Amatlab)) ; + MXFREE (mxGetPr (Amatlab)) ; mxSetJc (Amatlab, A->p) ; mxSetIr (Amatlab, A->i) ; mxSetPr (Amatlab, A->x) ; @@ -399,7 +390,8 @@ mxArray *sputil_put_sparse mexMakeMemoryPersistent (A->x) ; if (A->xtype != CHOLMOD_REAL) { - mxFree (mxGetPi (Amatlab)) ; + if (A->z == NULL) mexErrMsgTxt ("invalid complex sparse matrix") ; + MXFREE (mxGetPi (Amatlab)) ; mxSetPi (Amatlab, A->z) ; mexMakeMemoryPersistent (A->z) ; } @@ -429,16 +421,18 @@ mxArray *sputil_put_dense mxArray *Amatlab ; cholmod_dense *A ; A = *Ahandle ; + if (!A || A->x == NULL) mexErrMsgTxt ("invalid dense matrix") ; Amatlab = mxCreateDoubleMatrix (0, 0, (A->xtype != CHOLMOD_REAL) ? mxCOMPLEX: mxREAL) ; mxSetM (Amatlab, A->nrow) ; mxSetN (Amatlab, A->ncol) ; - mxFree (mxGetPr (Amatlab)) ; + MXFREE (mxGetPr (Amatlab)) ; mxSetPr (Amatlab, A->x) ; mexMakeMemoryPersistent (A->x) ; if (A->xtype != CHOLMOD_REAL) { - mxFree (mxGetPi (Amatlab)) ; + if (A->z == NULL) mexErrMsgTxt ("invalid complex dense matrix") ; + MXFREE (mxGetPi (Amatlab)) ; mxSetPi (Amatlab, A->z) ; mexMakeMemoryPersistent (A->z) ; } @@ -2081,7 +2075,7 @@ void sputil_sparse { s_logical [k] = 1 ; } - mxFree (mxGetData (pargout [0])) ; + MXFREE (mxGetData (pargout [0])) ; mxSetData (pargout [0], s_logical) ; mexMakeMemoryPersistent (s_logical) ; k++ ; @@ -2089,13 +2083,15 @@ void sputil_sparse else #endif + if (S->x == NULL) mexErrMsgTxt ("invalid sparse matrix") ; if (mxIsComplex (pargin [2])) { /* copy S into a MATLAB sparse complex double matrix */ + if (S->z == NULL) mexErrMsgTxt ("invalid complex sparse matrix") ; pargout [0] = mxCreateSparse (0, 0, 0, mxCOMPLEX) ; - mxFree (mxGetPr (pargout [0])) ; - mxFree (mxGetPi (pargout [0])) ; + MXFREE (mxGetPr (pargout [0])) ; + MXFREE (mxGetPi (pargout [0])) ; mxSetPr (pargout [0], S->x) ; mxSetPi (pargout [0], S->z) ; mexMakeMemoryPersistent (S->x) ; @@ -2117,8 +2113,8 @@ void sputil_sparse mxSetM (pargout [0], S->nrow) ; mxSetN (pargout [0], S->ncol) ; mxSetNzmax (pargout [0], S->nzmax) ; - mxFree (mxGetJc (pargout [0])) ; - mxFree (mxGetIr (pargout [0])) ; + MXFREE (mxGetJc (pargout [0])) ; + MXFREE (mxGetIr (pargout [0])) ; mxSetJc (pargout [0], S->p) ; mxSetIr (pargout [0], S->i) ; mexMakeMemoryPersistent (S->p) ; diff --git a/SuiteSparse/CHOLMOD/MATLAB/cholmod_matlab.h b/SuiteSparse/CHOLMOD/MATLAB/cholmod_matlab.h index ed39805ab..d8670bcf9 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/cholmod_matlab.h +++ b/SuiteSparse/CHOLMOD/MATLAB/cholmod_matlab.h @@ -33,6 +33,12 @@ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define LEN 16 +#define MXFREE(a) { \ + void *ptr ; \ + ptr = (void *) (a) ; \ + if (ptr != NULL) mxFree (ptr) ; \ +} + #define ERROR_TOO_SMALL 0 #define ERROR_HUGE 1 #define ERROR_NOT_INTEGER 2 diff --git a/SuiteSparse/CHOLMOD/MATLAB/ldlsolve.m b/SuiteSparse/CHOLMOD/MATLAB/ldlsolve.m index 399e3415b..5e4bafc6a 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/ldlsolve.m +++ b/SuiteSparse/CHOLMOD/MATLAB/ldlsolve.m @@ -9,12 +9,12 @@ % [L,D] = ldlsplit (LD) ; % x = L' \ (D \ (L \ b)) ; % -% LD is from ldlchol, or as updated by ldlupdate. You must not modify LD as -% obtained from ldlchol or ldlupdate prior to passing it to this function. -% See ldlupdate for more details. +% LD is from ldlchol, or as updated by ldlupdate or ldlrowmod. You must not +% modify LD as obtained from ldlchol, ldlupdate, or ldlrowmod prior to passing +% it to this function. See ldlupdate for more details. % -% See also LDLCHOL, LDLUPDATE, LDLSPLIT +% See also LDLCHOL, LDLUPDATE, LDLSPLIT, LDLROWMOD -% Copyright 2006-2007, Timothy A. Davis, http://www.suitesparse.com +% Copyright 2006-2017, Timothy A. Davis, http://www.suitesparse.com error ('ldlsolve mexFunction not found') ; diff --git a/SuiteSparse/CHOLMOD/MATLAB/nesdis.c b/SuiteSparse/CHOLMOD/MATLAB/nesdis.c index 446d978f7..78dcf64b1 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/nesdis.c +++ b/SuiteSparse/CHOLMOD/MATLAB/nesdis.c @@ -12,7 +12,7 @@ * METIS (Copyright 1998, G. Karypis) is not distributed with CHOLMOD. * -------------------------------------------------------------------------- */ -/* CHOLMOD's nested dissection, based on METIS_NodeComputerSeparator, CAMD, and +/* CHOLMOD's nested dissection, based on METIS_ComputeVertexSeparator, CAMD, and * CCOLAMD. * * Usage: diff --git a/SuiteSparse/CHOLMOD/MATLAB/resymbol.m b/SuiteSparse/CHOLMOD/MATLAB/resymbol.m index 4d3169ce4..697fe758f 100644 --- a/SuiteSparse/CHOLMOD/MATLAB/resymbol.m +++ b/SuiteSparse/CHOLMOD/MATLAB/resymbol.m @@ -8,11 +8,12 @@ % symmetric. Only tril(A) is used. Entries in L that are not in the Cholesky % factorization of A are removed from L. L can be from an LL' or LDL' % factorization (lchol or ldlchol). resymbol is useful after a series of -% downdates via ldlupdate, since downdates do not remove any entries in L. -% The numerical values of A are ignored; only its nonzero pattern is used. +% downdates via ldlupdate or ldlrowmod, since downdates do not remove any +% entries in L. The numerical values of A are ignored; only its nonzero +% pattern is used. % -% See also LCHOL, LDLUPDATE +% See also LCHOL, LDLUPDATE, LDLROWMOD -% Copyright 2006-2007, Timothy A. Davis, http://www.suitesparse.com +% Copyright 2006-2015, Timothy A. Davis, http://www.suitesparse.com error ('resymbol not found') ; diff --git a/SuiteSparse/CHOLMOD/Makefile b/SuiteSparse/CHOLMOD/Makefile index 5412c0bb9..bdbf59e61 100644 --- a/SuiteSparse/CHOLMOD/Makefile +++ b/SuiteSparse/CHOLMOD/Makefile @@ -2,11 +2,8 @@ # CHOLMOD Makefile #------------------------------------------------------------------------------- -VERSION = 3.0.5 - -# Note: If you do not have METIS, or do not wish to use it in CHOLMOD, you must -# compile CHOLMOD with the -DNPARTITION flag. -# See ../SuiteSparse_config/SuiteSparse_config.mk . +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all @@ -14,6 +11,7 @@ include ../SuiteSparse_config/SuiteSparse_config.mk # Compile the C-callable libraries and the Demo programs. all: + ( cd Lib ; $(MAKE) ) ( cd Demo ; $(MAKE) ) # Compile the C-callable libraries only. @@ -27,7 +25,7 @@ purge: ( cd Valgrind ; $(MAKE) dopurge ) ( cd Demo ; $(MAKE) purge ) ( cd Doc ; $(MAKE) purge ) - ( cd MATLAB ; $(RM) $(CLEAN) rename.h *.mex* ) + ( cd MATLAB ; $(RM) $(CLEAN) rename.h *.mex* GKlib_util.c GKlib_graph.c ) # Remove all files not in the original distribution, except keep the # compiled libraries. @@ -61,15 +59,8 @@ docs: # install CHOLMOD install: - $(CP) Lib/libcholmod.a $(INSTALL_LIB)/libcholmod.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libcholmod.$(VERSION).a libcholmod.a ) - $(CP) Include/cholmod*.h $(INSTALL_INCLUDE) - $(RM) $(INSTALL_INCLUDE)/cholmod_internal.h - chmod 644 $(INSTALL_LIB)/libcholmod*.a - chmod 644 $(INSTALL_INCLUDE)/cholmod*.h + ( cd Lib ; $(MAKE) install ) # uninstall CHOLMOD uninstall: - $(RM) $(INSTALL_LIB)/libcholmod*.a - $(RM) $(INSTALL_INCLUDE)/cholmod*.h - + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_drop.c b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_drop.c index 69eb0fa50..de0ce8a2c 100644 --- a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_drop.c +++ b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_drop.c @@ -19,6 +19,7 @@ * Supports pattern and real matrices, complex and zomplex not supported. */ +#ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" @@ -181,3 +182,4 @@ int CHOLMOD(drop) return (TRUE) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_horzcat.c b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_horzcat.c index 9388e9a90..b57961beb 100644 --- a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_horzcat.c +++ b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_horzcat.c @@ -23,6 +23,7 @@ * A and B cannot be complex or zomplex, unless values is FALSE. */ +#ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" @@ -201,3 +202,4 @@ cholmod_sparse *CHOLMOD(horzcat) return (C) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_norm.c b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_norm.c index 200f5bde1..48648539f 100644 --- a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_norm.c +++ b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_norm.c @@ -17,6 +17,7 @@ * Pattern, real, complex, and zomplex sparse matrices are supported. */ +#ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" @@ -450,3 +451,4 @@ double CHOLMOD(norm_sparse) return (anorm) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_scale.c b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_scale.c index 2f722c686..e2bf17390 100644 --- a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_scale.c +++ b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_scale.c @@ -51,6 +51,7 @@ * Only real matrices are supported. */ +#ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" @@ -215,3 +216,4 @@ int CHOLMOD(scale) return (TRUE) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_sdmult.c b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_sdmult.c index fd40b48ec..876921d21 100644 --- a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_sdmult.c +++ b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_sdmult.c @@ -32,6 +32,7 @@ * must all match. */ +#ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" @@ -147,3 +148,4 @@ int CHOLMOD(sdmult) return (TRUE) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_ssmult.c b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_ssmult.c index fbdf0ce27..13b3a40b9 100644 --- a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_ssmult.c +++ b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_ssmult.c @@ -34,6 +34,7 @@ * is FALSE). */ +#ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" @@ -485,3 +486,4 @@ cholmod_sparse *CHOLMOD(ssmult) return (C) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_submatrix.c b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_submatrix.c index a4120534c..7acb9c0e7 100644 --- a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_submatrix.c +++ b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_submatrix.c @@ -38,6 +38,7 @@ * are supported only when "values" is FALSE. */ +#ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" @@ -423,3 +424,4 @@ cholmod_sparse *CHOLMOD(submatrix) return (C) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_symmetry.c b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_symmetry.c index 3bae8c7bd..a82ab0571 100644 --- a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_symmetry.c +++ b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_symmetry.c @@ -87,6 +87,7 @@ * regardless of the value of the option parameter. */ +#ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" @@ -486,3 +487,4 @@ int CHOLMOD(symmetry) return (result) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_vertcat.c b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_vertcat.c index 4199a91dc..5641ae3ae 100644 --- a/SuiteSparse/CHOLMOD/MatrixOps/cholmod_vertcat.c +++ b/SuiteSparse/CHOLMOD/MatrixOps/cholmod_vertcat.c @@ -23,6 +23,7 @@ * are supported only if "values" is FALSE. */ +#ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" @@ -199,3 +200,4 @@ cholmod_sparse *CHOLMOD(vertcat) return (C) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/Modify/cholmod_rowadd.c b/SuiteSparse/CHOLMOD/Modify/cholmod_rowadd.c index dd7ecf0e3..82a264286 100644 --- a/SuiteSparse/CHOLMOD/Modify/cholmod_rowadd.c +++ b/SuiteSparse/CHOLMOD/Modify/cholmod_rowadd.c @@ -20,6 +20,7 @@ * numeric identity matrix before the row is added. */ +#ifndef NGPL #ifndef NMODIFY #include "cholmod_internal.h" @@ -676,3 +677,4 @@ int CHOLMOD(rowadd_mark) return (ok) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/Modify/cholmod_rowdel.c b/SuiteSparse/CHOLMOD/Modify/cholmod_rowdel.c index ccf1ce703..2760a8a39 100644 --- a/SuiteSparse/CHOLMOD/Modify/cholmod_rowdel.c +++ b/SuiteSparse/CHOLMOD/Modify/cholmod_rowdel.c @@ -21,6 +21,7 @@ * is used, it can have any valid xtype). */ +#ifndef NGPL #ifndef NMODIFY #include "cholmod_internal.h" @@ -459,3 +460,4 @@ int CHOLMOD(rowdel_mark) return (ok) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/Modify/cholmod_updown.c b/SuiteSparse/CHOLMOD/Modify/cholmod_updown.c index e3621f427..0ab15f42d 100644 --- a/SuiteSparse/CHOLMOD/Modify/cholmod_updown.c +++ b/SuiteSparse/CHOLMOD/Modify/cholmod_updown.c @@ -61,6 +61,7 @@ * numeric identity matrix. */ +#ifndef NGPL #ifndef NMODIFY #include "cholmod_internal.h" @@ -1593,3 +1594,4 @@ int CHOLMOD(updown_mask2) return (TRUE) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/Partition/cholmod_metis.c b/SuiteSparse/CHOLMOD/Partition/cholmod_metis.c index 06c01cda3..7142ac797 100644 --- a/SuiteSparse/CHOLMOD/Partition/cholmod_metis.c +++ b/SuiteSparse/CHOLMOD/Partition/cholmod_metis.c @@ -10,12 +10,21 @@ * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ -/* CHOLMOD interface to the METIS package (Version 4.0.1): +/* CHOLMOD interface to the METIS package (Version 5.1.0): * * cholmod_metis_bisector: * - * Wrapper for METIS_ComputeVertexSeparator. Finds a set of nodes that - * partitions the graph into two parts. + * Wrapper for the METIS node separator function, + * METIS_ComputeVertexSeparator (METIS 5.1). + * + * Finds a set of nodes that partitions the graph into two parts. METIS + * 4.0 (the function METIS_ComputeVertexSeparator) allowed for edge + * weights to be passed to the bisector. This feature is removed in METIS + * 5.1. CHOLMOD itself does not rely on this feature (it calls the METIS + * bisector with edge weights of all 1s). However, user code can call + * cholmod_metis_bisector directly, and pass in edge weights. If you use + * METIS 5.1, these edge weights are now ignored; if you pass a non-NULL + * entry for edge weights, an error will be returned. * * cholmod_metis: * @@ -46,23 +55,10 @@ #ifndef NPARTITION #include "cholmod_internal.h" -#undef ASSERT - #include "metis.h" -/* METIS has its own ASSERT that it reveals to the user, so remove it here: */ -#undef ASSERT - -/* and redefine it back again */ -#ifndef NDEBUG -#define ASSERT(expression) (assert (expression)) -#else -#define ASSERT(expression) -#endif - #include "cholmod_partition.h" #include "cholmod_cholesky.h" - /* ========================================================================== */ /* === dumpgraph ============================================================ */ /* ========================================================================== */ @@ -107,7 +103,7 @@ static void dumpgraph (idx_t *Mp, idx_t *Mi, SuiteSparse_long n, /* === metis_memory_ok ====================================================== */ /* ========================================================================== */ -/* METIS_NodeND and METIS_ComputeVertexSeparator will terminate your program it +/* METIS will terminate your program if * they run out of memory. In an attempt to workaround METIS' behavior, this * routine allocates a single block of memory of size equal to an observed * upper bound on METIS' memory usage. It then immediately deallocates the @@ -124,15 +120,6 @@ static void dumpgraph (idx_t *Mp, idx_t *Mi, SuiteSparse_long n, * If you do not mind having your program terminated if it runs out of memory, * set Common->metis_memory to zero. Its default value is 2, which allows for * some memory fragmentation, and also accounts for the Gupta/gupta2 matrix. - * - * An alternative, if CHOLMOD is used in MATLAB, is to use a version of METIS - * (4.0.2, perhaps) proposed to George Karypis. This version uses function - * pointer for malloc and free. They can be set to mxMalloc and mxFree - * (see sputil_config in MATLAB/sputil.c). On Linux, with gcc, you must also - * compile CHOLMOD, METIS, AMD, COLAMD, and CCOLAMD with the -fexceptions - * compiler flag. With this configuration, mxMalloc safely aborts the - * mexFunction, frees all memory allocted by METIS, and safely returns to - * MATLAB. You may then set Common->metis_memory = 0. */ #define GUESS(nz,n) (10 * (nz) + 50 * (n) + 4096) @@ -190,7 +177,7 @@ static int metis_memory_ok /* ========================================================================== */ /* Finds a set of nodes that bisects the graph of A or AA' (direct interface - * to METIS_ComputeVertexSeparator). + * to METIS_ComputeVertexSeparator. * * The input matrix A must be square, symmetric (with both upper and lower * parts present) and with no diagonal entries. These conditions are NOT @@ -201,8 +188,13 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to bisect */ - Int *Anw, /* size A->nrow, node weights */ - Int *Aew, /* size nz, edge weights */ + Int *Anw, /* size A->nrow, node weights, can be NULL, */ + /* which means the graph is unweighted. */ + Int *Aew, /* size nz, edge weights (silently ignored). */ + /* This option was available with METIS 4, but not */ + /* in METIS 5. This argument is now unused, but */ + /* it remains for backward compatibilty, so as not */ + /* to change the API for cholmod_metis_bisector. */ /* ---- output --- */ Int *Partition, /* size A->nrow */ /* --------------- */ @@ -210,10 +202,11 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ ) { Int *Ap, *Ai ; - idx_t *Mp, *Mi, *Mnw, *Mew, *Mpart ; + idx_t *Mp, *Mi, *Mnw, *Mpart ; Int n, nleft, nright, j, p, csep, total_weight, lightest, nz ; - int Opt [8], nn, csp ; + idx_t nn, csp ; size_t n1 ; + int ok ; DEBUG (Int nsep) ; /* ---------------------------------------------------------------------- */ @@ -222,8 +215,8 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (A, EMPTY) ; - RETURN_IF_NULL (Anw, EMPTY) ; - RETURN_IF_NULL (Aew, EMPTY) ; + /* RETURN_IF_NULL (Anw, EMPTY) ; */ + /* RETURN_IF_NULL (Aew, EMPTY) ; */ RETURN_IF_NULL (Partition, EMPTY) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, EMPTY) ; if (A->stype || A->nrow != A->ncol) @@ -234,6 +227,7 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ return (EMPTY) ; } Common->status = CHOLMOD_OK ; + ASSERT (CHOLMOD(dump_sparse) (A, "A for bisector", Common) >= 0) ; /* ---------------------------------------------------------------------- */ /* quick return */ @@ -254,43 +248,16 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ Ai = A->i ; nz = Ap [n] ; - /* ---------------------------------------------------------------------- */ - /* METIS does not have a 64-bit integer version */ - /* ---------------------------------------------------------------------- */ - -#ifdef LONG - if (sizeof (Int) > sizeof (idx_t) && MAX (n,nz) > INT_MAX / sizeof (int)) - { - /* CHOLMOD's matrix is too large for METIS */ - return (EMPTY) ; - } -#endif - - /* ---------------------------------------------------------------------- */ - /* set default options */ - /* ---------------------------------------------------------------------- */ - - Opt [0] = 0 ; /* use defaults */ - Opt [1] = 3 ; /* matching type */ - Opt [2] = 1 ; /* init. partitioning algo*/ - Opt [3] = 2 ; /* refinement algorithm */ - Opt [4] = 0 ; /* no debug */ - Opt [5] = 0 ; /* unused */ - Opt [6] = 0 ; /* unused */ - Opt [7] = -1 ; /* random seed */ - - DEBUG (for (j = 0 ; j < n ; j++) ASSERT (Anw [j] > 0)) ; + if (Anw != NULL) DEBUG (for (j = 0 ; j < n ; j++) ASSERT (Anw [j] > 0)) ; /* ---------------------------------------------------------------------- */ /* copy Int to METIS idx_t, if necessary */ /* ---------------------------------------------------------------------- */ - DEBUG (for (j = 0 ; j < nz ; j++) ASSERT (Aew [j] > 0)) ; if (sizeof (Int) == sizeof (idx_t)) { /* this is the typical case */ Mi = (idx_t *) Ai ; - Mew = (idx_t *) Aew ; Mp = (idx_t *) Ap ; Mnw = (idx_t *) Anw ; Mpart = (idx_t *) Partition ; @@ -299,14 +266,12 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ { /* idx_t and Int differ; copy the graph into the METIS idx_t */ Mi = CHOLMOD(malloc) (nz, sizeof (idx_t), Common) ; - Mew = CHOLMOD(malloc) (nz, sizeof (idx_t), Common) ; Mp = CHOLMOD(malloc) (n1, sizeof (idx_t), Common) ; - Mnw = CHOLMOD(malloc) (n, sizeof (idx_t), Common) ; + Mnw = Anw ? (CHOLMOD(malloc) (n, sizeof (idx_t), Common)) : NULL ; Mpart = CHOLMOD(malloc) (n, sizeof (idx_t), Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free) (nz, sizeof (idx_t), Mi, Common) ; - CHOLMOD(free) (nz, sizeof (idx_t), Mew, Common) ; CHOLMOD(free) (n1, sizeof (idx_t), Mp, Common) ; CHOLMOD(free) (n, sizeof (idx_t), Mnw, Common) ; CHOLMOD(free) (n, sizeof (idx_t), Mpart, Common) ; @@ -316,18 +281,17 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ { Mi [p] = Ai [p] ; } - for (p = 0 ; p < nz ; p++) - { - Mew [p] = Aew [p] ; - } for (j = 0 ; j <= n ; j++) { Mp [j] = Ap [j] ; } - for (j = 0 ; j < n ; j++) - { - Mnw [j] = Anw [j] ; - } + if (Anw != NULL) + { + for (j = 0 ; j < n ; j++) + { + Mnw [j] = Anw [j] ; + } + } } /* ---------------------------------------------------------------------- */ @@ -340,7 +304,6 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ if (sizeof (Int) != sizeof (idx_t)) { CHOLMOD(free) (nz, sizeof (idx_t), Mi, Common) ; - CHOLMOD(free) (nz, sizeof (idx_t), Mew, Common) ; CHOLMOD(free) (n1, sizeof (idx_t), Mp, Common) ; CHOLMOD(free) (n, sizeof (idx_t), Mnw, Common) ; CHOLMOD(free) (n, sizeof (idx_t), Mpart, Common) ; @@ -356,21 +319,31 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ PRINT1 (("Metis graph, n = "ID"\n", n)) ; for (j = 0 ; j < n ; j++) { - Int ppp ; - PRINT2 (("M(:,"ID") node weight "ID"\n", j, (Int) Mnw [j])) ; - ASSERT (Mnw [j] > 0) ; + Int ppp, nodeweight = (Mnw ? Mnw [j] : 1) ; + PRINT2 (("M(:,"ID") node weight "ID"\n", j, nodeweight)) ; + ASSERT (nodeweight > 0) ; for (ppp = Mp [j] ; ppp < Mp [j+1] ; ppp++) { - PRINT3 ((" "ID" : "ID"\n", (Int) Mi [ppp], (Int) Mew [ppp])) ; + PRINT3 ((" "ID "\n", (Int) Mi [ppp])) ; ASSERT (Mi [ppp] != j) ; - ASSERT (Mew [ppp] > 0) ; } } #endif + /* + METIS_ComputeVertexSeparator( + idx_t *nvtxs, number of nodes + idx_t *xadj, column pointers + idx_t *adjncy, row indices + idx_t *vwgt, vertex weights (NULL means unweighted) + idx_t *options, options (NULL means defaults) + idx_t *sepsize, separator size + idx_t *part); partition. part [i] = 0,1,2, where: + 0:left, 1:right, 2:separator + */ + nn = n ; - METIS_ComputeVertexSeparator (&nn, Mp, Mi, Mnw, Mew, Opt, &csp, Mpart) ; - n = nn ; + ok = METIS_ComputeVertexSeparator (&nn, Mp, Mi, Mnw, NULL, &csp, Mpart) ; csep = csp ; PRINT1 (("METIS csep "ID"\n", csep)) ; @@ -379,19 +352,42 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ /* copy the results back from idx_t, if required */ /* ---------------------------------------------------------------------- */ - if (sizeof (Int) != sizeof (idx_t)) + if (ok == METIS_OK && (sizeof (Int) != sizeof (idx_t))) { for (j = 0 ; j < n ; j++) { Partition [j] = Mpart [j] ; } + } + + /* ---------------------------------------------------------------------- */ + /* free the workspace for METIS, if allocated */ + /* ---------------------------------------------------------------------- */ + + if (sizeof (Int) != sizeof (idx_t)) + { CHOLMOD(free) (nz, sizeof (idx_t), Mi, Common) ; - CHOLMOD(free) (nz, sizeof (idx_t), Mew, Common) ; CHOLMOD(free) (n1, sizeof (idx_t), Mp, Common) ; CHOLMOD(free) (n, sizeof (idx_t), Mnw, Common) ; CHOLMOD(free) (n, sizeof (idx_t), Mpart, Common) ; } + if (ok == METIS_ERROR_MEMORY) + { + ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory in METIS") ; + return (EMPTY) ; + } + else if (ok == METIS_ERROR_INPUT) + { + ERROR (CHOLMOD_INVALID, "invalid input to METIS") ; + return (EMPTY) ; + } + else if (ok == METIS_ERROR) + { + ERROR (CHOLMOD_INVALID, "unspecified METIS error") ; + return (EMPTY) ; + } + /* ---------------------------------------------------------------------- */ /* ensure a reasonable separator */ /* ---------------------------------------------------------------------- */ @@ -409,17 +405,24 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ { /* The separator is empty, select lightest node as separator. If * ties, select the highest numbered node. */ - lightest = 0 ; - for (j = 0 ; j < n ; j++) - { - if (Anw [j] <= Anw [lightest]) - { - lightest = j ; - } - } + if (Anw == NULL) + { + lightest = n-1 ; + } + else + { + lightest = 0 ; + for (j = 0 ; j < n ; j++) + { + if (Anw [j] <= Anw [lightest]) + { + lightest = j ; + } + } + } PRINT1 (("Force "ID" as sep\n", lightest)) ; Partition [lightest] = 2 ; - csep = Anw [lightest] ; + csep = (Anw ? (Anw [lightest]) : 1) ; } /* determine the node weights in the left and right part of the graph */ @@ -431,17 +434,17 @@ SuiteSparse_long CHOLMOD(metis_bisector) /* returns separator size */ PRINT1 (("Partition ["ID"] = "ID"\n", j, Partition [j])) ; if (Partition [j] == 0) { - nleft += Anw [j] ; + nleft += (Anw ? (Anw [j]) : 1) ; } else if (Partition [j] == 1) { - nright += Anw [j] ; + nright += (Anw ? (Anw [j]) : 1) ; } #ifndef NDEBUG else { ASSERT (Partition [j] == 2) ; - nsep += Anw [j] ; + nsep += (Anw ? (Anw [j]) : 1) ; } #endif } @@ -510,7 +513,7 @@ int CHOLMOD(metis) idx_t *Mp, *Mi, *Mperm, *Miperm ; cholmod_sparse *B ; Int i, j, n, nz, p, identity, uncol ; - int Opt [8], nn, zero = 0 ; + idx_t nn, zero = 0 ; size_t n1, s ; int ok = TRUE ; @@ -595,36 +598,10 @@ int CHOLMOD(metis) Bi = B->i ; nz = Bp [n] ; - /* ---------------------------------------------------------------------- */ - /* METIS does not have a SuiteSparse_long integer version */ - /* ---------------------------------------------------------------------- */ - -#ifdef LONG - if (sizeof (Int) > sizeof (idx_t) && MAX (n,nz) > INT_MAX / sizeof (int)) - { - /* CHOLMOD's matrix is too large for METIS */ - CHOLMOD(free_sparse) (&B, Common) ; - return (FALSE) ; - } -#endif - /* B does not include the diagonal, and both upper and lower parts. * Common->anz includes the diagonal, and just the lower part of B */ Common->anz = nz / 2 + n ; - /* ---------------------------------------------------------------------- */ - /* set control parameters for METIS_NodeND */ - /* ---------------------------------------------------------------------- */ - - Opt [0] = 0 ; /* use defaults */ - Opt [1] = 3 ; /* matching type */ - Opt [2] = 1 ; /* init. partitioning algo*/ - Opt [3] = 2 ; /* refinement algorithm */ - Opt [4] = 0 ; /* no debug */ - Opt [5] = 1 ; /* initial compression */ - Opt [6] = 0 ; /* no dense node removal */ - Opt [7] = 1 ; /* number of separators @ each step */ - /* ---------------------------------------------------------------------- */ /* allocate the METIS input arrays, if needed */ /* ---------------------------------------------------------------------- */ @@ -729,9 +706,19 @@ int CHOLMOD(metis) dumpgraph (Mp, Mi, n, Common) ; #endif + /* + int METIS_NodeND( + idx_t *nvtxs, number of nodes + idx_t *xadj, column pointers + idx_t *adjncy, row indices + idx_t *vwgt, vertex weights (NULL means unweighted) + idx_t *options, options (NULL means defaults) + idx_t *perm, fill-reducing ordering + idx_t *iperm); inverse of perm + */ + nn = n ; - METIS_NodeND (&nn, Mp, Mi, &zero, Opt, Mperm, Miperm) ; - n = nn ; + METIS_NodeND (&nn, Mp, Mi, NULL, NULL, Mperm, Miperm) ; PRINT0 (("METIS_NodeND done\n")) ; } diff --git a/SuiteSparse/CHOLMOD/README.txt b/SuiteSparse/CHOLMOD/README.txt index 212b0dd8e..d6c149662 100644 --- a/SuiteSparse/CHOLMOD/README.txt +++ b/SuiteSparse/CHOLMOD/README.txt @@ -31,11 +31,8 @@ CAMD is authored by T. Davis and Y. Chen. LAPACK and the BLAS are authored by Jack Dongarra and many others. LAPACK is available at http://www.netlib.org/lapack -METIS is authored by George Karypis, Univ. of Minnesota. Its use in CHOLMOD -is optional. See http://www-users.cs.umn.edu/~karypis/metis. -Place a copy of the metis-4.0 directory in the same directory that -contains the CHOLMOD, AMD, COLAMD, and CCOLAMD directories prior to compiling -with "make". +METIS 5.1.0 is authored by George Karypis, Univ. of Minnesota. Its use in +CHOLMOD is optional. A copy is in SuiteSparse/metis-5.1.0. If you do not wish to use METIS, you must edit SuiteSparse_config and change the line: @@ -62,18 +59,6 @@ also ensures your mexFunctions are compiled with -fexceptions, so that exceptions are handled properly (when hitting control-C in the MATLAB command window, for example). -On the Pentium, do NOT use the Intel MKL BLAS prior to MKL Version 8.0 with -CHOLMOD. Older versions (prior to 8.0) have a bug in dgemm when computing -A*B'. The bug generates a NaN result, when the inputs are well-defined. Use -the Goto BLAS or the MKL v8.0 BLAS instead. The Goto BLAS is faster and more -reliable. See http://www.tacc.utexas.edu/~kgoto/ or -http://www.cs.utexas.edu/users/flame/goto/. -Sadly, the Intel MKL BLAS 7.x is the default for MATLAB 7.0.4. See -http://www.mathworks.com/support/bugreports/details.html?rp=252103 for more -details. To workaround this problem on Linux, set environment variable -BLAS_VERSION to libmkl_p3.so:libguide.so. On Windows, set environment variable -BLAS_VERSION to mkl_p3.dll. Better yet, get MATLAB 7sp3 (MATLAB 7.1) or later. - Acknowledgements: this work was supported in part by the National Science Foundation (NFS CCR-0203270 and DMS-9803599), and a grant from Sandia National Laboratories (Dept. of Energy) which supported the development of CHOLMOD's diff --git a/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_numeric.c b/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_numeric.c index 78c4effcc..7cfee2725 100644 --- a/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_numeric.c +++ b/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_numeric.c @@ -56,6 +56,7 @@ * must match. */ +#ifndef NGPL #ifndef NSUPERNODAL #include "cholmod_internal.h" @@ -309,3 +310,4 @@ int CHOLMOD(super_numeric) return (ok) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_solve.c b/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_solve.c index ff6b8a90a..ff5bf0075 100644 --- a/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_solve.c +++ b/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_solve.c @@ -15,6 +15,7 @@ * interface that performs that operation. */ +#ifndef NGPL #ifndef NSUPERNODAL #include "cholmod_internal.h" @@ -214,3 +215,4 @@ int CHOLMOD(super_ltsolve) /* TRUE if OK, FALSE if BLAS overflow occured */ return (Common->blas_ok) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_symbolic.c b/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_symbolic.c index ad8037c78..72491b800 100644 --- a/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_symbolic.c +++ b/SuiteSparse/CHOLMOD/Supernodal/cholmod_super_symbolic.c @@ -40,6 +40,7 @@ * Supports any xtype (pattern, real, complex, or zomplex). */ +#ifndef NGPL #ifndef NSUPERNODAL #include "cholmod_internal.h" @@ -990,3 +991,4 @@ int CHOLMOD(super_symbolic) return (CHOLMOD(super_symbolic2) (TRUE, A, F, Parent, L, Common)) ; } #endif +#endif diff --git a/SuiteSparse/CHOLMOD/Tcov/Makefile b/SuiteSparse/CHOLMOD/Tcov/Makefile index 37274af00..831494003 100644 --- a/SuiteSparse/CHOLMOD/Tcov/Makefile +++ b/SuiteSparse/CHOLMOD/Tcov/Makefile @@ -14,8 +14,13 @@ default: go include ../../SuiteSparse_config/SuiteSparse_config.mk include Make.inc +# Temp directory +T = $(TCOV_TMP)/CHOLMOD_TCOV_TMP + # Tcov requires gcc CC = gcc +BLAS = -lrefblas -lgfortran +LAPACK = -llapack # to test Tcov without METIS, but with CAMD, CCOLAMD, and CSYMAMD: # C = $(CC) $(CF) $(CHOLMOD_CONFIG) $(NANTESTS) -DNPARTITION @@ -24,33 +29,32 @@ CC = gcc C = $(CC) $(CF) $(CHOLMOD_CONFIG) $(NANTESTS) # default LAPACK and BLAS from SuiteSparse_config.mk: - LIB = $(METIS) -lm $(LAPACK) $(BLAS) - -# optimized LAPACK and BLAS -# LIB = $(METIS) -lm $(LAPACK) $(BLAS) $(XERBLA) -L/shared/apps/rhel-6.2/intel/ics-2013/lib/intel64 -liomp5 + LDLIBS = -L../../lib \ + -lmetis -lm $(LAPACK) $(BLAS) -lrt -Wl,-rpath=$(SUITESPARSE)/lib # LAPACK and the Fortran reference BLAS, compiled with gfortran -g -O: -# LIB = $(METIS) -lm -llapack_plain -lblas_plain -lg2c -# LIB = $(METIS) -lm -llapack_plain -lblas_plain -lgfortran -lgfortranbegin -# LIB = $(METIS) -lm -llapack -lblas -lgfortran -lgfortranbegin +# LDLIBS = $(METIS) -lm -llapack_plain -lblas_plain -lg2c +# LDLIBS = $(METIS) -lm -llapack_plain -lblas_plain -lgfortran -lgfortranbegin +# LDLIBS = $(METIS) -lm -llapack -lblas -lgfortran -lgfortranbegin # Linux: -# LIB = $(METIS) -lm -llapack_plain -lblas_plain -lgfortran -lgfortranbegin -lpthread -lrt +# LDLIBS = $(METIS) -lm -llapack_plain -lblas_plain -lgfortran -lgfortranbegin -lpthread -lrt # Mac: -# LIB = $(METIS) -lm -llapack -lblas -lgfortran -lgfortranbegin -lpthread +# LDLIBS = $(METIS) -lm -llapack -lblas -lgfortran -lgfortranbegin -lpthread # Solaris -# LIB = $(METIS) -xlic_lib=sunperf +# LDLIBS = $(METIS) -xlic_lib=sunperf #------------------------------------------------------------------------------- # With the CUDA BLAS: ifneq ($(GPU_CONFIG),) -LIB += $(CUDART_LIB) $(CUBLAS_LIB) +LDLIBS += $(CUDART_LIB) $(CUBLAS_LIB) endif #------------------------------------------------------------------------------- I = -I../../AMD/Include -I../../COLAMD/Include \ - -I$(METIS_PATH)/Lib -I../../CCOLAMD/Include -I../../CAMD/Include \ - -I../Include -I../../SuiteSparse_config + -I../../metis-5.1.0/include -I../../CCOLAMD/Include \ + -I../../CAMD/Include \ + -I../Include -I../../SuiteSparse_config $(CUDA_INC) I += $(GPU_CONFIG) @@ -318,229 +322,224 @@ IALL = $(IOBJ) $(AMDOBJ) $(COLAMDOBJ) $(CCOLAMDOBJ) $(CAMDOBJ) $(CONFIG) LALL = $(LOBJ) $(LAMDOBJ) $(LCOLAMDOBJ) $(LCCOLAMDOBJ) $(LCAMDOBJ) $(CONFIG) -cm: $(METIS) $(IALL) $(TEST) cm.h Makefile - $(C) $(I) $(TEST) -o cm $(IALL) $(LIB) +cm: metis $(IALL) $(TEST) cm.h Makefile + $(C) $(I) $(TEST) -o cm $(IALL) $(LDLIBS) -cl: $(METIS) $(LALL) $(TEST) cm.h Makefile - $(C) -DDLONG $(I) $(TEST) -o cl $(LALL) $(LIB) +cl: metis $(LALL) $(TEST) cm.h Makefile + $(C) -DDLONG $(I) $(TEST) -o cl $(LALL) $(LDLIBS) -cmread: $(METIS) $(IALL) cmread.c Makefile - $(C) $(I) cmread.c -o cmread $(IALL) $(LIB) +cmread: metis $(IALL) cmread.c Makefile + $(C) $(I) cmread.c -o cmread $(IALL) $(LDLIBS) -clread: $(METIS) $(LALL) cmread.c Makefile - $(C) -DDLONG $(I) cmread.c -o clread $(LALL) $(LIB) +clread: metis $(LALL) cmread.c Makefile + $(C) -DDLONG $(I) cmread.c -o clread $(LALL) $(LDLIBS) -zdemo: $(METIS) $(IALL) ../Demo/cholmod_demo.c cm.h Makefile \ +zdemo: metis $(IALL) ../Demo/cholmod_demo.c cm.h Makefile \ ../Demo/cholmod_demo.h cat ../Demo/cholmod_demo.c > zdemo.c - $(C) $(I) -I../Demo zdemo.c -o zdemo $(IALL) $(LIB) + $(C) $(I) -I../Demo zdemo.c -o zdemo $(IALL) $(LDLIBS) -ldemo: $(METIS) $(LALL) ../Demo/cholmod_l_demo.c cm.h Makefile \ +ldemo: metis $(LALL) ../Demo/cholmod_l_demo.c cm.h Makefile \ ../Demo/cholmod_demo.h cat ../Demo/cholmod_l_demo.c > ldemo.c - $(C) -DDLONG $(I) -I../Demo ldemo.c -o ldemo $(LALL) $(LIB) + $(C) -DDLONG $(I) -I../Demo ldemo.c -o ldemo $(LALL) $(LDLIBS) go: zdemo ldemo cmread clread cm cl - $(V) ./cl < Matrix/galenet > tmp/l_galenet.out - $(V) ./cl -m < Matrix/z5lo > tmp/l_z5lo.out - $(V) ./zdemo ../Demo/Matrix/bcsstk01.tri > tmp/demo_k1.out - $(V) ./zdemo ../Demo/Matrix/bcsstk02.tri > tmp/demo_k2.out - $(V) ./zdemo < ../Demo/Matrix/lp_afiro.tri > tmp/demo_afiro.out - $(V) ./zdemo < ../Demo/Matrix/can___24.mtx > tmp/demo_can24.out - $(V) ./zdemo < ../Demo/Matrix/c.tri > tmp/demo_c.out - $(V) ./zdemo < ../Demo/Matrix/d.tri > tmp/demo_d.out - $(V) ./zdemo < ../Demo/Matrix/up.tri > tmp/demo_up.out - $(V) ./zdemo < ../Demo/Matrix/c.mtx > tmp/demo_c_mtx.out - $(V) ./zdemo < ../Demo/Matrix/0.tri > tmp/demo_0.out - $(V) ./zdemo < Matrix/3_2 > tmp/demo_3_2.out - $(V) ./zdemo < Matrix/c5lo > tmp/demo_c5lo.out - $(V) ./zdemo < Matrix/c10 > tmp/demo_c10.out - $(V) ./zdemo no_such_file > tmp/demo_no_such_file.out - $(V) ./zdemo ../Demo/Matrix/mangle1.mtx > tmp/demo_mangle1.out - $(V) ./zdemo ../Demo/Matrix/mangle2.mtx > tmp/demo_mangle2.out - $(V) ./zdemo ../Demo/Matrix/mangle3.mtx > tmp/demo_mangle3.out - $(V) ./zdemo ../Demo/Matrix/mangle4.mtx > tmp/demo_mangle4.out - $(V) ./zdemo ../Demo/Matrix/pts5ldd03.mtx > tmp/demo_pts5ldd03.out - $(V) ./ldemo ../Demo/Matrix/bcsstk01.tri > tmp/ldemo_k1.out - $(V) ./ldemo ../Demo/Matrix/bcsstk02.tri > tmp/ldemo_k2.out - $(V) ./ldemo < ../Demo/Matrix/lp_afiro.tri > tmp/ldemo_afiro.out - $(V) ./ldemo < ../Demo/Matrix/can___24.mtx > tmp/ldemo_can24.out - $(V) ./ldemo < ../Demo/Matrix/c.tri > tmp/ldemo_c.out - $(V) ./ldemo ../Demo/Matrix/c.tri 1 > tmp/ldemo_c_zomplex.out - $(V) ./ldemo < ../Demo/Matrix/d.tri > tmp/ldemo_d.out - $(V) ./ldemo ../Demo/Matrix/d.tri 1 > tmp/ldemo_d.out - $(V) ./ldemo < ../Demo/Matrix/up.tri > tmp/ldemo_up.out - $(V) ./ldemo ../Demo/Matrix/up.tri 1 > tmp/ldemo_up_zomplex.out - $(V) ./ldemo < ../Demo/Matrix/c.mtx > tmp/ldemo_c_mtx.out - $(V) ./ldemo ../Demo/Matrix/c.mtx 1 > tmp/ldemo_c_mtx_zomplex.out - $(V) ./ldemo < ../Demo/Matrix/0.tri > tmp/ldemo_0.out - $(V) ./ldemo < Matrix/3_2 > tmp/ldemo_3_2.out - $(V) ./ldemo < Matrix/c5lo > tmp/ldemo_c5lo.out - $(V) ./ldemo < Matrix/c10 > tmp/ldemo_c10.out - $(V) ./ldemo no_such_file > tmp/ldemo_no_such_file.out - $(V) ./ldemo ../Demo/Matrix/mangle1.mtx > tmp/ldemo_mangle1.out - $(V) ./ldemo ../Demo/Matrix/mangle2.mtx > tmp/ldemo_mangle2.out - $(V) ./ldemo ../Demo/Matrix/mangle3.mtx > tmp/ldemo_mangle3.out - $(V) ./ldemo ../Demo/Matrix/mangle4.mtx > tmp/ldemo_mangle4.out - $(V) ./ldemo ../Demo/Matrix/pts5ldd03.mtx > tmp/ldemo_pts5ldd03.out - - grep resid tmp/demo* - $(V) ./cmread no_such_file > tmp/no_such_file.out - $(V) ./cmread Matrix/crud1 > tmp/crud1.out - $(V) ./cmread Matrix/crud2 > tmp/crud2.out - $(V) ./cmread Matrix/fullcrud.mtx > tmp/fullcrud.out - $(V) ./cmread Matrix/fullcrud1.mtx > tmp/fullcrud1.out - $(V) ./cmread Matrix/fullcrud2.mtx > tmp/fullcrud2.out - $(V) ./cmread Matrix/3by0.mtx > tmp/3by0.out - $(V) ./cmread Matrix/fullrza.mtx > tmp/fullrza.out - $(V) ./cmread Matrix/fullrsa.mtx > tmp/fullrsa.out - $(V) ./cmread Matrix/fullcsa.mtx > tmp/fullcsa.out - $(V) ./cmread Matrix/fullcza.mtx > tmp/fullcza.out - $(V) ./cmread Matrix/fullcha.mtx > tmp/fullcha.out - $(V) ./cmread Matrix/cha.mtx > tmp/cha.out - $(V) ./cmread Matrix/cza.mtx > tmp/cza.out - $(V) ./cmread Matrix/csa.mtx > tmp/csa.out - $(V) ./cmread Matrix/one > tmp/one.out - $(V) ./cmread Matrix/rza.mtx > tmp/rza.out - $(V) ./cmread ../Demo/Matrix/mangle5.tri > tmp/mangle5.out - $(V) ./cmread ../Demo/Matrix/mangle6.tri > tmp/mangle6.out - $(V) ./cmread ../Demo/Matrix/mangle7.tri > tmp/mangle6.out - $(V) ./cmread ../Demo/Matrix/mangle8.tri > tmp/mangle8.out - $(V) ./cmread ../Demo/Matrix/empty.tri > tmp/empty.out - $(V) ./cmread ../Demo/Matrix/one.tri > tmp/one.out - $(V) ./cmread Matrix/plskz362.mtx > tmp/plskz363.out - $(V) ./cmread Matrix/2diag.tri > tmp/2diag.out - $(V) ./cmread Matrix/r5lo > tmp/r5lo.out - $(V) ./cmread Matrix/r5lo2 > tmp/r5lo2.out - - diff tmp/r5lo.out tmp/r5lo2.out - $(V) ./cmread Matrix/cs.mtx > tmp/cs.out - $(V) ./cmread Matrix/2lo.tri > tmp/2lo.out - $(V) ./cmread Matrix/2.tri > tmp/2.out - $(V) ./cmread Matrix/2up.tri > tmp/2up.out - $(V) ./cmread Matrix/huge.tri > tmp/huge.out - $(V) ./cmread Matrix/1e99 > tmp/1e99.out - $(V) ./clread no_such_file > tmp/l_no_such_file.out - $(V) ./clread Matrix/crud1 > tmp/l_crud1.out - $(V) ./clread Matrix/crud2 > tmp/l_crud2.out - $(V) ./clread Matrix/fullcrud.mtx > tmp/l_fullcrud.out - $(V) ./clread Matrix/fullcrud1.mtx > tmp/l_fullcrud1.out - $(V) ./clread Matrix/fullcrud2.mtx > tmp/l_fullcrud2.out - $(V) ./clread Matrix/3by0.mtx > tmp/l_3by0.out - $(V) ./clread Matrix/fullrza.mtx > tmp/l_fullrza.out - $(V) ./clread Matrix/fullrsa.mtx > tmp/l_fullrsa.out - $(V) ./clread Matrix/fullcsa.mtx > tmp/l_fullcsa.out - $(V) ./clread Matrix/fullcza.mtx > tmp/l_fullcza.out - $(V) ./clread Matrix/fullcha.mtx > tmp/l_fullcha.out - $(V) ./clread Matrix/cha.mtx > tmp/l_cha.out - $(V) ./clread Matrix/cza.mtx > tmp/l_cza.out - $(V) ./clread Matrix/csa.mtx > tmp/l_csa.out - $(V) ./clread Matrix/one > tmp/l_one.out - $(V) ./clread Matrix/rza.mtx > tmp/l_rza.out - $(V) ./clread ../Demo/Matrix/mangle5.tri > tmp/l_mangle5.out - $(V) ./clread ../Demo/Matrix/mangle6.tri > tmp/l_mangle6.out - $(V) ./clread ../Demo/Matrix/mangle7.tri > tmp/l_mangle6.out - $(V) ./clread ../Demo/Matrix/mangle8.tri > tmp/l_mangle8.out - $(V) ./clread ../Demo/Matrix/empty.tri > tmp/l_empty.out - $(V) ./clread ../Demo/Matrix/one.tri > tmp/l_one.out - $(V) ./clread Matrix/plskz362.mtx > tmp/l_plskz363.out - $(V) ./clread Matrix/2diag.tri > tmp/l_2diag.out - $(V) ./clread Matrix/r5lo > tmp/l_r5lo.out - $(V) ./clread Matrix/r5lo2 > tmp/l_r5lo2.out - - diff tmp/r5lo.out tmp/r5lo2.out - $(V) ./clread Matrix/cs.mtx > tmp/l_cs.out - $(V) ./clread Matrix/2lo.tri > tmp/l_l_2lo.out - $(V) ./clread Matrix/2.tri > tmp/l_2.out - $(V) ./clread Matrix/2up.tri > tmp/l_2up.out - $(V) ./clread Matrix/huge.tri > tmp/l_huge.out - $(V) ./clread Matrix/1e99 > tmp/l_1e99.out - $(V) ./cm < Matrix/galenet > tmp/galenet.out + mkdir -p $(T) + $(V) ./cl < Matrix/galenet > $(T)/l_galenet.out + $(V) ./cl -m < Matrix/z5lo > $(T)/l_z5lo.out + $(V) ./zdemo ../Demo/Matrix/bcsstk01.tri > $(T)/demo_k1.out + $(V) ./zdemo ../Demo/Matrix/bcsstk02.tri > $(T)/demo_k2.out + $(V) ./zdemo < ../Demo/Matrix/lp_afiro.tri > $(T)/demo_afiro.out + $(V) ./zdemo < ../Demo/Matrix/can___24.mtx > $(T)/demo_can24.out + $(V) ./zdemo < ../Demo/Matrix/c.tri > $(T)/demo_c.out + $(V) ./zdemo < ../Demo/Matrix/d.tri > $(T)/demo_d.out + $(V) ./zdemo < ../Demo/Matrix/up.tri > $(T)/demo_up.out + $(V) ./zdemo < ../Demo/Matrix/c.mtx > $(T)/demo_c_mtx.out + $(V) ./zdemo < ../Demo/Matrix/0.tri > $(T)/demo_0.out + $(V) ./zdemo < Matrix/3_2 > $(T)/demo_3_2.out + $(V) ./zdemo < Matrix/c5lo > $(T)/demo_c5lo.out + $(V) ./zdemo < Matrix/c10 > $(T)/demo_c10.out + $(V) ./zdemo no_such_file > $(T)/demo_no_such_file.out + $(V) ./zdemo ../Demo/Matrix/mangle1.mtx > $(T)/demo_mangle1.out + $(V) ./zdemo ../Demo/Matrix/mangle2.mtx > $(T)/demo_mangle2.out + $(V) ./zdemo ../Demo/Matrix/mangle3.mtx > $(T)/demo_mangle3.out + $(V) ./zdemo ../Demo/Matrix/mangle4.mtx > $(T)/demo_mangle4.out + $(V) ./zdemo ../Demo/Matrix/pts5ldd03.mtx > $(T)/demo_pts5ldd03.out + $(V) ./ldemo ../Demo/Matrix/bcsstk01.tri > $(T)/ldemo_k1.out + $(V) ./ldemo ../Demo/Matrix/bcsstk02.tri > $(T)/ldemo_k2.out + $(V) ./ldemo < ../Demo/Matrix/lp_afiro.tri > $(T)/ldemo_afiro.out + $(V) ./ldemo < ../Demo/Matrix/can___24.mtx > $(T)/ldemo_can24.out + $(V) ./ldemo < ../Demo/Matrix/c.tri > $(T)/ldemo_c.out + $(V) ./ldemo ../Demo/Matrix/c.tri 1 > $(T)/ldemo_c_zomplex.out + $(V) ./ldemo < ../Demo/Matrix/d.tri > $(T)/ldemo_d.out + $(V) ./ldemo ../Demo/Matrix/d.tri 1 > $(T)/ldemo_d.out + $(V) ./ldemo < ../Demo/Matrix/up.tri > $(T)/ldemo_up.out + $(V) ./ldemo ../Demo/Matrix/up.tri 1 > $(T)/ldemo_up_zomplex.out + $(V) ./ldemo < ../Demo/Matrix/c.mtx > $(T)/ldemo_c_mtx.out + $(V) ./ldemo ../Demo/Matrix/c.mtx 1 > $(T)/ldemo_c_mtx_zomplex.out + $(V) ./ldemo < ../Demo/Matrix/0.tri > $(T)/ldemo_0.out + $(V) ./ldemo < Matrix/3_2 > $(T)/ldemo_3_2.out + $(V) ./ldemo < Matrix/c5lo > $(T)/ldemo_c5lo.out + $(V) ./ldemo < Matrix/c10 > $(T)/ldemo_c10.out + $(V) ./ldemo no_such_file > $(T)/ldemo_no_such_file.out + $(V) ./ldemo ../Demo/Matrix/mangle1.mtx > $(T)/ldemo_mangle1.out + $(V) ./ldemo ../Demo/Matrix/mangle2.mtx > $(T)/ldemo_mangle2.out + $(V) ./ldemo ../Demo/Matrix/mangle3.mtx > $(T)/ldemo_mangle3.out + $(V) ./ldemo ../Demo/Matrix/mangle4.mtx > $(T)/ldemo_mangle4.out + $(V) ./ldemo ../Demo/Matrix/pts5ldd03.mtx > $(T)/ldemo_pts5ldd03.out + - grep resid $(T)/demo* + $(V) ./cmread no_such_file > $(T)/no_such_file.out + $(V) ./cmread Matrix/crud1 > $(T)/crud1.out + $(V) ./cmread Matrix/crud2 > $(T)/crud2.out + $(V) ./cmread Matrix/fullcrud.mtx > $(T)/fullcrud.out + $(V) ./cmread Matrix/fullcrud1.mtx > $(T)/fullcrud1.out + $(V) ./cmread Matrix/fullcrud2.mtx > $(T)/fullcrud2.out + $(V) ./cmread Matrix/3by0.mtx > $(T)/3by0.out + $(V) ./cmread Matrix/fullrza.mtx > $(T)/fullrza.out + $(V) ./cmread Matrix/fullrsa.mtx > $(T)/fullrsa.out + $(V) ./cmread Matrix/fullcsa.mtx > $(T)/fullcsa.out + $(V) ./cmread Matrix/fullcza.mtx > $(T)/fullcza.out + $(V) ./cmread Matrix/fullcha.mtx > $(T)/fullcha.out + $(V) ./cmread Matrix/cha.mtx > $(T)/cha.out + $(V) ./cmread Matrix/cza.mtx > $(T)/cza.out + $(V) ./cmread Matrix/csa.mtx > $(T)/csa.out + $(V) ./cmread Matrix/one > $(T)/one.out + $(V) ./cmread Matrix/rza.mtx > $(T)/rza.out + $(V) ./cmread ../Demo/Matrix/mangle5.tri > $(T)/mangle5.out + $(V) ./cmread ../Demo/Matrix/mangle6.tri > $(T)/mangle6.out + $(V) ./cmread ../Demo/Matrix/mangle7.tri > $(T)/mangle6.out + $(V) ./cmread ../Demo/Matrix/mangle8.tri > $(T)/mangle8.out + $(V) ./cmread ../Demo/Matrix/empty.tri > $(T)/empty.out + $(V) ./cmread ../Demo/Matrix/one.tri > $(T)/one.out + $(V) ./cmread Matrix/plskz362.mtx > $(T)/plskz363.out + $(V) ./cmread Matrix/2diag.tri > $(T)/2diag.out + $(V) ./cmread Matrix/r5lo > $(T)/r5lo.out + $(V) ./cmread Matrix/r5lo2 > $(T)/r5lo2.out + - diff $(T)/r5lo.out $(T)/r5lo2.out + $(V) ./cmread Matrix/cs.mtx > $(T)/cs.out + $(V) ./cmread Matrix/2lo.tri > $(T)/2lo.out + $(V) ./cmread Matrix/2.tri > $(T)/2.out + $(V) ./cmread Matrix/2up.tri > $(T)/2up.out + $(V) ./cmread Matrix/huge.tri > $(T)/huge.out + $(V) ./cmread Matrix/1e99 > $(T)/1e99.out + $(V) ./clread no_such_file > $(T)/l_no_such_file.out + $(V) ./clread Matrix/crud1 > $(T)/l_crud1.out + $(V) ./clread Matrix/crud2 > $(T)/l_crud2.out + $(V) ./clread Matrix/fullcrud.mtx > $(T)/l_fullcrud.out + $(V) ./clread Matrix/fullcrud1.mtx > $(T)/l_fullcrud1.out + $(V) ./clread Matrix/fullcrud2.mtx > $(T)/l_fullcrud2.out + $(V) ./clread Matrix/3by0.mtx > $(T)/l_3by0.out + $(V) ./clread Matrix/fullrza.mtx > $(T)/l_fullrza.out + $(V) ./clread Matrix/fullrsa.mtx > $(T)/l_fullrsa.out + $(V) ./clread Matrix/fullcsa.mtx > $(T)/l_fullcsa.out + $(V) ./clread Matrix/fullcza.mtx > $(T)/l_fullcza.out + $(V) ./clread Matrix/fullcha.mtx > $(T)/l_fullcha.out + $(V) ./clread Matrix/cha.mtx > $(T)/l_cha.out + $(V) ./clread Matrix/cza.mtx > $(T)/l_cza.out + $(V) ./clread Matrix/csa.mtx > $(T)/l_csa.out + $(V) ./clread Matrix/one > $(T)/l_one.out + $(V) ./clread Matrix/rza.mtx > $(T)/l_rza.out + $(V) ./clread ../Demo/Matrix/mangle5.tri > $(T)/l_mangle5.out + $(V) ./clread ../Demo/Matrix/mangle6.tri > $(T)/l_mangle6.out + $(V) ./clread ../Demo/Matrix/mangle7.tri > $(T)/l_mangle6.out + $(V) ./clread ../Demo/Matrix/mangle8.tri > $(T)/l_mangle8.out + $(V) ./clread ../Demo/Matrix/empty.tri > $(T)/l_empty.out + $(V) ./clread ../Demo/Matrix/one.tri > $(T)/l_one.out + $(V) ./clread Matrix/plskz362.mtx > $(T)/l_plskz363.out + $(V) ./clread Matrix/2diag.tri > $(T)/l_2diag.out + $(V) ./clread Matrix/r5lo > $(T)/l_r5lo.out + $(V) ./clread Matrix/r5lo2 > $(T)/l_r5lo2.out + - diff $(T)/r5lo.out $(T)/r5lo2.out + $(V) ./clread Matrix/cs.mtx > $(T)/l_cs.out + $(V) ./clread Matrix/2lo.tri > $(T)/l_l_2lo.out + $(V) ./clread Matrix/2.tri > $(T)/l_2.out + $(V) ./clread Matrix/2up.tri > $(T)/l_2up.out + $(V) ./clread Matrix/huge.tri > $(T)/l_huge.out + $(V) ./clread Matrix/1e99 > $(T)/l_1e99.out + $(V) ./cm < Matrix/galenet > $(T)/galenet.out - $(COVER) - $(V) ./cm < Matrix/5by50 > tmp/5by50.out - $(V) ./cl < Matrix/5by50 > tmp/l_5by50.out + $(V) ./cm < Matrix/5by50 > $(T)/5by50.out + $(V) ./cl < Matrix/5by50 > $(T)/l_5by50.out - $(COVER) - $(V) ./cm < Matrix/r5lo > tmp/r5lo.out - $(V) ./cl < Matrix/r5lo > tmp/l_r5lo.out - $(V) ./cm < Matrix/r5up > tmp/r5up.out - $(V) ./cl < Matrix/r5up > tmp/l_r5up.out - $(V) ./cm < Matrix/r5up2 > tmp/r5up2.out - $(V) ./cl < Matrix/r5up2 > tmp/l_r5up2.out - $(V) ./cm < Matrix/c5up2 > tmp/c5up2.out - $(V) ./cl < Matrix/c5up2 > tmp/l_c5up2.out - $(V) ./cm < Matrix/z5up2 > tmp/z5up2.out - $(V) ./cl < Matrix/z5up2 > tmp/l_z5up2.out - $(V) ./cm -m < Matrix/z5lo > tmp/z5lo.out - $(V) ./cm < Matrix/ibm32 > tmp/ibm.out - $(V) ./cl < Matrix/ibm32 > tmp/l_ibm.out + $(V) ./cm < Matrix/r5lo > $(T)/r5lo.out + $(V) ./cl < Matrix/r5lo > $(T)/l_r5lo.out + $(V) ./cm < Matrix/r5up > $(T)/r5up.out + $(V) ./cl < Matrix/r5up > $(T)/l_r5up.out + $(V) ./cm < Matrix/r5up2 > $(T)/r5up2.out + $(V) ./cl < Matrix/r5up2 > $(T)/l_r5up2.out + $(V) ./cm < Matrix/c5up2 > $(T)/c5up2.out + $(V) ./cl < Matrix/c5up2 > $(T)/l_c5up2.out + $(V) ./cm < Matrix/z5up2 > $(T)/z5up2.out + $(V) ./cl < Matrix/z5up2 > $(T)/l_z5up2.out + $(V) ./cm -m < Matrix/z5lo > $(T)/z5lo.out + $(V) ./cm < Matrix/ibm32 > $(T)/ibm.out + $(V) ./cl < Matrix/ibm32 > $(T)/l_ibm.out - $(COVER) - $(V) ./cm -m < Matrix/c5lo > tmp/c5lo.out - $(V) ./cl -m < Matrix/c5lo > tmp/l_c5lo.out - $(V) ./cm -m < Matrix/z10 > tmp/z10.out - $(V) ./cl -m < Matrix/z10 > tmp/l_z10.out - $(V) ./cm -m < Matrix/z5up > tmp/z5up.out - $(V) ./cl -m < Matrix/z5up > tmp/l_z5up.out + $(V) ./cm -m < Matrix/c5lo > $(T)/c5lo.out + $(V) ./cl -m < Matrix/c5lo > $(T)/l_c5lo.out + $(V) ./cm -m < Matrix/z10 > $(T)/z10.out + $(V) ./cl -m < Matrix/z10 > $(T)/l_z10.out + $(V) ./cm -m < Matrix/z5up > $(T)/z5up.out + $(V) ./cl -m < Matrix/z5up > $(T)/l_z5up.out - $(COVER) - $(V) ./cm -s < Matrix/3singular > tmp/3singular.out - $(V) ./cl -s < Matrix/3singular > tmp/l_3singular.out - $(V) ./cm -s < Matrix/z3singular > tmp/z3singular.out - $(V) ./cl -s < Matrix/z3singular > tmp/l_z3singular.out - $(V) ./cm -s < Matrix/c3singular > tmp/c3singular.out - $(V) ./cl -s < Matrix/c3singular > tmp/l_c3singular.out - $(V) ./cm -m < Matrix/0 > tmp/0.out - $(V) ./cl -m < Matrix/0 > tmp/l_0.out - $(V) ./cm -m < Matrix/afiro > tmp/afiro.out - $(V) ./cl -m < Matrix/afiro > tmp/l_afiro.out + $(V) ./cm -s < Matrix/3singular > $(T)/3singular.out + $(V) ./cl -s < Matrix/3singular > $(T)/l_3singular.out + $(V) ./cm -s < Matrix/z3singular > $(T)/z3singular.out + $(V) ./cl -s < Matrix/z3singular > $(T)/l_z3singular.out + $(V) ./cm -s < Matrix/c3singular > $(T)/c3singular.out + $(V) ./cl -s < Matrix/c3singular > $(T)/l_c3singular.out + $(V) ./cm -m < Matrix/0 > $(T)/0.out + $(V) ./cl -m < Matrix/0 > $(T)/l_0.out + $(V) ./cm -m < Matrix/afiro > $(T)/afiro.out + $(V) ./cl -m < Matrix/afiro > $(T)/l_afiro.out - $(COVER) - $(V) ./cm -m < Matrix/k01up > tmp/k01up.out - $(V) ./cl -m < Matrix/k01up > tmp/l_k01up.out + $(V) ./cm -m < Matrix/k01up > $(T)/k01up.out + $(V) ./cl -m < Matrix/k01up > $(T)/l_k01up.out - $(COVER) - $(V) ./cm < Matrix/diag > tmp/diag.out - $(V) ./cl < Matrix/diag > tmp/l_diag.out - $(V) ./cm -m < Matrix/ex5lo > tmp/ex5lo.out - $(V) ./cl -m < Matrix/ex5lo > tmp/l_ex5lo.out + $(V) ./cm < Matrix/diag > $(T)/diag.out + $(V) ./cl < Matrix/diag > $(T)/l_diag.out + $(V) ./cm -m < Matrix/ex5lo > $(T)/ex5lo.out + $(V) ./cl -m < Matrix/ex5lo > $(T)/l_ex5lo.out - $(COVER) - $(V) ./cm < Matrix/20lo > tmp/20lo.out - $(V) ./cl < Matrix/20lo > tmp/l_20lo.out - $(V) ./cm < Matrix/z30lo > tmp/z30lo.out - $(V) ./cl < Matrix/z30lo > tmp/l_z30lo.out + $(V) ./cm < Matrix/20lo > $(T)/20lo.out + $(V) ./cl < Matrix/20lo > $(T)/l_20lo.out + $(V) ./cm < Matrix/z30lo > $(T)/z30lo.out + $(V) ./cl < Matrix/z30lo > $(T)/l_z30lo.out - $(COVER) - $(V) ./cm -m < Matrix/z30up > tmp/z30up.out - $(V) ./cl -m < Matrix/z30up > tmp/l_z30up.out - $(V) ./cm < Matrix/c10 > tmp/c10.out - $(V) ./cl < Matrix/c10 > tmp/l_c10.out - $(V) ./cm < Matrix/c30lo > tmp/c30lo.out - $(V) ./cl < Matrix/c30lo > tmp/l_c30lo.out + $(V) ./cm -m < Matrix/z30up > $(T)/z30up.out + $(V) ./cl -m < Matrix/z30up > $(T)/l_z30up.out + $(V) ./cm < Matrix/c10 > $(T)/c10.out + $(V) ./cl < Matrix/c10 > $(T)/l_c10.out + $(V) ./cm < Matrix/c30lo > $(T)/c30lo.out + $(V) ./cl < Matrix/c30lo > $(T)/l_c30lo.out - $(COVER) - $(V) ./cm < Matrix/C9840 > tmp/C9840.out - $(V) ./cl < Matrix/C9840 > tmp/l_C9840.out + $(V) ./cm < Matrix/C9840 > $(T)/C9840.out + $(V) ./cl < Matrix/C9840 > $(T)/l_C9840.out - $(COVER) - $(V) ./cm -m < Matrix/c30up > tmp/c30up.out - $(V) ./cl -m < Matrix/c30up > tmp/l_c30up.out - $(V) ./cm < Matrix/pi > tmp/pi.out - $(V) ./cl < Matrix/pi > tmp/l_pi.out - $(V) ./cm < Matrix/cpi > tmp/cpi.out - $(V) ./cl < Matrix/cpi > tmp/l_cpi.out - $(V) ./cm < Matrix/1_0 > tmp/1_0.out - $(V) ./cl < Matrix/1_0 > tmp/l_1_0.out - $(V) ./cm -s < Matrix/3b > tmp/3b.out - $(V) ./cl -s < Matrix/3b > tmp/l_3b.out - $(V) ./cm -s < Matrix/cza > tmp/cza2.out - $(V) ./cl -s < Matrix/cza > tmp/l_cza2.out - $(V) ./cm < Matrix/0_1 > tmp/0_1.out - $(V) ./cl < Matrix/0_1 > tmp/l_0_1.out + $(V) ./cm -m < Matrix/c30up > $(T)/c30up.out + $(V) ./cl -m < Matrix/c30up > $(T)/l_c30up.out + $(V) ./cm < Matrix/pi > $(T)/pi.out + $(V) ./cl < Matrix/pi > $(T)/l_pi.out + $(V) ./cm < Matrix/cpi > $(T)/cpi.out + $(V) ./cl < Matrix/cpi > $(T)/l_cpi.out + $(V) ./cm < Matrix/1_0 > $(T)/1_0.out + $(V) ./cl < Matrix/1_0 > $(T)/l_1_0.out + $(V) ./cm -s < Matrix/3b > $(T)/3b.out + $(V) ./cl -s < Matrix/3b > $(T)/l_3b.out + $(V) ./cm -s < Matrix/cza > $(T)/cza2.out + $(V) ./cl -s < Matrix/cza > $(T)/l_cza2.out + $(V) ./cm < Matrix/0_1 > $(T)/0_1.out + $(V) ./cl < Matrix/0_1 > $(T)/l_0_1.out - $(COVER) - $(V) ./cm -n < Matrix/galenet > tmp/galenet_nan.out + $(V) ./cm -n < Matrix/galenet > $(T)/galenet_nan.out - $(COVER) - $(V) ./cl -n < Matrix/galenet > tmp/l_galenet_nan.out + $(V) ./cl -n < Matrix/galenet > $(T)/l_galenet_nan.out - $(COVER) - $(V) ./cm < Matrix/zero > tmp/zero.out - $(V) ./cl < Matrix/zero > tmp/zero.out + $(V) ./cm < Matrix/zero > $(T)/zero.out + $(V) ./cl < Matrix/zero > $(T)/zero.out - $(COVER) -# removed: -# $(V) ./cm < Matrix/a1 > tmp/a1.out -# - $(COVER) -# $(V) ./cl < Matrix/a1 > tmp/l_a1.out -# - $(COVER) - cov: - $(COVER) @@ -558,12 +557,12 @@ gpu: ldemo purge: distclean distclean: clean - - $(RM) cm cl cmread clread *.c.gcov *.out tmp/*.out zdemo ldemo + - $(RM) cm cl cmread clread *.c.gcov *.out $(T) zdemo ldemo - $(RM) leak zz_*.c z_*.c *.a l_*.c zl_*.c cov.sort ldemo.c zdemo.c - - $(RM) -r cm.profile cmread.profile zdemo.profile - - $(RM) -r cl.profile clread.profile ldemo.profile *.dSYM - - $(RM) *.gcda *.gcno + - $(RM) -r cm.profile cmread.profile zdemo.profile $(T) + - $(RM) -r cl.profile clread.profile ldemo.profile - $(RM) temp*.mtx timelog.m + - $(RM) -r $(PURGE) clean: - $(RM) -r $(CLEAN) @@ -1257,5 +1256,5 @@ cholmod_gpu_kernels.o: ../GPU/cholmod_gpu_kernels.c \ #------------------------------------------------------------------------------- -$(METIS): - ( cd ../../metis-4.0/Lib && $(MAKE) ) +metis: + ( cd ../.. && $(MAKE) metis ) diff --git a/SuiteSparse/CHOLMOD/Tcov/README.txt b/SuiteSparse/CHOLMOD/Tcov/README.txt index 6b9352e5d..afbc6eeef 100644 --- a/SuiteSparse/CHOLMOD/Tcov/README.txt +++ b/SuiteSparse/CHOLMOD/Tcov/README.txt @@ -3,30 +3,26 @@ http://www.suitesparse.com -------------------------------------------------------------------------------- This test suite is not required to compile and use CHOLMOD. It is thus -not ported to all architectures. Linux is assumed; see the Makefile for -running on Solaris. Use tcov instead of gcov in the "covall" script. Edit -the Makefile and change the definition of CC. You may need to change PRETTY -as well. You will need to edit LIB to reflect the proper LAPACK and BLAS -libraries. +not ported to all architectures. Linux is required. Requires all CHOLMOD modules except the Partition Module, which it can optionally use (and test). Also acts as a statement coverage test for AMD, COLAMD, and CCOLAMD. Type "make" in this directory to compile CHOLMOMD with statement coverage -testing. Then type "make go" to run the tests. +testing, and to run the tests. Type "make go" to rerun the tests. -Note that about 500MB of disk space is required, mostly in the tmp/ -directory. +Note that about 500MB of disk space is required, mostly in the +CHOLMOD_TCOV_TMP directory. Every line of AMD, CAMD, COLAMD, CCOLAMD, and CHOLMOD will be exercised, and their results checked. The line "All tests passed" should be printed for each test on stderr. Some matrices will report NaN as their maximum error; these are the four singular test matrices (Matrix/1_0, Matrix/3singular, Matrix/c3singluar, and Matrix/z3singular). These test -results are expected. Nan's will also appear in tmp/galenet_nan.out and -tmp/l_galenet_nan.out; these are generated intentionally, to test the code's -NaN-handling features. +results are expected. Nan's appear in CHOLMOD_TCOV_TMP/galenet_nan.out +and CHOLMOD_TCOV_TMP/l_galenet_nan.out; these are generated intentionally, +to test the code's NaN-handling features. The source code files are first preprocessed with cc -E, and the resulting file (z_*.c, zz_*.c, l_*.c, or zl_*.c) is then compiled. This is to ensure @@ -36,16 +32,15 @@ real/complex templates are done in CHOLMOD, and compare those files with their source files in ../Modify and ../Cholesky). Note that many, many error messages will appear in the test output itself -(tmp/*.out), because all of CHOLMOD's error handling is checked as well. -These errors are expected. Any unexpected error will cause the test to fail. -The last line of each output file should be "All tests successful". +(CHOLMOD_TCOV_TMP/*.out), because all of CHOLMOD's error handling is +checked as well. These errors are expected. Any unexpected error will cause +the test to fail. The last line of each output file should be "All tests +successful". To remove all but the original source files and output files from this directory, type "make clean". To remove all but the files in the original distribution, type "make distclean". -The output of "make go" is in the "make_go.output" file. - On the Mac (OSX 10.6.1, Snow Leopard), you may see errors like this: cl(32662) malloc: *** mmap(size=121600000000000) failed (error code=12) diff --git a/SuiteSparse/CHOLMOD/Tcov/covall b/SuiteSparse/CHOLMOD/Tcov/covall old mode 100644 new mode 100755 diff --git a/SuiteSparse/CHOLMOD/Tcov/cover b/SuiteSparse/CHOLMOD/Tcov/cover old mode 100644 new mode 100755 diff --git a/SuiteSparse/CHOLMOD/Tcov/covs b/SuiteSparse/CHOLMOD/Tcov/covs old mode 100644 new mode 100755 diff --git a/SuiteSparse/CHOLMOD/Tcov/gcovs b/SuiteSparse/CHOLMOD/Tcov/gcovs old mode 100644 new mode 100755 diff --git a/SuiteSparse/CHOLMOD/Tcov/go b/SuiteSparse/CHOLMOD/Tcov/go old mode 100644 new mode 100755 diff --git a/SuiteSparse/CHOLMOD/Tcov/null2.c b/SuiteSparse/CHOLMOD/Tcov/null2.c index aa485e877..e4d714eed 100644 --- a/SuiteSparse/CHOLMOD/Tcov/null2.c +++ b/SuiteSparse/CHOLMOD/Tcov/null2.c @@ -2778,8 +2778,6 @@ if (do_nantests) } lr = CHOLMOD(metis_bisector)(Abad2, Anw, Aew, Pok, cm) ;NOT (lr >= 0); lr = CHOLMOD(metis_bisector)(NULL, Anw, Aew, Pok, cm) ; NOT (lr >= 0); - lr = CHOLMOD(metis_bisector)(A, NULL, Aew, Pok, cm) ; NOT (lr >= 0); - lr = CHOLMOD(metis_bisector)(A, Anw, NULL, Pok, cm) ; NOT (lr >= 0); lr = CHOLMOD(metis_bisector)(A, Anw, Aew, NULL, cm) ; NOT (lr >= 0); if (A->stype) diff --git a/SuiteSparse/CHOLMOD/Tcov/test_ops.c b/SuiteSparse/CHOLMOD/Tcov/test_ops.c index 5b07edab1..71940680c 100644 --- a/SuiteSparse/CHOLMOD/Tcov/test_ops.c +++ b/SuiteSparse/CHOLMOD/Tcov/test_ops.c @@ -69,6 +69,7 @@ Int check_partition (cholmod_sparse *A, Int *Part) if (A == NULL || Part == NULL || A->nrow != A->ncol) { + /* printf ("A NULL, no Partition, or rectangular\n") ; */ return (EMPTY) ; } n = A->nrow ; @@ -81,18 +82,22 @@ Int check_partition (cholmod_sparse *A, Int *Part) chek [1] = 0 ; chek [2] = 0 ; + /* printf ("\ncheck partition:\n") ; */ for (j = 0 ; j < n ; j++) { which = Part [j] ; + /* printf ("node "ID" in Part "ID"\n", j, which) ; */ p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; + /* printf (" neighbor "ID" in part "ID"\n", i, Part [i]) ; */ if (which == 0) { if (Part [i] == 1) { + /* printf (" broken!\n") ; */ return (EMPTY) ; } } @@ -100,16 +105,22 @@ Int check_partition (cholmod_sparse *A, Int *Part) { if (Part [i] == 0) { + /* printf (" broken!\n") ; */ return (EMPTY) ; } } } if (which < 0 || which > 2) { + /* printf (" node j, invalid partition, broken!\n") ; */ return (EMPTY) ; } chek [which]++ ; } + /* + printf ("nodes in left: "ID" right: "ID" separator: "ID"\n", + chek [0], chek [1], chek [2]) ; + */ return (chek [2]) ; } @@ -836,16 +847,21 @@ double test_ops (cholmod_sparse *A) Int *Cnw, *Cew, *Cmember, *CParent, *Perm ; double save1 ; - /* try CHOLMOD's interface to METIS_NodeComputeSeparator */ + /* try CHOLMOD's interface to METIS_ComputeVertexSeparator */ cm->metis_memory = 2.0 ; + /* cm->print = 5 ; */ CHOLMOD(print_sparse) (A, "A for bisect", cm) ; csep = CHOLMOD(bisect) (A, NULL, 0, TRUE, Partition, cm) ; if (csep != EMPTY) { - OK (csep == check_partition (A, Partition)) ; + Int csep2 ; + /* printf ("csep %g\n", (double) csep) ; */ + csep2 = check_partition (A, Partition) ; + /* printf ("csep2 %g\n", (double) csep2) ; */ + OK (csep == csep2) ; } - /* try the raw interface to METIS_NodeComputeSeparator */ + /* try the raw interface to METIS_ComputeVertexSeparator */ CHOLMOD(print_sparse) (A, "A for metis bisect", cm) ; /* C = A+A', remove the diagonal */ diff --git a/SuiteSparse/COLAMD/Demo/Makefile b/SuiteSparse/COLAMD/Demo/Makefile index a4ddbc082..5a1f9e544 100644 --- a/SuiteSparse/COLAMD/Demo/Makefile +++ b/SuiteSparse/COLAMD/Demo/Makefile @@ -2,15 +2,17 @@ # compile the COLAMD demo #----------------------------------------------------------------------------- -default: colamd_example colamd_l_example +default: all include ../../SuiteSparse_config/SuiteSparse_config.mk -I = -I../Include -I../../SuiteSparse_config +I = -I../../include C = $(CC) $(CF) $(I) -LIB2 = ../../SuiteSparse_config/libsuitesparseconfig.a $(LIB) +LIB2 = $(LDFLAGS) -L../../lib -lcolamd -lsuitesparseconfig $(LDLIBS) + +all: library colamd_example colamd_l_example library: ( cd ../../SuiteSparse_config ; $(MAKE) ) @@ -22,13 +24,13 @@ library: dist: -colamd_example: colamd_example.c library - $(C) -o colamd_example colamd_example.c ../Lib/libcolamd.a $(LIB2) +colamd_example: colamd_example.c + $(C) -o colamd_example colamd_example.c $(LIB2) - ./colamd_example > my_colamd_example.out - diff colamd_example.out my_colamd_example.out -colamd_l_example: colamd_l_example.c library - $(C) -o colamd_l_example colamd_l_example.c ../Lib/libcolamd.a $(LIB2) +colamd_l_example: colamd_l_example.c + $(C) -o colamd_l_example colamd_l_example.c $(LIB2) - ./colamd_l_example > my_colamd_l_example.out - diff colamd_l_example.out my_colamd_l_example.out @@ -37,11 +39,11 @@ colamd_l_example: colamd_l_example.c library #------------------------------------------------------------------------------ clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) purge: distclean distclean: clean - $(RM) colamd_example colamd_l_example - $(RM) my_colamd_example.out my_colamd_l_example.out - - $(RM) -r *.dSYM + - $(RM) -r $(PURGE) diff --git a/SuiteSparse/COLAMD/Demo/colamd_example.out b/SuiteSparse/COLAMD/Demo/colamd_example.out index 305164c32..d2fbc298c 100644 --- a/SuiteSparse/COLAMD/Demo/colamd_example.out +++ b/SuiteSparse/COLAMD/Demo/colamd_example.out @@ -15,7 +15,7 @@ Column 3, with 2 entries: row 1 row 3 -colamd version 2.9, Oct 10, 2014: OK. +colamd version 2.9, Feb 1, 2016: OK. colamd: number of dense or empty rows ignored: 0 colamd: number of dense or empty columns ignored: 0 colamd: number of garbage collections performed: 0 @@ -38,7 +38,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -symamd version 2.9, Oct 10, 2014: OK. +symamd version 2.9, Feb 1, 2016: OK. symamd: number of dense or empty rows ignored: 0 symamd: number of dense or empty columns ignored: 0 symamd: number of garbage collections performed: 0 diff --git a/SuiteSparse/COLAMD/Demo/colamd_l_example.out b/SuiteSparse/COLAMD/Demo/colamd_l_example.out index 2520a5f3d..ce864b199 100644 --- a/SuiteSparse/COLAMD/Demo/colamd_l_example.out +++ b/SuiteSparse/COLAMD/Demo/colamd_l_example.out @@ -15,7 +15,7 @@ Column 3, with 2 entries: row 1 row 3 -colamd version 2.9, Oct 10, 2014: OK. +colamd version 2.9, Feb 1, 2016: OK. colamd: number of dense or empty rows ignored: 0 colamd: number of dense or empty columns ignored: 0 colamd: number of garbage collections performed: 0 @@ -38,7 +38,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -symamd version 2.9, Oct 10, 2014: OK. +symamd version 2.9, Feb 1, 2016: OK. symamd: number of dense or empty rows ignored: 0 symamd: number of dense or empty columns ignored: 0 symamd: number of garbage collections performed: 0 diff --git a/SuiteSparse/COLAMD/Doc/ChangeLog b/SuiteSparse/COLAMD/Doc/ChangeLog index e95f15742..349e6b9cb 100644 --- a/SuiteSparse/COLAMD/Doc/ChangeLog +++ b/SuiteSparse/COLAMD/Doc/ChangeLog @@ -1,3 +1,17 @@ +Feb 1, 2016: version 2.9.4 + + * update to Makefiles + +Jan 30, 2016: version 2.9.3 + + * modifications to Makefiles + +Jan 1, 2016: version 2.9.2 + + * modified Makefile to create shared libraries + No change to C code except version number. + The empty file colamd_global.c removed. + Oct 10, 2014: version 2.9.1 modified MATLAB/colamd_make.m. No change to C code except version number. diff --git a/SuiteSparse/COLAMD/Include/colamd.h b/SuiteSparse/COLAMD/Include/colamd.h index ee4f6448b..2d7b454ba 100644 --- a/SuiteSparse/COLAMD/Include/colamd.h +++ b/SuiteSparse/COLAMD/Include/colamd.h @@ -77,11 +77,11 @@ extern "C" { * Versions 2.3 and earlier of COLAMD do not include a #define'd version number. */ -#define COLAMD_DATE "Oct 10, 2014" +#define COLAMD_DATE "Feb 1, 2016" #define COLAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define COLAMD_MAIN_VERSION 2 #define COLAMD_SUB_VERSION 9 -#define COLAMD_SUBSUB_VERSION 1 +#define COLAMD_SUBSUB_VERSION 4 #define COLAMD_VERSION \ COLAMD_VERSION_CODE(COLAMD_MAIN_VERSION,COLAMD_SUB_VERSION) diff --git a/SuiteSparse/COLAMD/Lib/Makefile b/SuiteSparse/COLAMD/Lib/Makefile index ea497201b..38d5d1566 100644 --- a/SuiteSparse/COLAMD/Lib/Makefile +++ b/SuiteSparse/COLAMD/Lib/Makefile @@ -1,32 +1,71 @@ #------------------------------------------------------------------------------- -# COLAMD Makefile +# COLAMD Lib/Makefile #------------------------------------------------------------------------------- -default: libcolamd.a +LIBRARY = libcolamd +VERSION = 2.9.4 +SO_VERSION = 2 + +default: library include ../../SuiteSparse_config/SuiteSparse_config.mk +# COLAMD depends on SuiteSparse_config +LDLIBS += -lsuitesparseconfig + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + I = -I../Include -I../../SuiteSparse_config INC = ../Include/colamd.h ../../SuiteSparse_config/SuiteSparse_config.h SRC = ../Source/colamd.c -# creates libcolamd.a, a C-callable COLAMD library -libcolamd.a: $(SRC) $(INC) +OBJ = colamd.o colamd_l.o + +colamd.o: $(SRC) $(INC) $(CC) $(CF) $(I) -c ../Source/colamd.c + +colamd_l.o: $(SRC) $(INC) $(CC) $(CF) $(I) -c ../Source/colamd.c -DDLONG -o colamd_l.o - $(ARCHIVE) libcolamd.a colamd.o colamd_l.o - - $(RANLIB) libcolamd.a -ccode: libcolamd.a +# creates libcolamd.a, a C-callable COLAMD library +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ -library: libcolamd.a +ccode: library clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) purge: distclean distclean: clean - - $(RM) libcolamd.a + - $(RM) -r $(PURGE) + +# install COLAMD +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/colamd.h $(INSTALL_INCLUDE) + $(CP) ../README.txt $(INSTALL_DOC)/COLAMD_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/colamd.h + chmod 644 $(INSTALL_DOC)/COLAMD_README.txt + +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/colamd.h + $(RM) $(INSTALL_DOC)/COLAMD_README.txt + diff --git a/SuiteSparse/COLAMD/Makefile b/SuiteSparse/COLAMD/Makefile index d253e5688..cefc4257c 100644 --- a/SuiteSparse/COLAMD/Makefile +++ b/SuiteSparse/COLAMD/Makefile @@ -2,7 +2,8 @@ # COLAMD Makefile #------------------------------------------------------------------------------ -VERSION = 2.9.1 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all @@ -43,14 +44,8 @@ lib: library # install COLAMD install: - $(CP) Lib/libcolamd.a $(INSTALL_LIB)/libcolamd.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libcolamd.$(VERSION).a libcolamd.a ) - $(CP) Include/colamd.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libcolamd*.a - chmod 644 $(INSTALL_INCLUDE)/colamd.h + ( cd Lib ; $(MAKE) install ) # uninstall COLAMD uninstall: - $(RM) $(INSTALL_LIB)/libcolamd*.a - $(RM) $(INSTALL_INCLUDE)/colamd.h - + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/COLAMD/README.txt b/SuiteSparse/COLAMD/README.txt index e22ebd5b1..cb9cc77c8 100644 --- a/SuiteSparse/COLAMD/README.txt +++ b/SuiteSparse/COLAMD/README.txt @@ -1,4 +1,4 @@ -COLAMD, Copyright 1998-2013, Timothy A. Davis. http://www.suitesparse.com +COLAMD, Copyright 1998-2016, Timothy A. Davis. http://www.suitesparse.com ------------------------------------------------------------------------------- The COLAMD column approximate minimum degree ordering algorithm computes @@ -33,8 +33,19 @@ mexFunction. v2.5 adds additional checks for integer overflow, so that the "int" version can be safely used with 64-bit pointers. Refer to the ChangeLog for more details. +Other "make" targets: + + make library compiles a C-callable library containing colamd + make clean removes all files not in the distribution, + but keeps the compiled libraries. + make distclean removes all files not in the distribution + make install installs the library in /usr/local/lib and + /usr/local/include + make uninstall uninstalls the library from /usr/local/lib and + /usr/local/include + To use colamd and symamd within an application written in C, all you need are -colamd.c, colamd_global.c, and colamd.h, which are the C-callable +colamd.c, and colamd.h, which are the C-callable colamd/symamd codes. See colamd.c for more information on how to call colamd from a C program. @@ -115,4 +126,3 @@ COLAMD files: ./Source: colamd.c primary source code - colamd_global.c globally defined function pointers (malloc, free, ...) diff --git a/SuiteSparse/CSparse/Demo/Makefile b/SuiteSparse/CSparse/Demo/Makefile index ee4610135..3f02e020c 100644 --- a/SuiteSparse/CSparse/Demo/Makefile +++ b/SuiteSparse/CSparse/Demo/Makefile @@ -1,7 +1,8 @@ CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O I = -I../Include -CS = ../Lib/libcsparse.a +LDLIBS += -lm +CS = $(LDFLAGS) ../Lib/libcsparse.a $(LDLIBS) all: lib cs_demo1 cs_demo2 cs_demo3 - ./cs_demo1 < ../Matrix/t1 @@ -20,13 +21,13 @@ lib: ( cd ../Lib ; $(MAKE) ) cs_demo1: lib cs_demo1.c Makefile - $(CC) $(CF) $(I) -o cs_demo1 cs_demo1.c $(CS) -lm + $(CC) $(CF) $(I) -o cs_demo1 cs_demo1.c $(CS) cs_demo2: lib cs_demo2.c cs_demo.c cs_demo.h Makefile - $(CC) $(CF) $(I) -o cs_demo2 cs_demo2.c cs_demo.c $(CS) -lm + $(CC) $(CF) $(I) -o cs_demo2 cs_demo2.c cs_demo.c $(CS) cs_demo3: lib cs_demo3.c cs_demo.c cs_demo.h Makefile - $(CC) $(CF) $(I) -o cs_demo3 cs_demo3.c cs_demo.c $(CS) -lm + $(CC) $(CF) $(I) -o cs_demo3 cs_demo3.c cs_demo.c $(CS) clean: - $(RM) *.o diff --git a/SuiteSparse/CSparse/Doc/ChangeLog b/SuiteSparse/CSparse/Doc/ChangeLog index bd56fcccf..e48da6297 100644 --- a/SuiteSparse/CSparse/Doc/ChangeLog +++ b/SuiteSparse/CSparse/Doc/ChangeLog @@ -1,3 +1,18 @@ +Feb 1, 2016: version 3.1.7 + + * update to Makefiles + +Jan 30, 2016: version 3.1.6 + + * correction to Makefiles + * correction to mexFunctions required for MATLAB R2015b, + for sparse empty matrices and NULL mxGetPr + +Jan 1, 2016: version 3.1.5 + + * Makefile now creates both static (*.a) and shared (*.so / *.dylib) + libraries. No change to C code except version number in cs.h. + Oct 10, 2014: version 3.1.4 modified cs_make.m. No change to C code except version number. diff --git a/SuiteSparse/CSparse/Include/cs.h b/SuiteSparse/CSparse/Include/cs.h index acc738a07..3abc86193 100644 --- a/SuiteSparse/CSparse/Include/cs.h +++ b/SuiteSparse/CSparse/Include/cs.h @@ -10,9 +10,9 @@ #endif #define CS_VER 3 /* CSparse Version */ #define CS_SUBVER 1 -#define CS_SUBSUB 4 -#define CS_DATE "Oct 10, 2014" /* CSparse release date */ -#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2014" +#define CS_SUBSUB 7 +#define CS_DATE "Feb 1, 2016" /* CSparse release date */ +#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2016" #ifdef MATLAB_MEX_FILE #undef csi diff --git a/SuiteSparse/CSparse/Lib/Makefile b/SuiteSparse/CSparse/Lib/Makefile index 2a86ef46e..ec57e71e0 100644 --- a/SuiteSparse/CSparse/Lib/Makefile +++ b/SuiteSparse/CSparse/Lib/Makefile @@ -1,9 +1,30 @@ -CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O +# On the Mac, you need to first install Xcode. Then +# type this command in the Terminal: +# xcode-select --install +# to ensure that you have the command-line tools installed. +# +# To just compile the library, do: +# make +# +# To run a demo using the library +# cd ../Demo ; make +# +# For system-wide installation, I recommend that you install CXSparse instead. +# The CSparse library is meant for personal experimentation. The 'make +# install' in this Makefile only installs a static compiled library in +# CSparse/Lib. It does not install it for system-wide usage. + +LIBRARY = libcsparse + +CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O -fPIC I = -I../Include RANLIB = ranlib ARCHIVE = $(AR) $(ARFLAGS) +CP = cp -f -all: libcsparse.a +AR_TARGET = $(LIBRARY).a + +all: install CS = cs_add.o cs_amd.o cs_chol.o cs_cholsol.o cs_counts.o cs_cumsum.o \ cs_droptol.o cs_dropzeros.o cs_dupl.o cs_entry.o \ @@ -20,9 +41,15 @@ $(CS): ../Include/cs.h Makefile %.o: ../Source/%.c ../Include/cs.h $(CC) $(CF) $(I) -c $< -libcsparse.a: $(CS) - $(ARCHIVE) libcsparse.a $(CS) - - $(RANLIB) libcsparse.a +$(AR_TARGET): $(CS) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ + +# install CSparse in this directory +install: $(AR_TARGET) + +# uninstall CSparse +uninstall: purge clean: - $(RM) *.o @@ -30,4 +57,5 @@ clean: purge: distclean distclean: clean - - $(RM) *.a *.obj *.dll + - $(RM) *.a *.obj *.dll *.dylib *.so *.so.* + diff --git a/SuiteSparse/CSparse/MATLAB/CSparse/cs_mex.c b/SuiteSparse/CSparse/MATLAB/CSparse/cs_mex.c index fdb3364b5..c64ccd465 100644 --- a/SuiteSparse/CSparse/MATLAB/CSparse/cs_mex.c +++ b/SuiteSparse/CSparse/MATLAB/CSparse/cs_mex.c @@ -51,6 +51,7 @@ mxArray *cs_mex_put_sparse (cs **Ahandle) { cs *A ; mxArray *Amatlab ; + if (!Ahandle || !CS_CSC ((*Ahandle))) mexErrMsgTxt ("invalid sparse matrix") ; A = *Ahandle ; Amatlab = mxCreateSparse (0, 0, 0, mxREAL) ; mxSetM (Amatlab, A->m) ; @@ -58,9 +59,20 @@ mxArray *cs_mex_put_sparse (cs **Ahandle) mxSetNzmax (Amatlab, A->nzmax) ; cs_free (mxGetJc (Amatlab)) ; cs_free (mxGetIr (Amatlab)) ; - cs_free (mxGetPr (Amatlab)) ; mxSetJc (Amatlab, (mwIndex *) A->p) ; /* assign A->p pointer to MATLAB A */ mxSetIr (Amatlab, (mwIndex *) A->i) ; + cs_free (mxGetPr (Amatlab)) ; + if (A->x == NULL) + { + /* A is a pattern only matrix; return all 1's to MATLAB */ + csi i, nz ; + nz = A->p [A->n] ; + A->x = cs_malloc (CS_MAX (nz,1), sizeof (double)) ; + for (i = 0 ; i < nz ; i++) + { + A->x [i] = 1 ; + } + } mxSetPr (Amatlab, A->x) ; mexMakeMemoryPersistent (A->p) ; /* ensure MATLAB does not free A->p */ mexMakeMemoryPersistent (A->i) ; diff --git a/SuiteSparse/CSparse/Makefile b/SuiteSparse/CSparse/Makefile index dbee1d49a..80c8f0d39 100644 --- a/SuiteSparse/CSparse/Makefile +++ b/SuiteSparse/CSparse/Makefile @@ -2,8 +2,6 @@ # CSparse Makefile #------------------------------------------------------------------------------ -VERSION = 3.1.4 - C: ( cd Lib ; $(MAKE) ) ( cd Demo ; $(MAKE) ) @@ -32,9 +30,9 @@ purge: distclean: purge -# do not install CSparse; use CXSparse instead -install: +install: library + ( cd Lib ; $(MAKE) install ) -# uninstall CSparse: do nothing uninstall: + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/CSparse/README.txt b/SuiteSparse/CSparse/README.txt index 04b29fa68..b27f35b86 100644 --- a/SuiteSparse/CSparse/README.txt +++ b/SuiteSparse/CSparse/README.txt @@ -1,5 +1,5 @@ CSparse: a Concise Sparse Matrix package. -VERSION 3.1.4, Copyright (c) 2006-2014, Timothy A. Davis, Oct 10, 2014 +VERSION 3.1.7, Copyright (c) 2006-2016, Timothy A. Davis. http://www.suitesparse.com Refer to "Direct Methods for Sparse Linear Systems," Timothy A. Davis, diff --git a/SuiteSparse/CSparse/Tcov/covall b/SuiteSparse/CSparse/Tcov/covall old mode 100644 new mode 100755 diff --git a/SuiteSparse/CSparse/Tcov/covall.linux b/SuiteSparse/CSparse/Tcov/covall.linux old mode 100644 new mode 100755 diff --git a/SuiteSparse/CSparse/Tcov/covall.sol b/SuiteSparse/CSparse/Tcov/covall.sol old mode 100644 new mode 100755 diff --git a/SuiteSparse/CSparse/Tcov/cover b/SuiteSparse/CSparse/Tcov/cover old mode 100644 new mode 100755 diff --git a/SuiteSparse/CSparse/Tcov/covs b/SuiteSparse/CSparse/Tcov/covs old mode 100644 new mode 100755 diff --git a/SuiteSparse/CSparse/Tcov/gcovs b/SuiteSparse/CSparse/Tcov/gcovs old mode 100644 new mode 100755 diff --git a/SuiteSparse/CSparse_to_CXSparse b/SuiteSparse/CSparse_to_CXSparse old mode 100644 new mode 100755 diff --git a/SuiteSparse/CXSparse/Demo/Makefile b/SuiteSparse/CXSparse/Demo/Makefile index e7c6d6589..d1b779285 100644 --- a/SuiteSparse/CXSparse/Demo/Makefile +++ b/SuiteSparse/CXSparse/Demo/Makefile @@ -5,18 +5,22 @@ default: all include ../../SuiteSparse_config/SuiteSparse_config.mk -I = -I../Include -I../../SuiteSparse_config +I = -I../../include -CS = ../Lib/libcxsparse.a +CS = $(LDFLAGS) -L../../lib -lcxsparse $(LDLIBS) -all: $(CS) cs_demo1 cs_demo2 cs_demo3 \ +all: library cs_demo1 cs_demo2 cs_demo3 \ cs_di_demo1 cs_di_demo2 cs_di_demo3 \ cs_dl_demo1 cs_dl_demo2 cs_dl_demo3 \ cs_ci_demo1 cs_ci_demo2 cs_ci_demo3 \ cs_cl_demo1 cs_cl_demo2 cs_cl_demo3 \ tests cs_idemo -tests: test_convert test test_di test_dl test_ci test_cl +library: + ( cd ../Lib ; $(MAKE) ) + ( cd ../../SuiteSparse_config ; $(MAKE) ) + +tests: library test_convert test test_di test_dl test_ci test_cl test: cs_demo1 cs_demo2 cs_demo3 - ./cs_demo1 < ../Matrix/t1 @@ -91,75 +95,72 @@ test_convert: cs_idemo cs_ldemo - ./cs_idemo < ../Matrix/t2 - ./cs_ldemo < ../Matrix/t2 -$(CS): - ( cd ../Lib ; $(MAKE) ) +cs_demo1: cs_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_demo1 cs_demo1.c $(CS) -cs_demo1: $(CS) cs_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_demo1 cs_demo1.c $(CS) -lm +cs_demo2: cs_demo2.c cs_demo.c cs_demo.h Makefile + $(CC) $(CF) $(I) -o cs_demo2 cs_demo2.c cs_demo.c $(CS) -cs_demo2: $(CS) cs_demo2.c cs_demo.c cs_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_demo2 cs_demo2.c cs_demo.c $(CS) -lm +cs_demo3: cs_demo3.c cs_demo.c cs_demo.h Makefile + $(CC) $(CF) $(I) -o cs_demo3 cs_demo3.c cs_demo.c $(CS) -cs_demo3: $(CS) cs_demo3.c cs_demo.c cs_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_demo3 cs_demo3.c cs_demo.c $(CS) -lm +cs_di_demo1: cs_di_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_di_demo1 cs_di_demo1.c $(CS) -cs_di_demo1: $(CS) cs_di_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_di_demo1 cs_di_demo1.c $(CS) -lm +cs_di_demo2: cs_di_demo2.c cs_di_demo.c cs_di_demo.h Makefile + $(CC) $(CF) $(I) -o cs_di_demo2 cs_di_demo2.c cs_di_demo.c $(CS) -cs_di_demo2: $(CS) cs_di_demo2.c cs_di_demo.c cs_di_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_di_demo2 cs_di_demo2.c cs_di_demo.c $(CS) -lm +cs_di_demo3: cs_di_demo3.c cs_di_demo.c cs_di_demo.h Makefile + $(CC) $(CF) $(I) -o cs_di_demo3 cs_di_demo3.c cs_di_demo.c $(CS) -cs_di_demo3: $(CS) cs_di_demo3.c cs_di_demo.c cs_di_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_di_demo3 cs_di_demo3.c cs_di_demo.c $(CS) -lm +cs_ci_demo1: cs_ci_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_ci_demo1 cs_ci_demo1.c $(CS) -cs_ci_demo1: $(CS) cs_ci_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_ci_demo1 cs_ci_demo1.c $(CS) -lm +cs_ci_demo2: cs_ci_demo2.c cs_ci_demo.c cs_ci_demo.h Makefile + $(CC) $(CF) $(I) -o cs_ci_demo2 cs_ci_demo2.c cs_ci_demo.c $(CS) -cs_ci_demo2: $(CS) cs_ci_demo2.c cs_ci_demo.c cs_ci_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_ci_demo2 cs_ci_demo2.c cs_ci_demo.c $(CS) -lm +cs_ci_demo3: cs_ci_demo3.c cs_ci_demo.c cs_ci_demo.h Makefile + $(CC) $(CF) $(I) -o cs_ci_demo3 cs_ci_demo3.c cs_ci_demo.c $(CS) -cs_ci_demo3: $(CS) cs_ci_demo3.c cs_ci_demo.c cs_ci_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_ci_demo3 cs_ci_demo3.c cs_ci_demo.c $(CS) -lm +cs_dl_demo1: cs_dl_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_dl_demo1 cs_dl_demo1.c $(CS) -cs_dl_demo1: $(CS) cs_dl_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_dl_demo1 cs_dl_demo1.c $(CS) -lm +cs_dl_demo2: cs_dl_demo2.c cs_dl_demo.c cs_dl_demo.h Makefile + $(CC) $(CF) $(I) -o cs_dl_demo2 cs_dl_demo2.c cs_dl_demo.c $(CS) -cs_dl_demo2: $(CS) cs_dl_demo2.c cs_dl_demo.c cs_dl_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_dl_demo2 cs_dl_demo2.c cs_dl_demo.c $(CS) -lm +cs_dl_demo3: cs_dl_demo3.c cs_dl_demo.c cs_dl_demo.h Makefile + $(CC) $(CF) $(I) -o cs_dl_demo3 cs_dl_demo3.c cs_dl_demo.c $(CS) -cs_dl_demo3: $(CS) cs_dl_demo3.c cs_dl_demo.c cs_dl_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_dl_demo3 cs_dl_demo3.c cs_dl_demo.c $(CS) -lm +cs_cl_demo1: cs_cl_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_cl_demo1 cs_cl_demo1.c $(CS) -cs_cl_demo1: $(CS) cs_cl_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_cl_demo1 cs_cl_demo1.c $(CS) -lm +cs_cl_demo2: cs_cl_demo2.c cs_cl_demo.c cs_cl_demo.h Makefile + $(CC) $(CF) $(I) -o cs_cl_demo2 cs_cl_demo2.c cs_cl_demo.c $(CS) -cs_cl_demo2: $(CS) cs_cl_demo2.c cs_cl_demo.c cs_cl_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_cl_demo2 cs_cl_demo2.c cs_cl_demo.c $(CS) -lm +cs_cl_demo3: cs_cl_demo3.c cs_cl_demo.c cs_cl_demo.h Makefile + $(CC) $(CF) $(I) -o cs_cl_demo3 cs_cl_demo3.c cs_cl_demo.c $(CS) -cs_cl_demo3: $(CS) cs_cl_demo3.c cs_cl_demo.c cs_cl_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_cl_demo3 cs_cl_demo3.c cs_cl_demo.c $(CS) -lm +cs_idemo: cs_idemo.c Makefile + $(CC) $(CF) $(I) -o cs_idemo cs_idemo.c $(CS) -cs_idemo: $(CS) cs_idemo.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_idemo cs_idemo.c $(CS) -lm - -cs_ldemo: $(CS) cs_ldemo.c Makefile $(CS) - $(CC) $(CF) $(I) -DCS_LONG -o cs_ldemo cs_ldemo.c $(CS) -lm +cs_ldemo: cs_ldemo.c Makefile + $(CC) $(CF) $(I) -DCS_LONG -o cs_ldemo cs_ldemo.c $(CS) clean: - - $(RM) *.o + - $(RM) -r $(CLEAN) purge: distclean @@ -169,4 +170,6 @@ distclean: clean - $(RM) cs_dl_demo1 cs_dl_demo2 cs_dl_demo3 - $(RM) cs_ci_demo1 cs_ci_demo2 cs_ci_demo3 - $(RM) cs_cl_demo1 cs_cl_demo2 cs_cl_demo3 - - $(RM) -r cs_idemo cs_ldemo *.dSYM + - $(RM) cs_idemo cs_ldemo + - $(RM) -r $(PURGE) + diff --git a/SuiteSparse/CXSparse/Demo/cs_demo.out b/SuiteSparse/CXSparse/Demo/cs_demo.out index d6d599a18..280dc6b50 100644 --- a/SuiteSparse/CXSparse/Demo/cs_demo.out +++ b/SuiteSparse/CXSparse/Demo/cs_demo.out @@ -1,9 +1,24 @@ +make[1]: Entering directory `/research/davis/sparse/SuiteSparse/CXSparse/Demo' +( cd ../Lib ; make ) +make[2]: Entering directory `/research/davis/sparse/SuiteSparse/CXSparse/Lib' +make install INSTALL=/research/davis/sparse/SuiteSparse +make[3]: Entering directory `/research/davis/sparse/SuiteSparse/CXSparse/Lib' +make[3]: Nothing to be done for `install'. +make[3]: Leaving directory `/research/davis/sparse/SuiteSparse/CXSparse/Lib' +make[2]: Leaving directory `/research/davis/sparse/SuiteSparse/CXSparse/Lib' +( cd ../../SuiteSparse_config ; make ) +make[2]: Entering directory `/research/davis/sparse/SuiteSparse/SuiteSparse_config' +make install INSTALL=/research/davis/sparse/SuiteSparse +make[3]: Entering directory `/research/davis/sparse/SuiteSparse/SuiteSparse_config' +make[3]: Nothing to be done for `install'. +make[3]: Leaving directory `/research/davis/sparse/SuiteSparse/SuiteSparse_config' +make[2]: Leaving directory `/research/davis/sparse/SuiteSparse/SuiteSparse_config' ./cs_idemo < ../Matrix/t2 --- cs_idemo, size of CS_INT: 4 T: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -17,7 +32,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : (1.7, 1) Treal: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -31,7 +46,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : 1.7 Timag: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3.14159 1 0 : 42 @@ -45,7 +60,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : 1 A: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -63,7 +78,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : (0.9, 99) C1 = real(A): -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -81,7 +96,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : 0.9 C2 = imag(A): -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 col 0 : locations 0 to 2 1 : 42 @@ -99,7 +114,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : 99 A1: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : (3.1, 0) @@ -117,7 +132,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : (0.9, 0) A2: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 col 0 : locations 0 to 2 1 : (0, 42) @@ -135,7 +150,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : (0, 99) B = conj(A): -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, -42) @@ -156,7 +171,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 --- cs_ldemo, size of CS_INT: 8 T: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -170,7 +185,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : (1.7, 1) Treal: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -184,7 +199,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : 1.7 Timag: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3.14159 1 0 : 42 @@ -198,7 +213,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 2 1 : 1 A: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -216,7 +231,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : (0.9, 99) C1 = real(A): -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -234,7 +249,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : 0.9 C2 = imag(A): -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 col 0 : locations 0 to 2 1 : 42 @@ -252,7 +267,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : 99 A1: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : (3.1, 0) @@ -270,7 +285,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : (0.9, 0) A2: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 col 0 : locations 0 to 2 1 : (0, 42) @@ -288,7 +303,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : (0, 99) B = conj(A): -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, -42) @@ -306,7 +321,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : (0.9, -99) ./cs_demo1 < ../Matrix/t1 T: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -319,7 +334,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : 4.5 2 1 : 1.7 A: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -336,7 +351,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 3 : 1 1 : 0.9 AT: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 col 0 : locations 0 to 1 0 : 4.5 @@ -353,7 +368,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : 0.4 3 : 1 D: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 col 0 : locations 0 to 3 1 : 13.95 @@ -391,8 +406,8 @@ LU amd(A'*A) time: 0.00 resid: 1.53e-17 zero entries dropped: 71 tiny entries dropped: 10 blocks: 38 singletons: 37 structural rank: 183 -QR natural time: 0.00 resid: 1.42e-27 -QR amd(A'*A) time: 0.00 resid: 3.35e-28 +QR natural time: 0.00 resid: 6.62e-28 +QR amd(A'*A) time: 0.00 resid: 4.62e-28 LU natural time: 0.00 resid: 6.20e-28 LU amd(A+A') time: 0.00 resid: 1.55e-27 LU amd(S'*S) time: 0.00 resid: 6.98e-28 @@ -401,8 +416,8 @@ LU amd(A'*A) time: 0.00 resid: 6.98e-28 --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 5.19e-17 -QR amd(A'*A) time: 0.00 resid: 3.25e-17 +QR natural time: 0.00 resid: 3.33e-17 +QR amd(A'*A) time: 0.00 resid: 5.84e-17 LU natural time: 0.00 resid: 3.89e-17 LU amd(A+A') time: 0.00 resid: 2.27e-17 LU amd(S'*S) time: 0.00 resid: 1.95e-17 @@ -411,8 +426,8 @@ LU amd(A'*A) time: 0.00 resid: 2.60e-17 --- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 blocks: 1 singletons: 0 structural rank: 27 -QR natural time: 0.00 resid: 3.85e-16 -QR amd(A'*A) time: 0.00 resid: 1.50e-16 +QR natural time: 0.00 resid: 2.25e-16 +QR amd(A'*A) time: 0.00 resid: 1.61e-16 ./cs_demo2 < ../Matrix/ash219 --- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 @@ -423,14 +438,14 @@ QR amd(A'*A) time: 0.00 resid: 1.61e-02 --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.04 resid: nan -QR amd(A'*A) time: 0.05 resid: nan +QR natural time: 0.03 resid: nan +QR amd(A'*A) time: 0.03 resid: nan ./cs_demo2 < ../Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 blocks: 1 singletons: 0 structural rank: 48 -QR natural time: 0.00 resid: 3.65e-19 -QR amd(A'*A) time: 0.00 resid: 4.02e-19 +QR natural time: 0.00 resid: 3.15e-19 +QR amd(A'*A) time: 0.00 resid: 2.55e-19 LU natural time: 0.00 resid: 2.17e-19 LU amd(A+A') time: 0.00 resid: 1.87e-19 LU amd(S'*S) time: 0.00 resid: 2.38e-19 @@ -447,36 +462,36 @@ numeric chol time 0.00 solve chol time 0.00 original: resid: 2.55e-19 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 3.52e-18 -rechol: time: 0.00 (incl solve) resid: 2.93e-18 +update: time: 0.00 (incl solve) resid: 9.66e-19 +rechol: time: 0.00 (incl solve) resid: 1.55e-18 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 4.32e-17 +downdate: time: 0.00 (incl solve) resid: 3.74e-17 ./cs_demo2 < ../Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.51 resid: 2.01e-22 -LU amd(A+A') time: 0.26 resid: 1.10e-22 -LU amd(S'*S) time: 0.26 resid: 1.28e-22 -LU amd(A'*A) time: 0.27 resid: 1.78e-22 -Chol amd(A+A') time: 0.08 resid: 1.19e-22 +QR amd(A'*A) time: 0.32 resid: 9.72e-23 +LU amd(A+A') time: 0.21 resid: 1.10e-22 +LU amd(S'*S) time: 0.22 resid: 1.28e-22 +LU amd(A'*A) time: 0.23 resid: 1.78e-22 +Chol amd(A+A') time: 0.07 resid: 1.19e-22 ./cs_demo3 < ../Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 chol then update/downdate amd(A+A') -symbolic chol time 0.01 -numeric chol time 0.08 +symbolic chol time 0.00 +numeric chol time 0.06 solve chol time 0.00 original: resid: 1.19e-22 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 1.71e-23 -rechol: time: 0.07 (incl solve) resid: 1.61e-23 +update: time: 0.00 (incl solve) resid: 1.12e-23 +rechol: time: 0.06 (incl solve) resid: 1.17e-23 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 1.24e-21 +downdate: time: 0.00 (incl solve) resid: 4.09e-22 ./cs_di_demo1 < ../Matrix/t1 T: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -489,7 +504,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : 4.5 2 1 : 1.7 A: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -506,7 +521,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 3 : 1 1 : 0.9 AT: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 col 0 : locations 0 to 1 0 : 4.5 @@ -523,7 +538,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : 0.4 3 : 1 D: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 col 0 : locations 0 to 3 1 : 13.95 @@ -561,8 +576,8 @@ LU amd(A'*A) time: 0.00 resid: 1.53e-17 zero entries dropped: 71 tiny entries dropped: 10 blocks: 38 singletons: 37 structural rank: 183 -QR natural time: 0.00 resid: 1.42e-27 -QR amd(A'*A) time: 0.00 resid: 3.35e-28 +QR natural time: 0.00 resid: 6.62e-28 +QR amd(A'*A) time: 0.00 resid: 4.62e-28 LU natural time: 0.00 resid: 6.20e-28 LU amd(A+A') time: 0.00 resid: 1.55e-27 LU amd(S'*S) time: 0.00 resid: 6.98e-28 @@ -571,8 +586,8 @@ LU amd(A'*A) time: 0.00 resid: 6.98e-28 --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 5.19e-17 -QR amd(A'*A) time: 0.00 resid: 3.25e-17 +QR natural time: 0.00 resid: 3.33e-17 +QR amd(A'*A) time: 0.00 resid: 5.84e-17 LU natural time: 0.00 resid: 3.89e-17 LU amd(A+A') time: 0.00 resid: 2.27e-17 LU amd(S'*S) time: 0.00 resid: 1.95e-17 @@ -581,8 +596,8 @@ LU amd(A'*A) time: 0.00 resid: 2.60e-17 --- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 blocks: 1 singletons: 0 structural rank: 27 -QR natural time: 0.00 resid: 3.85e-16 -QR amd(A'*A) time: 0.00 resid: 1.50e-16 +QR natural time: 0.00 resid: 2.25e-16 +QR amd(A'*A) time: 0.00 resid: 1.61e-16 ./cs_di_demo2 < ../Matrix/ash219 --- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 @@ -593,14 +608,14 @@ QR amd(A'*A) time: 0.00 resid: 1.61e-02 --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.04 resid: nan -QR amd(A'*A) time: 0.05 resid: nan +QR natural time: 0.02 resid: nan +QR amd(A'*A) time: 0.04 resid: nan ./cs_di_demo2 < ../Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 blocks: 1 singletons: 0 structural rank: 48 -QR natural time: 0.00 resid: 3.65e-19 -QR amd(A'*A) time: 0.00 resid: 4.02e-19 +QR natural time: 0.00 resid: 3.15e-19 +QR amd(A'*A) time: 0.00 resid: 2.55e-19 LU natural time: 0.00 resid: 2.17e-19 LU amd(A+A') time: 0.00 resid: 1.87e-19 LU amd(S'*S) time: 0.00 resid: 2.38e-19 @@ -617,36 +632,36 @@ numeric chol time 0.00 solve chol time 0.00 original: resid: 2.55e-19 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 3.52e-18 -rechol: time: 0.00 (incl solve) resid: 2.93e-18 +update: time: 0.00 (incl solve) resid: 9.66e-19 +rechol: time: 0.00 (incl solve) resid: 1.55e-18 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 4.32e-17 +downdate: time: 0.00 (incl solve) resid: 3.74e-17 ./cs_di_demo2 < ../Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.51 resid: 2.01e-22 -LU amd(A+A') time: 0.26 resid: 1.10e-22 -LU amd(S'*S) time: 0.26 resid: 1.28e-22 -LU amd(A'*A) time: 0.28 resid: 1.78e-22 -Chol amd(A+A') time: 0.08 resid: 1.19e-22 +QR amd(A'*A) time: 0.32 resid: 9.72e-23 +LU amd(A+A') time: 0.21 resid: 1.10e-22 +LU amd(S'*S) time: 0.22 resid: 1.28e-22 +LU amd(A'*A) time: 0.23 resid: 1.78e-22 +Chol amd(A+A') time: 0.06 resid: 1.19e-22 ./cs_di_demo3 < ../Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 chol then update/downdate amd(A+A') symbolic chol time 0.01 -numeric chol time 0.08 +numeric chol time 0.05 solve chol time 0.00 original: resid: 1.19e-22 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 1.71e-23 -rechol: time: 0.08 (incl solve) resid: 1.61e-23 +update: time: 0.00 (incl solve) resid: 1.12e-23 +rechol: time: 0.07 (incl solve) resid: 1.17e-23 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 1.24e-21 +downdate: time: 0.00 (incl solve) resid: 4.09e-22 ./cs_dl_demo1 < ../Matrix/t1 T: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -659,7 +674,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : 4.5 2 1 : 1.7 A: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -676,7 +691,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 3 : 1 1 : 0.9 AT: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 col 0 : locations 0 to 1 0 : 4.5 @@ -693,7 +708,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : 0.4 3 : 1 D: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 col 0 : locations 0 to 3 1 : 13.95 @@ -731,18 +746,18 @@ LU amd(A'*A) time: 0.00 resid: 1.53e-17 zero entries dropped: 71 tiny entries dropped: 10 blocks: 38 singletons: 37 structural rank: 183 -QR natural time: 0.00 resid: 1.42e-27 -QR amd(A'*A) time: 0.00 resid: 3.35e-28 +QR natural time: 0.00 resid: 6.62e-28 +QR amd(A'*A) time: 0.00 resid: 4.62e-28 LU natural time: 0.00 resid: 6.20e-28 -LU amd(A+A') time: 0.00 resid: 1.55e-27 +LU amd(A+A') time: 0.01 resid: 1.55e-27 LU amd(S'*S) time: 0.00 resid: 6.98e-28 LU amd(A'*A) time: 0.00 resid: 6.98e-28 ./cs_dl_demo2 < ../Matrix/west0067 --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 5.19e-17 -QR amd(A'*A) time: 0.00 resid: 3.25e-17 +QR natural time: 0.00 resid: 3.33e-17 +QR amd(A'*A) time: 0.00 resid: 5.84e-17 LU natural time: 0.00 resid: 3.89e-17 LU amd(A+A') time: 0.00 resid: 2.27e-17 LU amd(S'*S) time: 0.00 resid: 1.95e-17 @@ -751,8 +766,8 @@ LU amd(A'*A) time: 0.00 resid: 2.60e-17 --- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 blocks: 1 singletons: 0 structural rank: 27 -QR natural time: 0.00 resid: 3.85e-16 -QR amd(A'*A) time: 0.00 resid: 1.50e-16 +QR natural time: 0.00 resid: 2.25e-16 +QR amd(A'*A) time: 0.00 resid: 1.61e-16 ./cs_dl_demo2 < ../Matrix/ash219 --- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 @@ -763,14 +778,14 @@ QR amd(A'*A) time: 0.00 resid: 1.61e-02 --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.04 resid: nan -QR amd(A'*A) time: 0.05 resid: nan +QR natural time: 0.02 resid: nan +QR amd(A'*A) time: 0.04 resid: nan ./cs_dl_demo2 < ../Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 blocks: 1 singletons: 0 structural rank: 48 -QR natural time: 0.00 resid: 3.65e-19 -QR amd(A'*A) time: 0.00 resid: 4.02e-19 +QR natural time: 0.00 resid: 3.15e-19 +QR amd(A'*A) time: 0.00 resid: 2.55e-19 LU natural time: 0.00 resid: 2.17e-19 LU amd(A+A') time: 0.00 resid: 1.87e-19 LU amd(S'*S) time: 0.00 resid: 2.38e-19 @@ -787,36 +802,36 @@ numeric chol time 0.00 solve chol time 0.00 original: resid: 2.55e-19 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 3.52e-18 -rechol: time: 0.00 (incl solve) resid: 2.93e-18 +update: time: 0.00 (incl solve) resid: 9.66e-19 +rechol: time: 0.00 (incl solve) resid: 1.55e-18 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 4.32e-17 +downdate: time: 0.00 (incl solve) resid: 3.74e-17 ./cs_dl_demo2 < ../Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.52 resid: 2.01e-22 -LU amd(A+A') time: 0.27 resid: 1.10e-22 -LU amd(S'*S) time: 0.27 resid: 1.28e-22 -LU amd(A'*A) time: 0.28 resid: 1.78e-22 -Chol amd(A+A') time: 0.09 resid: 1.19e-22 +QR amd(A'*A) time: 0.33 resid: 9.72e-23 +LU amd(A+A') time: 0.20 resid: 1.10e-22 +LU amd(S'*S) time: 0.22 resid: 1.28e-22 +LU amd(A'*A) time: 0.22 resid: 1.78e-22 +Chol amd(A+A') time: 0.07 resid: 1.19e-22 ./cs_dl_demo3 < ../Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 chol then update/downdate amd(A+A') symbolic chol time 0.01 -numeric chol time 0.08 +numeric chol time 0.06 solve chol time 0.00 original: resid: 1.19e-22 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 1.71e-23 -rechol: time: 0.08 (incl solve) resid: 1.61e-23 +update: time: 0.00 (incl solve) resid: 1.12e-23 +rechol: time: 0.06 (incl solve) resid: 1.17e-23 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 1.24e-21 +downdate: time: 0.00 (incl solve) resid: 4.09e-22 ./cs_ci_demo1 < ../Matrix/t2 T: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -829,7 +844,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : (4.5, 6) 2 1 : (1.7, 1) A: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -846,7 +861,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 3 : (1, 7) 1 : (0.9, 99) AT: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 144.296 col 0 : locations 0 to 1 0 : (4.5, -6) @@ -863,7 +878,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : (0.4, -2.71828) 3 : (1, -7) D: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 16 nnz: 16, 1-norm: 25308.3 col 0 : locations 0 to 3 1 : (265.95, 170.4) @@ -889,18 +904,18 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 --- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.06e+02 blocks: 1 singletons: 0 structural rank: 4 -QR natural time: 0.00 resid: 3.42e-17 -QR amd(A'*A) time: 0.00 resid: 2.49e-17 -LU natural time: 0.00 resid: 7.38e-18 -LU amd(A+A') time: 0.00 resid: 5.40e-18 -LU amd(S'*S) time: 0.00 resid: 3.84e-18 -LU amd(A'*A) time: 0.00 resid: 5.40e-18 +QR natural time: 0.00 resid: 2.10e-17 +QR amd(A'*A) time: 0.00 resid: 2.51e-17 +LU natural time: 0.00 resid: 5.25e-18 +LU amd(A+A') time: 0.00 resid: 3.65e-18 +LU amd(S'*S) time: 0.00 resid: 6.90e-18 +LU amd(A'*A) time: 0.00 resid: 3.65e-18 ./cs_ci_demo2 < ../Matrix/t3 --- Matrix: 3-by-4, nnz: 12 (sym: 0: nnz 0), norm: 3.06e+00 blocks: 1 singletons: 0 structural rank: 3 -QR natural time: 0.00 resid: 1.27e-16 -QR amd(A'*A) time: 0.00 resid: 1.27e-16 +QR natural time: 0.00 resid: 7.81e-17 +QR amd(A'*A) time: 0.00 resid: 7.81e-17 ./cs_ci_demo2 < ../Matrix/t4 --- Matrix: 2-by-2, nnz: 3 (sym: 1: nnz 4), norm: 2.83e+00 @@ -917,58 +932,58 @@ Chol amd(A+A') time: 0.00 (failed) --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.17e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 7.47e-17 -QR amd(A'*A) time: 0.00 resid: 7.73e-17 -LU natural time: 0.00 resid: 6.30e-17 -LU amd(A+A') time: 0.00 resid: 5.29e-17 -LU amd(S'*S) time: 0.00 resid: 5.28e-17 -LU amd(A'*A) time: 0.00 resid: 4.33e-17 +QR natural time: 0.00 resid: 7.53e-17 +QR amd(A'*A) time: 0.00 resid: 1.15e-16 +LU natural time: 0.00 resid: 5.44e-17 +LU amd(A+A') time: 0.00 resid: 8.06e-17 +LU amd(S'*S) time: 0.00 resid: 6.73e-17 +LU amd(A'*A) time: 0.00 resid: 3.80e-17 ./cs_ci_demo2 < ../Matrix/c_mbeacxc --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.11 resid: nan -QR amd(A'*A) time: 0.12 resid: nan +QR natural time: 0.06 resid: nan +QR amd(A'*A) time: 0.08 resid: nan ./cs_ci_demo2 < ../Matrix/young1c --- Matrix: 841-by-841, nnz: 4089 (sym: 0: nnz 0), norm: 7.30e+02 blocks: 1 singletons: 0 structural rank: 841 -QR natural time: 0.01 resid: 1.56e-16 -QR amd(A'*A) time: 0.00 resid: 1.08e-16 -LU natural time: 0.00 resid: 1.56e-16 -LU amd(A+A') time: 0.00 resid: 3.55e-16 -LU amd(S'*S) time: 0.00 resid: 2.93e-16 -LU amd(A'*A) time: 0.00 resid: 2.93e-16 +QR natural time: 0.00 resid: 1.71e-16 +QR amd(A'*A) time: 0.00 resid: 1.43e-16 +LU natural time: 0.01 resid: 1.43e-16 +LU amd(A+A') time: 0.00 resid: 3.18e-16 +LU amd(S'*S) time: 0.00 resid: 3.16e-16 +LU amd(A'*A) time: 0.01 resid: 3.16e-16 ./cs_ci_demo2 < ../Matrix/qc324 --- Matrix: 324-by-324, nnz: 26730 (sym: 0: nnz 0), norm: 1.71e+00 blocks: 1 singletons: 0 structural rank: 324 -QR natural time: 0.02 resid: 9.86e-17 -QR amd(A'*A) time: 0.02 resid: 1.14e-16 -LU natural time: 0.01 resid: 4.32e-17 -LU amd(A+A') time: 0.01 resid: 3.99e-17 -LU amd(S'*S) time: 0.01 resid: 4.00e-17 -LU amd(A'*A) time: 0.01 resid: 4.00e-17 +QR natural time: 0.01 resid: 9.24e-17 +QR amd(A'*A) time: 0.02 resid: 8.71e-17 +LU natural time: 0.00 resid: 3.70e-17 +LU amd(A+A') time: 0.01 resid: 5.05e-17 +LU amd(S'*S) time: 0.00 resid: 3.70e-17 +LU amd(A'*A) time: 0.01 resid: 3.70e-17 ./cs_ci_demo2 < ../Matrix/neumann --- Matrix: 1600-by-1600, nnz: 7840 (sym: 0: nnz 0), norm: 1.41e+01 blocks: 1 singletons: 0 structural rank: 1600 -QR amd(A'*A) time: 0.01 resid: 7.66e-16 -LU amd(A+A') time: 0.00 resid: 4.59e-16 -LU amd(S'*S) time: 0.01 resid: 4.56e-16 -LU amd(A'*A) time: 0.01 resid: 4.56e-16 +QR amd(A'*A) time: 0.01 resid: 1.18e-15 +LU amd(A+A') time: 0.00 resid: 3.55e-16 +LU amd(S'*S) time: 0.00 resid: 4.03e-16 +LU amd(A'*A) time: 0.00 resid: 4.03e-16 ./cs_ci_demo2 < ../Matrix/c4 --- Matrix: 4-by-4, nnz: 10 (sym: -1: nnz 16), norm: 7.37e+01 blocks: 1 singletons: 0 structural rank: 4 QR natural time: 0.00 resid: 5.98e-17 QR amd(A'*A) time: 0.00 resid: 5.98e-17 -LU natural time: 0.00 resid: 4.59e-17 -LU amd(A+A') time: 0.00 resid: 4.59e-17 -LU amd(S'*S) time: 0.00 resid: 4.59e-17 -LU amd(A'*A) time: 0.00 resid: 4.59e-17 -Chol natural time: 0.00 resid: 9.17e-17 -Chol amd(A+A') time: 0.00 resid: 9.17e-17 +LU natural time: 0.00 resid: 4.73e-17 +LU amd(A+A') time: 0.00 resid: 4.73e-17 +LU amd(S'*S) time: 0.00 resid: 4.73e-17 +LU amd(A'*A) time: 0.00 resid: 4.73e-17 +Chol natural time: 0.00 resid: 6.88e-17 +Chol amd(A+A') time: 0.00 resid: 6.88e-17 ./cs_ci_demo3 < ../Matrix/c4 --- Matrix: 4-by-4, nnz: 10 (sym: -1: nnz 16), norm: 7.37e+01 @@ -977,22 +992,22 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 9.17e-17 +original: resid: 6.88e-17 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 7.03e-17 -rechol: time: 0.00 (incl solve) resid: 4.83e-17 +update: time: 0.00 (incl solve) resid: 6.49e-17 +rechol: time: 0.00 (incl solve) resid: 6.49e-17 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 9.17e-17 +downdate: time: 0.00 (incl solve) resid: 5.85e-17 ./cs_ci_demo2 < ../Matrix/mhd1280b --- Matrix: 1280-by-1280, nnz: 11963 (sym: -1: nnz 22646), norm: 8.00e+01 tiny entries dropped: 66 blocks: 20 singletons: 14 structural rank: 1280 -QR amd(A'*A) time: 0.00 resid: 5.96e-25 +QR amd(A'*A) time: 0.00 resid: 4.15e-25 LU amd(A+A') time: 0.00 resid: 2.33e-25 -LU amd(S'*S) time: 0.00 resid: 2.45e-25 -LU amd(A'*A) time: 0.00 resid: 2.45e-25 -Chol amd(A+A') time: 0.00 resid: 1.58e-25 +LU amd(S'*S) time: 0.01 resid: 3.96e-25 +LU amd(A'*A) time: 0.00 resid: 3.96e-25 +Chol amd(A+A') time: 0.00 resid: 1.69e-25 ./cs_ci_demo3 < ../Matrix/mhd1280b --- Matrix: 1280-by-1280, nnz: 12029 (sym: -1: nnz 22778), norm: 8.00e+01 @@ -1001,15 +1016,15 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 2.14e-25 +original: resid: 1.69e-25 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 2.14e-25 -rechol: time: 0.00 (incl solve) resid: 2.14e-25 +update: time: 0.00 (incl solve) resid: 1.75e-25 +rechol: time: 0.00 (incl solve) resid: 1.71e-25 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 1.05e-24 +downdate: time: 0.00 (incl solve) resid: 5.85e-25 ./cs_cl_demo1 < ../Matrix/t2 T: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -1022,7 +1037,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : (4.5, 6) 2 1 : (1.7, 1) A: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -1039,7 +1054,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 3 : (1, 7) 1 : (0.9, 99) AT: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 10 nnz: 10, 1-norm: 144.296 col 0 : locations 0 to 1 0 : (4.5, -6) @@ -1056,7 +1071,7 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 1 : (0.4, -2.71828) 3 : (1, -7) D: -CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 +CXSparse Version 3.1.7, Feb 1, 2016. Copyright (c) Timothy A. Davis, 2006-2016 4-by-4, nzmax: 16 nnz: 16, 1-norm: 25308.3 col 0 : locations 0 to 3 1 : (265.95, 170.4) @@ -1082,18 +1097,18 @@ CXSparse Version 3.1.4, Oct 10, 2014. Copyright (c) Timothy A. Davis, 2006-2014 --- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.06e+02 blocks: 1 singletons: 0 structural rank: 4 -QR natural time: 0.00 resid: 3.42e-17 -QR amd(A'*A) time: 0.00 resid: 2.49e-17 -LU natural time: 0.00 resid: 7.38e-18 -LU amd(A+A') time: 0.00 resid: 5.40e-18 -LU amd(S'*S) time: 0.00 resid: 3.84e-18 -LU amd(A'*A) time: 0.00 resid: 5.40e-18 +QR natural time: 0.00 resid: 2.10e-17 +QR amd(A'*A) time: 0.00 resid: 2.51e-17 +LU natural time: 0.00 resid: 5.25e-18 +LU amd(A+A') time: 0.00 resid: 3.65e-18 +LU amd(S'*S) time: 0.00 resid: 6.90e-18 +LU amd(A'*A) time: 0.00 resid: 3.65e-18 ./cs_cl_demo2 < ../Matrix/t3 --- Matrix: 3-by-4, nnz: 12 (sym: 0: nnz 0), norm: 3.06e+00 blocks: 1 singletons: 0 structural rank: 3 -QR natural time: 0.00 resid: 1.27e-16 -QR amd(A'*A) time: 0.00 resid: 1.27e-16 +QR natural time: 0.00 resid: 7.81e-17 +QR amd(A'*A) time: 0.00 resid: 7.81e-17 ./cs_cl_demo2 < ../Matrix/t4 --- Matrix: 2-by-2, nnz: 3 (sym: 1: nnz 4), norm: 2.83e+00 @@ -1110,58 +1125,58 @@ Chol amd(A+A') time: 0.00 (failed) --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.17e+00 blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 7.47e-17 -QR amd(A'*A) time: 0.00 resid: 7.73e-17 -LU natural time: 0.00 resid: 6.30e-17 -LU amd(A+A') time: 0.00 resid: 5.29e-17 -LU amd(S'*S) time: 0.00 resid: 5.28e-17 -LU amd(A'*A) time: 0.00 resid: 4.33e-17 +QR natural time: 0.00 resid: 7.53e-17 +QR amd(A'*A) time: 0.00 resid: 1.15e-16 +LU natural time: 0.00 resid: 5.44e-17 +LU amd(A+A') time: 0.00 resid: 8.06e-17 +LU amd(S'*S) time: 0.00 resid: 6.73e-17 +LU amd(A'*A) time: 0.00 resid: 3.80e-17 ./cs_cl_demo2 < ../Matrix/c_mbeacxc --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.11 resid: nan -QR amd(A'*A) time: 0.12 resid: nan +QR natural time: 0.07 resid: nan +QR amd(A'*A) time: 0.07 resid: nan ./cs_cl_demo2 < ../Matrix/young1c --- Matrix: 841-by-841, nnz: 4089 (sym: 0: nnz 0), norm: 7.30e+02 blocks: 1 singletons: 0 structural rank: 841 -QR natural time: 0.01 resid: 1.56e-16 -QR amd(A'*A) time: 0.00 resid: 1.08e-16 -LU natural time: 0.00 resid: 1.56e-16 -LU amd(A+A') time: 0.00 resid: 3.55e-16 -LU amd(S'*S) time: 0.00 resid: 2.93e-16 -LU amd(A'*A) time: 0.00 resid: 2.93e-16 +QR natural time: 0.00 resid: 1.71e-16 +QR amd(A'*A) time: 0.00 resid: 1.43e-16 +LU natural time: 0.01 resid: 1.43e-16 +LU amd(A+A') time: 0.00 resid: 3.18e-16 +LU amd(S'*S) time: 0.00 resid: 3.16e-16 +LU amd(A'*A) time: 0.01 resid: 3.16e-16 ./cs_cl_demo2 < ../Matrix/qc324 --- Matrix: 324-by-324, nnz: 26730 (sym: 0: nnz 0), norm: 1.71e+00 blocks: 1 singletons: 0 structural rank: 324 -QR natural time: 0.02 resid: 9.86e-17 -QR amd(A'*A) time: 0.02 resid: 1.14e-16 -LU natural time: 0.01 resid: 4.32e-17 -LU amd(A+A') time: 0.01 resid: 3.99e-17 -LU amd(S'*S) time: 0.01 resid: 4.00e-17 -LU amd(A'*A) time: 0.01 resid: 4.00e-17 +QR natural time: 0.01 resid: 9.24e-17 +QR amd(A'*A) time: 0.01 resid: 8.71e-17 +LU natural time: 0.01 resid: 3.70e-17 +LU amd(A+A') time: 0.01 resid: 5.05e-17 +LU amd(S'*S) time: 0.00 resid: 3.70e-17 +LU amd(A'*A) time: 0.01 resid: 3.70e-17 ./cs_cl_demo2 < ../Matrix/neumann --- Matrix: 1600-by-1600, nnz: 7840 (sym: 0: nnz 0), norm: 1.41e+01 blocks: 1 singletons: 0 structural rank: 1600 -QR amd(A'*A) time: 0.01 resid: 7.66e-16 -LU amd(A+A') time: 0.00 resid: 4.59e-16 -LU amd(S'*S) time: 0.01 resid: 4.56e-16 -LU amd(A'*A) time: 0.01 resid: 4.56e-16 +QR amd(A'*A) time: 0.01 resid: 1.18e-15 +LU amd(A+A') time: 0.00 resid: 3.55e-16 +LU amd(S'*S) time: 0.00 resid: 4.03e-16 +LU amd(A'*A) time: 0.01 resid: 4.03e-16 ./cs_cl_demo2 < ../Matrix/c4 --- Matrix: 4-by-4, nnz: 10 (sym: -1: nnz 16), norm: 7.37e+01 blocks: 1 singletons: 0 structural rank: 4 QR natural time: 0.00 resid: 5.98e-17 QR amd(A'*A) time: 0.00 resid: 5.98e-17 -LU natural time: 0.00 resid: 4.59e-17 -LU amd(A+A') time: 0.00 resid: 4.59e-17 -LU amd(S'*S) time: 0.00 resid: 4.59e-17 -LU amd(A'*A) time: 0.00 resid: 4.59e-17 -Chol natural time: 0.00 resid: 9.17e-17 -Chol amd(A+A') time: 0.00 resid: 9.17e-17 +LU natural time: 0.00 resid: 4.73e-17 +LU amd(A+A') time: 0.00 resid: 4.73e-17 +LU amd(S'*S) time: 0.00 resid: 4.73e-17 +LU amd(A'*A) time: 0.00 resid: 4.73e-17 +Chol natural time: 0.00 resid: 6.88e-17 +Chol amd(A+A') time: 0.00 resid: 6.88e-17 ./cs_cl_demo3 < ../Matrix/c4 --- Matrix: 4-by-4, nnz: 10 (sym: -1: nnz 16), norm: 7.37e+01 @@ -1170,22 +1185,22 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 9.17e-17 +original: resid: 6.88e-17 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 7.03e-17 -rechol: time: 0.00 (incl solve) resid: 4.83e-17 +update: time: 0.00 (incl solve) resid: 6.49e-17 +rechol: time: 0.00 (incl solve) resid: 6.49e-17 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 9.17e-17 +downdate: time: 0.00 (incl solve) resid: 5.85e-17 ./cs_cl_demo2 < ../Matrix/mhd1280b --- Matrix: 1280-by-1280, nnz: 11963 (sym: -1: nnz 22646), norm: 8.00e+01 tiny entries dropped: 66 blocks: 20 singletons: 14 structural rank: 1280 -QR amd(A'*A) time: 0.00 resid: 5.96e-25 +QR amd(A'*A) time: 0.00 resid: 4.15e-25 LU amd(A+A') time: 0.00 resid: 2.33e-25 -LU amd(S'*S) time: 0.00 resid: 2.45e-25 -LU amd(A'*A) time: 0.00 resid: 2.45e-25 -Chol amd(A+A') time: 0.00 resid: 1.58e-25 +LU amd(S'*S) time: 0.01 resid: 3.96e-25 +LU amd(A'*A) time: 0.00 resid: 3.96e-25 +Chol amd(A+A') time: 0.00 resid: 1.69e-25 ./cs_cl_demo3 < ../Matrix/mhd1280b --- Matrix: 1280-by-1280, nnz: 12029 (sym: -1: nnz 22778), norm: 8.00e+01 @@ -1194,9 +1209,10 @@ chol then update/downdate amd(A+A') symbolic chol time 0.00 numeric chol time 0.00 solve chol time 0.00 -original: resid: 2.14e-25 +original: resid: 1.69e-25 update: time: 0.00 -update: time: 0.00 (incl solve) resid: 2.14e-25 -rechol: time: 0.00 (incl solve) resid: 2.14e-25 +update: time: 0.00 (incl solve) resid: 1.75e-25 +rechol: time: 0.00 (incl solve) resid: 1.71e-25 downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 1.05e-24 +downdate: time: 0.00 (incl solve) resid: 5.85e-25 +make[1]: Leaving directory `/research/davis/sparse/SuiteSparse/CXSparse/Demo' diff --git a/SuiteSparse/CXSparse/Doc/ChangeLog b/SuiteSparse/CXSparse/Doc/ChangeLog index bd56fcccf..e48da6297 100644 --- a/SuiteSparse/CXSparse/Doc/ChangeLog +++ b/SuiteSparse/CXSparse/Doc/ChangeLog @@ -1,3 +1,18 @@ +Feb 1, 2016: version 3.1.7 + + * update to Makefiles + +Jan 30, 2016: version 3.1.6 + + * correction to Makefiles + * correction to mexFunctions required for MATLAB R2015b, + for sparse empty matrices and NULL mxGetPr + +Jan 1, 2016: version 3.1.5 + + * Makefile now creates both static (*.a) and shared (*.so / *.dylib) + libraries. No change to C code except version number in cs.h. + Oct 10, 2014: version 3.1.4 modified cs_make.m. No change to C code except version number. diff --git a/SuiteSparse/CXSparse/Include/cs.h b/SuiteSparse/CXSparse/Include/cs.h index ffc6531ec..48b4c8a8d 100644 --- a/SuiteSparse/CXSparse/Include/cs.h +++ b/SuiteSparse/CXSparse/Include/cs.h @@ -1,3 +1,23 @@ +/* ========================================================================== */ +/* CXSparse/Include/cs.h file */ +/* ========================================================================== */ + +/* This is the CXSparse/Include/cs.h file. It has the same name (cs.h) as + the CSparse/Include/cs.h file. The 'make install' for SuiteSparse installs + CXSparse, and this file, instead of CSparse. The two packages have the same + cs.h include filename, because CXSparse is a superset of CSparse. Any user + program that uses CSparse can rely on CXSparse instead, with no change to the + user code. The #include "cs.h" line will work for both versions, in user + code, and the function names and user-visible typedefs from CSparse all + appear in CXSparse. For experimenting and changing the package itself, I + recommend using CSparse since it's simpler and easier to modify. For + using the package in production codes, I recommend CXSparse since it has + more features (support for complex matrices, and both int and long + versions). + */ + +/* ========================================================================== */ + #ifndef _CXS_H #define _CXS_H #include @@ -24,9 +44,9 @@ extern "C" { #define CS_VER 3 /* CXSparse Version */ #define CS_SUBVER 1 -#define CS_SUBSUB 4 -#define CS_DATE "Oct 10, 2014" /* CXSparse release date */ -#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2014" +#define CS_SUBSUB 7 +#define CS_DATE "Feb 1, 2016" /* CXSparse release date */ +#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2016" #define CXSPARSE #include "SuiteSparse_config.h" diff --git a/SuiteSparse/CXSparse/Lib/Makefile b/SuiteSparse/CXSparse/Lib/Makefile index 3c10cf2a1..5a3e4f5eb 100644 --- a/SuiteSparse/CXSparse/Lib/Makefile +++ b/SuiteSparse/CXSparse/Lib/Makefile @@ -1,13 +1,25 @@ -# CC = cc -# CF = -O +#------------------------------------------------------------------------------- +# CXSparse Lib/Makefile +#------------------------------------------------------------------------------- -default: all +LIBRARY = libcxsparse +VERSION = 3.1.7 +SO_VERSION = 3 + +default: library include ../../SuiteSparse_config/SuiteSparse_config.mk +# CXSparse depends on SuiteSparse_config +LDLIBS += -lsuitesparseconfig + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + I = -I../../SuiteSparse_config -I../Include -all: libcxsparse.a +all: library CS_SOURCE = cs_add.c cs_amd.c cs_chol.c cs_cholsol.c cs_counts.c cs_cumsum.c \ cs_droptol.c cs_dropzeros.c cs_dupl.c cs_entry.c \ @@ -86,14 +98,39 @@ cs_convert.o: ../Source/cs_convert.c %_cl.o : ../Source/%.c $(CC) $(CF) $(I) -DCS_LONG -DCS_COMPLEX -c $< -o $@ -libcxsparse.a: $(CS) - $(ARCHIVE) libcxsparse.a $(CS) - - $(RANLIB) libcxsparse.a +$(AR_TARGET): $(CS) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ clean: - - $(RM) *.o + - $(RM) -r $(CLEAN) purge: distclean distclean: clean - - $(RM) *.a + - $(RM) -r $(PURGE) + +# install CXSparse +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(CS) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/cs.h $(INSTALL_INCLUDE) + $(CP) ../README.txt $(INSTALL_DOC)/CXSPARSE_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/cs.h + chmod 644 $(INSTALL_DOC)/CXSPARSE_README.txt + +# uninstall CXSparse +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/cs.h + $(RM) $(INSTALL_DOC)/CXSPARSE_README.txt + diff --git a/SuiteSparse/CXSparse/MATLAB/CSparse/cs_mex.c b/SuiteSparse/CXSparse/MATLAB/CSparse/cs_mex.c index 9090c20cd..a37730b47 100644 --- a/SuiteSparse/CXSparse/MATLAB/CSparse/cs_mex.c +++ b/SuiteSparse/CXSparse/MATLAB/CSparse/cs_mex.c @@ -52,8 +52,8 @@ mxArray *cs_dl_mex_put_sparse (cs_dl **Ahandle) { cs_dl *A ; mxArray *Amatlab ; + if (!Ahandle || !CS_CSC ((*Ahandle))) mexErrMsgTxt ("invalid sparse matrix") ; A = *Ahandle ; - if (!A) mexErrMsgTxt ("failed") ; Amatlab = mxCreateSparse (0, 0, 0, mxREAL) ; mxSetM (Amatlab, A->m) ; mxSetN (Amatlab, A->n) ; @@ -63,6 +63,17 @@ mxArray *cs_dl_mex_put_sparse (cs_dl **Ahandle) cs_free (mxGetPr (Amatlab)) ; mxSetJc (Amatlab, (void *) (A->p)) ; /* assign A->p pointer to MATLAB A */ mxSetIr (Amatlab, (void *) (A->i)) ; + if (A->x == NULL) + { + /* A is a pattern only matrix; return all 1's to MATLAB */ + CS_INT i, nz ; + nz = A->p [A->n] ; + A->x = cs_dl_malloc (CS_MAX (nz,1), sizeof (double)) ; + for (i = 0 ; i < nz ; i++) + { + A->x [i] = 1 ; + } + } mxSetPr (Amatlab, A->x) ; cs_free (A) ; /* frees A struct only, not A->p, etc */ *Ahandle = NULL ; @@ -161,9 +172,9 @@ mxArray *cs_cl_mex_put_sparse (cs_cl **Ahandle) double *x, *z ; mxArray *Amatlab ; CS_INT k ; - + if (!Ahandle || !CS_CSC ((*Ahandle))) mexErrMsgTxt ("invalid sparse matrix") ; A = *Ahandle ; - if (!A) mexErrMsgTxt ("failed") ; + if (A->x == NULL) mexErrMsgTxt ("invalid complex sparse matrix") ; Amatlab = mxCreateSparse (0, 0, 0, mxCOMPLEX) ; mxSetM (Amatlab, A->m) ; mxSetN (Amatlab, A->n) ; @@ -182,7 +193,7 @@ mxArray *cs_cl_mex_put_sparse (cs_cl **Ahandle) z [k] = cimag (A->x [k]) ; } cs_cl_free (A->x) ; /* free copy of complex values */ - mxSetPr (Amatlab, x) ; + mxSetPr (Amatlab, x) ; /* x and z will not be NULL, even if nz==0 */ mxSetPi (Amatlab, z) ; cs_cl_free (A) ; /* frees A struct only, not A->p, etc */ *Ahandle = NULL ; diff --git a/SuiteSparse/CXSparse/Makefile b/SuiteSparse/CXSparse/Makefile index d59dea471..dd041afe7 100644 --- a/SuiteSparse/CXSparse/Makefile +++ b/SuiteSparse/CXSparse/Makefile @@ -2,7 +2,8 @@ # CXSparse Makefile #------------------------------------------------------------------------------ -VERSION = 3.1.4 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: C @@ -36,16 +37,10 @@ purge: distclean: purge -# install CSparse +# install CXSparse install: - $(CP) Lib/libcxsparse.a $(INSTALL_LIB)/libcxsparse.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libcxsparse.$(VERSION).a libcxsparse.a ) - $(CP) Include/cs.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libcxsparse*.a - chmod 644 $(INSTALL_INCLUDE)/cs.h + ( cd Lib ; $(MAKE) install ) -# uninstall CSparse +# uninstall CXSparse uninstall: - $(RM) $(INSTALL_LIB)/libcxsparse*.a - $(RM) $(INSTALL_INCLUDE)/cs.h - + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/CXSparse/README.txt b/SuiteSparse/CXSparse/README.txt index f1f55bbe9..6a127dba5 100644 --- a/SuiteSparse/CXSparse/README.txt +++ b/SuiteSparse/CXSparse/README.txt @@ -13,11 +13,8 @@ includes a MATLAB interface, enabling the use of CXSparse functions on both 32-bit and 64-bit platforms. To install for use in MATLAB, simply type "cs_install" in the MATLAB Command -Window, while in the CXSparse/MATLAB directory. (NOTE: Windows users cannot -use the "lcc" command; run "mex -setup" first, and select a different -compiler). If you use the Unix "make" command in that directory instead and -are using a 64-bit platform, then you must edit the CXSparse/MATLAB/Makefile -first. Refer to the instructions in that file. +Window, while in the CXSparse/MATLAB directory. (NOTE: you may need to +run "mex -setup" first). Refer to "Direct Methods for Sparse Linear Systems," Timothy A. Davis, SIAM, Philadelphia, 2006. No detailed user guide is included in this @@ -31,6 +28,9 @@ I recommend that you use a different level of optimization than "cc -O", which was chosen so that the Makefile is portable. See Source/Makefile. +To install into /usr/local/lib and /usr/local/include, do "make install" +and "make uninstall" to uninstall CXSparse. + If your C compiler does not support the ANSI C99 complex type, the #include statement will fail. If this happens, compile the code with the -DNCOMPLEX flag (the MATLAB cs_install will do this for you). diff --git a/SuiteSparse/CXSparse/Tcov/covall b/SuiteSparse/CXSparse/Tcov/covall old mode 100644 new mode 100755 diff --git a/SuiteSparse/CXSparse/Tcov/covall.linux b/SuiteSparse/CXSparse/Tcov/covall.linux old mode 100644 new mode 100755 diff --git a/SuiteSparse/CXSparse/Tcov/covall.sol b/SuiteSparse/CXSparse/Tcov/covall.sol old mode 100644 new mode 100755 diff --git a/SuiteSparse/CXSparse/Tcov/cover b/SuiteSparse/CXSparse/Tcov/cover old mode 100644 new mode 100755 diff --git a/SuiteSparse/CXSparse/Tcov/covs b/SuiteSparse/CXSparse/Tcov/covs old mode 100644 new mode 100755 diff --git a/SuiteSparse/CXSparse/Tcov/gcovs b/SuiteSparse/CXSparse/Tcov/gcovs old mode 100644 new mode 100755 diff --git a/SuiteSparse/CXSparse_newfiles/Demo/Makefile b/SuiteSparse/CXSparse_newfiles/Demo/Makefile index e7c6d6589..d1b779285 100644 --- a/SuiteSparse/CXSparse_newfiles/Demo/Makefile +++ b/SuiteSparse/CXSparse_newfiles/Demo/Makefile @@ -5,18 +5,22 @@ default: all include ../../SuiteSparse_config/SuiteSparse_config.mk -I = -I../Include -I../../SuiteSparse_config +I = -I../../include -CS = ../Lib/libcxsparse.a +CS = $(LDFLAGS) -L../../lib -lcxsparse $(LDLIBS) -all: $(CS) cs_demo1 cs_demo2 cs_demo3 \ +all: library cs_demo1 cs_demo2 cs_demo3 \ cs_di_demo1 cs_di_demo2 cs_di_demo3 \ cs_dl_demo1 cs_dl_demo2 cs_dl_demo3 \ cs_ci_demo1 cs_ci_demo2 cs_ci_demo3 \ cs_cl_demo1 cs_cl_demo2 cs_cl_demo3 \ tests cs_idemo -tests: test_convert test test_di test_dl test_ci test_cl +library: + ( cd ../Lib ; $(MAKE) ) + ( cd ../../SuiteSparse_config ; $(MAKE) ) + +tests: library test_convert test test_di test_dl test_ci test_cl test: cs_demo1 cs_demo2 cs_demo3 - ./cs_demo1 < ../Matrix/t1 @@ -91,75 +95,72 @@ test_convert: cs_idemo cs_ldemo - ./cs_idemo < ../Matrix/t2 - ./cs_ldemo < ../Matrix/t2 -$(CS): - ( cd ../Lib ; $(MAKE) ) +cs_demo1: cs_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_demo1 cs_demo1.c $(CS) -cs_demo1: $(CS) cs_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_demo1 cs_demo1.c $(CS) -lm +cs_demo2: cs_demo2.c cs_demo.c cs_demo.h Makefile + $(CC) $(CF) $(I) -o cs_demo2 cs_demo2.c cs_demo.c $(CS) -cs_demo2: $(CS) cs_demo2.c cs_demo.c cs_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_demo2 cs_demo2.c cs_demo.c $(CS) -lm +cs_demo3: cs_demo3.c cs_demo.c cs_demo.h Makefile + $(CC) $(CF) $(I) -o cs_demo3 cs_demo3.c cs_demo.c $(CS) -cs_demo3: $(CS) cs_demo3.c cs_demo.c cs_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_demo3 cs_demo3.c cs_demo.c $(CS) -lm +cs_di_demo1: cs_di_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_di_demo1 cs_di_demo1.c $(CS) -cs_di_demo1: $(CS) cs_di_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_di_demo1 cs_di_demo1.c $(CS) -lm +cs_di_demo2: cs_di_demo2.c cs_di_demo.c cs_di_demo.h Makefile + $(CC) $(CF) $(I) -o cs_di_demo2 cs_di_demo2.c cs_di_demo.c $(CS) -cs_di_demo2: $(CS) cs_di_demo2.c cs_di_demo.c cs_di_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_di_demo2 cs_di_demo2.c cs_di_demo.c $(CS) -lm +cs_di_demo3: cs_di_demo3.c cs_di_demo.c cs_di_demo.h Makefile + $(CC) $(CF) $(I) -o cs_di_demo3 cs_di_demo3.c cs_di_demo.c $(CS) -cs_di_demo3: $(CS) cs_di_demo3.c cs_di_demo.c cs_di_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_di_demo3 cs_di_demo3.c cs_di_demo.c $(CS) -lm +cs_ci_demo1: cs_ci_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_ci_demo1 cs_ci_demo1.c $(CS) -cs_ci_demo1: $(CS) cs_ci_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_ci_demo1 cs_ci_demo1.c $(CS) -lm +cs_ci_demo2: cs_ci_demo2.c cs_ci_demo.c cs_ci_demo.h Makefile + $(CC) $(CF) $(I) -o cs_ci_demo2 cs_ci_demo2.c cs_ci_demo.c $(CS) -cs_ci_demo2: $(CS) cs_ci_demo2.c cs_ci_demo.c cs_ci_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_ci_demo2 cs_ci_demo2.c cs_ci_demo.c $(CS) -lm +cs_ci_demo3: cs_ci_demo3.c cs_ci_demo.c cs_ci_demo.h Makefile + $(CC) $(CF) $(I) -o cs_ci_demo3 cs_ci_demo3.c cs_ci_demo.c $(CS) -cs_ci_demo3: $(CS) cs_ci_demo3.c cs_ci_demo.c cs_ci_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_ci_demo3 cs_ci_demo3.c cs_ci_demo.c $(CS) -lm +cs_dl_demo1: cs_dl_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_dl_demo1 cs_dl_demo1.c $(CS) -cs_dl_demo1: $(CS) cs_dl_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_dl_demo1 cs_dl_demo1.c $(CS) -lm +cs_dl_demo2: cs_dl_demo2.c cs_dl_demo.c cs_dl_demo.h Makefile + $(CC) $(CF) $(I) -o cs_dl_demo2 cs_dl_demo2.c cs_dl_demo.c $(CS) -cs_dl_demo2: $(CS) cs_dl_demo2.c cs_dl_demo.c cs_dl_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_dl_demo2 cs_dl_demo2.c cs_dl_demo.c $(CS) -lm +cs_dl_demo3: cs_dl_demo3.c cs_dl_demo.c cs_dl_demo.h Makefile + $(CC) $(CF) $(I) -o cs_dl_demo3 cs_dl_demo3.c cs_dl_demo.c $(CS) -cs_dl_demo3: $(CS) cs_dl_demo3.c cs_dl_demo.c cs_dl_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_dl_demo3 cs_dl_demo3.c cs_dl_demo.c $(CS) -lm +cs_cl_demo1: cs_cl_demo1.c Makefile + $(CC) $(CF) $(I) -o cs_cl_demo1 cs_cl_demo1.c $(CS) -cs_cl_demo1: $(CS) cs_cl_demo1.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_cl_demo1 cs_cl_demo1.c $(CS) -lm +cs_cl_demo2: cs_cl_demo2.c cs_cl_demo.c cs_cl_demo.h Makefile + $(CC) $(CF) $(I) -o cs_cl_demo2 cs_cl_demo2.c cs_cl_demo.c $(CS) -cs_cl_demo2: $(CS) cs_cl_demo2.c cs_cl_demo.c cs_cl_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_cl_demo2 cs_cl_demo2.c cs_cl_demo.c $(CS) -lm +cs_cl_demo3: cs_cl_demo3.c cs_cl_demo.c cs_cl_demo.h Makefile + $(CC) $(CF) $(I) -o cs_cl_demo3 cs_cl_demo3.c cs_cl_demo.c $(CS) -cs_cl_demo3: $(CS) cs_cl_demo3.c cs_cl_demo.c cs_cl_demo.h Makefile $(CS) - $(CC) $(CF) $(I) -o cs_cl_demo3 cs_cl_demo3.c cs_cl_demo.c $(CS) -lm +cs_idemo: cs_idemo.c Makefile + $(CC) $(CF) $(I) -o cs_idemo cs_idemo.c $(CS) -cs_idemo: $(CS) cs_idemo.c Makefile $(CS) - $(CC) $(CF) $(I) -o cs_idemo cs_idemo.c $(CS) -lm - -cs_ldemo: $(CS) cs_ldemo.c Makefile $(CS) - $(CC) $(CF) $(I) -DCS_LONG -o cs_ldemo cs_ldemo.c $(CS) -lm +cs_ldemo: cs_ldemo.c Makefile + $(CC) $(CF) $(I) -DCS_LONG -o cs_ldemo cs_ldemo.c $(CS) clean: - - $(RM) *.o + - $(RM) -r $(CLEAN) purge: distclean @@ -169,4 +170,6 @@ distclean: clean - $(RM) cs_dl_demo1 cs_dl_demo2 cs_dl_demo3 - $(RM) cs_ci_demo1 cs_ci_demo2 cs_ci_demo3 - $(RM) cs_cl_demo1 cs_cl_demo2 cs_cl_demo3 - - $(RM) -r cs_idemo cs_ldemo *.dSYM + - $(RM) cs_idemo cs_ldemo + - $(RM) -r $(PURGE) + diff --git a/SuiteSparse/CXSparse_newfiles/Include/cs.h b/SuiteSparse/CXSparse_newfiles/Include/cs.h index ffc6531ec..48b4c8a8d 100644 --- a/SuiteSparse/CXSparse_newfiles/Include/cs.h +++ b/SuiteSparse/CXSparse_newfiles/Include/cs.h @@ -1,3 +1,23 @@ +/* ========================================================================== */ +/* CXSparse/Include/cs.h file */ +/* ========================================================================== */ + +/* This is the CXSparse/Include/cs.h file. It has the same name (cs.h) as + the CSparse/Include/cs.h file. The 'make install' for SuiteSparse installs + CXSparse, and this file, instead of CSparse. The two packages have the same + cs.h include filename, because CXSparse is a superset of CSparse. Any user + program that uses CSparse can rely on CXSparse instead, with no change to the + user code. The #include "cs.h" line will work for both versions, in user + code, and the function names and user-visible typedefs from CSparse all + appear in CXSparse. For experimenting and changing the package itself, I + recommend using CSparse since it's simpler and easier to modify. For + using the package in production codes, I recommend CXSparse since it has + more features (support for complex matrices, and both int and long + versions). + */ + +/* ========================================================================== */ + #ifndef _CXS_H #define _CXS_H #include @@ -24,9 +44,9 @@ extern "C" { #define CS_VER 3 /* CXSparse Version */ #define CS_SUBVER 1 -#define CS_SUBSUB 4 -#define CS_DATE "Oct 10, 2014" /* CXSparse release date */ -#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2014" +#define CS_SUBSUB 7 +#define CS_DATE "Feb 1, 2016" /* CXSparse release date */ +#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2016" #define CXSPARSE #include "SuiteSparse_config.h" diff --git a/SuiteSparse/CXSparse_newfiles/Lib/Makefile b/SuiteSparse/CXSparse_newfiles/Lib/Makefile index 3c10cf2a1..5a3e4f5eb 100644 --- a/SuiteSparse/CXSparse_newfiles/Lib/Makefile +++ b/SuiteSparse/CXSparse_newfiles/Lib/Makefile @@ -1,13 +1,25 @@ -# CC = cc -# CF = -O +#------------------------------------------------------------------------------- +# CXSparse Lib/Makefile +#------------------------------------------------------------------------------- -default: all +LIBRARY = libcxsparse +VERSION = 3.1.7 +SO_VERSION = 3 + +default: library include ../../SuiteSparse_config/SuiteSparse_config.mk +# CXSparse depends on SuiteSparse_config +LDLIBS += -lsuitesparseconfig + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + I = -I../../SuiteSparse_config -I../Include -all: libcxsparse.a +all: library CS_SOURCE = cs_add.c cs_amd.c cs_chol.c cs_cholsol.c cs_counts.c cs_cumsum.c \ cs_droptol.c cs_dropzeros.c cs_dupl.c cs_entry.c \ @@ -86,14 +98,39 @@ cs_convert.o: ../Source/cs_convert.c %_cl.o : ../Source/%.c $(CC) $(CF) $(I) -DCS_LONG -DCS_COMPLEX -c $< -o $@ -libcxsparse.a: $(CS) - $(ARCHIVE) libcxsparse.a $(CS) - - $(RANLIB) libcxsparse.a +$(AR_TARGET): $(CS) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ clean: - - $(RM) *.o + - $(RM) -r $(CLEAN) purge: distclean distclean: clean - - $(RM) *.a + - $(RM) -r $(PURGE) + +# install CXSparse +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(CS) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/cs.h $(INSTALL_INCLUDE) + $(CP) ../README.txt $(INSTALL_DOC)/CXSPARSE_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/cs.h + chmod 644 $(INSTALL_DOC)/CXSPARSE_README.txt + +# uninstall CXSparse +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/cs.h + $(RM) $(INSTALL_DOC)/CXSPARSE_README.txt + diff --git a/SuiteSparse/CXSparse_newfiles/MATLAB/CSparse/cs_mex.c b/SuiteSparse/CXSparse_newfiles/MATLAB/CSparse/cs_mex.c index 9090c20cd..a37730b47 100644 --- a/SuiteSparse/CXSparse_newfiles/MATLAB/CSparse/cs_mex.c +++ b/SuiteSparse/CXSparse_newfiles/MATLAB/CSparse/cs_mex.c @@ -52,8 +52,8 @@ mxArray *cs_dl_mex_put_sparse (cs_dl **Ahandle) { cs_dl *A ; mxArray *Amatlab ; + if (!Ahandle || !CS_CSC ((*Ahandle))) mexErrMsgTxt ("invalid sparse matrix") ; A = *Ahandle ; - if (!A) mexErrMsgTxt ("failed") ; Amatlab = mxCreateSparse (0, 0, 0, mxREAL) ; mxSetM (Amatlab, A->m) ; mxSetN (Amatlab, A->n) ; @@ -63,6 +63,17 @@ mxArray *cs_dl_mex_put_sparse (cs_dl **Ahandle) cs_free (mxGetPr (Amatlab)) ; mxSetJc (Amatlab, (void *) (A->p)) ; /* assign A->p pointer to MATLAB A */ mxSetIr (Amatlab, (void *) (A->i)) ; + if (A->x == NULL) + { + /* A is a pattern only matrix; return all 1's to MATLAB */ + CS_INT i, nz ; + nz = A->p [A->n] ; + A->x = cs_dl_malloc (CS_MAX (nz,1), sizeof (double)) ; + for (i = 0 ; i < nz ; i++) + { + A->x [i] = 1 ; + } + } mxSetPr (Amatlab, A->x) ; cs_free (A) ; /* frees A struct only, not A->p, etc */ *Ahandle = NULL ; @@ -161,9 +172,9 @@ mxArray *cs_cl_mex_put_sparse (cs_cl **Ahandle) double *x, *z ; mxArray *Amatlab ; CS_INT k ; - + if (!Ahandle || !CS_CSC ((*Ahandle))) mexErrMsgTxt ("invalid sparse matrix") ; A = *Ahandle ; - if (!A) mexErrMsgTxt ("failed") ; + if (A->x == NULL) mexErrMsgTxt ("invalid complex sparse matrix") ; Amatlab = mxCreateSparse (0, 0, 0, mxCOMPLEX) ; mxSetM (Amatlab, A->m) ; mxSetN (Amatlab, A->n) ; @@ -182,7 +193,7 @@ mxArray *cs_cl_mex_put_sparse (cs_cl **Ahandle) z [k] = cimag (A->x [k]) ; } cs_cl_free (A->x) ; /* free copy of complex values */ - mxSetPr (Amatlab, x) ; + mxSetPr (Amatlab, x) ; /* x and z will not be NULL, even if nz==0 */ mxSetPi (Amatlab, z) ; cs_cl_free (A) ; /* frees A struct only, not A->p, etc */ *Ahandle = NULL ; diff --git a/SuiteSparse/CXSparse_newfiles/Makefile b/SuiteSparse/CXSparse_newfiles/Makefile index d59dea471..dd041afe7 100644 --- a/SuiteSparse/CXSparse_newfiles/Makefile +++ b/SuiteSparse/CXSparse_newfiles/Makefile @@ -2,7 +2,8 @@ # CXSparse Makefile #------------------------------------------------------------------------------ -VERSION = 3.1.4 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: C @@ -36,16 +37,10 @@ purge: distclean: purge -# install CSparse +# install CXSparse install: - $(CP) Lib/libcxsparse.a $(INSTALL_LIB)/libcxsparse.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libcxsparse.$(VERSION).a libcxsparse.a ) - $(CP) Include/cs.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libcxsparse*.a - chmod 644 $(INSTALL_INCLUDE)/cs.h + ( cd Lib ; $(MAKE) install ) -# uninstall CSparse +# uninstall CXSparse uninstall: - $(RM) $(INSTALL_LIB)/libcxsparse*.a - $(RM) $(INSTALL_INCLUDE)/cs.h - + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/CXSparse_newfiles/README.txt b/SuiteSparse/CXSparse_newfiles/README.txt index f1f55bbe9..6a127dba5 100644 --- a/SuiteSparse/CXSparse_newfiles/README.txt +++ b/SuiteSparse/CXSparse_newfiles/README.txt @@ -13,11 +13,8 @@ includes a MATLAB interface, enabling the use of CXSparse functions on both 32-bit and 64-bit platforms. To install for use in MATLAB, simply type "cs_install" in the MATLAB Command -Window, while in the CXSparse/MATLAB directory. (NOTE: Windows users cannot -use the "lcc" command; run "mex -setup" first, and select a different -compiler). If you use the Unix "make" command in that directory instead and -are using a 64-bit platform, then you must edit the CXSparse/MATLAB/Makefile -first. Refer to the instructions in that file. +Window, while in the CXSparse/MATLAB directory. (NOTE: you may need to +run "mex -setup" first). Refer to "Direct Methods for Sparse Linear Systems," Timothy A. Davis, SIAM, Philadelphia, 2006. No detailed user guide is included in this @@ -31,6 +28,9 @@ I recommend that you use a different level of optimization than "cc -O", which was chosen so that the Makefile is portable. See Source/Makefile. +To install into /usr/local/lib and /usr/local/include, do "make install" +and "make uninstall" to uninstall CXSparse. + If your C compiler does not support the ANSI C99 complex type, the #include statement will fail. If this happens, compile the code with the -DNCOMPLEX flag (the MATLAB cs_install will do this for you). diff --git a/SuiteSparse/ChangeLog b/SuiteSparse/ChangeLog index e915ffecc..160a74fee 100644 --- a/SuiteSparse/ChangeLog +++ b/SuiteSparse/ChangeLog @@ -1,3 +1,53 @@ +Feb 1, 2016: SuiteSparse 4.5.1 + + * update to Makefiles. Version 4.5.0 is broken on the Mac. + That version also compiles *.so libraries on Linux with + underlinked dependencies to other libraries in SuiteSparse. + For example, AMD requires SuiteSparse_config. The links to + required libraries are now explicitly included in each library, + in SuiteSparse 4.5.1. + * minor change to CHOLMOD/Check/cholmod_write.c, when compiling with + -DNGPL + +Jan 30, 2016: SuiteSparse 4.5.0 + + * better Makefiles for creating and installing shared libraries + * CHOLMOD now uses METIS 5.1.0, which is distributed with SuiteSparse + * fix for MATLAB R2015b, which changed how it creates empty matrices, + as compared to prior versions of MATLAB. This change in MATLAB + breaks many of the mexFunctions in prior versions of SuiteSparse. + If you use MATLAB R2015b, you must upgrade to SuiteSparse 4.5.0 + or later. + +Jan 1, 2016: SuiteSparse 4.4.7 + + * note that this minor update fails on the Mac, so its + listed on my web page as a 'beta' release. + * Improved the Makefiles of all packages. They now create *.so + shared libraries (*.dylib on the Mac). Also, there is now + only a single SuiteSparse_config.mk file. It now determines + your system automatically, and whether or not you have METIS + and CUDA. It also automatically detects if you have the Intel + compiler or not, and uses it if it finds it. There should be + no need to edit this file for most cases, but you may need to + for your particular system. With this release, there are almost + no changes to the source code, except for the VERSION numbers + defined in the various include *.h files for each package. + +Aug 2015: SuiteSparse version 4.4.6 + + * SPQR: changed default tol when A has infs, from inf to realmax (~1e308) + +July 2015: SuiteSparse version 4.4.5 + + * CHOLMOD 3.0.6: + - minor fix to CHOLMOD (-DNGPL did not work as expected) + - added MATLAB interface for row add/delete (lurowmod) + * KLU 1.3.3: Fix for klu_dump.c (debugging case only) + * UFcollection: added additional stats for matrix collection + * AMD: changed the license. Was LGPL only, now either LGPL or BSD, + at the user's option. See AMD/Doc/License.txt for details. + Mar 24, 2015: SuiteSparse version 4.4.4 * CHOLMOD version number corrected. In 4.4.3, the CHOLMOD_SUBSUB_VERSION diff --git a/SuiteSparse/GPUQREngine/Demo/Makefile b/SuiteSparse/GPUQREngine/Demo/Makefile index ca363a04c..364c34b3b 100644 --- a/SuiteSparse/GPUQREngine/Demo/Makefile +++ b/SuiteSparse/GPUQREngine/Demo/Makefile @@ -2,39 +2,44 @@ # GPUQREngine/Demo Makefile #------------------------------------------------------------------------------- +default: all + include ../../SuiteSparse_config/SuiteSparse_config.mk -LIBS = $(CUDART_LIB) ../Lib/libGPUQREngine.a \ - ../../SuiteSparse_GPURuntime/Lib/libSuiteSparse_GPURuntime.a \ - ../../CHOLMOD/Lib/libcholmod.a \ - ../../SuiteSparse_config/libsuitesparseconfig.a \ - $(CUDART_LIB) $(CUBLAS_LIB) -lm -lrt +LIBS = $(LDFLAGS) -L../../lib $(CUDART_LIB) -lGPUQREngine \ + -lSuiteSparse_GPURuntime -lcholmod -lsuitesparseconfig \ + -lamd -lcolamd -lcamd -lccolamd $(LIB_WITH_PARTIION) \ + -lmetis $(CUDART_LIB) $(CUBLAS_LIB) $(BLAS) $(LAPACK) -lgomp \ + -liomp5 $(LDLIBS) -INC = -I../../SuiteSparse_GPURuntime/Include -I../Include \ - -I../../SuiteSparse_config -I../../CHOLMOD/Include +INC = -I../../SuiteSparse_GPURuntime/Include -I../Include -I../../include \ + $(CUDA_INC) #------------------------------------------------------------------------------- -all: lib demo - -library: lib +all: library demo clean: - $(RM) *.o + $(RM) -r $(CLEAN) purge: clean - $(RM) gpuqrengine_demo troll.m - -lib: - ( cd ../Lib ; $(MAKE) library ) + $(RM) -r gpuqrengine_demo troll.m $(PURGE) + +library: + ( cd ../Lib ; $(MAKE) ) ( cd ../../CHOLMOD ; $(MAKE) library ) - ( cd ../../SuiteSparse_config ; $(MAKE) library ) - ( cd ../../SuiteSparse_GPURuntime/Lib ; $(MAKE) library ) + ( cd ../../AMD ; $(MAKE) library ) + ( cd ../../COLAMD ; $(MAKE) library ) + ( cd ../../CAMD ; $(MAKE) library ) + ( cd ../../CCOLAMD ; $(MAKE) library ) + ( cd ../.. ; $(MAKE) metis ) + ( cd ../../SuiteSparse_config ; $(MAKE) ) + ( cd ../../SuiteSparse_GPURuntime ; $(MAKE) library ) demo: gpuqrengine_demo ./gpuqrengine_demo -gpuqrengine_demo: lib - $(NVCC) $(INC) -o gpuqrengine_demo gpuqrengine_demo.cpp $(LIBS) +gpuqrengine_demo: library gpuqrengine_demo.cpp + $(CC) $(CF) $(INC) -o gpuqrengine_demo gpuqrengine_demo.cpp $(LIBS) diff --git a/SuiteSparse/GPUQREngine/Doc/ChangeLog b/SuiteSparse/GPUQREngine/Doc/ChangeLog index 2e1593567..fbcc476e5 100644 --- a/SuiteSparse/GPUQREngine/Doc/ChangeLog +++ b/SuiteSparse/GPUQREngine/Doc/ChangeLog @@ -1,3 +1,16 @@ +Feb 1, 2016: version 1.0.3 + + * update to Makefiles + +Jan 30, 2016: version 1.0.2 + + * modifications to Makefiles + +Jan 1, 2016: version 1.0.1 + + * modified Makefile to create shared libraries + No change to C code except version number + Oct 17, 2014: version 1.0.0 * first stable release diff --git a/SuiteSparse/GPUQREngine/Include/GPUQREngine.hpp b/SuiteSparse/GPUQREngine/Include/GPUQREngine.hpp index ca236bdb4..06851a9b3 100644 --- a/SuiteSparse/GPUQREngine/Include/GPUQREngine.hpp +++ b/SuiteSparse/GPUQREngine/Include/GPUQREngine.hpp @@ -47,11 +47,11 @@ Int *GPUQREngine_FindStaircase ); // Version information: -#define GPUQRENGINE_DATE "Oct 17, 2014" +#define GPUQRENGINE_DATE "Feb 1, 2016" #define GPUQRENGINE_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define GPUQRENGINE_MAIN_VERSION 1 #define GPUQRENGINE_SUB_VERSION 0 -#define GPUQRENGINE_SUBSUB_VERSION 0 +#define GPUQRENGINE_SUBSUB_VERSION 3 #define GPUQRENGINE_VERSION \ GPUQRENGINE_VER_CODE(GPUQRENGINE_MAIN_VERSION,GPUQRENGINE_SUB_VERSION) diff --git a/SuiteSparse/GPUQREngine/Include/GPUQREngine_BucketList.hpp b/SuiteSparse/GPUQREngine/Include/GPUQREngine_BucketList.hpp index 6f141a99c..f37e3ecfd 100644 --- a/SuiteSparse/GPUQREngine/Include/GPUQREngine_BucketList.hpp +++ b/SuiteSparse/GPUQREngine/Include/GPUQREngine_BucketList.hpp @@ -62,7 +62,7 @@ class BucketList int VThead; // Index of the first available entry in VTlist // Constructors - void *operator new(size_t, BucketList* p) + void *operator new(long unsigned int, BucketList* p) { return p; } diff --git a/SuiteSparse/GPUQREngine/Include/GPUQREngine_Front.hpp b/SuiteSparse/GPUQREngine/Include/GPUQREngine_Front.hpp index 8517b2c21..02d4208b1 100644 --- a/SuiteSparse/GPUQREngine/Include/GPUQREngine_Front.hpp +++ b/SuiteSparse/GPUQREngine/Include/GPUQREngine_Front.hpp @@ -47,7 +47,7 @@ class Front /* Debug Fields */ bool printMe; - void* operator new(size_t reqMem, Front* ptr){ return ptr; } + void* operator new(long unsigned int reqMem, Front* ptr){ return ptr; } Front( Int fids_arg, // the front identifier diff --git a/SuiteSparse/GPUQREngine/Include/GPUQREngine_LLBundle.hpp b/SuiteSparse/GPUQREngine/Include/GPUQREngine_LLBundle.hpp index fc347143e..93bd3212c 100644 --- a/SuiteSparse/GPUQREngine/Include/GPUQREngine_LLBundle.hpp +++ b/SuiteSparse/GPUQREngine/Include/GPUQREngine_LLBundle.hpp @@ -68,7 +68,7 @@ class LLBundle TaskType CurrentTask; - void *operator new(size_t, LLBundle* p){ return p; } + void *operator new(long unsigned int, LLBundle* p){ return p; } LLBundle(BucketList *buckets, Int panelSize, Int nativeBucket); // empty LLBundle constructor (currently used, kept for possible future use diff --git a/SuiteSparse/GPUQREngine/Include/GPUQREngine_Scheduler.hpp b/SuiteSparse/GPUQREngine/Include/GPUQREngine_Scheduler.hpp index 069b01a5c..aa3781d5b 100644 --- a/SuiteSparse/GPUQREngine/Include/GPUQREngine_Scheduler.hpp +++ b/SuiteSparse/GPUQREngine/Include/GPUQREngine_Scheduler.hpp @@ -90,7 +90,7 @@ class Scheduler cudaStream_t memoryStreamD2H; /* Scheduler.cpp */ - void *operator new(size_t, Scheduler* p){ return p; } + void *operator new(long unsigned int, Scheduler* p){ return p; } Scheduler(Front *fronts, Int numFronts, size_t gpuMemorySize); ~Scheduler(); diff --git a/SuiteSparse/GPUQREngine/Lib/Makefile b/SuiteSparse/GPUQREngine/Lib/Makefile index e50b8c6db..f22531bb6 100644 --- a/SuiteSparse/GPUQREngine/Lib/Makefile +++ b/SuiteSparse/GPUQREngine/Lib/Makefile @@ -2,12 +2,23 @@ # GPUQREngine/Lib/Makefile: for compiling the GPUQREngine library #------------------------------------------------------------------------------- -default: all +LIBRARY = libGPUQREngine +VERSION = 1.0.3 +SO_VERSION = 1 + +default: library ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk +# GPUQREngine depends on SuiteSparse_config, CUDA, and SuiteSparse_GPURuntime +LDLIBS += -lSuiteSparse_GPURuntime -lsuitesparseconfig $(CUDART_LIB) + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + OBJS = GPUQREngine_GraphVizHelper.o \ GPUQREngine_Internal.o \ GPUQREngine_ExpertDense.o \ @@ -36,9 +47,6 @@ OBJS = GPUQREngine_GraphVizHelper.o \ TaskDescriptor_flops.o \ GPUQREngine_UberKernel.o -LIBS = $(CUDART_LIB) \ - ../../SuiteSparse_GPURuntime/Lib/libSuiteSparse_GPURuntime.a - INC = -I../../SuiteSparse_GPURuntime/Include -I../Include \ -I../../SuiteSparse_config @@ -93,8 +101,7 @@ H3 = \ ../../SuiteSparse_GPURuntime/Include/SuiteSparseGPU_macros.hpp \ ../../SuiteSparse_GPURuntime/Include/SuiteSparseGPU_Runtime.hpp \ ../../SuiteSparse_GPURuntime/Include/SuiteSparseGPU_Workspace.hpp \ - ../../SuiteSparse_GPURuntime/Include/SuiteSparseGPU_workspace_macros.hpp \ - Makefile + ../../SuiteSparse_GPURuntime/Include/SuiteSparseGPU_workspace_macros.hpp H += $(H3) H2 += $(H3) @@ -103,21 +110,42 @@ H2 += $(H3) C = $(NVCC) $(NVCCFLAGS) $(INC) -all: libGPUQREngine.a - -library: libGPUQREngine.a +all: library clean: - $(RM) *.o + $(RM) -r $(CLEAN) purge: distclean distclean: clean - $(RM) libGPUQREngine.a + $(RM) -r $(PURGE) + +$(AR_TARGET): $(OBJS) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ + +#------------------------------------------------------------------------------- -libGPUQREngine.a: $(OBJS) - $(ARCHIVE) libGPUQREngine.a $(OBJS) - - $(RANLIB) libGPUQREngine.a +# install GPUQREngine. Note that the include files are not installed. +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJS) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../README.txt $(INSTALL_DOC)/GPUQRENGINE_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_DOC)/GPUQRENGINE_README.txt + +# uninstall GPUQREngine +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_DOC)/GPUQRENGINE_README.txt #------------------------------------------------------------------------------- diff --git a/SuiteSparse/GPUQREngine/Makefile b/SuiteSparse/GPUQREngine/Makefile index 5a9bc81b3..189484efe 100644 --- a/SuiteSparse/GPUQREngine/Makefile +++ b/SuiteSparse/GPUQREngine/Makefile @@ -2,7 +2,8 @@ # GPUQREngine Makefile #------------------------------------------------------------------------------- -VERSION = 1.0.0 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE # default is 'library' since there is no demo program default: library @@ -19,11 +20,13 @@ library: # Remove all files not in the original distribution purge: ( cd Lib ; $(MAKE) purge ) + ( cd Demo ; $(MAKE) purge ) # Remove all files not in the original distribution, except keep the # compiled libraries. clean: ( cd Lib ; $(MAKE) clean ) + ( cd Demo ; $(MAKE) clean ) distclean: purge @@ -31,11 +34,7 @@ ccode: all # install GPUQREngine. Note that the include files are not installed. install: - $(CP) Lib/libGPUQREngine.a $(INSTALL_LIB)/libGPUQREngine.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libGPUQREngine.$(VERSION).a libGPUQREngine.a ) - chmod 644 $(INSTALL_LIB)/libGPUQREngine*.a + ( cd Lib ; $(MAKE) install ) -# uninstall GPUQREngine uninstall: - $(RM) $(INSTALL_LIB)/libGPUQREngine*.a - + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/GPUQREngine/README.txt b/SuiteSparse/GPUQREngine/README.txt index c42d4e413..39c062845 100644 --- a/SuiteSparse/GPUQREngine/README.txt +++ b/SuiteSparse/GPUQREngine/README.txt @@ -2,9 +2,6 @@ GPUQREngine Copyright (c) 2013, Timothy A. Davis, Sencer Nuri Yeralan, and Sanjay Ranka. http://www.suitesparse.com -NOTE: this is version 0.1.0, an alpha release. Some changes to the API -may occur in the 1.0.0 release. - GPUQREngine is a gpu-accelerated QR factorization engine supporting SuiteSparseQR. diff --git a/SuiteSparse/KLU/Demo/Makefile b/SuiteSparse/KLU/Demo/Makefile index 0bf97af18..51b0a479e 100644 --- a/SuiteSparse/KLU/Demo/Makefile +++ b/SuiteSparse/KLU/Demo/Makefile @@ -1,25 +1,22 @@ -# KLU Demo Makefile. The klu_simple demo is stand-alone. The other demos -# require CHOLMOD. +# KLU Demo Makefile default: all include ../../SuiteSparse_config/SuiteSparse_config.mk -CLIB = ../Lib/libklu.a ../../BTF/Lib/libbtf.a \ - ../../AMD/Lib/libamd.a ../../COLAMD/Lib/libcolamd.a \ - ../../SuiteSparse_config/libsuitesparseconfig.a +CLIB = $(LDFLAGS) -L../../lib -lklu -lbtf -lamd -lcolamd -lsuitesparseconfig \ + $(LIB_WITH_PARTITION) $(LDLIBS) -CHOLMOD_LIB = ../../CHOLMOD/Lib/libcholmod.a -CHOLMOD = $(CHOLMOD_LIB) $(LAPACK) $(BLAS) $(XERBLA) +CHOLMOD_LIB = -lcholmod +CHOLMOD = $(CHOLMOD_LIB) $(LAPACK) $(BLAS) ifneq ($(GPU_CONFIG),) CHOLMOD += $(CUDART_LIB) $(CUBLAS_LIB) endif -I = -I../../SuiteSparse_config -I../../AMD/Include -I../../COLAMD/Include \ - -I../../BTF/Include -I../Include -I../../CHOLMOD/Include +I = -I../../include -all: $(CLIB) klu_simple $(CHOLMOD_LIB) kludemo kluldemo +all: library klu_simple kludemo kluldemo - ./klu_simple - ./kludemo < ../Matrix/1c.mtx - ./kludemo < ../Matrix/arrowc.mtx @@ -34,42 +31,33 @@ all: $(CLIB) klu_simple $(CHOLMOD_LIB) kludemo kluldemo - ./kluldemo < ../Matrix/w156.mtx - ./kluldemo < ../Matrix/ctina.mtx -../Lib/libklu.a: +library: + ( cd ../../SuiteSparse_config ; $(MAKE) ) ( cd ../Lib ; $(MAKE) ) - -../../BTF/Lib/libbtf.a: ( cd ../../BTF ; $(MAKE) library ) - -../../AMD/Lib/libamd.a: ( cd ../../AMD ; $(MAKE) library ) - -../../COLAMD/Lib/libcolamd.a: ( cd ../../COLAMD ; $(MAKE) library ) - -../../CHOLMOD/Lib/libcholmod.a: ( cd ../../CHOLMOD ; $(MAKE) library ) -# ( cd ../../CAMD ; $(MAKE) ) -# ( cd ../../CCOLAMD ; $(MAKE) ) -# ( cd ../../metis-4.0 ; $(MAKE) ) - -../../SuiteSparse_config/libsuitesparseconfig.a: - ( cd ../../SuiteSparse_config ; $(MAKE) ) + - ( cd ../../CAMD ; $(MAKE) ) + - ( cd ../../CCOLAMD ; $(MAKE) ) + - ( cd ../.. ; $(MAKE) metis ) purge: distclean distclean: clean - $(RM) kludemo kluldemo klu_simple - - $(RM) -r *.dSYM + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) -kludemo: kludemo.c Makefile $(CLIB) - $(CC) $(CF) $(I) kludemo.c -o kludemo $(CLIB) $(CHOLMOD) $(LIB) +kludemo: kludemo.c Makefile + $(CC) $(CF) $(I) kludemo.c -o kludemo $(CLIB) $(CHOLMOD) -kluldemo: kludemo.c Makefile $(CLIB) - $(CC) $(CF) $(I) kluldemo.c -o kluldemo $(CLIB) $(CHOLMOD) $(LIB) +kluldemo: kludemo.c Makefile + $(CC) $(CF) $(I) kluldemo.c -o kluldemo $(CLIB) $(CHOLMOD) -klu_simple: klu_simple.c Makefile $(CLIB) - $(CC) $(CF) $(I) klu_simple.c -o klu_simple $(CLIB) $(LIB) +klu_simple: klu_simple.c Makefile + $(CC) $(CF) $(I) klu_simple.c -o klu_simple $(CLIB) - ./klu_simple + diff --git a/SuiteSparse/KLU/Demo/kludemo.out b/SuiteSparse/KLU/Demo/kludemo.out index e81081939..d132681f1 100644 --- a/SuiteSparse/KLU/Demo/kludemo.out +++ b/SuiteSparse/KLU/Demo/kludemo.out @@ -5,73 +5,73 @@ x [2] = 3 x [3] = 4 x [4] = 5 ./kludemo < ../Matrix/1c.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 1 nnz(A) 1 nnz(L+U+F) 1 resid 0 recip growth 1 condest 1 rcond 1 flops 0 peak memory usage: 492 bytes ./kludemo < ../Matrix/arrowc.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.68007e-14 recip growth 0.019999 condest 295.99 rcond 0.019999 flops 297 peak memory usage: 32244 bytes ./kludemo < ../Matrix/arrow.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.77636e-15 recip growth 0.0204082 condest 303 rcond 0.0204082 flops 297 peak memory usage: 20412 bytes ./kludemo < ../Matrix/impcol_a.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 207 nnz(A) 572 nnz(L+U+F) 615 resid 6.98492e-10 recip growth 0.00957447 condest 4.35093e+07 rcond 4.5277e-05 flops 259 peak memory usage: 34276 bytes ./kludemo < ../Matrix/w156.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 156 nnz(A) 362 nnz(L+U+F) 396 resid 6.23816e-08 recip growth 0.00889922 condest 1.79787e+09 rcond 0.000124785 flops 175 peak memory usage: 39516 bytes ./kludemo < ../Matrix/ctina.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 11 nnz(A) 36 nnz(L+U+F) 45 resid 4.44089e-16 recip growth 1 condest 56 rcond 1 flops 73 peak memory usage: 4268 bytes ./kluldemo < ../Matrix/1c.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 1 nnz(A) 1 nnz(L+U+F) 1 resid 0 recip growth 1 condest 1 rcond 1 flops 0 peak memory usage: 600 bytes ./kluldemo < ../Matrix/arrowc.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.68007e-14 recip growth 0.019999 condest 295.99 rcond 0.019999 flops 297 peak memory usage: 39000 bytes ./kluldemo < ../Matrix/arrow.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.77636e-15 recip growth 0.0204082 condest 303 rcond 0.0204082 flops 297 peak memory usage: 29584 bytes ./kluldemo < ../Matrix/impcol_a.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 207 nnz(A) 572 nnz(L+U+F) 615 resid 6.98492e-10 recip growth 0.00957447 condest 4.35093e+07 rcond 4.5277e-05 flops 259 peak memory usage: 44800 bytes ./kluldemo < ../Matrix/w156.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 156 nnz(A) 362 nnz(L+U+F) 396 resid 6.23816e-08 recip growth 0.00889922 condest 1.79787e+09 rcond 0.000124785 flops 175 peak memory usage: 47480 bytes ./kluldemo < ../Matrix/ctina.mtx -KLU: Oct 23, 2014, version: 1.3.2 +KLU: June 3, 2015, version: 1.3.3 n 11 nnz(A) 36 nnz(L+U+F) 45 resid 4.44089e-16 recip growth 1 condest 56 rcond 1 flops 73 peak memory usage: 5144 bytes diff --git a/SuiteSparse/KLU/Doc/ChangeLog b/SuiteSparse/KLU/Doc/ChangeLog index c14a1bf73..64fc9b8a8 100644 --- a/SuiteSparse/KLU/Doc/ChangeLog +++ b/SuiteSparse/KLU/Doc/ChangeLog @@ -1,3 +1,21 @@ +Feb 1, 2016: version 1.3.6 + + * update to Makefiles + +Jan 30, 2016: version 1.3.5 + + * modifications to Makefiles + +Jan 1, 2016: version 1.3.4 + + * modified Makefile to create shared libraries + No change to C code except version number + +June 3, 2015: version 1.3.3 + + * fix to klu_dump.c, only when debugging is enabled. + No affect on production code. + Oct 23, 2014: version 1.3.2 * modified MATLAB/klu_make.m. No change to C source code. diff --git a/SuiteSparse/KLU/Doc/KLU_UserGuide.pdf b/SuiteSparse/KLU/Doc/KLU_UserGuide.pdf index f5c509d6d..08077c5ed 100644 Binary files a/SuiteSparse/KLU/Doc/KLU_UserGuide.pdf and b/SuiteSparse/KLU/Doc/KLU_UserGuide.pdf differ diff --git a/SuiteSparse/KLU/Doc/KLU_UserGuide.tex b/SuiteSparse/KLU/Doc/KLU_UserGuide.tex index 6ad491aff..a40bffabf 100644 --- a/SuiteSparse/KLU/Doc/KLU_UserGuide.tex +++ b/SuiteSparse/KLU/Doc/KLU_UserGuide.tex @@ -26,7 +26,7 @@ } \and Eka Palamadai Natarajan} -\date{VERSION 1.3.2, Oct 23, 2014} +\date{VERSION 1.3.6, Feb 1, 2016} \maketitle %------------------------------------------------------------------------------ @@ -322,11 +322,7 @@ \section{Using KLU and BTF in MATLAB} them. In the {\tt BTF/MATLAB} directory, type {\tt btf\_install}, and then type {\tt klu\_install} in the {\tt KLU/MATLAB} directory. Alternatively, if you have the entire SuiteSparse, simply run the {\tt SuiteSparse\_install} -function in the {\tt SuiteSparse} directory. To use METIS 4.0.1 with KLU (and -CHOLMOD, another part of SuiteSparse) you must first download it from {\tt -http://glaros.dtc.umn.edu/gkhome/views/metis} and place the {\tt metis-4.0} -directory in the {\tt SuiteSparse} directory, alongside the {\tt KLU} and {\tt -BTF} directories. +function in the {\tt SuiteSparse} directory. After running the installation scripts, type {\tt pathtool} and save your path for future MATLAB sessions. If you cannot save your path because of file @@ -1263,13 +1259,13 @@ \section{Installation} For {\tt make}, system-dependent configurations are in the {\tt ../SuiteSparse\_config/SuiteSparse\_config.mk} file. You can edit that file to customize the -compilation. The default settings will work on most systems. Sample -configuration files are provided for Linux, Sun Solaris, SGI IRIX, IBM AIX, and -the DEC/Compaq Alpha. +compilation, but it now automatically detecs your system (Linux, Mac, etc). +So it's not likely that you will need to edit that file. To compile and install the C-callable KLU, BTF, AMD, and COLAMD libraries, go to the {\tt KLU} directory and type {\tt make}. The KLU and BTF libraries are -placed in {\tt KLU/Lib/libklu.a} and {\tt BTF/Lib/libbtf.a}. Two KLU demo +placed in {\tt KLU/Lib/libklu.*} and {\tt BTF/Lib/libbtf.*}. +Two KLU demo programs will be compiled and tested in the {\tt KLU/Demo} directory. You can compare the output of {\tt make} with the results in the KLU distribution, {\tt kludemo.out}. @@ -1282,16 +1278,19 @@ \section{Installation} make purge} and then {\tt make} to recompile. When you compile your program that uses the C-callable KLU library, you need to -add the {\tt KLU/Lib/libklu.a}, {\tt BTF/Lib/libbtf.a}, {\tt AMD/Lib/libamd.a}, -and {\tt COLAMD/Lib/libamd.a} libraries, a nd you need to tell your compiler to +add the {\tt KLU/Lib/libklu.*}, {\tt BTF/Lib/libbtf.*}, {\tt AMD/Lib/libamd.*}, +and {\tt COLAMD/Lib/libcolamd.*} libraries, and you need to tell your compiler to look in the {\tt KLU/Include} and {\tt BTF/Include} directory for include files. +Alternatively, do {\tt make install}, and KLU will be installed in +/usr/local/lib and /usr/local/include, and documentation is placed in +/usr/local/doc. These installation locations can be changed; +see {\tt SuiteSparse/README.txt} for details. If all you want to use is the KLU mexFunction in MATLAB, you can skip the use of the {\tt make} command entirely. Simply type {\tt klu\_install} in the MATLAB command window while in the {\tt KLU/MATLAB} directory. This works on -any system with MATLAB, including Windows. Alternately, type {\tt make} in the -{\tt KLU/MATLAB} directory. +any system with MATLAB, including Windows. %------------------------------------------------------------------------------ \newpage diff --git a/SuiteSparse/KLU/Doc/Makefile b/SuiteSparse/KLU/Doc/Makefile index afa0942b5..8d7e7492d 100644 --- a/SuiteSparse/KLU/Doc/Makefile +++ b/SuiteSparse/KLU/Doc/Makefile @@ -16,7 +16,7 @@ clean: purge: distclean distclean: clean - - $(RM) *.aux *.bbl *.blg *.log *.toc + - $(RM) -r $(PURGE) #------------------------------------------------------------------------------ # Create the User Guide and Quick Start Guide @@ -24,13 +24,13 @@ distclean: clean KLU_UserGuide.pdf: KLU_UserGuide.tex KLU_UserGuide.bib \ ../Include/klu.h ../../BTF/Include/btf.h Makefile - echo '\\begin{verbatim}' > klu_h.tex + echo '\begin{verbatim}' > klu_h.tex expand -8 ../Include/klu.h >> klu_h.tex echo '\end{verbatim}' >> klu_h.tex - echo '\\begin{verbatim}' > btf_h.tex + echo '\begin{verbatim}' > btf_h.tex expand -8 ../../BTF/Include/btf.h >> btf_h.tex echo '\end{verbatim}' >> btf_h.tex - echo '\\begin{verbatim}' > klu_simple_c.tex + echo '\begin{verbatim}' > klu_simple_c.tex expand -8 ../Demo/klu_simple.c >> klu_simple_c.tex echo '\end{verbatim}' >> klu_simple_c.tex pdflatex KLU_UserGuide diff --git a/SuiteSparse/KLU/Include/klu.h b/SuiteSparse/KLU/Include/klu.h index efbc5236c..ecf9629c8 100644 --- a/SuiteSparse/KLU/Include/klu.h +++ b/SuiteSparse/KLU/Include/klu.h @@ -819,11 +819,11 @@ void *klu_l_realloc (size_t, size_t, size_t, void *, klu_l_common *) ; * #endif */ -#define KLU_DATE "Oct 23, 2014" +#define KLU_DATE "Feb 1, 2016" #define KLU_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define KLU_MAIN_VERSION 1 #define KLU_SUB_VERSION 3 -#define KLU_SUBSUB_VERSION 2 +#define KLU_SUBSUB_VERSION 6 #define KLU_VERSION KLU_VERSION_CODE(KLU_MAIN_VERSION,KLU_SUB_VERSION) #ifdef __cplusplus diff --git a/SuiteSparse/KLU/Lib/Makefile b/SuiteSparse/KLU/Lib/Makefile index 7dc44b694..8ded04bfc 100644 --- a/SuiteSparse/KLU/Lib/Makefile +++ b/SuiteSparse/KLU/Lib/Makefile @@ -1,24 +1,37 @@ -default: all +#------------------------------------------------------------------------------- +# KLU Lib/Makefile +#------------------------------------------------------------------------------- + +LIBRARY = libklu +VERSION = 1.3.6 +SO_VERSION = 1 + +default: library ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk +# KLU depends on BTF, AMD, COLAMD, and SuiteSparse_config +LDLIBS += -lamd -lcolamd -lbtf -lsuitesparseconfig + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + # for testing only: # TEST = -DTESTING C = $(CC) $(CF) INC = ../Include/klu.h ../Include/klu_internal.h ../Include/klu_version.h \ - ../../SuiteSparse_config/SuiteSparse_config.h Makefile + ../../SuiteSparse_config/SuiteSparse_config.h I = -I../../AMD/Include -I../../COLAMD/Include -I../../BTF/Include \ -I../Include -I../../SuiteSparse_config all: library -library: libklu.a - KLU_D = klu_d.o klu_d_kernel.o klu_d_dump.o \ klu_d_factor.o klu_d_free_numeric.o klu_d_solve.o \ klu_d_scale.o klu_d_refactor.o \ @@ -47,9 +60,9 @@ COMMON = \ OBJ = $(COMMON) $(KLU_D) $(KLU_Z) $(KLU_L) $(KLU_ZL) -libklu.a: $(OBJ) - $(ARCHIVE) libklu.a $(OBJ) - - $(RANLIB) libklu.a +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ $(OBJ): $(INC) @@ -149,10 +162,10 @@ klu_memory.o: ../Source/klu_memory.c purge: distclean distclean: clean - - $(RM) libklu.a + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) #------------------------------------------------------------------------------- @@ -246,3 +259,31 @@ klu_l_memory.o: ../Source/klu_memory.c $(C) -c -DDLONG $(I) $< -o $@ #------------------------------------------------------------------------------- + +# install KLU +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/klu.h $(INSTALL_INCLUDE) + $(CP) ../Doc/KLU_UserGuide.pdf $(INSTALL_DOC) + $(CP) ../README.txt $(INSTALL_DOC)/KLU_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/klu.h + chmod 644 $(INSTALL_DOC)/KLU_UserGuide.pdf + chmod 644 $(INSTALL_DOC)/KLU_README.txt + +# uninstall KLU +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/klu.h + $(RM) $(INSTALL_DOC)/KLU_UserGuide.pdf + $(RM) $(INSTALL_DOC)/KLU_README.txt + diff --git a/SuiteSparse/KLU/MATLAB/klu_install.m b/SuiteSparse/KLU/MATLAB/klu_install.m index 09e7a1485..fff752184 100644 --- a/SuiteSparse/KLU/MATLAB/klu_install.m +++ b/SuiteSparse/KLU/MATLAB/klu_install.m @@ -6,18 +6,16 @@ function klu_install (metis_path) % % KLU relies on AMD, COLAMD, and BTF for its ordering options, and can % optionally use CHOLMOD, CCOLAMD, CAMD, and METIS as well. By default, -% CHOLMOD, CCOLAMD, CAMD, and METIS are not used. -% -% See http://www-users.cs.umn.edu/~karypis/metis for a copy of METIS 4.0.1. +% CHOLMOD, CCOLAMD, CAMD, and METIS are compiled and used by KLU. % % You must type the klu_install command while in the KLU/MATLAB directory. % % See also klu, btf -% Copyright 2004-2009, Univ. of Florida +% Copyright 2004-2016, Univ. of Florida if (nargin < 1) - metis_path = ['no metis'] ; + metis_path = ['../../metis-5.1.0'] ; end % compile KLU and add to the path diff --git a/SuiteSparse/KLU/MATLAB/klu_make.m b/SuiteSparse/KLU/MATLAB/klu_make.m index ab2fb6822..72fe8eeae 100644 --- a/SuiteSparse/KLU/MATLAB/klu_make.m +++ b/SuiteSparse/KLU/MATLAB/klu_make.m @@ -5,20 +5,18 @@ function klu_make (metis_path) % klu_make % % KLU relies on AMD, COLAMD, and BTF for its ordering options, and can -% optionally use CHOLMOD, CCOLAMD, CAMD, and METIS as well. METIS must -% be placed in ../../metis-4.0 alongside KLU, or it will not be used. -% See http://www-users.cs.umn.edu/~karypis/metis for a copy of METIS 4.0.1. +% optionally use CHOLMOD, CCOLAMD, CAMD, and METIS as well. % % You must type the klu_make command while in the KLU/MATLAB directory. % % See also klu. -% Copyright 2004-2009, Univ. of Florida +% Copyright 2004-2016, Univ. of Florida if (nargin < 1) - metis_path = '../../metis-4.0' ; + metis_path = '../../metis-5.1.0' ; end -with_cholmod = exist ([metis_path '/Lib'], 'dir') ; +with_cholmod = exist (metis_path, 'dir') ; details = 0 ; % if 1, print details of each command @@ -39,7 +37,10 @@ function klu_make (metis_path) include = '-I. -I../../AMD/Include -I../../COLAMD/Include -I../Include -I../../SuiteSparse_config -I../../BTF/Include' ; if (with_cholmod) - include = [include ' -I../../CCOLAMD/Include -I../../CAMD/Include -I../../CHOLMOD/Include -I../../SuiteSparse_config -I' metis_path '/Lib -I../User'] ; + include = [include ' -I../../CCOLAMD/Include -I../../CAMD/Include -I../../CHOLMOD/Include -I../../SuiteSparse_config -I../User'] ; + include = [include ' -I' metis_path '/include'] ; + include = [include ' -I' metis_path '/GKlib'] ; + include = [include ' -I' metis_path '/libmetis'] ; end % do not attempt to compile CHOLMOD with large file support (not needed) @@ -48,21 +49,6 @@ function klu_make (metis_path) % fix the METIS 4.0.1 rename.h file if (with_cholmod) fprintf ('with CHOLMOD, CAMD, CCOLAMD, and METIS\n') ; - f = fopen ('rename.h', 'w') ; - if (f == -1) - error ('unable to create rename.h in current directory') ; - end - fprintf (f, '/* do not edit this file; generated by klu_make */\n') ; - fprintf (f, '#undef log2\n') ; - fprintf (f, '#include "%s/Lib/rename.h"\n', metis_path) ; - fprintf (f, '#undef log2\n') ; - fprintf (f, '#define log2 METIS__log2\n') ; - fprintf (f, '#include "mex.h"\n') ; - fprintf (f, '#define malloc mxMalloc\n') ; - fprintf (f, '#define free mxFree\n') ; - fprintf (f, '#define calloc mxCalloc\n') ; - fprintf (f, '#define realloc mxRealloc\n') ; - fclose (f) ; include = ['-DNSUPERNODAL -DNMODIFY -DNMATRIXOPS -DNCHECK ' include] ; else fprintf ('without CHOLMOD, CAMD, CCOLAMD, and METIS\n') ; @@ -87,8 +73,7 @@ function klu_make (metis_path) '../../AMD/Source/amd_valid' } ; colamd_src = { - '../../COLAMD/Source/colamd', ... - '../../COLAMD/Source/colamd_global' } ; + '../../COLAMD/Source/colamd' } ; if (with_cholmod) @@ -107,62 +92,71 @@ function klu_make (metis_path) '../../CAMD/Source/camd_valid' } ; ccolamd_src = { - '../../CCOLAMD/Source/ccolamd', ... - '../../CCOLAMD/Source/ccolamd_global' } ; + '../../CCOLAMD/Source/ccolamd' } ; metis_src = { - 'Lib/balance', ... - 'Lib/bucketsort', ... - 'Lib/ccgraph', ... - 'Lib/coarsen', ... - 'Lib/compress', ... - 'Lib/debug', ... - 'Lib/estmem', ... - 'Lib/fm', ... - 'Lib/fortran', ... - 'Lib/frename', ... - 'Lib/graph', ... - 'Lib/initpart', ... - 'Lib/kmetis', ... - 'Lib/kvmetis', ... - 'Lib/kwayfm', ... - 'Lib/kwayrefine', ... - 'Lib/kwayvolfm', ... - 'Lib/kwayvolrefine', ... - 'Lib/match', ... - 'Lib/mbalance2', ... - 'Lib/mbalance', ... - 'Lib/mcoarsen', ... - 'Lib/memory', ... - 'Lib/mesh', ... - 'Lib/meshpart', ... - 'Lib/mfm2', ... - 'Lib/mfm', ... - 'Lib/mincover', ... - 'Lib/minitpart2', ... - 'Lib/minitpart', ... - 'Lib/mkmetis', ... - 'Lib/mkwayfmh', ... - 'Lib/mkwayrefine', ... - 'Lib/mmatch', ... - 'Lib/mmd', ... - 'Lib/mpmetis', ... - 'Lib/mrefine2', ... - 'Lib/mrefine', ... - 'Lib/mutil', ... - 'Lib/myqsort', ... - 'Lib/ometis', ... - 'Lib/parmetis', ... - 'Lib/pmetis', ... - 'Lib/pqueue', ... - 'Lib/refine', ... - 'Lib/separator', ... - 'Lib/sfm', ... - 'Lib/srefine', ... - 'Lib/stat', ... - 'Lib/subdomains', ... - 'Lib/timing', ... - 'Lib/util' } ; + 'GKlib/b64', ... + 'GKlib/blas', ... + 'GKlib/csr', ... + 'GKlib/error', ... + 'GKlib/evaluate', ... + 'GKlib/fkvkselect', ... + 'GKlib/fs', ... + 'GKlib/getopt', ... + 'GKlib/gkregex', ... + 'GKlib/graph', ... + 'GKlib/htable', ... + 'GKlib/io', ... + 'GKlib/itemsets', ... + 'GKlib/mcore', ... + 'GKlib/memory', ... + 'GKlib/omp', ... + 'GKlib/pdb', ... + 'GKlib/pqueue', ... + 'GKlib/random', ... + 'GKlib/rw', ... + 'GKlib/seq', ... + 'GKlib/sort', ... + 'GKlib/string', ... + 'GKlib/timers', ... + 'GKlib/tokenizer', ... + 'GKlib/util', ... + 'libmetis/auxapi', ... + 'libmetis/balance', ... + 'libmetis/bucketsort', ... + 'libmetis/checkgraph', ... + 'libmetis/coarsen', ... + 'libmetis/compress', ... + 'libmetis/contig', ... + 'libmetis/debug', ... + 'libmetis/fm', ... + 'libmetis/fortran', ... + 'libmetis/frename', ... + 'libmetis/gklib', ... + 'libmetis/graph', ... + 'libmetis/initpart', ... + 'libmetis/kmetis', ... + 'libmetis/kwayfm', ... + 'libmetis/kwayrefine', ... + 'libmetis/mcutil', ... + 'libmetis/mesh', ... + 'libmetis/meshpart', ... + 'libmetis/minconn', ... + 'libmetis/mincover', ... + 'libmetis/mmd', ... + 'libmetis/ometis', ... + 'libmetis/options', ... + 'libmetis/parmetis', ... + 'libmetis/pmetis', ... + 'libmetis/refine', ... + 'libmetis/separator', ... + 'libmetis/sfm', ... + 'libmetis/srefine', ... + 'libmetis/stat', ... + 'libmetis/timing', ... + 'libmetis/util', ... + 'libmetis/wspace', ... + } ; for i = 1:length (metis_src) metis_src {i} = [metis_path '/' metis_src{i}] ; @@ -290,16 +284,30 @@ function klu_make (metis_path) end for f = source - fs = f {1} ; - slash = strfind (fs, '/') ; - if (isempty (slash)) - slash = 1 ; + ff = f {1} ; + if (isequal (ff, [metis_path '/GKlib/util'])) + % special case, since a file with the same name also exists in libmetis + copyfile ([ff '.c'], 'GKlib_util.c', 'f') ; + ff = 'GKlib_util' ; + o = 'GKlib_util' ; + elseif (isequal (ff, [metis_path '/GKlib/graph'])) + % special case, since a file with the same name also exist in libmetis + copyfile ([ff '.c'], 'GKlib_graph.c', 'f') ; + ff = 'GKlib_graph' ; + o = 'GKlib_graph' ; else - slash = slash (end) + 1 ; + slash = strfind (ff, '/') ; + if (isempty (slash)) + slash = 1 ; + else + slash = slash (end) + 1 ; + end + o = ff (slash:end) ; end - o = fs (slash:end) ; - obj = [obj ' ' o obj_extension] ; %#ok - s = sprintf ('mex %s -DDLONG -O %s -c %s.c', d, include, fs) ; + % fprintf ('%s\n', o) ; + o = [o obj_extension] ; + obj = [obj ' ' o] ; %#ok + s = sprintf ('mex %s -DDLONG -O %s -c %s.c', d, include, ff) ; kk = do_cmd (s, kk, details) ; end @@ -339,6 +347,9 @@ function klu_make (metis_path) s = ['delete ' obj] ; do_cmd (s, kk, details) ; +rmfile ('GKlib_util.c') ; +rmfile ('GKlib_graph.c') ; + fprintf ('\nKLU successfully compiled\n') ; %------------------------------------------------------------------------------- diff --git a/SuiteSparse/KLU/Makefile b/SuiteSparse/KLU/Makefile index 1ca71fd1f..85287841a 100644 --- a/SuiteSparse/KLU/Makefile +++ b/SuiteSparse/KLU/Makefile @@ -2,7 +2,8 @@ # KLU Makefile #------------------------------------------------------------------------------ -VERSION = 1.3.2 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all @@ -32,7 +33,7 @@ distclean: purge: distclean -cov: library +cov: ( cd Tcov ; $(MAKE) ) # create PDF documents for the original distribution @@ -41,14 +42,8 @@ docs: # install KLU install: - $(CP) Lib/libklu.a $(INSTALL_LIB)/libklu.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libklu.$(VERSION).a libklu.a ) - $(CP) Include/klu.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libklu*.a - chmod 644 $(INSTALL_INCLUDE)/klu.h + ( cd Lib ; $(MAKE) install ) # uninstall KLU uninstall: - $(RM) $(INSTALL_LIB)/libklu*.a - $(RM) $(INSTALL_INCLUDE)/klu.h - + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/KLU/Source/klu_dump.c b/SuiteSparse/KLU/Source/klu_dump.c index 63170bc4c..8f5590053 100644 --- a/SuiteSparse/KLU/Source/klu_dump.c +++ b/SuiteSparse/KLU/Source/klu_dump.c @@ -110,14 +110,19 @@ Int KLU_valid_LU (Int n, Int flag_test_start_ptr, Int Xip [ ], for (j = 0 ; j < n ; j++) { p1 = Xip [j] ; - p2 = Xip [j+1] ; - PRINTF (("\nColumn: %d p1: %d p2: %d\n", j, p1, p2)) ; - if (p1 > p2) + PRINTF (("\nColumn of factor: %d p1: %d ", j, p1)) ; + if (j < n-1) { - /* column pointers must be ascending */ - PRINTF (("column %d pointer bad\n", j)) ; - return (FALSE) ; + p2 = Xip [j+1] ; + PRINTF (("p2: %d ", p2)) ; + if (p1 > p2) + { + /* column pointers must be ascending */ + PRINTF (("column %d pointer bad\n", j)) ; + return (FALSE) ; + } } + PRINTF (("\n")) ; GET_POINTER (LU, Xip, Xlen, Xi, Xx, j, len) ; for (p = 0 ; p < len ; p++) { diff --git a/SuiteSparse/KLU/Tcov/Makefile b/SuiteSparse/KLU/Tcov/Makefile index f7d8d70bc..787c0a062 100644 --- a/SuiteSparse/KLU/Tcov/Makefile +++ b/SuiteSparse/KLU/Tcov/Makefile @@ -3,10 +3,15 @@ # # This test requires BTF, METIS, CHOLMOD, AMD, COLAMD, CAMD, and CCOLAMD. +TCOV=yes + default: all include ../../SuiteSparse_config/SuiteSparse_config.mk +BLAS = -lrefblas +LAPACK = -llapack + # CF = -Wall -W -Wshadow -Wmissing-prototypes -Wstrict-prototypes \ # -Wredundant-decls -Wnested-externs -Wdisabled-optimization \ # -pedantic -ansi -O3 -pg @@ -14,20 +19,17 @@ include ../../SuiteSparse_config/SuiteSparse_config.mk # for statement coverage, picky tests CF = -Wall -W -Wshadow -Wmissing-prototypes -Wstrict-prototypes \ -Wredundant-decls -Wnested-externs -Wdisabled-optimization \ - -ansi -g -ftest-coverage -fprofile-arcs -fexceptions + -ansi -g -ftest-coverage -fprofile-arcs -fexceptions \ + -fopenmp C = $(CC) $(CF) -LIB = ../../AMD/Lib/libamd.a ../../COLAMD/Lib/libcolamd.a \ - ../../CHOLMOD/Lib/libcholmod.a \ - ../../CAMD/Lib/libcamd.a ../../CCOLAMD/Lib/libccolamd.a \ - ../../metis-4.0/libmetis.a \ - ../../SuiteSparse_config/libsuitesparseconfig.a \ - $(LAPACK) $(BLAS) $(CUDART_LIB) $(CUBLAS_LIB) -lm -lrt +LDLIBS = -L../../lib -lamd -lcolamd -lcholmod -lcamd -lccolamd \ + -lmetis -lsuitesparseconfig \ + $(LAPACK) $(BLAS) $(CUDART_LIB) $(CUBLAS_LIB) -lm -lrt \ + -Wl,-rpath=$(SUITESPARSE)/lib -lstdc++ -I = -I../../SuiteSparse_config -I../../AMD/Include -I../../COLAMD/Include \ - -I../../BTF/Include -I../../CHOLMOD/Include -I../../CAMD/Include \ - -I../../CCOLAMD/Include -I../../metis-4.0/Lib -I../Include -I../User +I = -I../../include -I../Include -I../User -I../../BTF/Include all: purge libs klutest klultest - ./klultests > klultests.out @@ -40,22 +42,22 @@ valgrind: purge klutest klultest - ./coverage libs: - ( cd ../../AMD && $(MAKE) library ) - ( cd ../../COLAMD && $(MAKE) library ) - ( cd ../../CAMD && $(MAKE) library ) - ( cd ../../CCOLAMD && $(MAKE) library ) - ( cd ../../metis-4.0 && $(MAKE) ) - ( cd ../../CHOLMOD && $(MAKE) library ) - ( cd ../../SuiteSparse_config && $(MAKE) library ) + ( cd ../../SuiteSparse_config && $(MAKE) TCOV=yes) + ( cd ../../AMD && $(MAKE) library TCOV=yes) + ( cd ../../COLAMD && $(MAKE) library TCOV=yes) + ( cd ../../CAMD && $(MAKE) library TCOV=yes) + ( cd ../../CCOLAMD && $(MAKE) library TCOV=yes) + ( cd ../.. && $(MAKE) metis ) + ( cd ../../CHOLMOD && $(MAKE) library TCOV=yes) purge: distclean distclean: clean - - $(RM) klutest klultest *.c.gcov *.out *.a cov_*.c *.gcda *.gcno + - $(RM) klutest klultest *.out cov_*.c + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) - - $(RM) -r *.dSYM + - $(RM) -r $(CLEAN) INC = \ ../Include/klu.h \ @@ -143,10 +145,10 @@ $(OBJ): $(INC) $(LOBJ): $(INC) klutest: $(OBJ) klutest.c - $(C) $(I) klutest.c -o klutest $(OBJ) $(LIB) + $(C) $(I) klutest.c -o klutest $(OBJ) $(LDLIBS) klultest: $(LOBJ) klutest.c - $(C) -DDLONG $(I) klutest.c -o klultest $(LOBJ) $(LIB) + $(C) -DDLONG $(I) klutest.c -o klultest $(LOBJ) $(LDLIBS) .c.o: $(C) -c $(I) $*.c diff --git a/SuiteSparse/KLU/Tcov/coverage b/SuiteSparse/KLU/Tcov/coverage old mode 100644 new mode 100755 diff --git a/SuiteSparse/KLU/Tcov/klultests b/SuiteSparse/KLU/Tcov/klultests old mode 100644 new mode 100755 diff --git a/SuiteSparse/KLU/Tcov/klutests b/SuiteSparse/KLU/Tcov/klutests old mode 100644 new mode 100755 diff --git a/SuiteSparse/KLU/Tcov/vklultests b/SuiteSparse/KLU/Tcov/vklultests old mode 100644 new mode 100755 diff --git a/SuiteSparse/KLU/Tcov/vklutests b/SuiteSparse/KLU/Tcov/vklutests old mode 100644 new mode 100755 diff --git a/SuiteSparse/KLU/User/Makefile b/SuiteSparse/KLU/User/Makefile index 987c37f56..b01a389c7 100644 --- a/SuiteSparse/KLU/User/Makefile +++ b/SuiteSparse/KLU/User/Makefile @@ -16,11 +16,10 @@ libklu_cholmod.a: library klu_cholmod.c klu_cholmod.h distclean: purge purge: clean - - $(RM) *.o *.a + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) - - $(RM) -r *.dSYM + - $(RM) -r $(CLEAN) library: ( cd ../../AMD ; $(MAKE) library ) diff --git a/SuiteSparse/LDL/Demo/Makefile b/SuiteSparse/LDL/Demo/Makefile index 38922fbe9..e1d1d7643 100644 --- a/SuiteSparse/LDL/Demo/Makefile +++ b/SuiteSparse/LDL/Demo/Makefile @@ -6,52 +6,51 @@ default: all include ../../SuiteSparse_config/SuiteSparse_config.mk -I = -I../../SuiteSparse_config -I../Include +I = -I../../include C = $(CC) $(CF) $(I) -all: ldlsimple ldllsimple ldlmain ldllmain ldlamd ldllamd +all: library ldlsimple ldllsimple ldlmain ldllmain ldlamd ldllamd -LIB2 = ../../SuiteSparse_config/libsuitesparseconfig.a $(LIB) +LIB2 = $(LDFLAGS) -L../../lib -lldl -lamd -lsuitesparseconfig $(LDLIBS) library: - ( cd ../../SuiteSparse_config ; $(MAKE) library ) - ( cd ../../AMD ; $(MAKE) library ) ( cd ../Lib ; $(MAKE) ) + ( cd ../../SuiteSparse_config ; $(MAKE) ) + ( cd ../../AMD ; $(MAKE) ) #------------------------------------------------------------------------------- # stand-alone C programs: #------------------------------------------------------------------------------- -ldlmain: ldlmain.c library - $(C) ldlmain.c ../Lib/libldl.a -o ldlmain $(LIB2) +ldlmain: ldlmain.c + $(C) ldlmain.c -o ldlmain $(LIB2) - ./ldlmain > my_ldlmain.out - diff ldlmain.out my_ldlmain.out -ldllmain: ldlmain.c library - $(C) -DLDL_LONG ldlmain.c ../Lib/libldl.a -o ldllmain $(LIB2) +ldllmain: ldlmain.c + $(C) -DLDL_LONG ldlmain.c -o ldllmain $(LIB2) - ./ldllmain > my_ldllmain.out - diff ldlmain.out my_ldllmain.out -ldlsimple: ldlsimple.c library - $(C) ldlsimple.c ../Lib/libldl.a -o ldlsimple $(LIB2) +ldlsimple: ldlsimple.c + $(C) ldlsimple.c -o ldlsimple $(LIB2) - ./ldlsimple > my_ldlsimple.out - diff ldlsimple.out my_ldlsimple.out ldllsimple: ldlsimple.c library - $(C) $(I) -DLDL_LONG ldlsimple.c ../Lib/libldl.a -o ldllsimple $(LIB2) + $(C) $(I) -DLDL_LONG ldlsimple.c -o ldllsimple $(LIB2) - ./ldllsimple > my_ldllsimple.out - diff ldlsimple.out my_ldllsimple.out ldlamd: ldlmain.c library - - $(C) -I../../AMD/Include -DUSE_AMD \ - ldlmain.c ../../AMD/Lib/libamd.a ../Lib/libldl.a -o ldlamd $(LIB2) + - $(C) -I../../AMD/Include -DUSE_AMD ldlmain.c -o ldlamd $(LIB2) - ./ldlamd > my_ldlamd.out - diff ldlamd.out my_ldlamd.out ldllamd: ldlmain.c library - $(C) -DLDL_LONG $(I) -I../../AMD/Include -DUSE_AMD \ - ldlmain.c ../../AMD/Lib/libamd.a ../Lib/libldl.a -o ldllamd $(LIB2) + ldlmain.c -o ldllamd $(LIB2) - ./ldllamd > my_ldllamd.out - diff ldllamd.out my_ldllamd.out @@ -80,7 +79,7 @@ purge: clean - $(RM) ldlmain ldllmain ldlsimple ldllsimple ldlamd ldllamd - $(RM) my_ldlmain.out my_ldlamd.out my_ldlsimple.out my_ldllamd.out - $(RM) my_ldllsimple.out my_ldllmain.out - - $(RM) -r *.dSYM + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) diff --git a/SuiteSparse/LDL/Demo/ldlamd.out b/SuiteSparse/LDL/Demo/ldlamd.out index c9130ab5e..aa61f24b7 100644 --- a/SuiteSparse/LDL/Demo/ldlamd.out +++ b/SuiteSparse/LDL/Demo/ldlamd.out @@ -6,7 +6,7 @@ name: Dense/0 n: 0 entries: 0 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -14,7 +14,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 0 @@ -37,7 +37,7 @@ name: Dense/0 n: 0 entries: 0 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -45,7 +45,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 0 @@ -68,7 +68,7 @@ name: Dense/1 n: 1 entries: 1 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -76,7 +76,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -119,7 +119,7 @@ name: Dense/1 n: 1 entries: 2 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -127,7 +127,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -170,7 +170,7 @@ name: Dense/2 n: 2 entries: 4 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -178,7 +178,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -221,7 +221,7 @@ name: Dense/2 n: 2 entries: 5 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -229,7 +229,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -272,7 +272,7 @@ name: Dense/3 n: 3 entries: 9 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -280,7 +280,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -323,7 +323,7 @@ name: Dense/3 n: 3 entries: 11 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -331,7 +331,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -374,7 +374,7 @@ name: HB/can_24 n: 24 entries: 160 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -382,7 +382,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -425,7 +425,7 @@ name: HB/can_24 n: 24 entries: 188 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -433,7 +433,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -476,7 +476,7 @@ name: FIDAP/ex5 n: 27 entries: 279 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -484,7 +484,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -527,7 +527,7 @@ name: FIDAP/ex5 n: 27 entries: 325 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -535,7 +535,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -578,7 +578,7 @@ name: HB/bcsstk01 n: 48 entries: 400 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -586,7 +586,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -629,7 +629,7 @@ name: HB/bcsstk01 n: 48 entries: 472 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -637,7 +637,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -680,7 +680,7 @@ name: HB/bcsstm01 n: 48 entries: 24 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -688,7 +688,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -731,7 +731,7 @@ name: HB/bcsstm01 n: 48 entries: 26 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -739,7 +739,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -782,7 +782,7 @@ name: Pothen/mesh1e1 n: 48 entries: 306 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -790,7 +790,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -833,7 +833,7 @@ name: Pothen/mesh1e1 n: 48 entries: 359 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -841,7 +841,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -884,7 +884,7 @@ name: Bai/bfwb62 n: 62 entries: 342 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -892,7 +892,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -935,7 +935,7 @@ name: Bai/bfwb62 n: 62 entries: 407 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -943,7 +943,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -986,7 +986,7 @@ name: HB/bcsstk02 n: 66 entries: 4356 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -994,7 +994,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1037,7 +1037,7 @@ name: HB/bcsstk02 n: 66 entries: 5175 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1045,7 +1045,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1088,7 +1088,7 @@ name: HB/bcsstm02 n: 66 entries: 66 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1096,7 +1096,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 66 @@ -1139,7 +1139,7 @@ name: HB/bcsstm02 n: 66 entries: 72 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1147,7 +1147,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 4 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 66 diff --git a/SuiteSparse/LDL/Demo/ldllamd.out b/SuiteSparse/LDL/Demo/ldllamd.out index 7dc808d6c..4a2dceb1a 100644 --- a/SuiteSparse/LDL/Demo/ldllamd.out +++ b/SuiteSparse/LDL/Demo/ldllamd.out @@ -6,7 +6,7 @@ name: Dense/0 n: 0 entries: 0 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -14,7 +14,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 0 @@ -37,7 +37,7 @@ name: Dense/0 n: 0 entries: 0 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -45,7 +45,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 0 @@ -68,7 +68,7 @@ name: Dense/1 n: 1 entries: 1 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -76,7 +76,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -119,7 +119,7 @@ name: Dense/1 n: 1 entries: 2 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -127,7 +127,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -170,7 +170,7 @@ name: Dense/2 n: 2 entries: 4 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -178,7 +178,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -221,7 +221,7 @@ name: Dense/2 n: 2 entries: 5 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -229,7 +229,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -272,7 +272,7 @@ name: Dense/3 n: 3 entries: 9 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -280,7 +280,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -323,7 +323,7 @@ name: Dense/3 n: 3 entries: 11 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -331,7 +331,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -374,7 +374,7 @@ name: HB/can_24 n: 24 entries: 160 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -382,7 +382,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -425,7 +425,7 @@ name: HB/can_24 n: 24 entries: 188 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -433,7 +433,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -476,7 +476,7 @@ name: FIDAP/ex5 n: 27 entries: 279 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -484,7 +484,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -527,7 +527,7 @@ name: FIDAP/ex5 n: 27 entries: 325 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -535,7 +535,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -578,7 +578,7 @@ name: HB/bcsstk01 n: 48 entries: 400 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -586,7 +586,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -629,7 +629,7 @@ name: HB/bcsstk01 n: 48 entries: 472 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -637,7 +637,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -680,7 +680,7 @@ name: HB/bcsstm01 n: 48 entries: 24 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -688,7 +688,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -731,7 +731,7 @@ name: HB/bcsstm01 n: 48 entries: 26 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -739,7 +739,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -782,7 +782,7 @@ name: Pothen/mesh1e1 n: 48 entries: 306 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -790,7 +790,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -833,7 +833,7 @@ name: Pothen/mesh1e1 n: 48 entries: 359 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -841,7 +841,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -884,7 +884,7 @@ name: Bai/bfwb62 n: 62 entries: 342 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -892,7 +892,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -935,7 +935,7 @@ name: Bai/bfwb62 n: 62 entries: 407 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -943,7 +943,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -986,7 +986,7 @@ name: HB/bcsstk02 n: 66 entries: 4356 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -994,7 +994,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1037,7 +1037,7 @@ name: HB/bcsstk02 n: 66 entries: 5175 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1045,7 +1045,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1088,7 +1088,7 @@ name: HB/bcsstm02 n: 66 entries: 66 -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1096,7 +1096,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 66 @@ -1139,7 +1139,7 @@ name: HB/bcsstm02 n: 66 entries: 72 (jumbled version) -------------------------------------------------------- -AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering +AMD version 2.4.4, Feb 1, 2016: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1147,7 +1147,7 @@ AMD version 2.4.1, Oct 10, 2014: approximate minimum degree ordering size of AMD integer: 8 -AMD version 2.4.1, Oct 10, 2014, results: +AMD version 2.4.4, Feb 1, 2016, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 66 diff --git a/SuiteSparse/LDL/Doc/ChangeLog b/SuiteSparse/LDL/Doc/ChangeLog index 02cb743de..9c057cf1a 100644 --- a/SuiteSparse/LDL/Doc/ChangeLog +++ b/SuiteSparse/LDL/Doc/ChangeLog @@ -1,3 +1,16 @@ +Feb 1, 2016: version 2.2.4 + + * update to Makefiles + +Jan 30, 2016: version 2.2.3 + + * modifications to Makefiles + +Jan 1, 2016: version 2.2.2 + + * modified Makefile to create shared libraries + No change to C code except version number + Oct 10, 2014: version 2.2.1 modified MATLAB/ldl_make.m. No change to C code except version number. diff --git a/SuiteSparse/LDL/Doc/Makefile b/SuiteSparse/LDL/Doc/Makefile index 6bf561d4b..8d35ffb8a 100644 --- a/SuiteSparse/LDL/Doc/Makefile +++ b/SuiteSparse/LDL/Doc/Makefile @@ -13,10 +13,10 @@ include ../../SuiteSparse_config/SuiteSparse_config.mk distclean: purge purge: clean - - $(RM) *.dvi *.aux *.log *.bak *.bbl *.blg *.ps + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) #------------------------------------------------------------------------------- # user guide: diff --git a/SuiteSparse/LDL/Doc/ldl_userguide.pdf b/SuiteSparse/LDL/Doc/ldl_userguide.pdf index 9e2ff1b5a..f5c5fbdd8 100644 Binary files a/SuiteSparse/LDL/Doc/ldl_userguide.pdf and b/SuiteSparse/LDL/Doc/ldl_userguide.pdf differ diff --git a/SuiteSparse/LDL/Doc/ldl_userguide.tex b/SuiteSparse/LDL/Doc/ldl_userguide.tex index 07766d594..f4bf298ed 100644 --- a/SuiteSparse/LDL/Doc/ldl_userguide.tex +++ b/SuiteSparse/LDL/Doc/ldl_userguide.tex @@ -24,7 +24,7 @@ University and the SciDAC program). }} -\date{VERSION 2.2.1, Oct 10, 2014} +\date{VERSION 2.2.4, Feb 1, 2016} \maketitle @@ -508,6 +508,12 @@ \section{Using LDL in a C program} \label{C} %------------------------------------------------------------------------------- +To compile the library, do {\tt make}. To install the shared library in +/usr/local/include and /usr/local/lib, do {\tt make install}; to remove it +from there, use {\tt make uninstall}. +For alternative installation locations, see the instructions in +{\tt SuiteSparse/README.txt}. + The C-callable {\tt LDL} library consists of nine user-callable routines and one include file. diff --git a/SuiteSparse/LDL/Include/ldl.h b/SuiteSparse/LDL/Include/ldl.h index 7ac9bca24..b7478e9cf 100644 --- a/SuiteSparse/LDL/Include/ldl.h +++ b/SuiteSparse/LDL/Include/ldl.h @@ -103,10 +103,10 @@ SuiteSparse_long ldl_l_valid_matrix ( SuiteSparse_long n, /* === LDL version ========================================================== */ /* ========================================================================== */ -#define LDL_DATE "Oct 10, 2014" +#define LDL_DATE "Feb 1, 2016" #define LDL_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define LDL_MAIN_VERSION 2 #define LDL_SUB_VERSION 2 -#define LDL_SUBSUB_VERSION 1 +#define LDL_SUBSUB_VERSION 4 #define LDL_VERSION LDL_VERSION_CODE(LDL_MAIN_VERSION,LDL_SUB_VERSION) diff --git a/SuiteSparse/LDL/Lib/Makefile b/SuiteSparse/LDL/Lib/Makefile index 73d153ceb..3d0657c21 100644 --- a/SuiteSparse/LDL/Lib/Makefile +++ b/SuiteSparse/LDL/Lib/Makefile @@ -1,32 +1,72 @@ #------------------------------------------------------------------------------- -# Makefile for the LDL library +# LDL Lib/Makefile #------------------------------------------------------------------------------- -default: all +LIBRARY = libldl +VERSION = 2.2.4 +SO_VERSION = 2 + +default: library include ../../SuiteSparse_config/SuiteSparse_config.mk +# LDL depends on SuiteSparse_config +LDLIBS += -lsuitesparseconfig + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + I = -I../../SuiteSparse_config -I../Include C = $(CC) $(CF) $(I) -all: libldl.a +all: library -#------------------------------------------------------------------------------- -# the ldl library: -#------------------------------------------------------------------------------- +OBJ = ldl.o ldll.o -libldl.a: ../Source/ldl.c ../Include/ldl.h +ldl.o: ../Source/ldl.c ../Include/ldl.h $(C) -c ../Source/ldl.c -o ldl.o + +ldll.o: ../Source/ldl.c ../Include/ldl.h $(C) -DLDL_LONG -c ../Source/ldl.c -o ldll.o - $(ARCHIVE) libldl.a ldl.o ldll.o - - $(RANLIB) libldl.a + +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ distclean: purge purge: clean - - $(RM) libldl.a + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) + +# install LDL +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/ldl.h $(INSTALL_INCLUDE) + $(CP) ../Doc/ldl_userguide.pdf $(INSTALL_DOC) + $(CP) ../README.txt $(INSTALL_DOC)/LDL_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/ldl.h + chmod 644 $(INSTALL_DOC)/ldl_userguide.pdf + chmod 644 $(INSTALL_DOC)/LDL_README.txt + +# uninstall LDL +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/ldl.h + $(RM) $(INSTALL_DOC)/ldl_userguide.pdf + $(RM) $(INSTALL_DOC)/LDL_README.txt diff --git a/SuiteSparse/LDL/Makefile b/SuiteSparse/LDL/Makefile index 7bf54f135..d871035ac 100644 --- a/SuiteSparse/LDL/Makefile +++ b/SuiteSparse/LDL/Makefile @@ -2,7 +2,8 @@ # LDL Makefile #------------------------------------------------------------------------------ -VERSION = 2.2.1 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all @@ -50,14 +51,9 @@ lib: library # install LDL install: - $(CP) Lib/libldl.a $(INSTALL_LIB)/libldl.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libldl.$(VERSION).a libldl.a ) - $(CP) Include/ldl.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libldl*.a - chmod 644 $(INSTALL_INCLUDE)/ldl.h + ( cd Lib ; $(MAKE) install ) # uninstall LDL uninstall: - $(RM) $(INSTALL_LIB)/libldl*.a - $(RM) $(INSTALL_INCLUDE)/ldl.h + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/LDL/SourceWrappers/ldl.o.c b/SuiteSparse/LDL/SourceWrappers/ldl.o.c index 80f5c581c..d1a86ff6a 100644 --- a/SuiteSparse/LDL/SourceWrappers/ldl.o.c +++ b/SuiteSparse/LDL/SourceWrappers/ldl.o.c @@ -1 +1 @@ -#include <../Source/ldl.c> +#include <../Source/ldl.c> diff --git a/SuiteSparse/LDL/SourceWrappers/ldll.o.c b/SuiteSparse/LDL/SourceWrappers/ldll.o.c index 63b55c639..ec9bcbde2 100644 --- a/SuiteSparse/LDL/SourceWrappers/ldll.o.c +++ b/SuiteSparse/LDL/SourceWrappers/ldll.o.c @@ -1,2 +1,2 @@ -#define LDL_LONG -#include <../Source/ldl.c> +#define LDL_LONG +#include <../Source/ldl.c> diff --git a/SuiteSparse/MATLAB_Tools/SFMULT/sfmult.c b/SuiteSparse/MATLAB_Tools/SFMULT/sfmult.c index 34f713c87..0f96bbf78 100644 --- a/SuiteSparse/MATLAB_Tools/SFMULT/sfmult.c +++ b/SuiteSparse/MATLAB_Tools/SFMULT/sfmult.c @@ -36,12 +36,12 @@ mxArray *sfmult_yalloc // return Y { // (TO DO): guard against integer overflow mxArray *Y = mxCreateDoubleMatrix (0, 0, Ycomplex ? mxCOMPLEX : mxREAL) ; - mxFree (mxGetPr (Y)) ; - mxSetPr (Y, mxMalloc (m * n * sizeof (double))) ; + MXFREE (mxGetPr (Y)) ; + mxSetPr (Y, mxMalloc (MAX (m*n, 1) * sizeof (double))) ; if (Ycomplex) { - mxFree (mxGetPi (Y)) ; - mxSetPi (Y, mxMalloc (m * n * sizeof (double))) ; + MXFREE (mxGetPi (Y)) ; + mxSetPi (Y, mxMalloc (MAX (m*n, 1) * sizeof (double))) ; } mxSetM (Y, m) ; mxSetN (Y, n) ; diff --git a/SuiteSparse/MATLAB_Tools/SFMULT/sfmult.h b/SuiteSparse/MATLAB_Tools/SFMULT/sfmult.h index 810105d12..4dbfc19fe 100644 --- a/SuiteSparse/MATLAB_Tools/SFMULT/sfmult.h +++ b/SuiteSparse/MATLAB_Tools/SFMULT/sfmult.h @@ -16,6 +16,12 @@ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#define MXFREE(a) { \ + double *ptr ; \ + ptr = (a) ; \ + if (ptr != NULL) mxFree (ptr) ; \ +} + // ----------------------------------------------------------------------------- // primary sparse-times-full and full-times-sparse // ----------------------------------------------------------------------------- diff --git a/SuiteSparse/MATLAB_Tools/SFMULT/ssmult_transpose.c b/SuiteSparse/MATLAB_Tools/SFMULT/ssmult_transpose.c index 1ebff0d8e..7c466b9c0 100644 --- a/SuiteSparse/MATLAB_Tools/SFMULT/ssmult_transpose.c +++ b/SuiteSparse/MATLAB_Tools/SFMULT/ssmult_transpose.c @@ -38,14 +38,14 @@ mxArray *ssmult_transpose // returns C = A' or A.' cnz = MAX (anz, 1) ; C = mxCreateSparse (0, 0, 0, C_is_complex ? mxCOMPLEX : mxREAL) ; - mxFree (mxGetJc (C)) ; - mxFree (mxGetIr (C)) ; - mxFree (mxGetPr (C)) ; - mxFree (mxGetPi (C)) ; + MXFREE (mxGetJc (C)) ; + MXFREE (mxGetIr (C)) ; + MXFREE (mxGetPr (C)) ; + MXFREE (mxGetPi (C)) ; Cp = mxMalloc ((m+1) * sizeof (Int)) ; - Ci = mxMalloc (cnz * sizeof (Int)) ; - Cx = mxMalloc (cnz * sizeof (double)) ; - Cz = C_is_complex ? mxMalloc (cnz * sizeof (double)) : NULL ; + Ci = mxMalloc (MAX (cnz,1) * sizeof (Int)) ; + Cx = mxMalloc (MAX (cnz,1) * sizeof (double)) ; + Cz = C_is_complex ? mxMalloc (MAX (cnz,1) * sizeof (double)) : NULL ; mxSetJc (C, Cp) ; mxSetIr (C, Ci) ; mxSetPr (C, Cx) ; @@ -58,7 +58,7 @@ mxArray *ssmult_transpose // returns C = A' or A.' // allocate workspace //-------------------------------------------------------------------------- - W = mxCalloc (m, sizeof (Int)) ; + W = mxCalloc (MAX (m,1), sizeof (Int)) ; //-------------------------------------------------------------------------- // compute row counts @@ -135,6 +135,6 @@ mxArray *ssmult_transpose // returns C = A' or A.' // free workspace and return result //-------------------------------------------------------------------------- - mxFree (W) ; + MXFREE (W) ; return (C) ; } diff --git a/SuiteSparse/MATLAB_Tools/SSMULT/ssmult.h b/SuiteSparse/MATLAB_Tools/SSMULT/ssmult.h index 8ff3c0758..090aac517 100644 --- a/SuiteSparse/MATLAB_Tools/SSMULT/ssmult.h +++ b/SuiteSparse/MATLAB_Tools/SSMULT/ssmult.h @@ -22,6 +22,12 @@ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define MXFREE(a) { \ + void *ptr ; \ + ptr = (void *) (a) ; \ + if (ptr != NULL) mxFree (ptr) ; \ +} + mxArray *ssmult_transpose /* returns C = A' or A.' */ ( const mxArray *A, diff --git a/SuiteSparse/MATLAB_Tools/SSMULT/ssmult_dot.c b/SuiteSparse/MATLAB_Tools/SSMULT/ssmult_dot.c index d7d772360..62fbe2f50 100644 --- a/SuiteSparse/MATLAB_Tools/SSMULT/ssmult_dot.c +++ b/SuiteSparse/MATLAB_Tools/SSMULT/ssmult_dot.c @@ -234,12 +234,12 @@ mxArray *ssmult_dot /* returns C = A'*B */ cnz = MAX (cnz, 1) ; C = mxCreateSparse (0, 0, 0, C_is_complex ? mxCOMPLEX : mxREAL) ; - mxFree (mxGetJc (C)) ; - mxFree (mxGetIr (C)) ; - mxFree (mxGetPr (C)) ; - mxFree (mxGetPi (C)) ; + MXFREE (mxGetJc (C)) ; + MXFREE (mxGetIr (C)) ; + MXFREE (mxGetPr (C)) ; + MXFREE (mxGetPi (C)) ; Cp = mxMalloc ((k + 1) * sizeof (Int)) ; - Ci = mxMalloc (cnz * sizeof (Int)) ; + Ci = mxMalloc (MAX (cnz,1) * sizeof (Int)) ; mxSetJc (C, (mwIndex *) Cp) ; mxSetIr (C, (mwIndex *) Ci) ; mxSetM (C, n) ; diff --git a/SuiteSparse/MATLAB_Tools/SSMULT/ssmult_saxpy.c b/SuiteSparse/MATLAB_Tools/SSMULT/ssmult_saxpy.c index 940af89cd..87cb41887 100644 --- a/SuiteSparse/MATLAB_Tools/SSMULT/ssmult_saxpy.c +++ b/SuiteSparse/MATLAB_Tools/SSMULT/ssmult_saxpy.c @@ -430,7 +430,7 @@ mxArray *ssmult_saxpy /* return C = A*B */ /* free workspace */ /* ---------------------------------------------------------------------- */ - mxFree (Flag) ; + MXFREE (Flag) ; /* ---------------------------------------------------------------------- */ /* convert C to real if Cz is all zero */ @@ -439,7 +439,7 @@ mxArray *ssmult_saxpy /* return C = A*B */ if (C_is_complex && zallzero) { C_is_complex = 0 ; - mxFree (Cz) ; + MXFREE (Cz) ; Cz = NULL ; } @@ -528,10 +528,10 @@ mxArray *ssmult_saxpy /* return C = A*B */ */ C = mxCreateSparse (0, 0, 0, C_is_complex ? mxCOMPLEX : mxREAL) ; - mxFree (mxGetJc (C)) ; - mxFree (mxGetIr (C)) ; - mxFree (mxGetPr (C)) ; - mxFree (mxGetPi (C)) ; + MXFREE (mxGetJc (C)) ; + MXFREE (mxGetIr (C)) ; + MXFREE (mxGetPr (C)) ; + MXFREE (mxGetPi (C)) ; mxSetJc (C, (mwIndex *) Cp) ; mxSetIr (C, (mwIndex *) Ci) ; mxSetPr (C, Cx) ; diff --git a/SuiteSparse/MATLAB_Tools/UFcollection/Doc/ChangeLog b/SuiteSparse/MATLAB_Tools/UFcollection/Doc/ChangeLog index b24cdb321..6d31d98af 100644 --- a/SuiteSparse/MATLAB_Tools/UFcollection/Doc/ChangeLog +++ b/SuiteSparse/MATLAB_Tools/UFcollection/Doc/ChangeLog @@ -1,3 +1,8 @@ +June 3, 2015: + + * correction in SuiteSparse 4.4.5 to UFindex.m, introduced a typo in + UFindex.m in SuiteSparse 4.3.0. + Jun 20, 2012: verison 1.6.2 * minor update for Windows (removed filesep) diff --git a/SuiteSparse/MATLAB_Tools/UFcollection/UFindex.m b/SuiteSparse/MATLAB_Tools/UFcollection/UFindex.m index ff5aec38f..1ef48213e 100644 --- a/SuiteSparse/MATLAB_Tools/UFcollection/UFindex.m +++ b/SuiteSparse/MATLAB_Tools/UFcollection/UFindex.m @@ -42,6 +42,12 @@ % posdef 1 if positive definite, 0 otherwise % isND 1 if a 2D/3D problem, 0 otherwise % isGraph 1 if a graph, 0 otherwise +% lowerbandwidth lower bandwidth, [i j]=find(A), max(0,max(i-j)) +% upperbandwidth upper bandwidth, [i j]=find(A), max(0,max(j-i)) +% rcm_lowerbandwidth lower bandwidth after symrcm +% rcm_upperbandwidth upper bandwidth after symrcm +% xmin smallest nonzero value +% xmax largest nonzero value % % If the statistic is intentionally not computed, it is set to -2. Some % statistics are not computed for rectangular or structurally singular @@ -154,6 +160,8 @@ UF_Index.upperbandwidth = nothing ; UF_Index.rcm_lowerbandwidth = nothing ; UF_Index.rcm_upperbandwidth = nothing ; + UF_Index.xmin = nothing ; + UF_Index.xmax = nothing ; else @@ -189,10 +197,12 @@ UF_Index.ncc = [UF_Index.ncc nothing] ; UF_Index.isND = [UF_Index.isND nothing] ; UF_Index.isGraph = [UF_Index.isGraph nothing] ; - UF_Index.lowerbandwidth = [UF_Index.lowerbandwidth nothing ; - UF_Index.upperbandwidth = [UF_Index.upperbandwidth nothing ; - UF_Index.rcm_lowerbandwidth = [UF_Index.rcm_upperbandwidth nothing ; - UF_Index.rcm_upperbandwidth = [UF_Index.rcm_upperbandwidth nothing ; + UF_Index.lowerbandwidth = [UF_Index.lowerbandwidth nothing] ; + UF_Index.upperbandwidth = [UF_Index.upperbandwidth nothing] ; + UF_Index.rcm_lowerbandwidth = [UF_Index.rcm_upperbandwidth nothing]; + UF_Index.rcm_upperbandwidth = [UF_Index.rcm_upperbandwidth nothing]; + UF_Index.xmin = [UF_Index.xmin nothing] ; + UF_Index.xmax = [UF_Index.xmax nothing] ; end end end @@ -362,6 +372,8 @@ UF_Index.upperbandwidth (id) = stats.upperbandwidth ; UF_Index.rcm_lowerbandwidth (id) = stats.rcm_lowerbandwidth ; UF_Index.rcm_upperbandwidth (id) = stats.rcm_upperbandwidth ; + UF_Index.xmin (id) = stats.xmin ; + UF_Index.xmax (id) = stats.xmax ; %--------------------------------------------------------------------------- % clear the problem and save the index and UFstats.csv diff --git a/SuiteSparse/MATLAB_Tools/UFcollection/UFstats.m b/SuiteSparse/MATLAB_Tools/UFcollection/UFstats.m index 541834b70..058d1d55e 100644 --- a/SuiteSparse/MATLAB_Tools/UFcollection/UFstats.m +++ b/SuiteSparse/MATLAB_Tools/UFcollection/UFstats.m @@ -36,6 +36,8 @@ % upperbandwidth upper bandwidth, [i j]=find(A), max(0,max(j-i)) % rcm_lowerbandwidth lower bandwidth after symrcm % rcm_upperbandwidth upper bandwidth after symrcm +% xmin smallest nonzero value +% xmax largest nonzero value % % amd_lnz and amd_flops are not computed for rectangular matrices. % @@ -179,6 +181,7 @@ fprintf ('rcm: lo %d up %d', ... stats.rcm_lowerbandwidth, stats.rcm_upperbandwidth) ; end +fprintf ('\n') ; clear AZ i j p %------------------------------------------------------------------------------- @@ -439,5 +442,19 @@ fprintf ('nblocks %d\n', stats.nblocks) ; fprintf ('sprank %d, time: %g\n', stats.sprank, toc) ; -fprintf ('UFstats done\n') ; +%------------------------------------------------------------------------------- +% xmin and xmax +%------------------------------------------------------------------------------- + +[i,j,x] = find (A) ; +stats.xmin = min (x) ; +stats.xmax = max (x) ; +fprintf ('xmin %32.16g xmax %32.16g\n', stats.xmin, stats.xmax) ; +if (stats.xmin == 0 || stats.xmax == 0) + error ('explicit zeros in the matrix!') ; +end + +%------------------------------------------------------------------------------- + +fprintf ('UFstats done\n') ; diff --git a/SuiteSparse/MATLAB_Tools/hprintf.m b/SuiteSparse/MATLAB_Tools/hprintf.m index fb542aa7f..65706a895 100644 --- a/SuiteSparse/MATLAB_Tools/hprintf.m +++ b/SuiteSparse/MATLAB_Tools/hprintf.m @@ -1,88 +1,88 @@ -function count = hprintf (varargin) -%HPRINTF fprintf with hypertext links not highlighted in the command window. -% hprintf does this by replacing the string "href=" with "HREF=". If the file -% descriptor is not present, the output defaults to the command window, just -% like fprintf. Note that all browsers accept either href= or HREF=, so your -% hypertext links will not be affected except within the MATLAB Command Window. -% General usage is identical to fprintf: -% -% hprintf (format, arg1, arg2, ...) -% hprintf (fid, format, arg1, arg2, ...) -% count = hprintf ( ... same as above ... ) -% -% Example: -% fprintf ('MathWorks\n') ; -% fprintf ('%d\n', 42) ; -% hprintf ('MathWorks\n') ; -% hprintf ('%d\n', 42) ; -% -% For a discussion, see Kristin's blog and the comments there at -% http://blogs.mathworks.com/desktop/2007/07/09 -% (Kristin's blog). -% -% NOTE: the examples above are modified by "help hprintf" so that you cannot -% see the HREF= text. To see the examples properly (without hypertext -% highlighting) use: -% -% edit hprintf -% -% To try the examples above, use hprintf with no inputs (note that this usage -% of hprintf also flags an error, to exactly mimic the fprintf behavior): -% -% hprintf -% -% Here is a slightly more complex example that has the advantage of being -% printed properly by "help hprintf": -% -% % a string template with hypertext contents: -% str = 'MathWorks\n' ; -% % made into an active hypertext, which will be underlined when -% % displayed in the command window: -% hstr = strrep (str, 'AREF', 'href') ; -% fprintf (hstr) ; -% % displays: 'MathWorks' -% hprintf (hstr) ; -% % displays: 'MathWorks' -% -% See also fprintf, strrep, sprintf. - -% Copyright 2007, T. Davis, with thanks to 'us' (us at neurol dot unizh dot ch) -% for suggestions. - -% Aug 25, 2007 - -if (nargin < 1) - - % try hprintf - help hprintf - fprintf ('\nhypertext highlighting with fprintf:\n\n') ; - fprintf ('MathWorks\n') ; - fprintf ('%d\n', 42) ; - fprintf ('\nhypertext highlighting turned off with hprintf:\n\n') ; - hprintf ('MathWorks\n') ; - hprintf ('%d\n\n', 42) ; - - % flag an error, to mimic fprintf behavior - error ('Not enough input arguments') ; - -elseif (nargout > 1) - - % mimic fprintf - error ('Too many output arguments') ; - -else - - if (ischar (varargin {1})) - % mimic fprintf ('hello world %d\n', 42), with no file ID - cnt = fprintf (strrep (sprintf (varargin {:}), 'href=', 'HREF=')) ; - else - % mimic fprintf (fid, 'hello world %d\n', 42), with file ID given - cnt = fprintf (varargin {1}, ... - strrep (sprintf (varargin {2:end}), 'href=', 'HREF=')) ; - end - if (nargout > 0) - % return the fprintf output - count = cnt ; - end -end - +function count = hprintf (varargin) +%HPRINTF fprintf with hypertext links not highlighted in the command window. +% hprintf does this by replacing the string "href=" with "HREF=". If the file +% descriptor is not present, the output defaults to the command window, just +% like fprintf. Note that all browsers accept either href= or HREF=, so your +% hypertext links will not be affected except within the MATLAB Command Window. +% General usage is identical to fprintf: +% +% hprintf (format, arg1, arg2, ...) +% hprintf (fid, format, arg1, arg2, ...) +% count = hprintf ( ... same as above ... ) +% +% Example: +% fprintf ('MathWorks\n') ; +% fprintf ('%d\n', 42) ; +% hprintf ('MathWorks\n') ; +% hprintf ('%d\n', 42) ; +% +% For a discussion, see Kristin's blog and the comments there at +% http://blogs.mathworks.com/desktop/2007/07/09 +% (Kristin's blog). +% +% NOTE: the examples above are modified by "help hprintf" so that you cannot +% see the HREF= text. To see the examples properly (without hypertext +% highlighting) use: +% +% edit hprintf +% +% To try the examples above, use hprintf with no inputs (note that this usage +% of hprintf also flags an error, to exactly mimic the fprintf behavior): +% +% hprintf +% +% Here is a slightly more complex example that has the advantage of being +% printed properly by "help hprintf": +% +% % a string template with hypertext contents: +% str = 'MathWorks\n' ; +% % made into an active hypertext, which will be underlined when +% % displayed in the command window: +% hstr = strrep (str, 'AREF', 'href') ; +% fprintf (hstr) ; +% % displays: 'MathWorks' +% hprintf (hstr) ; +% % displays: 'MathWorks' +% +% See also fprintf, strrep, sprintf. + +% Copyright 2007, T. Davis, with thanks to 'us' (us at neurol dot unizh dot ch) +% for suggestions. + +% Aug 25, 2007 + +if (nargin < 1) + + % try hprintf + help hprintf + fprintf ('\nhypertext highlighting with fprintf:\n\n') ; + fprintf ('MathWorks\n') ; + fprintf ('%d\n', 42) ; + fprintf ('\nhypertext highlighting turned off with hprintf:\n\n') ; + hprintf ('MathWorks\n') ; + hprintf ('%d\n\n', 42) ; + + % flag an error, to mimic fprintf behavior + error ('Not enough input arguments') ; + +elseif (nargout > 1) + + % mimic fprintf + error ('Too many output arguments') ; + +else + + if (ischar (varargin {1})) + % mimic fprintf ('hello world %d\n', 42), with no file ID + cnt = fprintf (strrep (sprintf (varargin {:}), 'href=', 'HREF=')) ; + else + % mimic fprintf (fid, 'hello world %d\n', 42), with file ID given + cnt = fprintf (varargin {1}, ... + strrep (sprintf (varargin {2:end}), 'href=', 'HREF=')) ; + end + if (nargout > 0) + % return the fprintf output + count = cnt ; + end +end + diff --git a/SuiteSparse/MATLAB_Tools/spqr_rank/SJget/mat/SJ_Index.mat b/SuiteSparse/MATLAB_Tools/spqr_rank/SJget/mat/SJ_Index.mat index 6e83d14b9..817c8d17b 100644 Binary files a/SuiteSparse/MATLAB_Tools/spqr_rank/SJget/mat/SJ_Index.mat and b/SuiteSparse/MATLAB_Tools/spqr_rank/SJget/mat/SJ_Index.mat differ diff --git a/SuiteSparse/Makefile b/SuiteSparse/Makefile index e47f7928b..9bd7bf67a 100644 --- a/SuiteSparse/Makefile +++ b/SuiteSparse/Makefile @@ -2,24 +2,27 @@ # Makefile for all SuiteSparse packages #------------------------------------------------------------------------------- +SUITESPARSE = $(CURDIR) +export SUITESPARSE + +default: go + include SuiteSparse_config/SuiteSparse_config.mk # Compile the default rules for each package -default: - ( cd SuiteSparse_config/xerbla && $(MAKE) ) +go: metis ( cd SuiteSparse_config && $(MAKE) ) - - ( cd metis-4.0 && $(MAKE) ) ( cd AMD && $(MAKE) ) - ( cd CAMD && $(MAKE) ) - ( cd COLAMD && $(MAKE) ) ( cd BTF && $(MAKE) ) - ( cd KLU && $(MAKE) ) - ( cd LDL && $(MAKE) ) + ( cd CAMD && $(MAKE) ) ( cd CCOLAMD && $(MAKE) ) - ( cd UMFPACK && $(MAKE) ) + ( cd COLAMD && $(MAKE) ) ( cd CHOLMOD && $(MAKE) ) ( cd CSparse && $(MAKE) ) ( cd CXSparse && $(MAKE) ) + ( cd LDL && $(MAKE) ) + ( cd KLU && $(MAKE) ) + ( cd UMFPACK && $(MAKE) ) ( cd RBio && $(MAKE) ) ifneq ($(GPU_CONFIG),) ( cd SuiteSparse_GPURuntime && $(MAKE) ) @@ -31,30 +34,47 @@ endif # install all packages in /usr/local/lib and /usr/local/include # (note that CSparse is not installed; CXSparse is installed instead) -install: +install: metis ( cd SuiteSparse_config && $(MAKE) install ) ( cd AMD && $(MAKE) install ) - ( cd CAMD && $(MAKE) install ) - ( cd COLAMD && $(MAKE) install ) ( cd BTF && $(MAKE) install ) - ( cd KLU && $(MAKE) install ) - ( cd LDL && $(MAKE) install ) + ( cd CAMD && $(MAKE) install ) ( cd CCOLAMD && $(MAKE) install ) - ( cd UMFPACK && $(MAKE) install ) + ( cd COLAMD && $(MAKE) install ) ( cd CHOLMOD && $(MAKE) install ) ( cd CXSparse && $(MAKE) install ) + ( cd LDL && $(MAKE) install ) + ( cd KLU && $(MAKE) install ) + ( cd UMFPACK && $(MAKE) install ) ( cd RBio && $(MAKE) install ) -ifneq ($(GPU_CONFIG),) +ifneq (,$(GPU_CONFIG)) ( cd SuiteSparse_GPURuntime && $(MAKE) install ) ( cd GPUQREngine && $(MAKE) install ) endif ( cd SPQR && $(MAKE) install ) # ( cd PIRO_BAND && $(MAKE) install ) # ( cd SKYLINE_SVD && $(MAKE) install ) + $(CP) README.txt $(INSTALL_DOC)/SuiteSparse_README.txt + chmod 644 $(INSTALL_DOC)/SuiteSparse_README.txt +ifeq (,$(MY_METIS_LIB)) + # install METIS from SuiteSparse/metis-5.1.0 + - $(CP) lib/libmetis.* $(INSTALL_LIB) + - $(CP) metis-5.1.0/manual/manual.pdf $(INSTALL_DOC)/METIS_manual.pdf + - $(CP) metis-5.1.0/README.txt $(INSTALL_DOC)/METIS_README.txt + # the following is needed only on the Mac, so *.dylib is hardcoded: + $(SO_INSTALL_NAME) $(INSTALL_LIB)/libmetis.dylib $(INSTALL_LIB)/libmetis.dylib + - $(CP) include/metis.h $(INSTALL_INCLUDE) + chmod 755 $(INSTALL_LIB)/libmetis.* + chmod 644 $(INSTALL_INCLUDE)/metis.h + chmod 644 $(INSTALL_DOC)/METIS_manual.pdf + chmod 644 $(INSTALL_DOC)/METIS_README.txt +endif # uninstall all packages uninstall: + $(RM) $(INSTALL_DOC)/SuiteSparse_README.txt ( cd SuiteSparse_config && $(MAKE) uninstall ) + - ( cd metis-5.1.0 && $(MAKE) uninstall ) ( cd AMD && $(MAKE) uninstall ) ( cd CAMD && $(MAKE) uninstall ) ( cd COLAMD && $(MAKE) uninstall ) @@ -64,6 +84,7 @@ uninstall: ( cd CCOLAMD && $(MAKE) uninstall ) ( cd UMFPACK && $(MAKE) uninstall ) ( cd CHOLMOD && $(MAKE) uninstall ) + ( cd CSparse && $(MAKE) uninstall ) ( cd CXSparse && $(MAKE) uninstall ) ( cd RBio && $(MAKE) uninstall ) ( cd SuiteSparse_GPURuntime && $(MAKE) uninstall ) @@ -71,11 +92,17 @@ uninstall: ( cd SPQR && $(MAKE) uninstall ) # ( cd PIRO_BAND && $(MAKE) uninstall ) # ( cd SKYLINE_SVD && $(MAKE) uninstall ) +ifeq (,$(MY_METIS_LIB)) + # uninstall METIS, which came from SuiteSparse/metis-5.1.0 + $(RM) $(INSTALL_LIB)/libmetis.* + $(RM) $(INSTALL_INCLUDE)/metis.h + $(RM) $(INSTALL_DOC)/METIS_manual.pdf + $(RM) $(INSTALL_DOC)/METIS_README.txt +endif + $(RM) -r $(INSTALL_DOC) -library: - ( cd SuiteSparse_config/xerbla && $(MAKE) ) +library: metis ( cd SuiteSparse_config && $(MAKE) ) - - ( cd metis-4.0 && $(MAKE) ) ( cd AMD && $(MAKE) library ) ( cd BTF && $(MAKE) library ) ( cd CAMD && $(MAKE) library ) @@ -88,7 +115,7 @@ library: ( cd CSparse && $(MAKE) library ) ( cd CXSparse && $(MAKE) library ) ( cd RBio && $(MAKE) library ) -ifneq ($(GPU_CONFIG),) +ifneq (,$(GPU_CONFIG)) ( cd SuiteSparse_GPURuntime && $(MAKE) library ) ( cd GPUQREngine && $(MAKE) library ) endif @@ -98,9 +125,8 @@ endif # Remove all files not in the original distribution purge: - - ( cd SuiteSparse_config/xerbla && $(MAKE) purge ) - ( cd SuiteSparse_config && $(MAKE) purge ) - - ( cd metis-4.0 && $(MAKE) realclean ) + - ( cd metis-5.1.0 && $(MAKE) distclean ) - ( cd AMD && $(MAKE) purge ) - ( cd CAMD && $(MAKE) purge ) - ( cd COLAMD && $(MAKE) purge ) @@ -121,12 +147,12 @@ purge: # - ( cd PIRO_BAND && $(MAKE) purge ) # - ( cd SKYLINE_SVD && $(MAKE) purge ) - $(RM) MATLAB_Tools/*/*.mex* MATLAB_Tools/spok/private/*.mex* + - $(RM) -r include/* bin/* lib/* share/* # Remove all files not in the original distribution, but keep the libraries clean: - - ( cd SuiteSparse_config/xerbla && $(MAKE) clean ) - ( cd SuiteSparse_config && $(MAKE) clean ) - - ( cd metis-4.0 && $(MAKE) clean ) + - ( cd metis-5.1.0 && $(MAKE) clean ) - ( cd AMD && $(MAKE) clean ) - ( cd CAMD && $(MAKE) clean ) - ( cd COLAMD && $(MAKE) clean ) @@ -163,6 +189,7 @@ distclean: purge # Note that the CXSparse directory should initially not exist. cx: ( cd CSparse ; $(MAKE) purge ) + ( cd SuiteSparse_config && $(MAKE) ) ( cd CXSparse_newfiles ; tar cfv - * | gzip -9 > ../CXSparse_newfiles.tar.gz ) ./CSparse_to_CXSparse CSparse CXSparse CXSparse_newfiles.tar.gz ( cd CXSparse/Demo ; $(MAKE) ) @@ -171,14 +198,32 @@ cx: $(RM) -f CXSparse_newfiles.tar.gz # statement coverage (Linux only); this requires a lot of time. -# The umfpack tcov requires a lot of disk space -cov: +# The umfpack tcov requires a lot of disk space in /tmp +cov: purge ( cd CXSparse && $(MAKE) cov ) ( cd CSparse && $(MAKE) cov ) - ( cd KLU && $(MAKE) cov ) ( cd CHOLMOD && $(MAKE) cov ) + ( cd KLU && $(MAKE) cov ) ( cd SPQR && $(MAKE) cov ) ( cd UMFPACK && $(MAKE) cov ) # ( cd PIRO_BAND && $(MAKE) cov ) # ( cd SKYLINE_SVD && $(MAKE) cov ) +# configure and compile METIS, placing the libmetis.* library in +# SuiteSparse/lib and the metis.h include file in SuiteSparse/include. +metis: include/metis.h + +# Install the shared version of METIS in SuiteSparse/lib. +# The SO_INSTALL_NAME commmand is only needed on the Mac, so *.dylib is +# hardcoded below. +include/metis.h: +ifeq (,$(MY_METIS_LIB)) + - ( cd metis-5.1.0 && $(MAKE) config shared=1 prefix=$(SUITESPARSE) ) + - ( cd metis-5.1.0 && $(MAKE) ) + - ( cd metis-5.1.0 && $(MAKE) install ) + - $(SO_INSTALL_NAME) $(SUITESPARSE)/lib/libmetis.dylib \ + $(SUITESPARSE)/lib/libmetis.dylib +else + @echo 'Using pre-installed METIS 5.1.0 library at ' '[$(MY_METIS_LIB)]' +endif + diff --git a/SuiteSparse/README.txt b/SuiteSparse/README.txt index 8b5f56192..ad94378b6 100644 --- a/SuiteSparse/README.txt +++ b/SuiteSparse/README.txt @@ -1,159 +1,291 @@ SuiteSparse: A Suite of Sparse matrix packages at http://www.suitesparse.com -March 24, 2015. SuiteSparse VERSION 4.4.4 +Feb 1, 2016. SuiteSparse VERSION 4.5.1 ------------------ SuiteSparse/README ------------------ ================================================================================ -QUICK START FOR MATLAB USERS (Linux, Mac, or Windows): uncompress the -SuiteSparse.zip or SuiteSparse.tar.gz archive file (they contain the same -thing), then in the MATLAB Command Window, cd to the SuiteSparse directory and -type SuiteSparse_install. All packages will be compiled, and several demos -will be run. - -QUICK START FOR LINUX: Just type 'make' in this directory. Then do -'sudo make install' if you want to install the libraries and include files -in /usr/local. - -QUICK START FOR MAC: Delete the SuiteSparse_config/SuiteSparse_config.mk -file, and then remove "_Mac" from the *Mac.mk file in that directory. Then -continue as the 'QUICK START FOR LINUX' above. - -QUICK START FOR GPU: Delete the SuiteSparse_config/SuiteSparse_config.mk -file, and then remove "_GPU" from the *GPU.mk file in that directory. -Locate and modify CUDA library and include paths in the *.mk file. -Then continue as the 'QUICK START FOR LINUX' above. +Packages in SuiteSparse, and files in this directory: ================================================================================ + AMD approximate minimum degree ordering. This is the built-in AMD + function in MATLAB. - spqr_rank MATLAB toolbox for rank deficient sparse matrices: null spaces, - reliable factorizations, etc. With Leslie Foster, San Jose - State Univ. + bin where the metis-5.1.0 programs are placed when METIS is compiled - AMD approximate minimum degree ordering + BTF permutation to block triangular form CAMD constrained approximate minimum degree ordering - COLAMD column approximate minimum degree ordering - CCOLAMD constrained column approximate minimum degree ordering - BTF permutation to block triangular form - - KLU sparse LU factorization, primarily for circuit simulation. - Requires AMD, COLAMD, and BTF. Optionally uses CHOLMOD, - CAMD, CCOLAMD, and METIS. - - UMFPACK sparse LU factorization. Requires AMD and the BLAS. + ChangeLog a summary of changes to SuiteSparse. See */Doc/ChangeLog + for details for each package. CHOLMOD sparse Cholesky factorization. Requires AMD, COLAMD, CCOLAMD, - the BLAS, and LAPACK. Optionally uses METIS. + the BLAS, and LAPACK. Optionally uses METIS. This is chol and + x=A\b in MATLAB. - SuiteSparse_config configuration file for all the above packages. The - SuiteSparse_config/SuiteSparse_config.mk is included in the - Makefile's of all packages. CSparse and MATLAB_Tools do not - use SuiteSparse_config. Prior to SuiteSparse Version 4.0.0, - this configuration directory was called 'UFconfig'. - Version 4.0.0 and later use SuiteSparse_config instead, - which is upward compatible with UFconfig. + COLAMD column approximate minimum degree ordering. This is the + built-in COLAMD function in MATLAB. + + Contents.m a list of contents for 'help SuiteSparse' in MATLAB. CSparse a concise sparse matrix package, developed for my book, "Direct Methods for Sparse Linear Systems", published by SIAM. Intended primarily for teaching. + It does have a 'make install' but I recommend using + CXSparse instead. In particular, both CSparse and CXSparse + have the same include filename: cs.h. + + This package is used for the built-in DMPERM in MATLAB. + + CSparse_to_CXSparse + a Perl script to create CXSparse from CSparse and + CXSparse_newfiles CXSparse CSparse Extended. Includes support for complex matrices and both int or long integers. Use this instead of CSparse - for production use. + for production use; it creates a libcsparse.so (or *dylib on + the Mac) with the same name as CSparse. It is a superset + of CSparse. Any code that links against CSparse should + also be able to link against CXSparse instead. - RBio read/write sparse matrices in Rutherford/Boeing format + CXSparse_newfiles + Files unique to CXSparse + + doc 'make' places documentation for each package here - UFcollection toolbox for managing the UF Sparse Matrix Collection + GPUQREngine GPU support package for SPQR (not built into MATLAB, however) - LPDASA LP dual active set algorithm (to appear) + include 'make' places user-visible include fomes for each package here - MESHND 2D and 3D mesh generation and nested dissection ordering + KLU sparse LU factorization, primarily for circuit simulation. + Requires AMD, COLAMD, and BTF. Optionally uses CHOLMOD, + CAMD, CCOLAMD, and METIS. + + LDL a very concise LDL' factorization package + + lib 'make' places shared libraries for each package here + + Makefile to compile all of SuiteSparse: + make compiles SuiteSparse libraries and runs demos + make install compiles SuiteSparse and installs in /usr/local + make uninstall undoes 'make install' + make library compiles SuiteSparse libraries (not demos) + make distclean removes all files not in distribution, including + ./bin, ./doc, ./lib, and ./include. + make purge same as 'make distclean' + make clean removes all files not in distribution, but + keeps compiled libraries and demoes, ./lib, + ./doc, and ./include. + make config displays parameter settings; does not compile + + Each individual package also has each of the above 'make' + targets. Doing 'make config' in each package */Lib directory + displays the exact shared and static library names. + + Things you don't need to do: + make cx creates CXSparse from CSparse + make docs creates user guides from LaTeX files + make cov runs statement coverage tests (Linux only) + make metis compiles METIS (also done by 'make') + + MATLAB_Tools various m-files for use in MATLAB + + Contents.m list of contents + dimacs10 loads matrices for DIMACS10 collection + Factorize object-oriented x=A\b for MATLAB + find_components finds connected components in an image + GEE simple Gaussian elimination + getversion.m determine MATLAB version + gipper.m create MATLAB archive + hprintf.m print hyperlinks in command window + LINFACTOR predecessor to Factorize package + MESHND nested dissection ordering of regular meshes + pagerankdemo.m illustrates how PageRank works + SFMULT C=S*F where S is sparse and F is full + shellgui display a seashell + sparseinv sparse inverse subset + spok check if a sparse matrix is valid + spqr_rank SPQR_RANK package. MATLAB toolbox for rank + deficient sparse matrices: null spaces, + reliable factorizations, etc. With Leslie + Foster, San Jose State Univ. + SSMULT C=A*B where A and B are both sparse + UFcollection maitains the SuiteSparse matrix collection + waitmex waitbar for use inside a mexFunction + + The SSMULT and SFMULT functions are the basis for the + built-in C=A*B functions in MATLAB. + + metis-5.1.0 a modified version of METIS. See the README.txt files for + details. - SSMULT sparse matrix multiply for MATLAB + RBio read/write sparse matrices in Rutherford/Boeing format + + README.txt this file - LINFACTOR simple m-file demonstrating how to use LU and CHOL in - MATLAB to solve Ax=b + SPQR sparse QR factorization. This the built-in qr and x=A\b in + MATLAB. - MATLAB_Tools various simple m-files for use in MATLAB + SuiteSparse_config configuration file for all the above packages. The + SuiteSparse_config/SuiteSparse_config.mk is included in the + Makefile's of all packages. CSparse and MATLAB_Tools do not + use SuiteSparse_config. - SPQR sparse QR factorization - GPUQREngine GPU support package for SPQR SuiteSparse_GPURuntime GPU support package for SPQR + (not builtin to MATLAB, however). + + SuiteSparse_install.m install SuiteSparse for MATLAB + + SuiteSparse_test.m exhaustive test for SuiteSparse in MATLAB + + UFget MATLAB interface to the SuiteSparse Matrix Collection + (formerly called the UF Sparse Matrix Collection). -Some codes optionally use METIS 4.0.1 -(http://www-users.cs.umn.edu/~karypis/metis). To use METIS, place a copy of -the metis-4.0 directory in the same directory containing this README file. -Be sure that you do not have a nested metis-4.0/metis-4.0 directory; SuiteSparse -won't find METIS if you do this, which can happen with a zip file of metis-4.0 -on Windows. The use of METIS will improve the ordering quality. + UMFPACK sparse LU factorization. Requires AMD and the BLAS. + This is the built-in lu and x=A\b in MATLAB. + +Some codes optionally use METIS 5.1.0. This package is located in SuiteSparse +in the metis-5.1.0 directory. Its use is optional, so you can remove it before +compiling SuiteSparse, if you desire. The use of METIS will improve the +ordering quality. METIS has been slightly modified for use in SuiteSparse; see +the metis-5.1.0/README.txt file for details. SuiteSparse can use the +unmodified METIS 5.1.0, however. To use your own copy of METIS, or a +pre-installed copy of METIS use 'make MY_METIS_LIB=-lmymetis' or +'make MY_METIS_LIB=/my/stuff/metis-5.1.0/whereeveritis/libmetis.so + MY_METIS_INC=/my/stuff/metis-5.1.0/include'. +If you want to use METIS in MATLAB, however, you MUST use the version provided +here, in SuiteSparse/metis-5.1.0. The MATLAB interface to METIS required some +small changes in METIS itself to get it to work. The original METIS 5.1.0 +will segfault MATLAB. Refer to each package for license, copyright, and author information. All codes are authored or co-authored by Timothy A. Davis. -email: DrTimothyAldenDavis@gmail.com +email: davis@tamu.edu + ================================================================================ -If you use SuiteSparse_install in MATLAB, stop reading here. +QUICK START FOR MATLAB USERS (Linux, Mac, or Windows): uncompress the +SuiteSparse.zip or SuiteSparse.tar.gz archive file (they contain the same +thing), then in the MATLAB Command Window, cd to the SuiteSparse directory and +type SuiteSparse_install. All packages will be compiled, and several demos +will be run. To run a (long!) exhaustive test, do SuiteSparse_test. ================================================================================ +================================================================================ +QUICK START FOR THE C/C++ LIBRARIES: Just type 'make' in this directory. All +libraries will be created and copied into SuiteSparse/lib. All include files +need by the applications that use SuiteSparse are copied into +SuiteSparse/include. All user documenation is copied into SuiteSparse/doc. +Any program that uses SuiteSparse can thus use a simpler rule as compared to +earlier versions of SuiteSparse. If you add /home/myself/SuiteSparse/lib to +your library search patch, you can do the following (for example): ----------------------------- -To use "make" in Unix/Linux: ----------------------------- + S = /home/myself/SuiteSparse + cc myprogram.c -I$(S)/include -lumfpack -lamd -lcholmod -lsuitesparseconfig -lm -(1) Use the right BLAS and LAPACK libraries +Do 'make install' if you want to install the libraries and include files in +SuiteSparse/lib and SuiteSparse/include, and the documentation in +SuiteSparse/doc/suitesparse-VERSION. +This will work on Linux/Unix and the Mac. It should automatically detect if +you have the Intel compilers or not, and whether or not you have CUDA. If this +fails, see the SuiteSparse_config/SuiteSparse_config.mk file. There are many +options that you can either list on the 'make' command line, or you can just +edit that file. For example, to compile with your own BLAS: - Edit your SuiteSparse_config/SuiteSparse_config.mk file to point to the - right compilers, and to the correct BLAS and LAPACK libraries. There are - many examples of different computer architectures there. Scroll through to - find yours, and uncomment those lines. + make BLAS=-lmyblaslibraryhere -(2) Install Intel's Threading Building Blocks (TBB) +To list all configuration options (but not compile anything), do: - This is optionally used by SuiteSparseQR. Refer to the User Guide in - SuiteSparse/SPQR/Doc/spqr_user_guide.pdf for details. + make config -(3) Configure METIS (or don't use METIS) +Any parameter you see in the output of 'make config' with an equal sign +can be modified at the 'make' command line. - If you don't download METIS, skip this step. Otherwise, - cd to metis-4.0 and edit the Makefile.in file. I recommend making these - changes to metis-4.0/Makefile.in, but this is optional. +If you do "make install" by itself, then the packages are all installed in +SuiteSparse/lib (libraries), SuiteSparse/include (include *.h files), and +SuiteSparse/doc/suitesparse-VERSION (documentation). If you want to install +elsewhere, do: - CC = gcc - OPTFLAGS = -O3 + make install INSTALL=/my/path -(4) Make other changes to SuiteSparse_config/SuiteSparse_config.mk as needed +which puts the files in /my/path/lib, /my/path/include, and /my/path/doc. +If you want to selectively put the libraries, include files, and doc files +in different locations, do: - Edit the SuiteSparse_config/SuiteSparse_config.mk file as needed. - Directions are in that file. If you have compiled SuiteSparse already - (partially or completely), then whenever you edit the - SuiteSparse_config/SuiteSparse_config.mk file, you should then type "make - purge" (or "make realclean") in this directory. + make install INSTALL_LIB=/my/libs INSTALL_INCLUDE=/myotherstuff/include INSTALL_DOC=/mydocs -(5) Type "make" in this directory. All packages will be be compiled. METIS - will be compiled if you have it. Several demos will be run. +for example. Any term not defined will be set to its default, so if you don't +want to install the documentation, but wish to install the libraries and +includes in /usr/local/lib and /usr/local/include, do: - To compile just the libraries, without running any demos, use - "make library". + make install INSTALL_DOC=/tmp/doc + +which copies the documentation to /tmp/doc where you can then remove it later. + +Both the static (*.a) and shared (*.so) libraries are compiled. The *.a +libraries are left in the package Lib folder (AMD/Lib/libamd.a for example). +The main exception to this rule is the SuiteSparse_config library, which is in +SuiteSparse/libsuiteSparseconfig.a. SuiteSparse_config is required by all +packages. The (extremely) optional xerbla library is also an exception, but it +is highly unlikely that you need that library. + +The 'make uninstall' takes the same command-line arguments. + +---------------------------------- +Step-by-step details: +---------------------------------- + +(1) Use the right BLAS and LAPACK libraries + + Determine where your BLAS and LAPACK libraries are. If the default + 'make' does not find them, use + 'make BLAS=-lmyblaslibraryhere LAPACK=-lmylapackgoeshere' - The libraries will appear in */Lib/*.a. Include files, as needed by user - programs that use CHOLMOD, AMD, CAMD, COLAMD, CCOLAMD, BTF, KLU, UMFPACK, - LDL, etc. are in */Include/*.h. +(2) Install Intel's Threading Building Blocks (TBB) + + This is optionally used by SuiteSparseQR. Refer to the User Guide in + SuiteSparse/SPQR/Doc/spqr_user_guide.pdf for details. - The METIS library is in metis-4.0/libmetis.a. METIS Include files (not - needed by the end user of SuiteSparse) are in located in metis-4.0/Lib/*.h. +(3) Determine what other command line options you need for 'make'. All options + can be set at the 'make' command line without the need to edit this file. + Browse that file to see what options you can control. If you choose + different options and wish to recompile, be sure to do 'make distclean' in + this directory first, to remove all files not in the original distribution. + +(4) Type "make" in this directory. All packages will be be compiled. METIS + 5.1.0 will be compiled if you have it (note that METIS require CMake to + build it). Several demos will be run. + + To compile just the libraries, without running any demos, use + "make library". -(6) To install, type "sudo make install". This will place copies of all - libraries in /usr/local/lib, and all include files in /usr/local/include. - You can change the install location by editting SuiteSparse_config.mk. - These directories must already exist. + The libraries will appear in */Lib/*.so.* (*.dylib for the Mac). Include + files, as needed by user programs that use CHOLMOD, AMD, CAMD, COLAMD, + CCOLAMD, BTF, KLU, UMFPACK, LDL, etc. are in */Include/*.h. The include + files required by user programs are then copied into SuiteSparse/include, + and the compiled libraries are copied into SuiteSparse/lib. Documentation + is copied into SuiteSparse/doc. + + NOTE: on Linux, you may see some errors when you compile METIS + ('make: *** No rule to make target 'w'.). You can safely ignore those + errors. + +(6) To install, type "make install". This will place copies of all + libraries in SuiteSparse/lib, and all include files in SuiteSparse/include, + and all documentation in SuiteSparse/doc/suitesparse-VERSION. You can + change the install location by "make install INSTALL=/my/path" which puts + the libraries in /my/path/lib, the include files in /my/path/include, and + documentation in /my/path/doc. These directories are created if they do + not already exist. + +(7) To uninstall, type "make uninstall", which reverses "make install" + by removing the SuiteSparse libraries, include files, and documentation + from the place they were installed. If you pass INSTALL_***= options + to 'make install', you must pass the same to 'make uninstall'. -(7) To uninstall, type "sudo make uninstall", which reverses "make install" - by removing the SuiteSparse libraries from /usr/local/lib, and the - include files from /usr/local/include. diff --git a/SuiteSparse/SPQR/Demo/Makefile b/SuiteSparse/SPQR/Demo/Makefile index 4df7c33e4..14326838e 100644 --- a/SuiteSparse/SPQR/Demo/Makefile +++ b/SuiteSparse/SPQR/Demo/Makefile @@ -8,38 +8,13 @@ ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk -#------------------------------------------------------------------------------- -# the optional Partition module requires METIS, CAMD, and CCOLAMD -I_WITH_PARTITION = -LIB_WITH_PARTITION = -CONFIG_PARTITION = -DNPARTITION -# check if METIS is requested and available -ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG))) - # METIS is requested. See if it is available - ifeq ($(METIS_PATH), $(wildcard $(METIS_PATH))) - ifeq (../../CAMD, $(wildcard ../../CAMD)) - ifeq (../../CCOLAMD, $(wildcard ../../CCOLAMD)) - # METIS, CAMD, and CCOLAMD are available - LIB_WITH_PARTITION = $(METIS) ../../CCOLAMD/Lib/libccolamd.a \ - ../../CAMD/Lib/libcamd.a - I_WITH_PARTITION = -I$(METIS_PATH)/Lib \ - -I../../CCOLAMD/Include -I../../CAMD/Include - CONFIG_PARTITION = - endif - endif - endif -endif -#------------------------------------------------------------------------------- - #------------------------------------------------------------------------------- # the optional SPQRGPU module requires CUDA, SuiteSparse_GPURuntime, GPUQREngine ifneq ($(GPU_CONFIG),) LIB_WITH_SPQRGPU = $(CUDART_LIB) $(CUBLAS_LIB) \ - ../../SuiteSparse_GPURuntime/Lib/libSuiteSparse_GPURuntime.a \ - ../../GPUQREngine/Lib/libGPUQREngine.a + -lSuiteSparse_GPURuntime -lGPUQREngine I_WITH_SPQRGPU = -I../../SuiteSparse_GPURuntime/Include \ - -I../../GPUQREngine/Include \ - -I$(CUDA_INC_PATH) + -I../../GPUQREngine/Include $(CUDA_INC) else LIB_WITH_SPQRGPU = I_WITH_SPQRGPU = @@ -47,22 +22,18 @@ endif #------------------------------------------------------------------------------- -CLIB = ../Lib/libspqr.a \ - ../../SuiteSparse_config/libsuitesparseconfig.a \ - ../../CHOLMOD/Lib/libcholmod.a ../../AMD/Lib/libamd.a \ - ../../COLAMD/Lib/libcolamd.a \ - $(LIB_WITH_PARTITION) \ - $(LIB_WITH_SPQRGPU) +CLIB = $(LDFLAGS) -L../../lib -lspqr -lsuitesparseconfig -lcholmod -lamd \ + -lcolamd $(LIB_WITH_PARTITION) $(LIB_WITH_SPQRGPU) $(LDLIBS) # use the BLAS and LAPACK defined by SuiteSparse_config.mk; do not use valgrind FLIB = $(LAPACK) $(BLAS) -V = +V = # To use Valgrind and the plain BLAS and plain LAPACK (non-optimized): # FLIB = -lgfortran -llapack_plain -lblas_plain -lg2c # V = valgrind --quiet -all: library qrdemo qrsimple qrsimplec +all: library qrdemo qrsimple qrsimplec gpu - $(V) ./qrsimple < ../Matrix/ash219.mtx - $(V) ./qrsimplec < ../Matrix/ash219.mtx - $(V) ./qrsimple < ../Matrix/west0067.mtx @@ -126,12 +97,20 @@ cdemo: qrdemoc - $(V) ./qrdemoc < ../Matrix/young1c.mtx - $(V) ./qrdemoc < ../Matrix/lp_e226_transposed.mtx -gpu: qrdemo_gpu qrdemo_gpu2 qrdemo_gpu3 +ifneq ($(GPU_CONFIG),) +GPU_DEMOS = gpu2 gpu3 gpu4 gpu1 +else +GPU_DEMOS = +endif + +gpu: $(GPU_DEMOS) + +gpu1: qrdemo_gpu - $(V) ./qrdemo_gpu ../Matrix/west0067.mtx 2 - $(V) ./qrdemo_gpu ../Matrix/lp_e226_transposed.mtx 2 - $(V) ./qrdemo_gpu ../Matrix/lp_e226_transposed.mtx 6 -gpu2: +gpu2: qrdemo_gpu2 - $(V) ./qrdemo_gpu2 ../Matrix/west0067.mtx 2 - $(V) ./qrdemo_gpu2 ../Matrix/lp_e226_transposed.mtx 2 - $(V) ./qrdemo_gpu2 ../Matrix/lp_e226_transposed.mtx 6 @@ -145,101 +124,72 @@ gpu4: qrdemo_gpu - $(V) ./qrdemo_gpu ../Matrix/Groebner_id2003_aug.mtx 6 - $(V) ./qrdemo_gpu ../Matrix/Franz6_id1959_aug.mtx 6 -../Lib/libspqr.a: +library: metis ( cd ../Lib ; $(MAKE) ) - -../../AMD/Lib/libamd.a: ( cd ../../AMD ; $(MAKE) library ) - -../../SuiteSparse_config/libsuitesparseconfig.a: ( cd ../../SuiteSparse_config ; $(MAKE) library ) - -../../CHOLMOD/Lib/libcholmod.a: - ( cd ../../CHOLMOD && $(MAKE) library ) - -../../COLAMD/Lib/libcolamd.a: - ( cd ../../COLAMD && $(MAKE) library ) - -../../CCOLAMD/Lib/libccolamd.a: - ( cd ../../CCOLAMD && $(MAKE) library ) - -../../CAMD/Lib/libcamd.a: - ( cd ../../CAMD && $(MAKE) library ) - -../../SuiteSparse_GPURuntime/Lib/libSuiteSparse_GPURuntime.a: - - ( cd ../../SuiteSparse_GPURuntime && $(MAKE) ) - -../../GPUQREngine/Lib/libGPUQREngine.a: - - ( cd ../../GPUQREngine && $(MAKE) ) - -$(METIS): - - ( cd $(METIS_PATH) && $(MAKE) ) - -library: - ( cd ../Lib ; $(MAKE) ) - ( cd ../../AMD ; $(MAKE) library ) - ( cd ../../SuiteSparse_config ; $(MAKE) library ) - - ( cd ../../CHOLMOD && $(MAKE) library ) - - ( cd ../../COLAMD && $(MAKE) library ) - - ( cd ../../CCOLAMD && $(MAKE) library ) - - ( cd ../../CAMD && $(MAKE) library ) -ifneq ($(GPU_CONFIG),) - - ( cd ../../SuiteSparse_GPURuntime && $(MAKE) ) - - ( cd ../../GPUQREngine && $(MAKE) ) -endif ifneq ($(GPU_CONFIG),) - - ( cd $(METIS_PATH) && $(MAKE) ) + - ( cd ../../SuiteSparse_GPURuntime && $(MAKE) library ) + - ( cd ../../GPUQREngine && $(MAKE) library ) endif +metis: ../../include/metis.h + +../../include/metis.h: + - ( cd ../.. && $(MAKE) metis ) + purge: distclean - - $(RM) -r *.dot pfile tfile distclean: clean - $(RM) qrdemo qrdemo_gpu qrdemoc qrsimple qrsimplec X.mtx - - $(RM) -r *.dSYM gpu_results.txt qrdemo_gpu2 qrdemo_gpu3 + - $(RM) R.mtx C.mtx E.txt gpu_results.txt qrdemo_gpu2 qrdemo_gpu3 + - $(RM) *.dot pfile tfile + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) INC = ../Include/spqr.hpp ../Include/SuiteSparseQR_C.h \ ../Include/SuiteSparseQR_definitions.h \ ../Include/SuiteSparseQR.hpp Makefile -I = -I../../CHOLMOD/Include \ - -I../../SuiteSparse_config \ - -I../Include \ - $(I_WITH_SPQRGPU) +I = -I../../include $(I_WITH_SPQRGPU) -C = $(CXX) $(CF) $(SPQR_CONFIG) $(CONFIG_PARTITION) $(CONFIG_GPU) $(I) +C = $(CXX) $(CF) $(SPQR_CONFIG) $(CONFIG_PARTITION) $(CONFIG_GPU) $(I) \ + $(CHOLMOD_CONFIG) -LIBS = $(CLIB) $(LIB) $(FLIB) $(TBB) $(GPULIB) +LIBS = $(CLIB) $(FLIB) $(TBB) $(GPULIB) # With the CUDA BLAS ifneq ($(GPU_CONFIG),) LIBS += $(CUDART_LIB) $(CUBLAS_LIB) endif -qrsimple: qrsimple.cpp library $(INC) +qrsimple: qrsimple.cpp $(INC) $(C) qrsimple.cpp -o qrsimple $(LIBS) -qrdemo: qrdemo.cpp library $(INC) +qrdemo: qrdemo.cpp $(INC) $(C) qrdemo.cpp -o qrdemo $(LIBS) -qrdemo_gpu: qrdemo_gpu.cpp library $(INC) +qrdemo_gpu: qrdemo_gpu.cpp $(INC) ifneq ($(GPU_CONFIG),) $(C) qrdemo_gpu.cpp -o qrdemo_gpu $(LIBS) else echo endif -qrdemo_gpu2: qrdemo_gpu2.cpp library $(INC) +qrdemo_gpu2: qrdemo_gpu2.cpp $(INC) ifneq ($(GPU_CONFIG),) $(C) qrdemo_gpu2.cpp -o qrdemo_gpu2 $(LIBS) else echo endif -qrdemo_gpu3: qrdemo_gpu3.cpp library $(INC) +qrdemo_gpu3: qrdemo_gpu3.cpp $(INC) ifneq ($(GPU_CONFIG),) $(C) qrdemo_gpu3.cpp -o qrdemo_gpu3 $(LIBS) else @@ -251,12 +201,12 @@ endif qrdemoc.o: qrdemoc.c $(INC) $(CC) $(CF) $(SPQR_CONFIG) -ansi $(I) -c $< -qrdemoc: qrdemoc.o library $(INC) +qrdemoc: qrdemoc.o $(INC) $(C) -o qrdemoc qrdemoc.o $(LIBS) qrsimplec.o: qrsimplec.c $(INC) - $(CC) $(CF) $(SPQR_CONFIG) -ansi $(I) -c $< + $(CC) $(CF) $(SPQR_CONFIG) $(CHOLMOD_CONFIG) -ansi $(I) -c $< -qrsimplec: qrsimplec.o library $(INC) +qrsimplec: qrsimplec.o $(INC) $(C) -o qrsimplec qrsimplec.o $(LIBS) diff --git a/SuiteSparse/SPQR/Demo/qrdemo.cpp b/SuiteSparse/SPQR/Demo/qrdemo.cpp index 764a53474..3f76d974f 100644 --- a/SuiteSparse/SPQR/Demo/qrdemo.cpp +++ b/SuiteSparse/SPQR/Demo/qrdemo.cpp @@ -37,6 +37,7 @@ void check_residual // get the rank(A) estimate rnk = cc->SPQR_istat [4] ; +#ifndef NMATRIXOPS // anorm = norm (A,1) ; anorm = cholmod_l_norm_sparse (A, 1, cc) ; @@ -63,6 +64,10 @@ void check_residual "rel. norm(A'(Ax-b)) %8.1e\n", rnorm, rnk, atrnorm) ; cholmod_l_free_dense (&r, cc) ; cholmod_l_free_dense (&atr, cc) ; +#else + printf ("relative norm(Ax-b): not computed (requires CHOLMOD/MatrixOps)\n"); + printf ("rank: %6ld\n", rnk) ; +#endif } // ============================================================================= diff --git a/SuiteSparse/SPQR/Demo/qrdemo_gpu.cpp b/SuiteSparse/SPQR/Demo/qrdemo_gpu.cpp index 48dea69f6..f74737259 100644 --- a/SuiteSparse/SPQR/Demo/qrdemo_gpu.cpp +++ b/SuiteSparse/SPQR/Demo/qrdemo_gpu.cpp @@ -19,6 +19,8 @@ int main (int argc, char **argv) long m, n, rnk ; size_t total_mem, available_mem ; + printf ("\nqrdemo_gpu: Testing SPQR on the GPU:\n") ; + // start CHOLMOD cholmod_common *cc, Common ; cc = &Common ; diff --git a/SuiteSparse/SPQR/Demo/qrdemo_gpu2.cpp b/SuiteSparse/SPQR/Demo/qrdemo_gpu2.cpp index b8c1a239b..46da3b64b 100644 --- a/SuiteSparse/SPQR/Demo/qrdemo_gpu2.cpp +++ b/SuiteSparse/SPQR/Demo/qrdemo_gpu2.cpp @@ -22,6 +22,8 @@ int main (int argc, char **argv) size_t total_mem, available_mem ; double t ; + printf ("\nqrdemo_gpu2: Testing SPQR on the GPU:\n") ; + // start CHOLMOD cholmod_common *cc, Common ; cc = &Common ; diff --git a/SuiteSparse/SPQR/Demo/qrdemo_gpu3.cpp b/SuiteSparse/SPQR/Demo/qrdemo_gpu3.cpp index e5b832125..0205b1b85 100644 --- a/SuiteSparse/SPQR/Demo/qrdemo_gpu3.cpp +++ b/SuiteSparse/SPQR/Demo/qrdemo_gpu3.cpp @@ -1,12 +1,12 @@ // ============================================================================= -// === qrdemo_gpu2.cpp ========================================================= +// === qrdemo_gpu3.cpp ========================================================= // ============================================================================= // A simple C++ demo of SuiteSparseQR. The comments give the MATLAB equivalent // statements. See also qrdemo.m // // usage: -// qrdemo_gpu2 matrixfile orderingoption +// qrdemo_gpu3 matrixfile orderingoption #include "SuiteSparseQR.hpp" #include "SuiteSparseGPU_Runtime.hpp" @@ -22,6 +22,10 @@ int main (int argc, char **argv) size_t total_mem, available_mem ; double t ; + printf ("\nqrdemo_gpu3: Testing SPQR on the CPU:\n") ; + printf ("This is the same test as qrdemo_gpu2, " + "but with cc->useGPU=false\n") ; + // start CHOLMOD cholmod_common *cc, Common ; cc = &Common ; diff --git a/SuiteSparse/SPQR/Demo/qrsimple.cpp b/SuiteSparse/SPQR/Demo/qrsimple.cpp index 27330ccc6..647ca357f 100644 --- a/SuiteSparse/SPQR/Demo/qrsimple.cpp +++ b/SuiteSparse/SPQR/Demo/qrsimple.cpp @@ -10,7 +10,7 @@ int main (int argc, char **argv) { cholmod_common Common, *cc ; cholmod_sparse *A ; - cholmod_dense *X, *B, *Residual ; + cholmod_dense *X, *B, *Residual = NULL ; double rnorm, one [2] = {1,0}, minusone [2] = {-1,0} ; int mtype ; @@ -28,11 +28,15 @@ int main (int argc, char **argv) // X = A\B X = SuiteSparseQR (A, B, cc) ; +#ifndef NMATRIXOPS // rnorm = norm (B-A*X) Residual = cholmod_l_copy_dense (B, cc) ; cholmod_l_sdmult (A, 0, minusone, one, X, Residual, cc) ; rnorm = cholmod_l_norm_dense (Residual, 2, cc) ; printf ("2-norm of residual: %8.1e\n", rnorm) ; +#else + printf ("2-norm of residual: not computed (requires CHOLMOD/MatrixOps)\n") ; +#endif printf ("rank %ld\n", cc->SPQR_istat [4]) ; // free everything and finish CHOLMOD diff --git a/SuiteSparse/SPQR/Demo/qrsimplec.c b/SuiteSparse/SPQR/Demo/qrsimplec.c index 4596bb904..5fabe2593 100644 --- a/SuiteSparse/SPQR/Demo/qrsimplec.c +++ b/SuiteSparse/SPQR/Demo/qrsimplec.c @@ -10,7 +10,7 @@ int main (int argc, char **argv) { cholmod_common Common, *cc ; cholmod_sparse *A ; - cholmod_dense *X, *B, *Residual ; + cholmod_dense *X, *B, *Residual = NULL ; double rnorm, one [2] = {1,0}, minusone [2] = {-1,0} ; int mtype ; @@ -28,11 +28,15 @@ int main (int argc, char **argv) /* X = A\B */ X = SuiteSparseQR_C_backslash_default (A, B, cc) ; +#ifndef NMATRIXOPS /* rnorm = norm (B-A*X) */ Residual = cholmod_l_copy_dense (B, cc) ; cholmod_l_sdmult (A, 0, minusone, one, X, Residual, cc) ; rnorm = cholmod_l_norm_dense (Residual, 2, cc) ; printf ("2-norm of residual: %8.1e\n", rnorm) ; +#else + printf ("2-norm of residual: not computed (requires CHOLMOD/MatrixOps)\n") ; +#endif printf ("rank %ld\n", cc->SPQR_istat [4]) ; /* free everything and finish CHOLMOD */ diff --git a/SuiteSparse/SPQR/Doc/ChangeLog b/SuiteSparse/SPQR/Doc/ChangeLog index da9e153e6..dbb5c4c21 100644 --- a/SuiteSparse/SPQR/Doc/ChangeLog +++ b/SuiteSparse/SPQR/Doc/ChangeLog @@ -1,3 +1,26 @@ +Feb 1, 2016: version 2.0.5 + + * update to Makefiles + * better error handling when -DNGPL is used in CHOLMOD. + SuiteSparseQR requires the CHOLMOD/Supernodal module. This is now + checked both at compile time and at run time. + +Jan 30, 2016: versions 2.0.4 + + * modifications to Makefiles + * correction to mexFunctions required for MATLAB R2015b, + for sparse empty matrices and NULL mxGetPr + * added "#include " to spqr_tol.cpp. + +Jan 1, 2016: version 2.0.3 + + * modified Makefile to create shared libraries + No change to C code except version number + +Aug 28, 2015: version 2.0.2 + + * changed the default tol when A has inf's + Mar 24, 2015: version 2.0.1 * minor changes to documentation diff --git a/SuiteSparse/SPQR/Doc/Makefile b/SuiteSparse/SPQR/Doc/Makefile index 3aeea7c4f..79ec7c196 100644 --- a/SuiteSparse/SPQR/Doc/Makefile +++ b/SuiteSparse/SPQR/Doc/Makefile @@ -1,11 +1,19 @@ + +default: spqr_user_guide.pdf + +include ../../SuiteSparse_config/SuiteSparse_config.mk + spqr_user_guide.pdf: spqr_user_guide.tex spqr_user_guide.bib Makefile pdflatex spqr_user_guide.tex bibtex spqr_user_guide pdflatex spqr_user_guide.tex pdflatex spqr_user_guide.tex - - $(RM) *.aux *.bbl *.blg *.log *.out + - $(RM) -r $(CLEAN) *.out + +distclean: purge -clean: purge +clean: + - $(RM) -r $(CLEAN) *.out -purge: - - $(RM) *.aux *.bbl *.blg *.log *.out +purge: clean + - $(RM) -r $(PURGE) diff --git a/SuiteSparse/SPQR/Doc/spqr_user_guide.pdf b/SuiteSparse/SPQR/Doc/spqr_user_guide.pdf index bc316525a..d6be318d6 100644 Binary files a/SuiteSparse/SPQR/Doc/spqr_user_guide.pdf and b/SuiteSparse/SPQR/Doc/spqr_user_guide.pdf differ diff --git a/SuiteSparse/SPQR/Doc/spqr_user_guide.tex b/SuiteSparse/SPQR/Doc/spqr_user_guide.tex index 60aa6f6e7..831bd8599 100644 --- a/SuiteSparse/SPQR/Doc/spqr_user_guide.tex +++ b/SuiteSparse/SPQR/Doc/spqr_user_guide.tex @@ -29,7 +29,7 @@ Science Foundation, under grants 0203270, 0620286, and 0619080.}, Sencer Nuri Yeralan, and Sanjay Ranka} -\date{VERSION 2.0.1, March 24, 2015} +\date{VERSION 2.0.5, Feb 1, 2016} %------------------------------------------------------------------------------- \begin{document} @@ -101,17 +101,10 @@ \subsubsection{Required instructions for Windows} \subsubsection{Optional instructions on using METIS for any operating system} %------------------------------------------------------------------------------- -To use METIS \cite{KarypisKumar98e}, obtain a copy of the metis-4.0.1 -distribution from \newline -\htmladdnormallink{http://glaros.dtc.umn.edu/gkhome/views/metis}{http://glaros.dtc.umn.edu/gkhome/views/metis}. -Do not get the \verb'metis-4.0.zip' file since it does not contain source code; -you must download the \verb'metis-4.0.tar.gz' file instead. Uncompress this -file and place the \verb'metis-4.0' directory in the SuiteSparse directory. -You must not have a nested \verb'SuiteSparse/metis-4.0/metis-4.0' directory; -this can occur on Windows when you extract a compressed archive. If you have -this directory, move the lowest \verb'metis-4.0' directory up one level so that -(for example) the file \newline \verb'SuiteSparse/metis-4.0/Lib/metis.h' -exists. +SuiteSparse now relies on METIS 5.1.0, which is distributed along with +SuiteSparse itself. Its use is optional, however. If you compile with +{\tt -DNPARTITION}, or if you delete or move the {\tt SuiteSparse/metis-5.1.0} +folder, then SuiteSparse will be compiled without it. METIS tends to give orderings that are good for the parallelism exploited by TBB, so its use with TBB is recommended. Note however that METIS is not @@ -609,7 +602,11 @@ \subsection{Installing the C/C++ library on Linux/Unix} Before you compile the SuiteSparseQR library and demo programs, you may wish to edit the \verb'SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk' configuration file. The -defaults should be fine on most Linux/Unix systems. Next, type \verb'make' at +defaults should be fine on most Linux/Unix systems and on the Mac. +It automatically detects what system you have and sets compile parameters +accordingly. + +Next, type \verb'make' at the Linux/Unix command line, in either the \verb'SuiteSparse' directory (which compiles all of SuiteSparse) or in the \verb'SuiteSparse/SPQR' directory (which just compiles SuiteSparseQR and the libraries it requires). SuiteSparseQR will @@ -621,7 +618,9 @@ \subsection{Installing the C/C++ library on Linux/Unix} scheme for the name and location of these libraries. The defaults in the \verb'SuiteSparse_config.mk' file use \verb'-llapack' and \verb'-lblas'; the latter may link against the standard Fortran reference BLAS, which will not provide -optimal performance. For best results, you should use the Goto BLAS +optimal performance. For best results, you should use the OpenBLAS +at openblas.net +(based on the Goto BLAS) \cite{GotoVanDeGeijn08}, or high-performance vendor-supplied BLAS such as the Intel MKL, AMD ACML, or the Sun Performance Library. Selection of LAPACK and the BLAS is done with the \verb'LAPACK=' and \verb'BLAS=' lines in the @@ -649,6 +648,11 @@ \subsection{Installing the C/C++ library on Linux/Unix} To fully test 100\% of the lines of SuiteSparseQR, go to the \verb'Tcov' directory and type \verb'make'. This will work for Linux only. +To install the shared library +into /usr/local/lib and /usr/local/include, do {\tt make install}. +To uninstall, do {\tt make uninstall}. +For more options, see the {\tt SuiteSparse/README.txt} file. + %------------------------------------------------------------------------------- \subsection{C/C++ Example} %------------------------------------------------------------------------------- diff --git a/SuiteSparse/SPQR/Include/SuiteSparseQR_definitions.h b/SuiteSparse/SPQR/Include/SuiteSparseQR_definitions.h index 5a96fdbcf..f8101f41e 100644 --- a/SuiteSparse/SPQR/Include/SuiteSparseQR_definitions.h +++ b/SuiteSparse/SPQR/Include/SuiteSparseQR_definitions.h @@ -59,11 +59,11 @@ #endif */ -#define SPQR_DATE "Mar 24, 2015" +#define SPQR_DATE "Feb 1, 2016" #define SPQR_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define SPQR_MAIN_VERSION 2 #define SPQR_SUB_VERSION 0 -#define SPQR_SUBSUB_VERSION 1 +#define SPQR_SUBSUB_VERSION 5 #define SPQR_VERSION SPQR_VER_CODE(SPQR_MAIN_VERSION,SPQR_SUB_VERSION) #endif diff --git a/SuiteSparse/SPQR/Lib/Makefile b/SuiteSparse/SPQR/Lib/Makefile index eae51aa6a..d6d56f5aa 100644 --- a/SuiteSparse/SPQR/Lib/Makefile +++ b/SuiteSparse/SPQR/Lib/Makefile @@ -2,58 +2,38 @@ # SuiteSparseQR/Lib/Makefile #=============================================================================== -default: all +LIBRARY = libspqr +VERSION = 2.0.5 +SO_VERSION = 2 + +default: library ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk -#------------------------------------------------------------------------------- -# the optional Partition module requires METIS, CAMD, and CCOLAMD -I_WITH_PARTITION = -LIB_WITH_PARTITION = -CONFIG_PARTITION = -DNPARTITION -# check if METIS is requested and available -ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG))) - # METIS is requested. See if it is available - ifeq ($(METIS_PATH), $(wildcard $(METIS_PATH))) - ifeq (../../CAMD, $(wildcard ../../CAMD)) - ifeq (../../CCOLAMD, $(wildcard ../../CCOLAMD)) - # METIS, CAMD, and CCOLAMD are available - LIB_WITH_PARTITION = $(METIS) ../../CCOLAMD/Lib/libccolamd.a \ - ../../CAMD/Lib/libcamd.a - I_WITH_PARTITION = -I$(METIS_PATH)/Lib \ - -I../../CCOLAMD/Include -I../../CAMD/Include - CONFIG_PARTITION = - endif - endif - endif -endif -#------------------------------------------------------------------------------- +# SPQR depends on CHOLMOD, AMD, COLAMD, LAPACK, the BLAS and SuiteSparse_config +LDLIBS += -lamd -lcolamd -lcholmod -lsuitesparseconfig $(LAPACK) $(BLAS) -#------------------------------------------------------------------------------- +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) -# no statement coverage, high optimization -# CF = -O3 \ -# -Wall -W -Wshadow -Winline -Wno-unused-parameter \ -# -Wredundant-decls -Wdisabled-optimization \ -# -ansi -fexceptions - -all: libspqr.a +#------------------------------------------------------------------------------- -library: libspqr.a +all: library purge: distclean distclean: clean - - $(RM) libspqr.a + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) INC = ../Include/spqr.hpp ../Include/SuiteSparseQR_C.h \ ../Include/SuiteSparseQR_definitions.h \ - ../Include/SuiteSparseQR.hpp Makefile + ../Include/SuiteSparseQR.hpp OBJ = \ spqr_rmap.o \ @@ -110,15 +90,23 @@ I = -I../../CHOLMOD/Include -I../../SuiteSparse_config -I../Include ifneq ($(GPU_CONFIG),) I += -I../../SuiteSparse_GPURuntime/Include \ - -I../../GPUQREngine/Include \ - -I$(CUDA_INC_PATH) + -I../../GPUQREngine/Include $(CUDA_INC) +endif + +C = $(CXX) $(CF) $(SPQR_CONFIG) $(CHOLMOD_CONFIG) $(CONFIG_PARTITION) $(I) + +ifneq ($(GPU_CONFIG),) + LDLIBS += $(CUDART_LIB) $(CUBLAS_LIB) \ + -lSuiteSparse_GPURuntime -lGPUQREngine endif -C = $(CXX) $(CF) $(SPQR_CONFIG) $(CONFIG_PARTITION) $(I) +#------------------------------------------------------------------------------- -libspqr.a: $(OBJ) - $(ARCHIVE) libspqr.a $(OBJ) - - $(RANLIB) libspqr.a +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ + +#------------------------------------------------------------------------------- spqr_1colamd.o: ../Source/spqr_1colamd.cpp $(C) -c $< @@ -248,3 +236,42 @@ spqrgpu_buildAssemblyMaps.o: ../SPQRGPU/spqrgpu_buildAssemblyMaps.cpp spqrgpu_computeFrontStaging.o: ../SPQRGPU/spqrgpu_computeFrontStaging.cpp $(C) -c $< + +#------------------------------------------------------------------------------- + +# install SPQR +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/SuiteSparseQR.hpp $(INSTALL_INCLUDE) + $(CP) ../Include/SuiteSparseQR_C.h $(INSTALL_INCLUDE) + $(CP) ../Include/SuiteSparseQR_definitions.h $(INSTALL_INCLUDE) + $(CP) ../Include/spqr.hpp $(INSTALL_INCLUDE) + $(CP) ../Doc/spqr_user_guide.pdf $(INSTALL_DOC) + $(CP) ../README.txt $(INSTALL_DOC)/SPQR_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/SuiteSparseQR.hpp + chmod 644 $(INSTALL_INCLUDE)/SuiteSparseQR_C.h + chmod 644 $(INSTALL_INCLUDE)/SuiteSparseQR_definitions.h + chmod 644 $(INSTALL_INCLUDE)/spqr.hpp + chmod 644 $(INSTALL_DOC)/spqr_user_guide.pdf + chmod 644 $(INSTALL_DOC)/SPQR_README.txt + +# uninstall SPQR +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/SuiteSparseQR.hpp + $(RM) $(INSTALL_INCLUDE)/SuiteSparseQR_C.h + $(RM) $(INSTALL_INCLUDE)/SuiteSparseQR_definitions.h + $(RM) $(INSTALL_INCLUDE)/spqr.hpp + $(RM) $(INSTALL_DOC)/spqr_user_guide.pdf + $(RM) $(INSTALL_DOC)/SPQR_README.txt + diff --git a/SuiteSparse/SPQR/MATLAB/spqr_install.m b/SuiteSparse/SPQR/MATLAB/spqr_install.m index 82af2fbe0..3615607e9 100644 --- a/SuiteSparse/SPQR/MATLAB/spqr_install.m +++ b/SuiteSparse/SPQR/MATLAB/spqr_install.m @@ -2,16 +2,14 @@ function spqr_install (tbb) %SPQR_INSTALL compile and install SuiteSparseQR % % Example: -% spqr_install % compiles using ../../metis-4.0, no TBB +% spqr_install % compiles using METIS, no TBB % spqr_install ('tbb') % compiles with TBB % % SuiteSparseQR relies on CHOLMOD, AMD, and COLAMD, and can optionally use % CCOLAMD, CAMD, and METIS as well. By default, CCOLAMD, CAMD, and METIS are -% used. METIS is assumed to be in the ../../metis-4.0 directory. If not +% used. METIS is assumed to be in the ../../metis-5.1.0 directory. If not % present there, it is not used. % -% See http://www-users.cs.umn.edu/~karypis/metis for a copy of METIS 4.0.1. -% % You can only use spqr_install while in the SuiteSparseQR/MATLAB directory. % % Multithreading based on Intel Threading Building Blocks (TBB) is optionally diff --git a/SuiteSparse/SPQR/MATLAB/spqr_make.m b/SuiteSparse/SPQR/MATLAB/spqr_make.m index 7b63ec608..337803738 100644 --- a/SuiteSparse/SPQR/MATLAB/spqr_make.m +++ b/SuiteSparse/SPQR/MATLAB/spqr_make.m @@ -5,16 +5,12 @@ function spqr_make (opt1) % spqr_make % % SuiteSparseQR relies on CHOLMOD, AMD, and COLAMD, and optionally CCOLAMD, -% CAMD, and METIS. All but METIS are distributed with CHOLMOD. To compile -% SuiteSparseQR to use METIS you must first place a copy of the metis-4.0 -% directory (METIS version 4.0.1) in same directory that contains the AMD, -% COLAMD, CCOLAMD, CHOLMOD, and SuiteSparseQR directories. Next, type +% CAMD, and METIS. Next, type % % spqr_make % -% in the MATLAB command window. If METIS is not present in ../../metis-4.0, -% then it is not used. See http://www-users.cs.umn.edu/~karypis/metis for a -% copy of METIS 4.0.1. +% in the MATLAB command window. If METIS is not present in ../../metis-5.1.0, +% then it is not used. % % To compile using Intel's Threading Building Blocks (TBB) use: % @@ -59,8 +55,8 @@ function spqr_make (opt1) include = '-DNMATRIXOPS -DNMODIFY -I. -I../../AMD/Include -I../../COLAMD/Include -I../../CHOLMOD/Include -I../Include -I../../SuiteSparse_config' ; % Determine if METIS is available -metis_path = '../../metis-4.0' ; -have_metis = exist ([metis_path '/Lib'], 'dir') ; +metis_path = '../../metis-5.1.0' ; +have_metis = exist (metis_path, 'dir') ; % Determine if TBB is to be used if (nargin < 1) @@ -72,22 +68,9 @@ function spqr_make (opt1) % fix the METIS 4.0.1 rename.h file if (have_metis) fprintf ('Compiling SuiteSparseQR with METIS for MATLAB Version %s\n', v) ; - f = fopen ('rename.h', 'w') ; - if (f == -1) - error ('unable to create rename.h in current directory') ; - end - fprintf (f, '/* do not edit this file; generated by spqr_make */\n') ; - fprintf (f, '#undef log2\n') ; - fprintf (f, '#include "%s/Lib/rename.h"\n', metis_path) ; - fprintf (f, '#undef log2\n') ; - fprintf (f, '#define log2 METIS__log2\n') ; - fprintf (f, '#include "mex.h"\n') ; - fprintf (f, '#define malloc mxMalloc\n') ; - fprintf (f, '#define free mxFree\n') ; - fprintf (f, '#define calloc mxCalloc\n') ; - fprintf (f, '#define realloc mxRealloc\n') ; - fclose (f) ; - include = [include ' -I' metis_path '/Lib'] ; + include = [include ' -I' metis_path '/include'] ; + include = [include ' -I' metis_path '/GKlib'] ; + include = [include ' -I' metis_path '/libmetis'] ; include = [include ' -I../../CCOLAMD/Include -I../../CAMD/Include' ] ; else fprintf ('Compiling SuiteSparseQR without METIS on MATLAB Version %s\n', v); @@ -215,8 +198,7 @@ function spqr_make (opt1) '../../AMD/Source/amd_valid' } ; colamd_c_src = { - '../../COLAMD/Source/colamd', ... - '../../COLAMD/Source/colamd_global' } ; + '../../COLAMD/Source/colamd' } ; % CAMD and CCOLAMD are not needed if we don't have METIS camd_c_src = { ... @@ -234,64 +216,73 @@ function spqr_make (opt1) '../../CAMD/Source/camd_valid' } ; ccolamd_c_src = { - '../../CCOLAMD/Source/ccolamd', ... - '../../CCOLAMD/Source/ccolamd_global' } ; + '../../CCOLAMD/Source/ccolamd' } ; if (have_metis) metis_c_src = { - 'Lib/balance', ... - 'Lib/bucketsort', ... - 'Lib/ccgraph', ... - 'Lib/coarsen', ... - 'Lib/compress', ... - 'Lib/debug', ... - 'Lib/estmem', ... - 'Lib/fm', ... - 'Lib/fortran', ... - 'Lib/frename', ... - 'Lib/graph', ... - 'Lib/initpart', ... - 'Lib/kmetis', ... - 'Lib/kvmetis', ... - 'Lib/kwayfm', ... - 'Lib/kwayrefine', ... - 'Lib/kwayvolfm', ... - 'Lib/kwayvolrefine', ... - 'Lib/match', ... - 'Lib/mbalance2', ... - 'Lib/mbalance', ... - 'Lib/mcoarsen', ... - 'Lib/memory', ... - 'Lib/mesh', ... - 'Lib/meshpart', ... - 'Lib/mfm2', ... - 'Lib/mfm', ... - 'Lib/mincover', ... - 'Lib/minitpart2', ... - 'Lib/minitpart', ... - 'Lib/mkmetis', ... - 'Lib/mkwayfmh', ... - 'Lib/mkwayrefine', ... - 'Lib/mmatch', ... - 'Lib/mmd', ... - 'Lib/mpmetis', ... - 'Lib/mrefine2', ... - 'Lib/mrefine', ... - 'Lib/mutil', ... - 'Lib/myqsort', ... - 'Lib/ometis', ... - 'Lib/parmetis', ... - 'Lib/pmetis', ... - 'Lib/pqueue', ... - 'Lib/refine', ... - 'Lib/separator', ... - 'Lib/sfm', ... - 'Lib/srefine', ... - 'Lib/stat', ... - 'Lib/subdomains', ... - 'Lib/timing', ... - 'Lib/util' } ; + 'GKlib/b64', ... + 'GKlib/blas', ... + 'GKlib/csr', ... + 'GKlib/error', ... + 'GKlib/evaluate', ... + 'GKlib/fkvkselect', ... + 'GKlib/fs', ... + 'GKlib/getopt', ... + 'GKlib/gkregex', ... + 'GKlib/graph', ... + 'GKlib/htable', ... + 'GKlib/io', ... + 'GKlib/itemsets', ... + 'GKlib/mcore', ... + 'GKlib/memory', ... + 'GKlib/omp', ... + 'GKlib/pdb', ... + 'GKlib/pqueue', ... + 'GKlib/random', ... + 'GKlib/rw', ... + 'GKlib/seq', ... + 'GKlib/sort', ... + 'GKlib/string', ... + 'GKlib/timers', ... + 'GKlib/tokenizer', ... + 'GKlib/util', ... + 'libmetis/auxapi', ... + 'libmetis/balance', ... + 'libmetis/bucketsort', ... + 'libmetis/checkgraph', ... + 'libmetis/coarsen', ... + 'libmetis/compress', ... + 'libmetis/contig', ... + 'libmetis/debug', ... + 'libmetis/fm', ... + 'libmetis/fortran', ... + 'libmetis/frename', ... + 'libmetis/gklib', ... + 'libmetis/graph', ... + 'libmetis/initpart', ... + 'libmetis/kmetis', ... + 'libmetis/kwayfm', ... + 'libmetis/kwayrefine', ... + 'libmetis/mcutil', ... + 'libmetis/mesh', ... + 'libmetis/meshpart', ... + 'libmetis/minconn', ... + 'libmetis/mincover', ... + 'libmetis/mmd', ... + 'libmetis/ometis', ... + 'libmetis/options', ... + 'libmetis/parmetis', ... + 'libmetis/pmetis', ... + 'libmetis/refine', ... + 'libmetis/separator', ... + 'libmetis/sfm', ... + 'libmetis/srefine', ... + 'libmetis/stat', ... + 'libmetis/timing', ... + 'libmetis/util', ... + 'libmetis/wspace', ... + } ; for i = 1:length (metis_c_src) metis_c_src {i} = [metis_path '/' metis_c_src{i}] ; @@ -443,18 +434,33 @@ function spqr_make (opt1) for f = c_source ff = f {1} ; - slash = strfind (ff, '/') ; - if (isempty (slash)) - slash = 1 ; + if (isequal (ff, [metis_path '/GKlib/util'])) + % special case, since a file with the same name also exists in libmetis + copyfile ([ff '.c'], 'GKlib_util.c', 'f') ; + ff = 'GKlib_util' ; + o = 'GKlib_util' ; + elseif (isequal (ff, [metis_path '/GKlib/graph'])) + % special case, since a file with the same name also exist in libmetis + copyfile ([ff '.c'], 'GKlib_graph.c', 'f') ; + ff = 'GKlib_graph' ; + o = 'GKlib_graph' ; else - slash = slash (end) + 1 ; + slash = strfind (ff, '/') ; + if (isempty (slash)) + slash = 1 ; + else + slash = slash (end) + 1 ; + end + o = ff (slash:end) ; end - o = ff (slash:end) ; - obj = [obj ' ' o obj_extension] ; %#ok + % fprintf ('%s\n', o) ; + o = [o obj_extension] ; + obj = [obj ' ' o] ; %#ok s = sprintf ('mex %s -DDLONG -O %s -c %s.c', flags, include, ff) ; kk = do_cmd (s, kk, details) ; end + % compile each mexFunction for f = spqr_mex_cpp_src s = sprintf ('mex %s -O %s %s.cpp', flags, include, f{1}) ; @@ -470,6 +476,14 @@ function spqr_make (opt1) do_cmd (s, kk, details) ; fprintf ('\nSuiteSparseQR successfully compiled\n') ; +% remove the renamed METIS files, if they exist +if (exist ('GKlib_util.c', 'file')) + delete ('GKlib_util.c') ; +end +if (exist ('GKlib_graph.c', 'file')) + delete ('GKlib_graph.c') ; +end + %------------------------------------------------------------------------------- function kk = do_cmd (s, kk, details) %DO_CMD evaluate a command, and either print it or print a "." @@ -483,3 +497,4 @@ function spqr_make (opt1) fprintf ('.') ; end eval (s) ; + diff --git a/SuiteSparse/SPQR/MATLAB/spqr_mx.cpp b/SuiteSparse/SPQR/MATLAB/spqr_mx.cpp index 4dd541646..cc421c962 100644 --- a/SuiteSparse/SPQR/MATLAB/spqr_mx.cpp +++ b/SuiteSparse/SPQR/MATLAB/spqr_mx.cpp @@ -38,16 +38,6 @@ int spqr_mx_config (Long spumoni, cholmod_common *cc) cc->error_handler = spqr_mx_error ; spqr_spumoni = spumoni ; -#ifndef NPARTITION -#if defined(METIS_VERSION) -#if (METIS_VERSION >= METIS_VER(4,0,2)) - // METIS 4.0.2 uses function pointers for malloc and free - METIS_malloc = SuiteSparse_config.malloc_func ; - METIS_free = SuiteSparse_config.free_func ; -#endif -#endif -#endif - // Turn off METIS memory guard. It is not needed, because mxMalloc will // safely terminate the mexFunction and free any workspace without killing // all of MATLAB. This assumes spqr_make was used to compile SuiteSparseQR @@ -448,7 +438,7 @@ int spqr_mx_get_options { mexErrMsgIdAndTxt ("QR:invalidInput","invalid ordering option"); } - mxFree (s) ; + MXFREE (s) ; } } @@ -485,7 +475,7 @@ int spqr_mx_get_options { mexErrMsgIdAndTxt ("QR:invalidInput", "invalid Q option") ; } - mxFree (s) ; + MXFREE (s) ; } // ------------------------------------------------------------------------- @@ -508,7 +498,7 @@ int spqr_mx_get_options { mexErrMsgIdAndTxt ("QR:invalidInput", "invalid permutation option"); } - mxFree (s) ; + MXFREE (s) ; } // ------------------------------------------------------------------------- @@ -536,7 +526,7 @@ int spqr_mx_get_options { mexErrMsgIdAndTxt ("QR:invalidInput", "invalid solution option"); } - mxFree (s) ; + MXFREE (s) ; } // if haveB becomes TRUE, Qformat must be set to "discard" @@ -566,7 +556,8 @@ static int put_values // A is complex, stored in interleaved form; split it for MATLAB Long k ; double z, *Ax2, *Az2 ; - mxFree (mxGetPi (A)) ; + MXFREE (mxGetPi (A)) ; + // Ax2 and Az2 will never be NULL, even if nz == 0 Ax2 = (double *) cholmod_l_malloc (nz, sizeof (double), cc) ; Az2 = (double *) cholmod_l_malloc (nz, sizeof (double), cc) ; for (k = 0 ; k < nz ; k++) @@ -583,7 +574,8 @@ static int put_values if (imag_all_zero) { // free the imaginary part, converting A to real - cholmod_l_free (nz, sizeof (double), Az2, cc) ; + cholmod_l_free (1, sizeof (double), Az2, cc) ; + // the imaginary part can be NULL, for MATLAB Az2 = NULL ; } mxSetPi (A, Az2) ; @@ -593,6 +585,11 @@ static int put_values else { // A is real; just set Ax and return (do not free Ax) + if (Ax == NULL) + { + // don't give MATLAB a null pointer + Ax = (double *) cholmod_l_malloc (1, sizeof (double), cc) ; + } mxSetPr (A, Ax) ; } return (TRUE) ; @@ -622,9 +619,9 @@ mxArray *spqr_mx_put_sparse mxSetM (Amatlab, A->nrow) ; mxSetN (Amatlab, A->ncol) ; mxSetNzmax (Amatlab, A->nzmax) ; - mxFree (mxGetJc (Amatlab)) ; - mxFree (mxGetIr (Amatlab)) ; - mxFree (mxGetPr (Amatlab)) ; + MXFREE (mxGetJc (Amatlab)) ; + MXFREE (mxGetIr (Amatlab)) ; + MXFREE (mxGetPr (Amatlab)) ; mxSetJc (Amatlab, (mwIndex *) A->p) ; mxSetIr (Amatlab, (mwIndex *) A->i) ; @@ -662,8 +659,8 @@ mxArray *spqr_mx_put_dense2 A = mxCreateDoubleMatrix (0, 0, is_complex ? mxCOMPLEX : mxREAL) ; mxSetM (A, m) ; mxSetN (A, n) ; - mxFree (mxGetPr (A)) ; - mxFree (mxGetPi (A)) ; + MXFREE (mxGetPr (A)) ; + MXFREE (mxGetPi (A)) ; put_values (m*n, A, Ax, is_complex, cc) ; return (A) ; } diff --git a/SuiteSparse/SPQR/MATLAB/spqr_mx.hpp b/SuiteSparse/SPQR/MATLAB/spqr_mx.hpp index 2f1a4200c..a78f70c06 100644 --- a/SuiteSparse/SPQR/MATLAB/spqr_mx.hpp +++ b/SuiteSparse/SPQR/MATLAB/spqr_mx.hpp @@ -27,6 +27,12 @@ typedef std::complex Complex ; #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define MXFREE(a) { \ + void *ptr ; \ + ptr = (void *) (a) ; \ + if (ptr != NULL) mxFree (ptr) ; \ +} + typedef struct spqr_mx_options_struct { double tol ; // <= -2 means to use default tol diff --git a/SuiteSparse/SPQR/Makefile b/SuiteSparse/SPQR/Makefile index a4af9fc66..8dab11af0 100644 --- a/SuiteSparse/SPQR/Makefile +++ b/SuiteSparse/SPQR/Makefile @@ -2,12 +2,13 @@ # SuiteSparseQR Makefile #------------------------------------------------------------------------------- -VERSION = 2.0.1 - -include ../SuiteSparse_config/SuiteSparse_config.mk +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all +include ../SuiteSparse_config/SuiteSparse_config.mk + all: ( cd Lib ; $(MAKE) ) ( cd Demo ; $(MAKE) ) @@ -18,6 +19,9 @@ library: demos: ( cd Demo ; $(MAKE) ) +gpu: + ( cd Demo ; $(MAKE) gpu ) + cov: ( cd Tcov ; $(MAKE) ) @@ -43,23 +47,9 @@ docs: # install SPQR install: - $(CP) Lib/libspqr.a $(INSTALL_LIB)/libspqr.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libspqr.$(VERSION).a libspqr.a ) - $(CP) Include/SuiteSparseQR.hpp $(INSTALL_INCLUDE) - $(CP) Include/SuiteSparseQR_C.h $(INSTALL_INCLUDE) - $(CP) Include/SuiteSparseQR_definitions.h $(INSTALL_INCLUDE) - $(CP) Include/spqr.hpp $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libspqr*.a - chmod 644 $(INSTALL_INCLUDE)/SuiteSparseQR.hpp - chmod 644 $(INSTALL_INCLUDE)/SuiteSparseQR_C.h - chmod 644 $(INSTALL_INCLUDE)/SuiteSparseQR_definitions.h - chmod 644 $(INSTALL_INCLUDE)/spqr.hpp + ( cd Lib ; $(MAKE) install ) # uninstall SPQR uninstall: - $(RM) $(INSTALL_LIB)/libspqr*.a - $(RM) $(INSTALL_INCLUDE)/SuiteSparseQR.hpp - $(RM) $(INSTALL_INCLUDE)/SuiteSparseQR_C.h - $(RM) $(INSTALL_INCLUDE)/SuiteSparseQR_definitions.h - $(RM) $(INSTALL_INCLUDE)/spqr.hpp + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/SPQR/README.txt b/SuiteSparse/SPQR/README.txt index 4d748118f..8d9d03bb6 100644 --- a/SuiteSparse/SPQR/README.txt +++ b/SuiteSparse/SPQR/README.txt @@ -1,4 +1,4 @@ -SuiteSparseQR Copyright (c) 2008-2015, Timothy A. Davis, +SuiteSparseQR Copyright (c) 2008-2016, Timothy A. Davis, GPU modules Copyright (c) 2015, Timothy A. Davis, Sencer Nuri Yeralan, and Sanjay Ranka. http://www.suitesparse.com @@ -11,6 +11,11 @@ computing. See SPQR/Demo/qrdemo_gpu.cpp, and do 'make gpu' in SPQR/Demo to test it (compare your output with SPQR/Demo/qrdemo_gpu.out. For more extensive tests, see SPQR/Demo/go*.m. +NOTE: you may get an error about a C++-style commment in the C header file, +/usr/local/cude/include/cuComplex.h. This is a bug in NVIDIA CUDA 7.0. If +you encounter this error, then either edit the file and delete all lines +beginning with "//", or upgrade to CUDA 7.5. + QUICK START FOR MATLAB USERS (on Windows, Linux, Solaris, or the Mac OS): To compile and test the MATLAB mexFunctions, do this in the MATLAB command window: @@ -23,7 +28,8 @@ FOR MORE DETAILS: please see the User Guide in Doc/spqr_user_guide.pdf. FOR LINUX/UNIX/Mac USERS who want to use the C++ callable library: To compile the C++ library and run a short demo, just type "make" in - the Unix shell. + the Unix shell. If you have an NVIDIA GPU, this also compiles + the GPU accelerated part of SPQR. To compile the SuiteSparseQR C++ library, in the Unix shell, do: diff --git a/SuiteSparse/SPQR/Source/spqr_analyze.cpp b/SuiteSparse/SPQR/Source/spqr_analyze.cpp index 881a5ac51..426d99b42 100644 --- a/SuiteSparse/SPQR/Source/spqr_analyze.cpp +++ b/SuiteSparse/SPQR/Source/spqr_analyze.cpp @@ -8,6 +8,10 @@ #include "spqr.hpp" +#ifdef NSUPERNODAL +#error "SuiteSparseQR requires the CHOLMOD/Supernodal module" +#endif + // ============================================================================= #define FREE_WORK \ @@ -314,6 +318,15 @@ spqr_symbolic *spqr_analyze return (NULL) ; } + if (Sc == NULL || !(Sc->is_super) || !(Sc->is_ll)) + { + cholmod_l_free_factor (&Sc, cc) ; + FREE_WORK ; + ERROR (CHOLMOD_INVALID, + "SuiteSparseQR requires the CHOLMOD/Supernodal module") ; + return (NULL) ; + } + ASSERT (Sc != NULL && Sc->is_ll && Sc->is_super) ; // ------------------------------------------------------------------------- diff --git a/SuiteSparse/SPQR/Source/spqr_tol.cpp b/SuiteSparse/SPQR/Source/spqr_tol.cpp index 035924ba6..771e6237f 100644 --- a/SuiteSparse/SPQR/Source/spqr_tol.cpp +++ b/SuiteSparse/SPQR/Source/spqr_tol.cpp @@ -5,6 +5,8 @@ // Return the default column 2-norm tolerance #include "spqr.hpp" +#include +#include // return the default tol (-1 if error) template double spqr_tol @@ -18,8 +20,14 @@ template double spqr_tol { RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (A, EMPTY) ; - return (20 * ((double) A->nrow + (double) A->ncol) * DBL_EPSILON * - spqr_maxcolnorm (A, cc)) ; + double tol = (20 * ((double) A->nrow + (double) A->ncol) * DBL_EPSILON * + spqr_maxcolnorm (A, cc)); + // MathWorks modification: if the tolerance becomes Inf, replace it with + // realmax; otherwise, we may end up with an all-zero matrix R + // (see g1284493) + tol = std::min(tol, std::numeric_limits::max()); + + return (tol) ; } template double spqr_tol // return the default tol diff --git a/SuiteSparse/SPQR/Tcov/Makefile b/SuiteSparse/SPQR/Tcov/Makefile index 4d01962f3..54a1f0ef8 100644 --- a/SuiteSparse/SPQR/Tcov/Makefile +++ b/SuiteSparse/SPQR/Tcov/Makefile @@ -5,30 +5,31 @@ # This test requires METIS, and it only works on Linux. # run statement-coverage test without Valgrind -default: $(METIS) go +default: go # to run with Valgrind as well -valgrind: $(METIS) vgo +valgrind: vgo ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk +# this test requires gcc +CC = gcc +CXX= g++ +BLAS = -lrefblas +LAPACK = -llapack + # for statement coverage (with gcov; see go) and picky compiler warnings CF = -pg \ -O0 -g -fprofile-arcs -ftest-coverage \ -Wall -W -Wshadow -Winline -Wno-unused-parameter \ -Wredundant-decls -Wdisabled-optimization \ - -ansi -fexceptions + -ansi -fexceptions -fopenmp -# Use the standard reference BLAS, and LAPACK, both compiled with -g, -# for best diagnostics. Also, some BLAS (such as the Goto BLAS) cause -# problems for Valgrind (using instructions that Valgrind doesn't understand). +# Using an optimized BLAS can cause problems in Valgrind # FLIB = -llapack_plain -lblas_plain -lgfortran # FLIB = -llapack_plain -lblas_plain -lgfortran -lg2c - -# This can be used, but severe valgrind failures may occur in the BLAS, -# because of how the BLAS is optimized: FLIB = $(LAPACK) $(BLAS) #------------------------------------------------------------------------------- @@ -40,13 +41,7 @@ NVCC = /usr/local/cuda/bin/nvcc -g --profile --generate-line-info $(NV20) \ #------------------------------------------------------------------------------- -CLIB = ../../CHOLMOD/Lib/libcholmod.a \ - ../../AMD/Lib/libamd.a \ - ../../COLAMD/Lib/libcolamd.a \ - ../../CCOLAMD/Lib/libccolamd.a \ - ../../CAMD/Lib/libcamd.a \ - ../../SuiteSparse_config/libsuitesparseconfig.a \ - $(METIS) +CLIB = -L../../lib -lcholmod -lamd -lcolamd -lccolamd -lcamd -lmetis -lsuitesparseconfig all: qrtest gpudemo qrdemo_gpu @@ -56,11 +51,11 @@ purge: distclean distclean: clean - $(RM) qrtest qrtest_out.txt pfile tfile cov.out qrtest_out1.txt - - $(RM) gpuqrengine_demo troll.m qrdemo_gpu gpu_results.txt + - $(RM) gpuqrengine_demo troll.m qrdemo_gpu gpu_results.txt X.mtx + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) - - $(RM) -r *.dSYM + - $(RM) -r $(CLEAN) INC = ../Include/spqr.hpp ../Include/SuiteSparseQR_C.h \ ../Include/SuiteSparseQR_definitions.h \ @@ -154,18 +149,17 @@ I = -I../../CHOLMOD/Include -I../../SuiteSparse_config -I../Include \ ifneq ($(GPU_CONFIG),) I += -I../../SuiteSparse_GPURuntime/Include \ - -I../../GPUQREngine/Include \ - -I$(CUDA_INC_PATH) + -I../../GPUQREngine/Include $(CUDA_INC) endif -C = $(CXX) $(CF) $(I) $(SPQR_CONFIG) $(GPU_CONFIG) +C = $(CXX) $(CF) $(I) $(SPQR_CONFIG) -LIBS = $(CLIB) $(FLIB) $(LIB) $(CUDA_LIB) +LIBS = $(CLIB) $(FLIB) $(LDLIBS) $(CUDA_LIB) qrtestc.o: qrtestc.c $(INC) $(CC) $(CF) $(I) -c $< -qrtest: $(CLIB) qrtest.cpp $(INC) $(OBJ) +qrtest: libraries qrtest.cpp $(INC) $(OBJ) $(C) qrtest.cpp -o qrtest $(OBJ) $(LIBS) -lm ifneq ($(GPU_CONFIG),) @@ -180,7 +174,7 @@ else gpu: endif -gpuqrengine_demo: $(CLIB) \ +gpuqrengine_demo: libraries \ ../../GPUQREngine/Demo/gpuqrengine_demo.cpp $(INC) $(OBJ) $(C) $(GPUQRDEMO)/gpuqrengine_demo.cpp -o gpuqrengine_demo \ $(OBJ) $(LIBS) -lm @@ -340,26 +334,14 @@ spqrgpu_computeFrontStaging.o: ../SPQRGPU/spqrgpu_computeFrontStaging.cpp # libraries compiled without test coverage #------------------------------------------------------------------------------- -$(METIS): - ( cd ../../metis-4.0/Lib && $(MAKE) ) - -../../CHOLMOD/Lib/libcholmod.a: - ( cd ../../CHOLMOD && $(MAKE) library ) - -../../AMD/Lib/libamd.a: - ( cd ../../AMD && $(MAKE) library ) - -../../COLAMD/Lib/libcolamd.a: - ( cd ../../COLAMD && $(MAKE) library ) - -../../CCOLAMD/Lib/libccolamd.a: - ( cd ../../CCOLAMD && $(MAKE) library ) - -../../CAMD/Lib/libcamd.a: - ( cd ../../CAMD && $(MAKE) library ) - -../../SuiteSparse_config/libsuitesparseconfig.a: - ( cd ../../SuiteSparse_config ; $(MAKE) library ) +libraries: + ( cd ../.. && $(MAKE) metis ) + ( cd ../../CHOLMOD && $(MAKE) library TCOV=yes ) + ( cd ../../AMD && $(MAKE) library TCOV=yes ) + ( cd ../../COLAMD && $(MAKE) library TCOV=yes ) + ( cd ../../CCOLAMD && $(MAKE) library TCOV=yes ) + ( cd ../../CAMD && $(MAKE) library TCOV=yes ) + ( cd ../../SuiteSparse_config ; $(MAKE) library TCOV=yes ) #------------------------------------------------------------------------------- # SuiteSparse_GPURuntime diff --git a/SuiteSparse/SPQR/Tcov/cov b/SuiteSparse/SPQR/Tcov/cov old mode 100644 new mode 100755 diff --git a/SuiteSparse/SuiteSparse_GPURuntime/Doc/ChangeLog b/SuiteSparse/SuiteSparse_GPURuntime/Doc/ChangeLog index 2e1593567..cb8c100ab 100644 --- a/SuiteSparse/SuiteSparse_GPURuntime/Doc/ChangeLog +++ b/SuiteSparse/SuiteSparse_GPURuntime/Doc/ChangeLog @@ -1,3 +1,11 @@ +Feb 1, 2016: version 1.0.3 + + * update to Makefiles + +Jan 30, 2016: version 1.0.2 + + * modifications to Makefiles + Oct 17, 2014: version 1.0.0 * first stable release diff --git a/SuiteSparse/SuiteSparse_GPURuntime/Include/SuiteSparseGPU_Runtime.hpp b/SuiteSparse/SuiteSparse_GPURuntime/Include/SuiteSparseGPU_Runtime.hpp index 111ceff91..616a4bc9b 100644 --- a/SuiteSparse/SuiteSparse_GPURuntime/Include/SuiteSparseGPU_Runtime.hpp +++ b/SuiteSparse/SuiteSparse_GPURuntime/Include/SuiteSparseGPU_Runtime.hpp @@ -21,11 +21,11 @@ class Workspace; #include "SuiteSparseGPU_Workspace.hpp" // Version information: -#define SUITESPARSE_GPURUNTIME_DATE "Oct 1, 2014" +#define SUITESPARSE_GPURUNTIME_DATE "Feb 1, 2016" #define SUITESPARSE_GPURUNTIME_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define SUITESPARSE_GPURUNTIME_MAIN_VERSION 1 #define SUITESPARSE_GPURUNTIME_SUB_VERSION 0 -#define SUITESPARSE_GPURUNTIME_SUBSUB_VERSION 0 +#define SUITESPARSE_GPURUNTIME_SUBSUB_VERSION 3 #define SUITESPARSE_GPURUNTIME_VERSION \ SUITESPARSE_GPURUNTIME_VER_CODE(SUITESPARSE_GPURUNTIME_MAIN_VERSION,SUITESPARSE_GPURUNTIME_SUB_VERSION) diff --git a/SuiteSparse/SuiteSparse_GPURuntime/Lib/Makefile b/SuiteSparse/SuiteSparse_GPURuntime/Lib/Makefile index bea188fb5..4da8153e3 100644 --- a/SuiteSparse/SuiteSparse_GPURuntime/Lib/Makefile +++ b/SuiteSparse/SuiteSparse_GPURuntime/Lib/Makefile @@ -2,50 +2,89 @@ # SuiteSparse_GPURuntime/Lib/Makfile #------------------------------------------------------------------------------- +LIBRARY = libSuiteSparse_GPURuntime +VERSION = 1.0.3 +SO_VERSION = 1 + +default: library + include ../../SuiteSparse_config/SuiteSparse_config.mk +# SuiteSparse_GPURuntime depends on SuiteSparse_config and CUDA +LDLIBS += -lsuitesparseconfig $(CUDART_LIB) + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + OBJS = SuiteSparseGPU_Workspace.o \ SuiteSparseGPU_Workspace_cpuAllocators.o \ SuiteSparseGPU_Workspace_gpuAllocators.o \ SuiteSparseGPU_Workspace_transfer.o INC = -I../Include -I../../SuiteSparse_config -LIBS = $(CUDART_LIB) H = \ ../Include/SuiteSparseGPU_Workspace.hpp \ ../Include/SuiteSparseGPU_debug.hpp \ ../Include/SuiteSparseGPU_macros.hpp \ ../Include/SuiteSparseGPU_workspace_macros.hpp \ - ../Include/SuiteSparseGPU_Runtime.hpp \ - Makefile + ../Include/SuiteSparseGPU_Runtime.hpp #------------------------------------------------------------------------------- -all: runtime +all: library -library: runtime +runtime: library -lib: runtime +lib: library clean: - $(RM) -f *.o + $(RM) -r $(CLEAN) purge: clean - $(RM) -f libSuiteSparse_GPURuntime.a + $(RM) -r $(PURGE) + +distclean: purge -runtime: $(OBJS) - $(AR) -r "libSuiteSparse_GPURuntime.a" $(OBJS) +$(AR_TARGET): $(OBJS) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ + +#------------------------------------------------------------------------------- SuiteSparseGPU_Workspace.o: ../Source/SuiteSparseGPU_Workspace.cpp $(H) - $(NVCC) -c $(INC) $< + $(NVCC) -c $(INC) $(NVCCFLAGS) $< SuiteSparseGPU_Workspace_cpuAllocators.o: ../Source/SuiteSparseGPU_Workspace_cpuAllocators.cpp $(H) - $(NVCC) -c $(INC) $< + $(NVCC) -c $(INC) $(NVCCFLAGS) $< SuiteSparseGPU_Workspace_gpuAllocators.o: ../Source/SuiteSparseGPU_Workspace_gpuAllocators.cpp $(H) - $(NVCC) -c $(INC) $< + $(NVCC) -c $(INC) $(NVCCFLAGS) $< SuiteSparseGPU_Workspace_transfer.o: ../Source/SuiteSparseGPU_Workspace_transfer.cpp $(H) - $(NVCC) -c $(INC) $< + $(NVCC) -c $(INC) $(NVCCFLAGS) $< + +#------------------------------------------------------------------------------- + +# install SuiteSparse_GPURuntime (just the library, not the include files) +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJS) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../README.txt $(INSTALL_DOC)/GPURUNTIME_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_DOC)/GPURUNTIME_README.txt + +# uninstall SuiteSparse_GPURuntime +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_DOC)/GPURUNTIME_README.txt diff --git a/SuiteSparse/SuiteSparse_GPURuntime/Makefile b/SuiteSparse/SuiteSparse_GPURuntime/Makefile index d4f9eeb54..099948f16 100644 --- a/SuiteSparse/SuiteSparse_GPURuntime/Makefile +++ b/SuiteSparse/SuiteSparse_GPURuntime/Makefile @@ -2,7 +2,8 @@ # SuiteSparse_GPURuntime Makefile #------------------------------------------------------------------------------- -VERSION = 1.0.0 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all @@ -28,13 +29,9 @@ distclean: purge ccode: all -# install SuiteSparse_GPURuntime (just the library, not the include files) install: - $(CP) Lib/libSuiteSparse_GPURuntime.a $(INSTALL_LIB)/libSuiteSparse_GPURuntime.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libSuiteSparse_GPURuntime.$(VERSION).a libSuiteSparse_GPURuntime.a ) - chmod 644 $(INSTALL_LIB)/libSuiteSparse_GPURuntime*.a + ( cd Lib ; $(MAKE) install ) -# uninstall SuiteSparse_GPURuntime uninstall: - $(RM) $(INSTALL_LIB)/libSuiteSparse_GPURuntime*.a + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/SuiteSparse_GPURuntime/README.txt b/SuiteSparse/SuiteSparse_GPURuntime/README.txt index e3d398de9..8dd0eaa9a 100644 --- a/SuiteSparse/SuiteSparse_GPURuntime/README.txt +++ b/SuiteSparse/SuiteSparse_GPURuntime/README.txt @@ -1,4 +1,4 @@ -SuiteSparse_GPURuntime Copyright (c) 2013, Timothy A. Davis, +SuiteSparse_GPURuntime Copyright (c) 2013-2016, Timothy A. Davis, Sencer Nuri Yeralan, and Sanjay Ranka. http://www.suitesparse.com SuiteSparse_GPURuntime provides helper functions for the GPU. @@ -9,7 +9,15 @@ FOR LINUX/UNIX/Mac USERS who want to use the C++ callable library: cd Lib ; make - or just 'make' in this directory. + or just 'make' in this directory. Both static (*.a) and shared + (*.so) libraries are created. + + To install the librari into /usr/local/lib, do 'make install'. + The include files are not copied into /usr/local/include, since this + library is currently not meant to be user-callable. It is used only + by SuiteSparseQR. + + To remove it from /usr/local/lib, do 'make uninstall'. -------------------------------------------------------------------------------- diff --git a/SuiteSparse/SuiteSparse_config/Makefile b/SuiteSparse/SuiteSparse_config/Makefile index 474cf8a43..2f53093fc 100644 --- a/SuiteSparse/SuiteSparse_config/Makefile +++ b/SuiteSparse/SuiteSparse_config/Makefile @@ -2,47 +2,69 @@ # SuiteSparse_config Makefile #------------------------------------------------------------------------------- -VERSION = 4.4.4 +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE -default: ccode +# version of SuiteSparse_config is also version of SuiteSparse meta-package +LIBRARY = libsuitesparseconfig +VERSION = 4.5.1 +SO_VERSION = 4 + +default: library include SuiteSparse_config.mk -ccode: libsuitesparseconfig.a +ccode: all + +all: library -all: libsuitesparseconfig.a +# compile and install in SuiteSparse/lib +library: $(AR_TARGET) + $(MAKE) install INSTALL=$(SUITESPARSE) -library: libsuitesparseconfig.a +OBJ = SuiteSparse_config.o -libsuitesparseconfig.a: SuiteSparse_config.c SuiteSparse_config.h +SuiteSparse_config.o: SuiteSparse_config.c SuiteSparse_config.h $(CC) $(CF) -c SuiteSparse_config.c - $(ARCHIVE) libsuitesparseconfig.a SuiteSparse_config.o - $(RANLIB) libsuitesparseconfig.a - - $(RM) SuiteSparse_config.o + +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $(AR_TARGET) SuiteSparse_config.o + $(RANLIB) $(AR_TARGET) distclean: purge purge: clean - - $(RM) *.o *.a + ( cd xerbla ; $(MAKE) purge ) + - $(RM) -r $(PURGE) clean: + ( cd xerbla ; $(MAKE) clean ) - $(RM) -r $(CLEAN) # install SuiteSparse_config -install: - $(CP) libsuitesparseconfig.a $(INSTALL_LIB)/libsuitesparseconfig.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libsuitesparseconfig.$(VERSION).a libsuitesparseconfig.a ) +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) $(CP) SuiteSparse_config.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libsuitesparseconfig*.a + $(CP) README.txt $(INSTALL_DOC)/SUITESPARSECONFIG_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 755 $(INSTALL_LIB)/$(SO_PLAIN) chmod 644 $(INSTALL_INCLUDE)/SuiteSparse_config.h + chmod 644 $(INSTALL_DOC)/SUITESPARSECONFIG_README.txt # uninstall SuiteSparse_config uninstall: - $(RM) $(INSTALL_LIB)/libsuitesparseconfig*.a + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) $(RM) $(INSTALL_INCLUDE)/SuiteSparse_config.h + $(RM) $(INSTALL_DOC)/SUITESPARSECONFIG_README.txt + ( cd xerbla ; $(MAKE) uninstall ) + -dif: - - diff SuiteSparse_config.mk SuiteSparse_config_linux.mk - - diff SuiteSparse_config_linux.mk SuiteSparse_config_GPU_gcc.mk - - diff SuiteSparse_config_GPU_gcc.mk SuiteSparse_config_GPU_icc.mk - - diff SuiteSparse_config_GPU_icc.mk SuiteSparse_config_GPU_icc10.mk diff --git a/SuiteSparse/SuiteSparse_config/README.txt b/SuiteSparse/SuiteSparse_config/README.txt index 38202d458..966f9c57c 100644 --- a/SuiteSparse/SuiteSparse_config/README.txt +++ b/SuiteSparse/SuiteSparse_config/README.txt @@ -1,35 +1,12 @@ -SuiteSparse_config, 2015, Timothy A. Davis, http://www.suitesparse.com +SuiteSparse_config, 2016, Timothy A. Davis, http://www.suitesparse.com (formerly the UFconfig package) -This directory contains a default SuiteSparse_config.mk file, which -in the original distribution is the same as SuiteSparse_config_linux.mk. -The various config file versions are: +This directory contains a default SuiteSparse_config.mk file. It tries to +detect your system (Linux, SunOS, or Mac), which compiler to use (icc or cc), +which BLAS and LAPACK library to use (OpenBLAS or MKL), and whether or not to +compile with CUDA. - SuiteSparse_config_GPU_icc.mk for GPU with the Intel compiler - SuiteSparse_config_GPU_icc10.mk ditto, but for 10 cores - SuiteSparse_config_GPU_gcc.mk for GPU with the gcc compiler - SuiteSparse_config_linux.mk for linux, no GPU - SuiteSparse_config_Mac.mk for Mac - SuiteSparse_config.mk the actual one in use - -To use a GPU for CHOLMOD and SPQR, using gcc, do this: - - cp SuiteSparse_config_GPU_gcc.mk SuiteSparse_config.mk - -To use a GPU for CHOLMOD and SPQR, using icc and the Intel MKL, do this: - - cp SuiteSparse_config_GPU_icc.mk SuiteSparse_config.mk - -To compile SuiteSparse for the Mac, do this: - - cp SuiteSparse_config_Mac.mk SuiteSparse_config.mk - -To use a GPU for CHOLMOD and SPQR, using icc and the Intel MKL, -and for a system with 10 cores, do this - - cp SuiteSparse_config_GPU_icc10.mk SuiteSparse_config.mk - -For other alternatives, see the comments in the SuiteSparse_config.mk file. +For alternatives, see the comments in the SuiteSparse_config.mk file. -------------------------------------------------------------------------------- diff --git a/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c b/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c index 0d5dbaf06..b491539fe 100644 --- a/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c +++ b/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c @@ -440,8 +440,8 @@ int SuiteSparse_version * to ANSI C99. However, SuiteSparse does not assume that ANSI C99 is * available. You can use the ANSI C99 hypot routine with: * - * #include - * SuiteSparse_config.hypot_func = hypot ; + * #include + *i SuiteSparse_config.hypot_func = hypot ; * * Default value of the SuiteSparse_config.hypot_func pointer is * SuiteSparse_hypot, defined below. @@ -460,27 +460,27 @@ double SuiteSparse_hypot (double x, double y) y = fabs (y) ; if (x >= y) { - if (x + y == x) - { - s = x ; - } - else - { - r = y / x ; - s = x * sqrt (1.0 + r*r) ; - } + if (x + y == x) + { + s = x ; + } + else + { + r = y / x ; + s = x * sqrt (1.0 + r*r) ; + } } else { - if (y + x == y) - { - s = y ; - } - else - { - r = x / y ; - s = y * sqrt (1.0 + r*r) ; - } + if (y + x == y) + { + s = y ; + } + else + { + r = x / y ; + s = y * sqrt (1.0 + r*r) ; + } } return (s) ; } @@ -505,25 +505,25 @@ double SuiteSparse_hypot (double x, double y) int SuiteSparse_divcomplex ( - double ar, double ai, /* real and imaginary parts of a */ - double br, double bi, /* real and imaginary parts of b */ - double *cr, double *ci /* real and imaginary parts of c */ + double ar, double ai, /* real and imaginary parts of a */ + double br, double bi, /* real and imaginary parts of b */ + double *cr, double *ci /* real and imaginary parts of c */ ) { double tr, ti, r, den ; if (fabs (br) >= fabs (bi)) { - r = bi / br ; - den = br + r * bi ; - tr = (ar + ai * r) / den ; - ti = (ai - ar * r) / den ; + r = bi / br ; + den = br + r * bi ; + tr = (ar + ai * r) / den ; + ti = (ai - ar * r) / den ; } else { - r = br / bi ; - den = r * br + bi ; - tr = (ar * r + ai) / den ; - ti = (ai * r - ar) / den ; + r = br / bi ; + den = r * br + bi ; + tr = (ar * r + ai) / den ; + ti = (ai * r - ar) / den ; } *cr = tr ; *ci = ti ; diff --git a/SuiteSparse/SuiteSparse_config/SuiteSparse_config.h b/SuiteSparse/SuiteSparse_config/SuiteSparse_config.h index 682968f21..c4b4cfcf3 100644 --- a/SuiteSparse/SuiteSparse_config/SuiteSparse_config.h +++ b/SuiteSparse/SuiteSparse_config/SuiteSparse_config.h @@ -184,28 +184,29 @@ int SuiteSparse_divcomplex * * SuiteSparse contains the following packages: * - * SuiteSparse_config version 4.4.1 (version always the same as SuiteSparse) - * AMD version 2.4.1 - * BTF version 1.2.1 - * CAMD version 2.4.1 - * CCOLAMD version 2.9.1 - * CHOLMOD version 3.0.5 - * COLAMD version 2.9.1 - * CSparse version 3.1.4 - * CXSparse version 3.1.4 - * KLU version 1.3.2 - * LDL version 2.2.1 - * RBio version 2.2.1 - * SPQR version 2.0.1 - * GPUQREngine version 1.0.0 - * SuiteSparse_GPURuntime version 1.0.0 - * UMFPACK version 5.7.1 + * SuiteSparse_config version 4.5.1 (version always the same as SuiteSparse) + * AMD version 2.4.4 + * BTF version 1.2.4 + * CAMD version 2.4.4 + * CCOLAMD version 2.9.4 + * CHOLMOD version 3.0.9 + * COLAMD version 2.9.4 + * CSparse version 3.1.7 + * CXSparse version 3.1.7 + * GPUQREngine version 1.0.3 + * KLU version 1.3.6 + * LDL version 2.2.4 + * RBio version 2.2.4 + * SPQR version 2.0.5 + * SuiteSparse_GPURuntime version 1.0.3 + * UMFPACK version 5.7.3 * MATLAB_Tools various packages & M-files + * xerbla version 1.0.2 * * Other package dependencies: * BLAS required by CHOLMOD and UMFPACK * LAPACK required by CHOLMOD - * METIS 4.0.1 required by CHOLMOD (optional) and KLU (optional) + * METIS 5.1.0 required by CHOLMOD (optional) and KLU (optional) * CUBLAS, CUDART NVIDIA libraries required by CHOLMOD and SPQR when * they are compiled with GPU acceleration. */ @@ -233,11 +234,11 @@ int SuiteSparse_version /* returns SUITESPARSE_VERSION */ */ #define SUITESPARSE_HAS_VERSION_FUNCTION -#define SUITESPARSE_DATE "Mar 24, 2015" +#define SUITESPARSE_DATE "Jan 30, 2016" #define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define SUITESPARSE_MAIN_VERSION 4 -#define SUITESPARSE_SUB_VERSION 4 -#define SUITESPARSE_SUBSUB_VERSION 4 +#define SUITESPARSE_SUB_VERSION 5 +#define SUITESPARSE_SUBSUB_VERSION 0 #define SUITESPARSE_VERSION \ SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION) diff --git a/SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk b/SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk index 3ab813cc1..91a424bd9 100644 --- a/SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk +++ b/SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk @@ -2,451 +2,600 @@ # SuiteSparse_config.mk: common configuration file for the SuiteSparse #=============================================================================== -# This file contains all configuration settings for all packages authored or -# co-authored by Tim Davis: -# -# Package Version Description -# ------- ------- ----------- -# AMD 1.2 or later approximate minimum degree ordering -# COLAMD 2.4 or later column approximate minimum degree ordering -# CCOLAMD 1.0 or later constrained column approximate minimum degree ordering -# CAMD any constrained approximate minimum degree ordering -# UMFPACK 4.5 or later sparse LU factorization, with the BLAS -# CHOLMOD any sparse Cholesky factorization, update/downdate -# KLU 0.8 or later sparse LU factorization, BLAS-free -# BTF 0.8 or later permutation to block triangular form -# LDL 1.2 or later concise sparse LDL' -# CXSparse any extended version of CSparse (int/long, real/complex) -# SuiteSparseQR any sparse QR factorization -# RBio 2.0 or later read/write sparse matrices in Rutherford-Boeing format -# -# By design, this file is NOT included in the CSparse makefile. -# That package is fully stand-alone. CSparse is primarily for teaching; -# production code should use CXSparse. -# -# The SuiteSparse_config directory and the above packages should all appear in -# a single directory, in order for the Makefile's within each package to find -# this file. -# -# To enable an option of the form "# OPTION = ...", edit this file and -# delete the "#" in the first column of the option you wish to use. -# -# The use of METIS 4.0.1 is optional. To exclude METIS, you must compile with -# CHOLMOD_CONFIG set to -DNPARTITION. See below for details. However, if you -# do not have a metis-4.0 directory inside the SuiteSparse directory, the -# */Makefile's that optionally rely on METIS will automatically detect this -# and compile without METIS. +# This file contains all configuration settings for all packages in SuiteSparse, +# except for CSparse (which is stand-alone) and the packages in MATLAB_Tools. -#------------------------------------------------------------------------------ -# Generic configuration -#------------------------------------------------------------------------------ +SUITESPARSE_VERSION = 4.5.1 -# Using standard definitions from the make environment, typically: -# -# CC cc C compiler -# CXX g++ C++ compiler -# CFLAGS [ ] flags for C and C++ compiler -# CPPFLAGS [ ] flags for C and C++ compiler -# TARGET_ARCH [ ] target architecture -# FFLAGS [ ] flags for Fortran compiler -# RM rm -f delete a file -# AR ar create a static *.a library archive -# ARFLAGS rv flags for ar -# MAKE make make itself (sometimes called gmake) -# -# You can redefine them here, but by default they are used from the -# default make environment. - -# To use OpenMP add -openmp to the CFLAGS -# If OpenMP is used, it is recommended to define CHOLMOD_OMP_NUM_THREADS -# as the number of cores per socket on the machine being used to maximize -# memory performance - CFLAGS = -# CFLAGS = -g -# for the icc compiler and OpenMP: -# CFLAGS = -openmp - -# C and C++ compiler flags. The first three are standard for *.c and *.cpp -# Add -DNTIMER if you do use any timing routines (otherwise -lrt is required). -# CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC -DNTIMER - CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC -# for the MKL BLAS: -# CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC -I$(MKLROOT)/include -D_GNU_SOURCE -# with no optimization: -# CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -fexceptions -fPIC - -# ranlib, and ar, for generating libraries. If you don't need ranlib, -# just change it to RANLAB = echo -RANLIB = ranlib -ARCHIVE = $(AR) $(ARFLAGS) - -# copy and delete a file -CP = cp -f -MV = mv -f - -# Fortran compiler (not required for 'make' or 'make library') -F77 = gfortran -F77FLAGS = $(FFLAGS) -O -F77LIB = - -# C and Fortran libraries. Remove -lrt if you don't have it. - LIB = -lm -lrt -# Using the following requires CF = ... -DNTIMER on POSIX C systems. -# LIB = -lm - -# For "make install" -INSTALL_LIB = /usr/local/lib -INSTALL_INCLUDE = /usr/local/include - -# Which version of MAKE you are using (default is "make") -# MAKE = make -# MAKE = gmake - -#------------------------------------------------------------------------------ -# BLAS and LAPACK configuration: -#------------------------------------------------------------------------------ - -# UMFPACK and CHOLMOD both require the BLAS. CHOLMOD also requires LAPACK. -# See Kazushige Goto's BLAS at http://www.cs.utexas.edu/users/flame/goto/ or -# http://www.tacc.utexas.edu/~kgoto/ for the best BLAS to use with CHOLMOD. -# LAPACK is at http://www.netlib.org/lapack/ . You can use the standard -# Fortran LAPACK along with Goto's BLAS to obtain very good performance. -# CHOLMOD gets a peak numeric factorization rate of 3.6 Gflops on a 3.2 GHz -# Pentium 4 (512K cache, 4GB main memory) with the Goto BLAS, and 6 Gflops -# on a 2.5Ghz dual-core AMD Opteron. - -# These settings will probably not work, since there is no fixed convention for -# naming the BLAS and LAPACK library (*.a or *.so) files. - -# This is probably slow ... it might connect to the Standard Reference BLAS: -# BLAS = -lblas -lgfortran - LAPACK = -llapack - -# MKL -# BLAS = -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_core.a $(MKLROOT)/lib/intel64/libmkl_intel_thread.a -Wl,--end-group -lpthread -lm -# LAPACK = - -# ACML -# BLAS = -lacml -lgfortran -# LAPACK = - -# OpenBLAS - BLAS = -lopenblas -# LAPACK = - -# NOTE: this next option for the "Goto BLAS" has nothing to do with a "goto" -# statement. Rather, the Goto BLAS is written by Dr. Kazushige Goto. -# Using the Goto BLAS: -# BLAS = -lgoto -lgfortran -lgfortranbegin -# BLAS = -lgoto2 -lgfortran -lgfortranbegin -lpthread - -# Using non-optimized versions: -# BLAS = -lblas_plain -lgfortran -lgfortranbegin -# LAPACK = -llapack_plain - -# BLAS = -lblas_plain -lgfortran -lgfortranbegin -# LAPACK = -llapack - -# The BLAS might not contain xerbla, an error-handling routine for LAPACK and -# the BLAS. Also, the standard xerbla requires the Fortran I/O library, and -# stops the application program if an error occurs. A C version of xerbla -# distributed with this software (SuiteSparse_config/xerbla/libcerbla.a) -# includes a Fortran-callable xerbla routine that prints nothing and does not -# stop the application program. This is optional. - -# XERBLA = ../../SuiteSparse_config/xerbla/libcerbla.a - -# If you wish to use the XERBLA in LAPACK and/or the BLAS instead, -# use this option: -XERBLA = - -# If you wish to use the Fortran SuiteSparse_config/xerbla/xerbla.f instead, -# use this: - -# XERBLA = ../../SuiteSparse_config/xerbla/libxerbla.a - -#------------------------------------------------------------------------------ -# GPU configuration for CHOLMOD and SPQR -#------------------------------------------------------------------------------ - -# no cuda - CUDA_ROOT = - GPU_BLAS_PATH = - GPU_CONFIG = - CUDA_PATH = - CUDART_LIB = - CUBLAS_LIB = - CUDA_INC_PATH = - NV20 = - NV30 = - NV35 = - NVCC = echo - NVCCFLAGS = - -# with cuda for CHOLMOD -# CUDA_ROOT = /usr/local/cuda -# GPU_BLAS_PATH = $(CUDA_ROOT) -# with 4 cores (default): -# GPU_CONFIG = -I$(CUDA_ROOT)/include -DGPU_BLAS -# with 10 cores: -# GPU_CONFIG = -I$(CUDA_ROOT)/include -DGPU_BLAS -DCHOLMOD_OMP_NUM_THREADS=10 -# CUDA_PATH = $(CUDA_ROOT) -# CUDART_LIB = $(CUDA_ROOT)/lib64/libcudart.so -# CUBLAS_LIB = $(CUDA_ROOT)/lib64/libcublas.so -# CUDA_INC_PATH = $(CUDA_ROOT)/include/ -# NV20 = -arch=sm_20 -Xcompiler -fPIC -# NV30 = -arch=sm_30 -Xcompiler -fPIC -# NV35 = -arch=sm_35 -Xcompiler -fPIC -# NVCC = $(CUDA_ROOT)/bin/nvcc -# NVCCFLAGS = $(NV20) -O3 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=sm_35 - -# was NVCC = $(CUDA_ROOT)/bin/nvcc $(NV35) $(NV30) $(NV20) - -#------------------------------------------------------------------------------ -# METIS, optionally used by CHOLMOD -#------------------------------------------------------------------------------ - -# If you do not have METIS, or do not wish to use it in CHOLMOD, you must -# compile CHOLMOD with the -DNPARTITION flag. - -# 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 - -#------------------------------------------------------------------------------ -# UMFPACK configuration: -#------------------------------------------------------------------------------ - -# Configuration flags for UMFPACK. See UMFPACK/Source/umf_config.h for details. -# -# -DNBLAS do not use the BLAS. UMFPACK will be very slow. -# -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by -# LAPACK and the BLAS (defaults to 'int') -# -DNSUNPERF do not use the Sun Perf. Library (default is use it on Solaris) -# -DNRECIPROCAL do not multiply by the reciprocal -# -DNO_DIVIDE_BY_ZERO do not divide by zero -# -DNCHOLMOD do not use CHOLMOD as a ordering method. If -DNCHOLMOD is -# included in UMFPACK_CONFIG, then UMFPACK does not rely on -# CHOLMOD, CAMD, CCOLAMD, COLAMD, and METIS. - -UMFPACK_CONFIG = - -# uncomment this line to compile UMFPACK without CHOLMOD: -# UMFPACK_CONFIG = -DNCHOLMOD - -#------------------------------------------------------------------------------ -# CHOLMOD configuration -#------------------------------------------------------------------------------ - -# CHOLMOD Library Modules, which appear in libcholmod.a: -# Core requires: none -# Check requires: Core -# Cholesky requires: Core, AMD, COLAMD. optional: Partition, Supernodal -# MatrixOps requires: Core -# Modify requires: Core -# Partition requires: Core, CCOLAMD, METIS. optional: Cholesky -# Supernodal requires: Core, BLAS, LAPACK -# -# CHOLMOD test/demo Modules (all are GNU GPL, do not appear in libcholmod.a): -# Tcov requires: Core, Check, Cholesky, MatrixOps, Modify, Supernodal -# optional: Partition -# Valgrind same as Tcov -# Demo requires: Core, Check, Cholesky, MatrixOps, Supernodal -# optional: Partition -# -# Configuration flags: -# -DNCHECK do not include the Check module. License GNU LGPL -# -DNCHOLESKY do not include the Cholesky module. License GNU LGPL -# -DNPARTITION do not include the Partition module. License GNU LGPL -# also do not include METIS. -# -DNCAMD do not use CAMD, etc from Partition module. GNU LGPL -# -DNGPL do not include any GNU GPL Modules in the CHOLMOD library: -# -DNMATRIXOPS do not include the MatrixOps module. License GNU GPL -# -DNMODIFY do not include the Modify module. License GNU GPL -# -DNSUPERNODAL do not include the Supernodal module. License GNU GPL -# -# -DNPRINT do not print anything. -# -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by -# LAPACK and the BLAS (defaults to 'int') -# -DNSUNPERF for Solaris only. If defined, do not use the Sun -# Performance Library +#=============================================================================== +# Options you can change without editing this file: +#=============================================================================== -CHOLMOD_CONFIG = $(GPU_CONFIG) + # To list the options you can modify at the 'make' command line, type + # 'make config', which also lists their default values. You can then + # change them with 'make OPTION=value'. For example, to use an INSTALL + # path of /my/path, and to use your own BLAS and LAPACK libraries, do: + # + # make install INSTALL=/my/path BLAS=-lmyblas LAPACK=-lmylapackgoeshere + # + # which will install the package into /my/path/lib and /my/path/include, + # and use -lmyblas -lmylapackgoes here when building the demo program. -# uncomment this line to compile CHOLMOD without METIS: -# CHOLMOD_CONFIG = -DNPARTITION +#=============================================================================== +# Defaults for any system +#=============================================================================== -#------------------------------------------------------------------------------ -# SuiteSparseQR configuration: -#------------------------------------------------------------------------------ + #--------------------------------------------------------------------------- + # SuiteSparse root directory + #--------------------------------------------------------------------------- + + # Most Makefiles are in SuiteSparse/Pkg/Lib or SuiteSparse/Pkg/Demo, so + # the top-level of SuiteSparse is in ../.. unless otherwise specified. + # This is true for all but the SuiteSparse_config package. + SUITESPARSE ?= $(realpath $(CURDIR)/../..) + + #--------------------------------------------------------------------------- + # installation location + #--------------------------------------------------------------------------- + + # For "make install" and "make uninstall", the default location is + # SuiteSparse/lib, SuiteSparse/include, and + # SuiteSparse/share/doc/suitesparse-x.y.z + # If you do this: + # make install INSTALL=/usr/local + # then the libraries are installed in /usr/local/lib, include files in + # /usr/local/include, and documentation in + # /usr/local/share/doc/suitesparse-x.y.z. + # You can instead specify the install location of each of these 3 components + # separately, via (for example): + # make install INSTALL_LIB=/yada/mylibs INSTALL_INCLUDE=/yoda/myinc \ + # INSTALL_DOC=/solo/mydox + # which puts the libraries in /yada/mylibs, include files in /yoda/myinc, + # and documentation in /solo/mydox. + INSTALL ?= $(SUITESPARSE) + INSTALL_LIB ?= $(INSTALL)/lib + INSTALL_INCLUDE ?= $(INSTALL)/include + INSTALL_DOC ?= $(INSTALL)/share/doc/suitesparse-$(SUITESPARSE_VERSION) + + #--------------------------------------------------------------------------- + # optimization level + #--------------------------------------------------------------------------- + + OPTIMIZATION ?= -O3 + + #--------------------------------------------------------------------------- + # statement coverage for */Tcov + #--------------------------------------------------------------------------- + + ifeq ($(TCOV),yes) + # Each package has a */Tcov directory for extensive testing, including + # statement coverage. The Tcov tests require Linux and gcc, and use + # the vanilla BLAS. For those tests, the packages use 'make TCOV=yes', + # which overrides the following settings: + MKLROOT = + AUTOCC = no + CC = gcc + CXX = g++ + BLAS = -lrefblas -lgfortran -lstdc++ + LAPACK = -llapack + CFLAGS += --coverage + OPTIMIZATION = -g + LDFLAGS += --coverage + endif + + #--------------------------------------------------------------------------- + # CFLAGS for the C/C++ compiler + #--------------------------------------------------------------------------- + + # The CF macro is used by SuiteSparse Makefiles as a combination of + # CFLAGS, CPPFLAGS, TARGET_ARCH, and system-dependent settings. + CF ?= $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(OPTIMIZATION) -fexceptions -fPIC + + #--------------------------------------------------------------------------- + # OpenMP is used in CHOLMOD + #--------------------------------------------------------------------------- + + # with gcc, enable OpenMP directives via -fopenmp + # This is not supported on Darwin, so this string is cleared, below. + CFOPENMP ?= -fopenmp + + #--------------------------------------------------------------------------- + # compiler + #--------------------------------------------------------------------------- + + # By default, look for the Intel compilers. If present, they are used + # instead of $(CC), $(CXX), and $(F77). To disable this feature and + # use the $(CC), $(CXX), and $(F77) compilers, use 'make AUTOCC=no' + + AUTOCC ?= yes + + ifneq ($(AUTOCC),no) + ifneq ($(shell which icc 2>/dev/null),) + # use the Intel icc compiler for C codes, and -qopenmp for OpenMP + CC = icc -D_GNU_SOURCE + CXX = $(CC) + CFOPENMP = -qopenmp -I$(MKLROOT)/include + endif + ifneq ($(shell which ifort 2>/dev/null),) + # use the Intel ifort compiler for Fortran codes + F77 = ifort + endif + endif + + #--------------------------------------------------------------------------- + # code formatting (for Tcov only) + #--------------------------------------------------------------------------- + + PRETTY ?= grep -v "^\#" | indent -bl -nce -bli0 -i4 -sob -l120 + + #--------------------------------------------------------------------------- + # required libraries + #--------------------------------------------------------------------------- + + # SuiteSparse requires the BLAS, LAPACK, and -lm (Math) libraries. + # It places its shared *.so libraries in SuiteSparse/lib. + # Linux also requires the -lrt library (see below) + LDLIBS ?= -lm + LDFLAGS += -L$(INSTALL_LIB) + + # See http://www.openblas.net for a recent and freely available optimzed + # BLAS. LAPACK is at http://www.netlib.org/lapack/ . You can use the + # standard Fortran LAPACK along with OpenBLAS to obtain very good + # performance. This script can also detect if the Intel MKL BLAS is + # installed. + + LAPACK ?= -llapack + + ifndef BLAS + ifdef MKLROOT + # use the Intel MKL for BLAS and LAPACK + # using static linking: + # BLAS = -Wl,--start-group \ + # $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a \ + # $(MKLROOT)/lib/intel64/libmkl_core.a \ + # $(MKLROOT)/lib/intel64/libmkl_intel_thread.a \ + # -Wl,--end-group -lpthread -lm + # using dynamic linking: + BLAS = -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -lpthread -lm + LAPACK = + else + # use the OpenBLAS at http://www.openblas.net + BLAS = -lopenblas + endif + endif + + # For ACML, use this instead: + # make BLAS='-lacml -lgfortran' + + #--------------------------------------------------------------------------- + # shell commands + #--------------------------------------------------------------------------- + + # ranlib, and ar, for generating libraries. If you don't need ranlib, + # just change it to RANLAB = echo + RANLIB ?= ranlib + ARCHIVE ?= $(AR) $(ARFLAGS) + CP ?= cp -f + MV ?= mv -f + + #--------------------------------------------------------------------------- + # Fortran compiler (not required for 'make' or 'make library') + #--------------------------------------------------------------------------- + + # A Fortran compiler is optional. Only required for the optional Fortran + # interfaces to AMD and UMFPACK. Not needed by 'make' or 'make install' + F77 ?= gfortran + F77FLAGS ?= $(FFLAGS) $(OPTIMIZATION) + + #--------------------------------------------------------------------------- + # NVIDIA CUDA configuration for CHOLMOD and SPQR + #--------------------------------------------------------------------------- + + # CUDA is detected automatically, and used if found. To disable CUDA, + # use CUDA=no + + ifneq ($(CUDA),no) + CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") + endif + + ifeq ($(wildcard $(CUDA_PATH)),) + # CUDA is not present + CUDA_PATH = + GPU_BLAS_PATH = + GPU_CONFIG = + CUDART_LIB = + CUBLAS_LIB = + CUDA_INC_PATH = + CUDA_INC = + NVCC = echo + NVCCFLAGS = + else + # with CUDA for CHOLMOD and SPQR + GPU_BLAS_PATH = $(CUDA_PATH) + # GPU_CONFIG must include -DGPU_BLAS to compile SuiteSparse for the + # GPU. You can add additional GPU-related flags to it as well. + # with 4 cores (default): + GPU_CONFIG = -DGPU_BLAS + # For example, to compile CHOLMOD for 10 CPU cores when using the GPU: + # GPU_CONFIG = -DGPU_BLAS -DCHOLMOD_OMP_NUM_THREADS=10 + CUDART_LIB = $(CUDA_PATH)/lib64/libcudart.so + CUBLAS_LIB = $(CUDA_PATH)/lib64/libcublas.so + CUDA_INC_PATH = $(CUDA_PATH)/include/ + CUDA_INC = -I$(CUDA_INC_PATH) + NVCC = $(CUDA_PATH)/bin/nvcc + NVCCFLAGS = -Xcompiler -fPIC -O3 \ + -gencode=arch=compute_20,code=sm_20 \ + -gencode=arch=compute_30,code=sm_30 \ + -gencode=arch=compute_35,code=sm_35 \ + -gencode=arch=compute_50,code=sm_50 \ + -gencode=arch=compute_50,code=compute_50 + endif + + #--------------------------------------------------------------------------- + # UMFPACK configuration: + #--------------------------------------------------------------------------- + + # Configuration for UMFPACK. See UMFPACK/Source/umf_config.h for details. + # + # -DNBLAS do not use the BLAS. UMFPACK will be very slow. + # -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by + # LAPACK and the BLAS (defaults to 'int') + # -DNSUNPERF do not use the Sun Perf. Library on Solaris + # -DNRECIPROCAL do not multiply by the reciprocal + # -DNO_DIVIDE_BY_ZERO do not divide by zero + # -DNCHOLMOD do not use CHOLMOD as a ordering method. If -DNCHOLMOD is + # included in UMFPACK_CONFIG, then UMFPACK does not rely on + # CHOLMOD, CAMD, CCOLAMD, COLAMD, and METIS. + + UMFPACK_CONFIG ?= + + # For example, uncomment this line to compile UMFPACK without CHOLMOD: + # UMFPACK_CONFIG = -DNCHOLMOD + # or use 'make UMFPACK_CONFIG=-DNCHOLMOD' + + #--------------------------------------------------------------------------- + # CHOLMOD configuration + #--------------------------------------------------------------------------- + + # CHOLMOD Library Modules, which appear in -lcholmod + # Core requires: none + # Check requires: Core + # Cholesky requires: Core, AMD, COLAMD. optional: Partition, Supernodal + # MatrixOps requires: Core + # Modify requires: Core + # Partition requires: Core, CCOLAMD, METIS. optional: Cholesky + # Supernodal requires: Core, BLAS, LAPACK + # + # CHOLMOD test/demo Modules (these do not appear in -lcholmod): + # Tcov requires: Core, Check, Cholesky, MatrixOps, Modify, Supernodal + # optional: Partition + # Valgrind same as Tcov + # Demo requires: Core, Check, Cholesky, MatrixOps, Supernodal + # optional: Partition + # + # Configuration flags: + # -DNCHECK do not include the Check module. License GNU LGPL + # -DNCHOLESKY do not include the Cholesky module. License GNU LGPL + # -DNPARTITION do not include the Partition module. License GNU LGPL + # also do not include METIS. + # -DNCAMD do not use CAMD & CCOLAMD in Parition Modulel GNU LGPL + # -DNGPL do not include any GNU GPL Modules in the CHOLMOD library: + # -DNMATRIXOPS do not include the MatrixOps module. License GNU GPL + # -DNMODIFY do not include the Modify module. License GNU GPL + # -DNSUPERNODAL do not include the Supernodal module. License GNU GPL + # + # -DNPRINT do not print anything. + # -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by + # LAPACK and the BLAS (defaults to 'int') + # -DNSUNPERF for Solaris only. If defined, do not use the Sun + # Performance Library + # -DGPU_BLAS enable the use of the CUDA BLAS + + CHOLMOD_CONFIG ?= $(GPU_CONFIG) + + #--------------------------------------------------------------------------- + # SuiteSparseQR configuration: + #--------------------------------------------------------------------------- + + # The SuiteSparseQR library can be compiled with the following options: + # + # -DNPARTITION do not include the CHOLMOD partition module + # -DNEXPERT do not include the functions in SuiteSparseQR_expert.cpp + # -DHAVE_TBB enable the use of Intel's Threading Building Blocks + # -DGPU_BLAS enable the use of the CUDA BLAS + + SPQR_CONFIG ?= $(GPU_CONFIG) + + # to compile with Intel's TBB, use TBB=-ltbb SPQR_CONFIG=-DHAVE_TBB + TBB ?= + + # TODO: this *mk file should auto-detect the presence of Intel's TBB, + # and set the compiler flags accordingly. -# The SuiteSparseQR library can be compiled with the following options: -# -# -DNPARTITION do not include the CHOLMOD partition module -# -DNEXPERT do not include the functions in SuiteSparseQR_expert.cpp -# -DHAVE_TBB enable the use of Intel's Threading Building Blocks (TBB) - -# default, without timing, without TBB: -SPQR_CONFIG = $(GPU_CONFIG) -# with TBB: -# SPQR_CONFIG = -DHAVE_TBB - -# This is needed for IBM AIX: (but not for and C codes, just C++) -# SPQR_CONFIG = -DBLAS_NO_UNDERSCORE - -# with TBB, you must select this: -# TBB = -ltbb -# without TBB: -TBB = - -#------------------------------------------------------------------------------ -# code formatting -#------------------------------------------------------------------------------ - -# Use "grep" only, if you do not have "indent" -# PRETTY = grep -v "^\#" -# PRETTY = grep -v "^\#" | indent -bl -nce -ss -bli0 -i4 -sob -l120 - PRETTY = grep -v "^\#" | indent -bl -nce -bli0 -i4 -sob -l120 - -#------------------------------------------------------------------------------ -# Linux -#------------------------------------------------------------------------------ - -# Using default compilers: -# CC = gcc -# CF = $(CFLAGS) -O3 -fexceptions - -# alternatives: -# CF = $(CFLAGS) -g -fexceptions \ -# -Wall -W -Wshadow -Wmissing-prototypes -Wstrict-prototypes \ -# -Wredundant-decls -Wnested-externs -Wdisabled-optimization -ansi \ -# -funit-at-a-time -# CF = $(CFLAGS) -O3 -fexceptions \ -# -Wall -W -Werror -Wshadow -Wmissing-prototypes -Wstrict-prototypes \ -# -Wredundant-decls -Wnested-externs -Wdisabled-optimization -ansi -# CF = $(CFLAGS) -O3 -fexceptions -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -# CF = $(CFLAGS) -O3 -# CF = $(CFLAGS) -O3 -g -fexceptions -# CF = $(CFLAGS) -g -fexceptions \ -# -Wall -W -Wshadow \ -# -Wredundant-decls -Wdisabled-optimization -ansi - -# consider: -# -fforce-addr -fmove-all-movables -freduce-all-givs -ftsp-ordering -# -frename-registers -ffast-math -funroll-loops - -# Using the Goto BLAS: -# BLAS = -lgoto -lfrtbegin -lg2c $(XERBLA) -lpthread - -# Using Intel's icc and ifort compilers: -# (does not work for mexFunctions unless you add a mexopts.sh file) -# F77 = ifort -# CC = icc -# CF = $(CFLAGS) -O3 -xN -vec_report=0 -# CF = $(CFLAGS) -g - -# 64bit: -# F77FLAGS = -O -m64 -# CF = $(CFLAGS) -O3 -fexceptions -m64 -# BLAS = -lgoto64 -lfrtbegin -lg2c -lpthread $(XERBLA) -# LAPACK = -llapack64 - -# SUSE Linux 10.1, AMD Opteron, with GOTO Blas -# F77 = gfortran -# BLAS = -lgoto_opteron64 -lgfortran - -# SUSE Linux 10.1, Intel Pentium, with GOTO Blas -# F77 = gfortran -# BLAS = -lgoto -lgfortran - -#------------------------------------------------------------------------------ -# Mac -#------------------------------------------------------------------------------ - -# As recommended by macports, http://suitesparse.darwinports.com/ -# I've tested them myself on Mac OSX 10.6.1 and 10.6.8 (Snow Leopard), -# on my MacBook Air, and they work fine. - -# F77 = gfortran -# CF = $(CFLAGS) -O3 -fno-common -fexceptions -DNTIMER -# BLAS = -framework Accelerate -# LAPACK = -framework Accelerate -# LIB = -lm - -#------------------------------------------------------------------------------ -# Solaris -#------------------------------------------------------------------------------ - -# 32-bit -# CF = $(CFLAGS) -KPIC -dalign -xc99=%none -Xc -xlibmieee -xO5 -xlibmil -m32 - -# 64-bit -# CF = $(CFLAGS) -fast -KPIC -xc99=%none -xlibmieee -xlibmil -m64 -Xc - -# FFLAGS = -fast -KPIC -dalign -xlibmil -m64 - -# The Sun Performance Library includes both LAPACK and the BLAS: -# BLAS = -xlic_lib=sunperf -# LAPACK = - - -#------------------------------------------------------------------------------ -# Compaq Alpha -#------------------------------------------------------------------------------ - -# 64-bit mode only -# CF = $(CFLAGS) -O2 -std1 -# BLAS = -ldxml -# LAPACK = - -#------------------------------------------------------------------------------ -# IBM RS 6000 -#------------------------------------------------------------------------------ - -# BLAS = -lessl -# LAPACK = - -# 32-bit mode: -# CF = $(CFLAGS) -O4 -qipa -qmaxmem=16384 -qproto -# F77FLAGS = -O4 -qipa -qmaxmem=16384 - -# 64-bit mode: -# CF = $(CFLAGS) -O4 -qipa -qmaxmem=16384 -q64 -qproto -# F77FLAGS = -O4 -qipa -qmaxmem=16384 -q64 - -#------------------------------------------------------------------------------ -# SGI IRIX -#------------------------------------------------------------------------------ - -# BLAS = -lscsl -# LAPACK = - -# 32-bit mode -# CF = $(CFLAGS) -O +#=============================================================================== +# System-dependent configurations +#=============================================================================== + + #--------------------------------------------------------------------------- + # determine what system we are on + #--------------------------------------------------------------------------- + + # To disable these auto configurations, use 'make UNAME=custom' + + ifndef UNAME + ifeq ($(OS),Windows_NT) + # Cygwin Make on Windows has an $(OS) variable, but not uname. + # Note that this option is untested. + UNAME = Windows + else + # Linux and Darwin (Mac OSX) have been tested. + UNAME := $(shell uname) + endif + endif + + #--------------------------------------------------------------------------- + # Linux + #--------------------------------------------------------------------------- + + ifeq ($(UNAME),Linux) + # add the realtime library, librt, and SuiteSparse/lib + LDLIBS += -lrt -Wl,-rpath=$(INSTALL_LIB) + endif + + #--------------------------------------------------------------------------- + # Mac + #--------------------------------------------------------------------------- + + ifeq ($(UNAME), Darwin) + # To compile on the Mac, you must install Xcode. Then do this at the + # command line in the Terminal, before doing 'make': + # xcode-select --install + CF += -fno-common + BLAS = -framework Accelerate + LAPACK = -framework Accelerate + # OpenMP is not yet supported by default in clang + CFOPENMP = + endif + + #--------------------------------------------------------------------------- + # Solaris + #--------------------------------------------------------------------------- + + ifeq ($(UNAME), SunOS) + # Using the Sun compiler and the Sun Performance Library + # This hasn't been tested recently. + # I leave it here in case you need it. It likely needs updating. + CF += -fast -KPIC -xc99=%none -xlibmieee -xlibmil -m64 -Xc + F77FLAGS = -O -fast -KPIC -dalign -xlibmil -m64 + BLAS = -xlic_lib=sunperf + LAPACK = + # Using the GCC compiler and the reference BLAS + ## CC = gcc + ## CXX = g++ + ## MAKE = gmake + ## BLAS = -lrefblas -lgfortran + ## LAPACK = -llapack + endif + + #--------------------------------------------------------------------------- + # IBM AIX + #--------------------------------------------------------------------------- + + ifeq ($(UNAME), AIX) + # hasn't been tested for a very long time... + # I leave it here in case you need it. It likely needs updating. + CF += -O4 -qipa -qmaxmem=16384 -q64 -qproto -DBLAS_NO_UNDERSCORE + F77FLAGS = -O4 -qipa -qmaxmem=16384 -q64 + BLAS = -lessl + LAPACK = + endif -# 64-bit mode (32 bit int's and 64-bit long's): -# CF = $(CFLAGS) -64 -# F77FLAGS = -64 +#=============================================================================== +# finalize the CF compiler flags +#=============================================================================== + + CF += $(CFOPENMP) + +#=============================================================================== +# internal configuration +#=============================================================================== + + # The user should not have to change these definitions, and they are + # not displayed by 'make config' + + #--------------------------------------------------------------------------- + # for removing files not in the distribution + #--------------------------------------------------------------------------- -# SGI doesn't have ranlib -# RANLIB = echo + # remove object files, but keep compiled libraries via 'make clean' + CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.tcov *.gcov gmon.out *.bak *.d \ + *.gcda *.gcno *.aux *.bbl *.blg *.log *.toc *.dvi *.lof *.lot -#------------------------------------------------------------------------------ -# AMD Opteron (64 bit) -#------------------------------------------------------------------------------ + # also remove compiled libraries, via 'make distclean' + PURGE = *.so* *.a *.dll *.dylib *.dSYM -# BLAS = -lgoto_opteron64 -lg2c -# LAPACK = -llapack_opteron64 + # location of TCOV test output + TCOV_TMP ?= /tmp -# SUSE Linux 10.1, AMD Opteron -# F77 = gfortran -# BLAS = -lgoto_opteron64 -lgfortran -# LAPACK = -llapack_opteron64 +#=============================================================================== +# Building the shared and static libraries +#=============================================================================== + +# How to build/install shared and static libraries for Mac and Linux/Unix. +# This assumes that LIBRARY and VERSION have already been defined by the +# Makefile that includes this file. + +SO_OPTS = $(LDFLAGS) + +ifeq ($(UNAME),Windows) + # Cygwin Make on Windows (untested) + AR_TARGET = $(LIBRARY).lib + SO_PLAIN = $(LIBRARY).dll + SO_MAIN = $(LIBRARY).$(SO_VERSION).dll + SO_TARGET = $(LIBRARY).$(VERSION).dll + SO_INSTALL_NAME = echo +else + # Mac or Linux/Unix + AR_TARGET = $(LIBRARY).a + ifeq ($(UNAME),Darwin) + # Mac + SO_PLAIN = $(LIBRARY).dylib + SO_MAIN = $(LIBRARY).$(SO_VERSION).dylib + SO_TARGET = $(LIBRARY).$(VERSION).dylib + SO_OPTS += -dynamiclib -compatibility_version $(SO_VERSION) \ + -current_version $(VERSION) \ + -shared -undefined dynamic_lookup + # When a Mac *.dylib file is moved, this command is required + # to change its internal name to match its location in the filesystem: + SO_INSTALL_NAME = install_name_tool -id + else + # Linux and other variants of Unix + SO_PLAIN = $(LIBRARY).so + SO_MAIN = $(LIBRARY).so.$(SO_VERSION) + SO_TARGET = $(LIBRARY).so.$(VERSION) + SO_OPTS += -shared -Wl,-soname -Wl,$(SO_MAIN) -Wl,--no-undefined + # Linux/Unix *.so files can be moved without modification: + SO_INSTALL_NAME = echo + endif +endif + +#=============================================================================== +# Configure CHOLMOD/Partition module with METIS, CAMD, and CCOLAMD +#=============================================================================== + +# By default, SuiteSparse uses METIS 5.1.0 in the SuiteSparse/metis-5.1.0 +# directory. SuiteSparse's interface to METIS is only through the +# SuiteSparse/CHOLMOD/Partition module, which also requires SuiteSparse/CAMD +# and SuiteSparse/CCOLAMD. +# +# If you wish to use your own pre-installed copy of METIS, use the MY_METIS_LIB +# and MY_METIS_INC options passed to 'make'. For example: +# make MY_METIS_LIB=-lmetis +# make MY_METIS_LIB=/home/myself/mylibraries/libmetis.so +# make MY_METIS_LIB='-L/home/myself/mylibraries -lmetis' +# If you need to tell the compiler where to find the metis.h include file, +# then add MY_METIS_INC=/home/myself/metis-5.1.0/include as well, which points +# to the directory containing metis.h. If metis.h is already installed in +# a location known to the compiler (/usr/local/include/metis.h for example) +# then you do not need to add MY_METIS_INC. + +I_WITH_PARTITION = +LIB_WITH_PARTITION = +CONFIG_PARTITION = -DNPARTITION -DNCAMD +# check if CAMD/CCOLAMD and METIS are requested and available +ifeq (,$(findstring -DNCAMD, $(CHOLMOD_CONFIG))) + # CAMD and CCOLAMD are requested. See if they are available in + # SuiteSparse/CAMD and SuiteSparse/CCOLAMD + ifneq (, $(wildcard $(SUITESPARSE)/CAMD)) + ifneq (, $(wildcard $(SUITESPARSE)/CCOLAMD)) + # CAMD and CCOLAMD are requested and available + LIB_WITH_PARTITION = -lccolamd -lcamd + I_WITH_PARTITION = -I$(SUITESPARSE)/CCOLAMD/Include -I$(SUITESPARSE)/CAMD/Include + CONFIG_PARTITION = -DNPARTITION + # check if METIS is requested and available + ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG))) + # METIS is requested. See if it is available. + ifneq (,$(MY_METIS_LIB)) + # METIS 5.1.0 is provided elsewhere, and we are not using + # SuiteSparse/metis-5.1.0. To do so, we link with + # $(MY_METIS_LIB) and add the -I$(MY_METIS_INC) option for + # the compiler. The latter can be empty if you have METIS + # installed in a place where the compiler can find the + # metis.h include file by itself without any -I option + # (/usr/local/include/metis.h for example). + LIB_WITH_PARTITION += $(MY_METIS_LIB) + ifneq (,$(MY_METIS_INC)) + I_WITH_PARTITION += -I$(MY_METIS_INC) + endif + CONFIG_PARTITION = + else + # see if METIS is in SuiteSparse/metis-5.1.0 + ifneq (, $(wildcard $(SUITESPARSE)/metis-5.1.0)) + # SuiteSparse/metis5.1.0 is available + ifeq ($(UNAME), Darwin) + LIB_WITH_PARTITION += $(SUITESPARSE)/lib/libmetis.dylib + else + LIB_WITH_PARTITION += -lmetis + endif + I_WITH_PARTITION += -I$(SUITESPARSE)/metis-5.1.0/include + CONFIG_PARTITION = + endif + endif + endif + endif + endif +endif + +#=============================================================================== +# display configuration +#=============================================================================== -#------------------------------------------------------------------------------ -# remove object files and profile output -#------------------------------------------------------------------------------ +ifeq ($(LIBRARY),) + # placeholders, for 'make config' in the top-level SuiteSparse + LIBRARY=PackageNameWillGoHere + VERSION=x.y.z + SO_VERSION=x +endif + +# 'make config' lists the primary installation options +config: + @echo ' ' + @echo '----------------------------------------------------------------' + @echo 'SuiteSparse package compilation options:' + @echo '----------------------------------------------------------------' + @echo ' ' + @echo 'SuiteSparse Version: ' '$(SUITESPARSE_VERSION)' + @echo 'SuiteSparse top folder: ' '$(SUITESPARSE)' + @echo 'Package: LIBRARY= ' '$(LIBRARY)' + @echo 'Version: VERSION= ' '$(VERSION)' + @echo 'SO version: SO_VERSION= ' '$(SO_VERSION)' + @echo 'System: UNAME= ' '$(UNAME)' + @echo 'Install directory: INSTALL= ' '$(INSTALL)' + @echo 'Install libraries in: INSTALL_LIB= ' '$(INSTALL_LIB)' + @echo 'Install include files in: INSTALL_INCLUDE=' '$(INSTALL_INCLUDE)' + @echo 'Install documentation in: INSTALL_DOC= ' '$(INSTALL_DOC)' + @echo 'Optimization level: OPTIMIZATION= ' '$(OPTIMIZATION)' + @echo 'BLAS library: BLAS= ' '$(BLAS)' + @echo 'LAPACK library: LAPACK= ' '$(LAPACK)' + @echo 'Intel TBB library: TBB= ' '$(TBB)' + @echo 'Other libraries: LDLIBS= ' '$(LDLIBS)' + @echo 'static library: AR_TARGET= ' '$(AR_TARGET)' + @echo 'shared library (full): SO_TARGET= ' '$(SO_TARGET)' + @echo 'shared library (main): SO_MAIN= ' '$(SO_MAIN)' + @echo 'shared library (short): SO_PLAIN= ' '$(SO_PLAIN)' + @echo 'shared library options: SO_OPTS= ' '$(SO_OPTS)' + @echo 'shared library name tool: SO_INSTALL_NAME=' '$(SO_INSTALL_NAME)' + @echo 'ranlib, for static libs: RANLIB= ' '$(RANLIB)' + @echo 'static library command: ARCHIVE= ' '$(ARCHIVE)' + @echo 'copy file: CP= ' '$(CP)' + @echo 'move file: MV= ' '$(MV)' + @echo 'remove file: RM= ' '$(RM)' + @echo 'pretty (for Tcov tests): PRETTY= ' '$(PRETTY)' + @echo 'C compiler: CC= ' '$(CC)' + @echo 'C++ compiler: CXX= ' '$(CXX)' + @echo 'CUDA compiler: NVCC= ' '$(NVCC)' + @echo 'CUDA root directory: CUDA_PATH= ' '$(CUDA_PATH)' + @echo 'OpenMP flags: CFOPENMP= ' '$(CFOPENMP)' + @echo 'C/C++ compiler flags: CF= ' '$(CF)' + @echo 'LD flags: LDFLAGS= ' '$(LDFLAGS)' + @echo 'Fortran compiler: F77= ' '$(F77)' + @echo 'Fortran flags: F77FLAGS= ' '$(F77FLAGS)' + @echo 'Intel MKL root: MKLROOT= ' '$(MKLROOT)' + @echo 'Auto detect Intel icc: AUTOCC= ' '$(AUTOCC)' + @echo 'UMFPACK config: UMFPACK_CONFIG= ' '$(UMFPACK_CONFIG)' + @echo 'CHOLMOD config: CHOLMOD_CONFIG= ' '$(CHOLMOD_CONFIG)' + @echo 'SuiteSparseQR config: SPQR_CONFIG= ' '$(SPQR_CONFIG)' + @echo 'CUDA library: CUDART_LIB= ' '$(CUDART_LIB)' + @echo 'CUBLAS library: CUBLAS_LIB= ' '$(CUBLAS_LIB)' + @echo 'METIS and CHOLMOD/Partition configuration:' + @echo 'Your METIS library: MY_METIS_LIB= ' '$(MY_METIS_LIB)' + @echo 'Your metis.h is in: MY_METIS_INC= ' '$(MY_METIS_INC)' + @echo 'METIS is used via the CHOLMOD/Partition module, configured as follows.' + @echo 'If the next line has -DNPARTITION then METIS will not be used:' + @echo 'CHOLMOD Partition config: ' '$(CONFIG_PARTITION)' + @echo 'CHOLMOD Partition libs: ' '$(LIB_WITH_PARTITION)' + @echo 'CHOLMOD Partition include:' '$(I_WITH_PARTITION)' +ifeq ($(TCOV),yes) + @echo 'TCOV=yes, for extensive testing only (gcc, g++, vanilla BLAS)' +endif -CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.tcov *.gcov gmon.out *.bak *.d *.gcda *.gcno diff --git a/SuiteSparse/SuiteSparse_config/xerbla/Makefile b/SuiteSparse/SuiteSparse_config/xerbla/Makefile index 9de73302f..420c50e88 100644 --- a/SuiteSparse/SuiteSparse_config/xerbla/Makefile +++ b/SuiteSparse/SuiteSparse_config/xerbla/Makefile @@ -1,33 +1,73 @@ -# Makefile for null-output xerbla +# Makefile for null-output xerbla, both C and Fortran versions. +# By default, the C version (libcerbla.a and *.so) is compiled and installed. +# Set the USE_FORTRAN option to 1 to create the Fortran instead (libxerbla): + USE_FORTRAN = 0 +# USE_FORTRAN = 1 -default: ccode +VERSION = 1.0.2 +SO_VERSION = 1 + +default: library + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + +all: library + +ifeq ($(USE_FORTRAN),0) + LIBRARY = libcerbla +else + LIBRARY = libxerbla +endif include ../SuiteSparse_config.mk -ccode: libcerbla.a +ifeq ($(USE_FORTRAN),0) + COMPILE = $(CC) $(CF) -c xerbla.c + DEPENDS = xerbla.c xerbla.h +else + COMPILE = $(F77) $(F77FLAGS) -c xerbla.f + DEPENDS = xerbla.f +endif -fortran: libxerbla.a +ccode: all -all: libxerbla.a libcerbla.a +fortran: all -# Fortran version: -libxerbla.a: xerbla.f - $(F77) $(F77FLAGS) -c xerbla.f - $(ARCHIVE) libxerbla.a xerbla.o - - $(RANLIB) libxerbla.a +$(AR_TARGET): $(DEPENDS) + $(COMPILE) + $(ARCHIVE) $(AR_TARGET) xerbla.o + - $(RANLIB) $(AR_TARGET) - $(RM) xerbla.o -# C version: -libcerbla.a: xerbla.c xerbla.h - $(CC) $(CF) -c xerbla.c - $(ARCHIVE) libcerbla.a xerbla.o - - $(RANLIB) libcerbla.a +# install libcerbla / libxerbla +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(DEPENDS) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(COMPILE) + $(CC) $(SO_OPTS) xerbla.o -o $@ - $(RM) xerbla.o + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) xerbla.h $(INSTALL_INCLUDE) + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/xerbla.h + +# uninstall libcerbla / libxerbla +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_INCLUDE)/xerbla.h distclean: purge purge: clean - - $(RM) *.o *.a + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) + diff --git a/SuiteSparse/SuiteSparse_install.m b/SuiteSparse/SuiteSparse_install.m index 073b3430d..4a5cdda4c 100644 --- a/SuiteSparse/SuiteSparse_install.m +++ b/SuiteSparse/SuiteSparse_install.m @@ -59,22 +59,7 @@ function SuiteSparse_install (do_demo) fprintf ('\nInstalling SuiteSparse for MATLAB version %s\n\n', v) ; -% check if METIS 4.0.1 is present where it's supposed to be -have_metis = exist ('metis-4.0/Lib', 'dir') ; -if (~have_metis) - fprintf ('METIS 4.0.1 is not present. CHOLMOD, KLU, UMFPACK and SPQR\n') ; - fprintf ('optionally use it as an ordering method. To use METIS,\n') ; - fprintf ('download it from http://glaros.dtc.umn.edu/gkhome/views/metis\n'); - fprintf ('and place the metis-4.0 directory in this directory\n') ; - fprintf ('so that ./metis-4.0/Lib exists.\n\n') ; - fprintf ('Now compiling without METIS.\n') ; -else - fprintf ('\nCompiling with METIS 4.0.1. You may safely ignore warnings\n'); - fprintf ('in metis-4.0/Lib/util.c regarding a malformed format string.\n') ; -end - % add SuiteSparse to the path -fprintf ('\n\nPlease wait while SuiteSparse is compiled and installed.\n\n') ; paths = add_to_path (paths, SuiteSparse) ; %------------------------------------------------------------------------------- diff --git a/SuiteSparse/SuiteSparse_test.m b/SuiteSparse/SuiteSparse_test.m index e1a4913a8..f277b764d 100644 --- a/SuiteSparse/SuiteSparse_test.m +++ b/SuiteSparse/SuiteSparse_test.m @@ -19,24 +19,10 @@ SuiteSparse = pwd ; package = 0 ; -if (verLessThan ('matlab', '7.0')) - error ('SuiteSparse_test requires MATLAB 7.0 or later') ; -end - -% if at UF, ensure pre-installed UF Sparse Matrix Collection is used -uf = { '/cise/homes/davis/Install/UFget', 'd:/UFget', '/share/UFget', ... - '/windows/UFget', '/cise/research/sparse/UFget' } ; -for k = 1:length(uf) - if (exist (uf {k}, 'dir')) - addpath (uf {k}) ; - break ; - end -end - try %--------------------------------------------------------------------------- - % CSparse (both 64-bit and 32-bit MATLAB) + % CSparse %--------------------------------------------------------------------------- % compile and install CSparse (not installed by SuiteSparse_install) diff --git a/SuiteSparse/UFget/mat/UF_Index.mat b/SuiteSparse/UFget/mat/UF_Index.mat index 33213c841..c15345da0 100644 Binary files a/SuiteSparse/UFget/mat/UF_Index.mat and b/SuiteSparse/UFget/mat/UF_Index.mat differ diff --git a/SuiteSparse/UFget/matrices/UFstats.csv b/SuiteSparse/UFget/matrices/UFstats.csv index 6c4224260..0c4c0fcd1 100644 --- a/SuiteSparse/UFget/matrices/UFstats.csv +++ b/SuiteSparse/UFget/matrices/UFstats.csv @@ -1,5 +1,5 @@ -2650 -03-Dec-2012 16:02:06 +2757 +03-Jun-2015 15:41:38 HB,1138_bus,1138,1138,4054,1,0,0,1,1,1,power network problem HB,494_bus,494,494,1666,1,0,0,1,1,1,power network problem HB,662_bus,662,662,2474,1,0,0,1,1,1,power network problem @@ -1477,7 +1477,7 @@ Pajek,football,35,35,118,1,0,0,0,0,0,directed weighted graph Pajek,GD00_a,352,352,458,1,1,0,0,0,0,directed graph Pajek,GD00_c,638,638,1041,1,0,0,0,0.02133850630455868,0.01551891367604268,directed multigraph Pajek,GD01_a,311,311,645,1,0,0,0,0.01550387596899225,0.01550387596899225,directed weighted graph -Pajek,GD01_A,953,953,645,1,0,0,0,0.01550387596899225,0.01550387596899225,directed multigraph +Pajek,GD01_Acap,953,953,645,1,0,0,0,0.01550387596899225,0.01550387596899225,directed multigraph Pajek,GD01_b,18,18,37,1,1,0,0,0.5142857142857142,0.5142857142857142,directed graph Pajek,GD01_c,33,33,135,1,0,0,0,0,0,directed multigraph Pajek,GD02_a,23,23,87,1,1,0,0,0.6436781609195402,0.6436781609195402,directed graph @@ -2650,3 +2650,110 @@ Janna,CoupCons3D,416800,416800,17277420,1,0,1,0,1,0.008881642549324996,structura Janna,ML_Laplace,377002,377002,27582698,1,0,1,0,1,7.351401706466176e-08,structural problem Janna,Transport,1602111,1602111,23487281,1,0,1,0,1,0,structural problem Janna,ML_Geer,1504002,1504002,110686677,1,0,1,0,1,2.381330188145693e-07,structural problem +ANSYS,Delor64K,64719,1785345,652140,1,0,0,0,0,0,least squares problem +ANSYS,Delor295K,295734,1823928,2401323,1,0,0,0,0,0,least squares problem +ANSYS,Delor338K,343236,887058,4211599,1,0,0,0,0,0,least squares problem +Sorensen,Linux_call_graph,324085,324085,1208908,1,0,0,0,0.0006324084497715383,0.0006125422157473015,directed weighted graph +LeGresley,LeGresley_2508,2508,2508,16727,1,0,0,0,0.8376116463886349,0.2557141852450946,power network problem +LeGresley,LeGresley_4908,4908,4908,30482,1,0,0,0,0.9773607038123168,0.02995112414467253,power network problem +LeGresley,LeGresley_87936,87936,87936,593276,1,0,0,0,0.9792020608292309,0.03427471928313486,power network problem +Brogan,specular,477976,1600,7647040,1,0,1,0,0,0,computer vision problem +Janna,Bump_2911,2911419,2911419,127729899,1,0,1,1,1,1,2D/3D problem +Janna,Queen_4147,4147110,4147110,316548962,1,0,1,1,1,1,2D/3D problem +Janna,PFlow_742,742793,742793,37138461,1,0,1,1,1,1,2D/3D problem +Freescale,Freescale2,2999349,2999349,14313235,1,0,0,0,0.9853083953765489,0.5600838032920651,circuit simulation matrix +Moqri,MISKnowledgeMap,2427,2427,57022,1,0,0,0,1,1,undirected weighted graph +Mazaheri,bundle_adj,513351,513351,20207907,1,0,1,1,1,1,computer vision problem +VDOL,dynamicSoaringProblem_1,647,647,5367,1,0,0,0,1,1,optimal control problem +VDOL,dynamicSoaringProblem_2,1591,1591,15588,1,0,0,0,1,1,optimal control problem +VDOL,dynamicSoaringProblem_3,2871,2871,32022,1,0,0,0,1,1,optimal control problem +VDOL,dynamicSoaringProblem_4,3191,3191,36516,1,0,0,0,1,1,optimal control problem +VDOL,dynamicSoaringProblem_5,3271,3271,36789,1,0,0,0,1,1,optimal control problem +VDOL,dynamicSoaringProblem_6,3431,3431,36741,1,0,0,0,1,1,optimal control problem +VDOL,dynamicSoaringProblem_7,3511,3511,37680,1,0,0,0,1,1,optimal control problem +VDOL,dynamicSoaringProblem_8,3543,3543,38136,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_1,798,798,5246,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_2,1338,1338,11600,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_3,1718,1718,12922,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_4,2358,2358,18218,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_5,2878,2878,24582,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_6,3358,3358,27030,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_7,3918,3918,31046,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_8,4398,4398,34958,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_9,4778,4778,39964,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_10,5218,5218,40080,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_11,5438,5438,40054,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_12,5578,5578,41940,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_13,5718,5718,43994,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_14,5958,5958,43298,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_15,6038,6038,43378,1,0,0,0,1,1,optimal control problem +VDOL,freeFlyingRobot_16,6078,6078,44006,1,0,0,0,1,1,optimal control problem +VDOL,goddardRocketProblem_1,831,831,8498,1,0,0,0,1,1,optimal control problem +VDOL,goddardRocketProblem_2,867,867,9058,1,0,0,0,1,1,optimal control problem +VDOL,hangGlider_1,360,360,3477,1,0,0,0,1,1,optimal control problem +VDOL,hangGlider_2,1647,1647,14754,1,0,0,0,1,1,optimal control problem +VDOL,hangGlider_3,10260,10260,92703,1,0,0,0,1,1,optimal control problem +VDOL,hangGlider_4,15561,15561,149532,1,0,0,0,1,1,optimal control problem +VDOL,hangGlider_5,16011,16011,155246,1,0,0,0,1,1,optimal control problem +VDOL,kineticBatchReactor_1,2052,2052,20600,1,0,0,0,1,1,optimal control problem +VDOL,kineticBatchReactor_2,4361,4361,44840,1,0,0,0,1,1,optimal control problem +VDOL,kineticBatchReactor_3,5082,5082,53219,1,0,0,0,1,1,optimal control problem +VDOL,kineticBatchReactor_4,7105,7105,74869,1,0,0,0,1,1,optimal control problem +VDOL,kineticBatchReactor_5,7641,7641,80767,1,0,0,0,1,1,optimal control problem +VDOL,kineticBatchReactor_6,7773,7773,82500,1,0,0,0,1,1,optimal control problem +VDOL,kineticBatchReactor_7,7968,7968,84508,1,0,0,0,1,1,optimal control problem +VDOL,kineticBatchReactor_8,8052,8052,85194,1,0,0,0,1,1,optimal control problem +VDOL,kineticBatchReactor_9,8115,8115,86183,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_1,584,584,6133,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_2,2312,2312,26261,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_3,7064,7064,80645,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_4,13562,13562,160947,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_5,16262,16262,198369,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_6,16928,16928,207349,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_7,17378,17378,211561,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_8,17702,17702,216445,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_9,18044,18044,219589,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_10,18260,18260,222005,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_11,18368,18368,223801,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_12,18458,18458,224593,1,0,0,0,1,1,optimal control problem +VDOL,lowThrust_13,18476,18476,224897,1,0,0,0,1,1,optimal control problem +VDOL,orbitRaising_1,442,442,2906,1,0,0,0,1,1,optimal control problem +VDOL,orbitRaising_2,739,739,6526,1,0,0,0,1,1,optimal control problem +VDOL,orbitRaising_3,761,761,6098,1,0,0,0,1,1,optimal control problem +VDOL,orbitRaising_4,915,915,7790,1,0,0,0,1,1,optimal control problem +VDOL,reorientation_1,677,677,7326,1,0,0,0,1,1,optimal control problem +VDOL,reorientation_2,1544,1544,17910,1,0,0,0,1,1,optimal control problem +VDOL,reorientation_3,2513,2513,32166,1,0,0,0,1,1,optimal control problem +VDOL,reorientation_4,2717,2717,33630,1,0,0,0,1,1,optimal control problem +VDOL,reorientation_5,2904,2904,35590,1,0,0,0,1,1,optimal control problem +VDOL,reorientation_6,3006,3006,37342,1,0,0,0,1,1,optimal control problem +VDOL,reorientation_7,3057,3057,37150,1,0,0,0,1,1,optimal control problem +VDOL,reorientation_8,3108,3108,37894,1,0,0,0,1,1,optimal control problem +VDOL,spaceShuttleEntry_1,560,560,6891,1,0,0,0,1,1,optimal control problem +VDOL,spaceShuttleEntry_2,1428,1428,24073,1,0,0,0,1,1,optimal control problem +VDOL,spaceShuttleEntry_3,1834,1834,28757,1,0,0,0,1,1,optimal control problem +VDOL,spaceShuttleEntry_4,2450,2450,39669,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_1,99,99,927,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_2,329,329,5817,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_3,467,467,5103,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_4,950,950,13626,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_5,1019,1019,15219,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_6,1111,1111,17595,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_7,1134,1134,18252,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_8,1157,1157,18945,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_9,1180,1180,19674,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_10,1272,1272,17478,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_11,1364,1364,18954,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_12,1410,1410,19728,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_13,1617,1617,23649,1,0,0,0,1,1,optimal control problem +VDOL,spaceStation_14,1640,1640,24324,1,0,0,0,1,1,optimal control problem +VDOL,tumorAntiAngiogenesis_1,205,205,1783,1,0,0,0,1,1,optimal control problem +VDOL,tumorAntiAngiogenesis_2,305,305,2699,1,0,0,0,1,1,optimal control problem +VDOL,tumorAntiAngiogenesis_3,410,410,3952,1,0,0,0,1,1,optimal control problem +VDOL,tumorAntiAngiogenesis_4,455,455,4593,1,0,0,0,1,1,optimal control problem +VDOL,tumorAntiAngiogenesis_5,460,460,4690,1,0,0,0,1,1,optimal control problem +VDOL,tumorAntiAngiogenesis_6,465,465,4795,1,0,0,0,1,1,optimal control problem +VDOL,tumorAntiAngiogenesis_7,475,475,4597,1,0,0,0,1,1,optimal control problem +VDOL,tumorAntiAngiogenesis_8,490,490,4776,1,0,0,0,1,1,optimal control problem +Meng,iChem_Jacobian,274087,274087,4137369,0,0,0,0,0.9801722990969854,0.6457048695901567,computational chemistry problem +Harvard_Seismology,JP,87616,67320,13734559,1,0,0,0,0,0,tomography problem diff --git a/SuiteSparse/UMFPACK/Demo/Makefile b/SuiteSparse/UMFPACK/Demo/Makefile index b4b386110..ce11b4201 100644 --- a/SuiteSparse/UMFPACK/Demo/Makefile +++ b/SuiteSparse/UMFPACK/Demo/Makefile @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------- -# compile the UMFPACK demos (for GNU make and original make) +# compile the UMFPACK demos #------------------------------------------------------------------------------- # UMFPACK Copyright (c) Timothy A. Davis. @@ -16,78 +16,33 @@ all64: libs run hb fortran64 include ../../SuiteSparse_config/SuiteSparse_config.mk #------------------------------------------------------------------------------- -# the optional Partition module requires METIS, CAMD, and CCOLAMD -I_WITH_PARTITION = -LIB_WITH_PARTITION = -CONFIG1 = -DNCHOLMOD -CONFIG2 = -DNPARTITION +# UMFPACK optionally uses the CHOLMOD Partition module +LIB_WITH_CHOLMOD = ifeq (,$(findstring -DNCHOLMOD, $(UMFPACK_CONFIG))) - # CHOLMOD is requested. See if it is available - ifeq (../../CHOLMOD, $(wildcard ../../CHOLMOD)) - ifeq (../../COLAMD, $(wildcard ../../COLAMD)) - # CHOLMOD and COLAMD are available - CONFIG1 = - LIB_WITH_CHOLMOD = ../../CHOLMOD/Lib/libcholmod.a \ - ../../COLAMD/Lib/libcolamd.a - # check if METIS is requested and available - ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG))) - # METIS is requested. See if it is available - ifeq ($(METIS_PATH), $(wildcard $(METIS_PATH))) - ifeq (../../CAMD, $(wildcard ../../CAMD)) - ifeq (../../CCOLAMD, $(wildcard ../../CCOLAMD)) - # METIS, CAMD, and CCOLAMD are available - LIB_WITH_PARTITION = $(METIS) \ - ../../CCOLAMD/Lib/libccolamd.a \ - ../../CAMD/Lib/libcamd.a - I_WITH_PARTITION = -I$(METIS_PATH)/Lib \ - -I../../CCOLAMD/Include -I../../CAMD/Include - CONFIG2 = - endif - endif - endif - endif - endif - endif + LIB_WITH_CHOLMOD = $(LIB_WITH_PARTITION) $(CUBLAS_LIB) $(CUDART_LIB) endif -#------------------------------------------------------------------------------- - -C = $(CC) $(CF) $(UMFPACK_CONFIG) $(CONFIG1) $(CONFIG2) \ - -I../Include -I../../AMD/Include -I../../SuiteSparse_config -INC = ../Include/umfpack.h ../../AMD/Include/amd.h ../../SuiteSparse_config/SuiteSparse_config.h +#------------------------------------------------------------------------------- -LIBS = $(LAPACK) $(BLAS) $(XERBLA) $(LIB) $(LIB_WITH_CHOLMOD) $(LIB_WITH_PARTITION) $(CUBLAS_LIB) $(CUDART_LIB) +C = $(CC) $(CF) $(UMFPACK_CONFIG) $(CONFIG_PARTITION) \ + -I../../include -../Lib/libumfpack.a: - ( cd ../Lib ; $(MAKE) ) +LIBS = $(LDLIBS) -L../../lib -lumfpack -lamd -lsuitesparseconfig \ + $(LIB_WITH_CHOLMOD) $(LAPACK) $(BLAS) -../../AMD/Lib/libamd.a: +libs: metis + ( cd ../../SuiteSparse_config ; $(MAKE) ) ( cd ../../AMD ; $(MAKE) library ) - -../../SuiteSparse_config/libsuitesparseconfig.a: - ( cd ../../SuiteSparse_config ; $(MAKE) library ) - -../../CHOLMOD/Lib/libcholmod.a: + ( cd ../Lib ; $(MAKE) ) - ( cd ../../CHOLMOD && $(MAKE) library ) - -../../COLAMD/Lib/libcolamd.a: - ( cd ../../COLAMD && $(MAKE) library ) + - ( cd ../../CCOLAMD ; $(MAKE) library ) + - ( cd ../../CAMD ; $(MAKE) library ) +metis: ../../include/metis.h -../../CCOLAMD/Lib/libccolamd.a: - - ( cd ../../CCOLAMD && $(MAKE) library ) - -../../CAMD/Lib/libcamd.a: - - ( cd ../../CAMD && $(MAKE) library ) - -$(METIS): - ( cd $(METIS_PATH) && $(MAKE) ) - -UMFPACK = ../Lib/libumfpack.a ../../AMD/Lib/libamd.a \ - ../../SuiteSparse_config/libsuitesparseconfig.a \ - $(LIB_WITH_CHOLMOD) $(LIB_WITH_PARTITION) - -libs: $(UMFPACK) +../../include/metis.h: + - ( cd ../.. && $(MAKE) metis ) #------------------------------------------------------------------------------- # Create the demo programs, run them, and compare the output @@ -95,15 +50,15 @@ libs: $(UMFPACK) dist: umfpack_di_demo.c umfpack_dl_demo.c umfpack_zi_demo.c umfpack_zl_demo.c -umfpack_simple: umfpack_simple.c $(INC) $(UMFPACK) - $(C) -o umfpack_simple umfpack_simple.c $(UMFPACK) $(LIBS) +umfpack_simple: umfpack_simple.c + $(C) -o umfpack_simple umfpack_simple.c $(LIBS) # the GNU rules are simpler: # umfpack_%_demo.c: umfpack_xx_demo.c umfpack_%_demo.sed # - sed -f umfpack_$*_demo.sed < umfpack_xx_demo.c > umfpack_$*_demo.c # -# umfpack_%_demo: umfpack_%_demo.c $(INC) $(UMFPACK) -# $(C) -o umfpack_$*_demo umfpack_$*_demo.c $(UMFPACK) $(LIBS) +# umfpack_%_demo: umfpack_%_demo.c $(UMFPACK) +# $(C) -o umfpack_$*_demo umfpack_$*_demo.c $(LIBS) # ./umfpack_$*_demo > my_umfpack_$*_demo.out # but do this via brute-force, so we can use just a single Makefile: @@ -112,29 +67,29 @@ umfpack_simple: umfpack_simple.c $(INC) $(UMFPACK) umfpack_di_demo.c: umfpack_xx_demo.c umfpack_di_demo.sed - sed -f umfpack_di_demo.sed < umfpack_xx_demo.c > umfpack_di_demo.c -umfpack_di_demo: umfpack_di_demo.c $(INC) $(UMFPACK) - $(C) -o umfpack_di_demo umfpack_di_demo.c $(UMFPACK) $(LIBS) +umfpack_di_demo: umfpack_di_demo.c + $(C) -o umfpack_di_demo umfpack_di_demo.c $(LIBS) # double-precision, SuiteSparse_long verion: umfpack_dl_demo.c: umfpack_xx_demo.c umfpack_dl_demo.sed - sed -f umfpack_dl_demo.sed < umfpack_xx_demo.c > umfpack_dl_demo.c -umfpack_dl_demo: umfpack_dl_demo.c $(INC) $(UMFPACK) - $(C) -o umfpack_dl_demo umfpack_dl_demo.c $(UMFPACK) $(LIBS) +umfpack_dl_demo: umfpack_dl_demo.c + $(C) -o umfpack_dl_demo umfpack_dl_demo.c $(LIBS) # complex, int verion: umfpack_zi_demo.c: umfpack_xx_demo.c umfpack_zi_demo.sed - sed -f umfpack_zi_demo.sed < umfpack_xx_demo.c > umfpack_zi_demo.c -umfpack_zi_demo: umfpack_zi_demo.c $(INC) $(UMFPACK) - $(C) -o umfpack_zi_demo umfpack_zi_demo.c $(UMFPACK) $(LIBS) +umfpack_zi_demo: umfpack_zi_demo.c + $(C) -o umfpack_zi_demo umfpack_zi_demo.c $(LIBS) # complex, SuiteSparse_long verion: umfpack_zl_demo.c: umfpack_xx_demo.c umfpack_zl_demo.sed - sed -f umfpack_zl_demo.sed < umfpack_xx_demo.c > umfpack_zl_demo.c -umfpack_zl_demo: umfpack_zl_demo.c $(INC) $(UMFPACK) - $(C) -o umfpack_zl_demo umfpack_zl_demo.c $(UMFPACK) $(LIBS) +umfpack_zl_demo: umfpack_zl_demo.c + $(C) -o umfpack_zl_demo umfpack_zl_demo.c $(LIBS) run: umfpack_di_demo umfpack_zi_demo umfpack_dl_demo umfpack_zl_demo umfpack_simple ./umfpack_simple @@ -175,8 +130,8 @@ hb: $(UMFPACK) umf4 readhb readhb_nozeros readhb_size - ./readhb_size < HB/arc130.rua > tmp/Asize - ./umf4 a 1e-6 -umf4: umf4.c $(UMFPACK) - $(C) -o umf4 umf4.c $(UMFPACK) $(LIBS) +umf4: umf4.c + $(C) -o umf4 umf4.c $(LIBS) readhb: readhb.f $(F77) $(F77FLAGS) -o readhb readhb.f $(F77LIB) @@ -193,31 +148,28 @@ readhb_nozeros: readhb_nozeros.f # This doesn't seem to work on the Mac (Snow Leopard, OS X 10.6.1) fortran: $(UMFPACK) umf4hb.f umf4_f77wrapper.o umf4zhb.f umf4_f77zwrapper.o $(UMFPACK) - $(F77) $(F77FLAGS) -o umf4hb umf4hb.f umf4_f77wrapper.o \ - $(UMFPACK) $(LIBS) + $(F77) $(F77FLAGS) -o umf4hb umf4hb.f umf4_f77wrapper.o $(LIBS) - ./umf4hb < HB/west0067.rua > my_umf4hb.out - diff my_umf4hb.out umf4hb.out - $(F77) $(F77FLAGS) -o umf4zhb umf4zhb.f umf4_f77zwrapper.o \ - $(UMFPACK) $(LIBS) + $(F77) $(F77FLAGS) -o umf4zhb umf4zhb.f umf4_f77zwrapper.o $(LIBS) - ./umf4zhb < HB/qc324.cua > my_umf4zhb.out - diff my_umf4zhb.out umf4zhb.out fortran64: $(UMFPACK) umf4hb64.f umf4_f77wrapper64.o umf4_f77zwrapper64.o $(UMFPACK) - $(F77) $(F77FLAGS) -o umf4hb64 umf4hb64.f umf4_f77wrapper64.o \ - $(UMFPACK) $(LIBS) + $(F77) $(F77FLAGS) -o umf4hb64 umf4hb64.f umf4_f77wrapper64.o $(LIBS) - ./umf4hb64 < HB/west0067.rua > my_umf4hb64.out - diff my_umf4hb64.out umf4hb64.out -umf4_f77wrapper.o: umf4_f77wrapper.c $(INC) +umf4_f77wrapper.o: umf4_f77wrapper.c $(C) -c umf4_f77wrapper.c -o umf4_f77wrapper.o -umf4_f77zwrapper.o: umf4_f77zwrapper.c $(INC) +umf4_f77zwrapper.o: umf4_f77zwrapper.c $(C) -c umf4_f77zwrapper.c -o umf4_f77zwrapper.o -umf4_f77wrapper64.o: umf4_f77wrapper.c $(INC) +umf4_f77wrapper64.o: umf4_f77wrapper.c $(C) -DDLONG -c umf4_f77wrapper.c -o umf4_f77wrapper64.o -umf4_f77zwrapper64.o: umf4_f77zwrapper.c $(INC) +umf4_f77zwrapper64.o: umf4_f77zwrapper.c $(C) -DZLONG -c umf4_f77zwrapper.c -o umf4_f77zwrapper64.o #------------------------------------------------------------------------------- @@ -233,7 +185,7 @@ purge: clean - $(RM) umf4hb umf4zhb *.umf my_umf4hb.out - $(RM) umf4hb64 my_umf4hb64.out my_umf4zhb.out - $(RM) umf4 readhb readhb_nozeros readhb_size tmp/* - - $(RM) -r *.dSYM + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) diff --git a/SuiteSparse/UMFPACK/Demo/dodefault b/SuiteSparse/UMFPACK/Demo/dodefault old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Demo/dospd b/SuiteSparse/UMFPACK/Demo/dospd old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Demo/simple_compile b/SuiteSparse/UMFPACK/Demo/simple_compile old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Demo/umfpack_di_demo.out b/SuiteSparse/UMFPACK/Demo/umfpack_di_demo.out index 1ec2a6ca0..2264385e1 100644 --- a/SuiteSparse/UMFPACK/Demo/umfpack_di_demo.out +++ b/SuiteSparse/UMFPACK/Demo/umfpack_di_demo.out @@ -1,5 +1,5 @@ -UMFPACK V5.7 (Oct 10, 2014) demo: _di_ version +UMFPACK V5.7 (Feb 1, 2016) demo: _di_ version UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. @@ -38,9 +38,9 @@ UMFPACK License: and a notice that the code was modified is included. Availability: http://www.suitesparse.com -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK -UMFPACK V5.7.1 (Oct 10, 2014), Control: +UMFPACK V5.7.4 (Feb 1, 2016), Control: Matrix entry defined as: double Int (generic integer) defined as: int @@ -279,7 +279,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -354,6 +354,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.00 solve flops: 1.19000e+02 iterative refinement steps taken: 0 @@ -367,7 +368,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK x (solution of Ax=b): dense vector, n = 5. @@ -383,7 +384,7 @@ maxnorm of residual: 1.06581e-14 UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK determinant: (1.14) * 10^(2) @@ -397,7 +398,7 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.06581e-14 -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -472,6 +473,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.00 solve flops: 1.11000e+02 iterative refinement steps taken: 0 @@ -538,7 +540,7 @@ Numeric factorization of modified A: Numeric object: largest actual frontal matrix size: 4 memory defragmentations: 1 memory reallocations: 1 - costly memory reallocations: 0 + costly memory reallocations: 1 entries in compressed pattern (L and U): 2 number of nonzeros in L (excl diag): 4 number of entries stored in L (excl diag): 2 @@ -625,7 +627,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -698,7 +700,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 8 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 1.17000e+02 @@ -784,7 +786,7 @@ Numeric factorization of completely modified A: Numeric object: largest actual frontal matrix size: 4 memory defragmentations: 1 memory reallocations: 1 - costly memory reallocations: 0 + costly memory reallocations: 1 entries in compressed pattern (L and U): 2 number of nonzeros in L (excl diag): 4 number of entries stored in L (excl diag): 2 @@ -872,7 +874,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -945,7 +947,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 9 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 1.19000e+02 @@ -1082,7 +1084,7 @@ Numeric factorization of C: Numeric object: largest actual frontal matrix size: 4 memory defragmentations: 1 memory reallocations: 1 - costly memory reallocations: 0 + costly memory reallocations: 1 entries in compressed pattern (L and U): 2 number of nonzeros in L (excl diag): 3 number of entries stored in L (excl diag): 2 @@ -1263,7 +1265,7 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -1336,7 +1338,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 9 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 1.11000e+02 @@ -1361,7 +1363,7 @@ maxnorm of residual: 3.55271e-15 Solving C'x=b again, using umfpack_di_wsolve instead: -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -1434,7 +1436,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 9 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 1.11000e+02 @@ -1459,4 +1461,4 @@ maxnorm of residual: 3.55271e-15 umfpack_di_demo complete. -Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) +Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) diff --git a/SuiteSparse/UMFPACK/Demo/umfpack_dl_demo.out b/SuiteSparse/UMFPACK/Demo/umfpack_dl_demo.out index c310a093d..ad3d343b1 100644 --- a/SuiteSparse/UMFPACK/Demo/umfpack_dl_demo.out +++ b/SuiteSparse/UMFPACK/Demo/umfpack_dl_demo.out @@ -1,5 +1,5 @@ -UMFPACK V5.7 (Oct 10, 2014) demo: _dl_ version +UMFPACK V5.7 (Feb 1, 2016) demo: _dl_ version UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. @@ -38,9 +38,9 @@ UMFPACK License: and a notice that the code was modified is included. Availability: http://www.suitesparse.com -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK -UMFPACK V5.7.1 (Oct 10, 2014), Control: +UMFPACK V5.7.4 (Feb 1, 2016), Control: Matrix entry defined as: double Int (generic integer) defined as: SuiteSparse_long @@ -279,7 +279,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -354,6 +354,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.00 solve flops: 1.19000e+02 iterative refinement steps taken: 0 @@ -367,7 +368,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK x (solution of Ax=b): dense vector, n = 5. @@ -383,7 +384,7 @@ maxnorm of residual: 1.06581e-14 UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK determinant: (1.14) * 10^(2) @@ -397,7 +398,7 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.06581e-14 -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -472,6 +473,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.00 solve flops: 1.11000e+02 iterative refinement steps taken: 0 @@ -625,7 +627,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -872,7 +874,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -1082,7 +1084,7 @@ Numeric factorization of C: Numeric object: largest actual frontal matrix size: 4 memory defragmentations: 1 memory reallocations: 1 - costly memory reallocations: 0 + costly memory reallocations: 1 entries in compressed pattern (L and U): 2 number of nonzeros in L (excl diag): 3 number of entries stored in L (excl diag): 2 @@ -1263,7 +1265,7 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -1336,7 +1338,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 9 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 1.11000e+02 @@ -1361,7 +1363,7 @@ maxnorm of residual: 3.55271e-15 Solving C'x=b again, using umfpack_dl_wsolve instead: -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -1434,7 +1436,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 9 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 1.11000e+02 @@ -1459,4 +1461,4 @@ maxnorm of residual: 3.55271e-15 umfpack_dl_demo complete. -Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) +Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) diff --git a/SuiteSparse/UMFPACK/Demo/umfpack_zi_demo.out b/SuiteSparse/UMFPACK/Demo/umfpack_zi_demo.out index f29347ad7..cde29a156 100644 --- a/SuiteSparse/UMFPACK/Demo/umfpack_zi_demo.out +++ b/SuiteSparse/UMFPACK/Demo/umfpack_zi_demo.out @@ -1,5 +1,5 @@ -UMFPACK V5.7 (Oct 10, 2014) demo: _zi_ version +UMFPACK V5.7 (Feb 1, 2016) demo: _zi_ version UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. @@ -38,9 +38,9 @@ UMFPACK License: and a notice that the code was modified is included. Availability: http://www.suitesparse.com -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK -UMFPACK V5.7.1 (Oct 10, 2014), Control: +UMFPACK V5.7.4 (Feb 1, 2016), Control: Matrix entry defined as: double complex Int (generic integer) defined as: int @@ -279,7 +279,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -354,6 +354,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.01 solve flops: 1.02800e+03 iterative refinement steps taken: 1 @@ -367,7 +368,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK x (solution of Ax=b): dense vector, n = 5. @@ -383,7 +384,7 @@ maxnorm of residual: 1.77636e-15 UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK determinant: (-1.7814+ (2.3784)i) * 10^(2) @@ -397,7 +398,7 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.77636e-14 -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -472,6 +473,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.01 solve flops: 4.80000e+02 iterative refinement steps taken: 0 @@ -538,7 +540,7 @@ Numeric factorization of modified A: Numeric object: largest actual frontal matrix size: 4 memory defragmentations: 1 memory reallocations: 1 - costly memory reallocations: 0 + costly memory reallocations: 1 entries in compressed pattern (L and U): 2 number of nonzeros in L (excl diag): 3 number of entries stored in L (excl diag): 1 @@ -625,7 +627,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -698,7 +700,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 8 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 5.15000e+02 @@ -872,7 +874,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -951,7 +953,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: solve flops: 5.23000e+02 iterative refinement steps taken: 0 iterative refinement steps attempted: 0 - sparse backward error omega1: 8.05e-17 + sparse backward error omega1: 5.55e-17 sparse backward error omega2: 0.00e+00 solve wall clock time (sec): 0.00 @@ -966,7 +968,7 @@ x (with completely modified A): dense vector, n = 5. 4 : (0.658245 + 0.0407649i) dense vector OK -maxnorm of residual: 9.10383e-15 +maxnorm of residual: 3.9968e-15 C (transpose of A): column-form matrix, n_row 5 n_col 5, nz = 12. @@ -1082,7 +1084,7 @@ Numeric factorization of C: Numeric object: largest actual frontal matrix size: 4 memory defragmentations: 1 memory reallocations: 1 - costly memory reallocations: 0 + costly memory reallocations: 1 entries in compressed pattern (L and U): 2 number of nonzeros in L (excl diag): 3 number of entries stored in L (excl diag): 2 @@ -1263,7 +1265,7 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -1336,7 +1338,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 9 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 4.80000e+02 @@ -1361,7 +1363,7 @@ maxnorm of residual: 4.88498e-15 Solving C'x=b again, using umfpack_zi_wsolve instead: -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: int BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -1434,7 +1436,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 9 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 4.80000e+02 @@ -1459,4 +1461,4 @@ maxnorm of residual: 4.88498e-15 umfpack_zi_demo complete. -Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) +Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) diff --git a/SuiteSparse/UMFPACK/Demo/umfpack_zl_demo.out b/SuiteSparse/UMFPACK/Demo/umfpack_zl_demo.out index c1b848839..dcd9dabc3 100644 --- a/SuiteSparse/UMFPACK/Demo/umfpack_zl_demo.out +++ b/SuiteSparse/UMFPACK/Demo/umfpack_zl_demo.out @@ -1,5 +1,5 @@ -UMFPACK V5.7 (Oct 10, 2014) demo: _zl_ version +UMFPACK V5.7 (Feb 1, 2016) demo: _zl_ version UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. @@ -38,9 +38,9 @@ UMFPACK License: and a notice that the code was modified is included. Availability: http://www.suitesparse.com -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK -UMFPACK V5.7.1 (Oct 10, 2014), Control: +UMFPACK V5.7.4 (Feb 1, 2016), Control: Matrix entry defined as: double complex Int (generic integer) defined as: SuiteSparse_long @@ -279,7 +279,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -354,6 +354,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.02 solve flops: 1.02800e+03 iterative refinement steps taken: 1 @@ -367,7 +368,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK x (solution of Ax=b): dense vector, n = 5. @@ -383,7 +384,7 @@ maxnorm of residual: 1.77636e-15 UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved. -UMFPACK V5.7.1 (Oct 10, 2014): OK +UMFPACK V5.7.4 (Feb 1, 2016): OK determinant: (-1.7814+ (2.3784)i) * 10^(2) @@ -397,7 +398,7 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.77636e-14 -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -472,6 +473,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.02 solve flops: 4.80000e+02 iterative refinement steps taken: 0 @@ -625,7 +627,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -872,7 +874,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -951,7 +953,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: solve flops: 5.23000e+02 iterative refinement steps taken: 0 iterative refinement steps attempted: 0 - sparse backward error omega1: 8.05e-17 + sparse backward error omega1: 5.55e-17 sparse backward error omega2: 0.00e+00 solve wall clock time (sec): 0.00 @@ -966,7 +968,7 @@ x (with completely modified A): dense vector, n = 5. 4 : (0.658245 + 0.0407649i) dense vector OK -maxnorm of residual: 9.10383e-15 +maxnorm of residual: 3.9968e-15 C (transpose of A): column-form matrix, n_row 5 n_col 5, nz = 12. @@ -1082,7 +1084,7 @@ Numeric factorization of C: Numeric object: largest actual frontal matrix size: 4 memory defragmentations: 1 memory reallocations: 1 - costly memory reallocations: 0 + costly memory reallocations: 1 entries in compressed pattern (L and U): 2 number of nonzeros in L (excl diag): 3 number of entries stored in L (excl diag): 2 @@ -1263,7 +1265,7 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -1336,7 +1338,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 9 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 4.80000e+02 @@ -1361,7 +1363,7 @@ maxnorm of residual: 4.88498e-15 Solving C'x=b again, using umfpack_zl_wsolve instead: -UMFPACK V5.7.1 (Oct 10, 2014), Info: +UMFPACK V5.7.4 (Feb 1, 2016), Info: matrix entry defined as: double complex Int (generic integer) defined as: SuiteSparse_long BLAS library used: Fortran BLAS. size of BLAS integer: 4 @@ -1434,7 +1436,7 @@ UMFPACK V5.7.1 (Oct 10, 2014), Info: numerical values stored in Numeric object: 9 numeric factorization defragmentations: 1 numeric factorization reallocations: 1 - costly numeric factorization reallocations: 0 + costly numeric factorization reallocations: 1 numeric factorization wallclock time (sec): 0.00 solve flops: 4.80000e+02 @@ -1459,4 +1461,4 @@ maxnorm of residual: 4.88498e-15 umfpack_zl_demo complete. -Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) +Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) diff --git a/SuiteSparse/UMFPACK/Doc/ChangeLog b/SuiteSparse/UMFPACK/Doc/ChangeLog index 5736af755..38544841b 100644 --- a/SuiteSparse/UMFPACK/Doc/ChangeLog +++ b/SuiteSparse/UMFPACK/Doc/ChangeLog @@ -1,3 +1,20 @@ +Feb 1, 2016: version 5.7.4 + + * update to Makefiles + +Jan 30, 2016: version 5.7.3 + + * better Makefiles for creating and installing shared libraries + * minor MATLAB cleanup. Renamed umfpack mexFunction to back to umfpack, + from umfpack2, since it no longer clashes with a MATLAB function + of the same name. The umfpack2.m file is still present; it just + calls umfpack.m. + +Jan 1, 2016: version 5.7.2 + + * modified Makefile to create shared libraries + No change to C code except version number + Oct 10, 2014: version 5.7.1 modified MATLAB/umfpack_make.m. No change to C code except version number. diff --git a/SuiteSparse/UMFPACK/Doc/Makefile b/SuiteSparse/UMFPACK/Doc/Makefile index 6b93e0fbc..500420b22 100644 --- a/SuiteSparse/UMFPACK/Doc/Makefile +++ b/SuiteSparse/UMFPACK/Doc/Makefile @@ -13,14 +13,14 @@ include ../../SuiteSparse_config/SuiteSparse_config.mk # Remove all but the files in the original distribution #------------------------------------------------------------------------------- -# Note that UserGuide.tex is created from UserGuide.stex, the files in -# the ../Include directory, and the ../Demo/umfpack_simple.c file. +# Note that UMFPACK_UserGuide.tex is created from UMFPACK_UserGuide.stex, the +# files in the ../Include directory, and the ../Demo/umfpack_simple.c file. purge: clean - - $(RM) *.aux *.bbl *.blg *.log *.toc - - $(RM) UserGuide.tex + - $(RM) UMFPACK_UserGuide.tex + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) #------------------------------------------------------------------------------- # Create the User Guide and Quick Start Guide @@ -42,18 +42,18 @@ USER = $(UMFPACKW) $(UMFPACK) SRC = $(addprefix ../Include/, $(addsuffix .h,$(USER))) ../Demo/umfpack_simple.c -UserGuide.pdf: UserGuide.stex UserGuide.sed1 UserGuide.sed2 $(SRC) UserGuide.bib - sed -f UserGuide.sed1 < UserGuide.stex | sed -f UserGuide.sed2 \ - | expand -8 > UserGuide.tex - pdflatex UserGuide - bibtex UserGuide - pdflatex UserGuide - pdflatex UserGuide +UMFPACK_UserGuide.pdf: UMFPACK_UserGuide.stex UserGuide.sed1 UserGuide.sed2 $(SRC) UserGuide.bib + sed -f UserGuide.sed1 < UMFPACK_UserGuide.stex | sed -f UserGuide.sed2 \ + | expand -8 > UMFPACK_UserGuide.tex + pdflatex UMFPACK_UserGuide + bibtex UMFPACK_UserGuide + pdflatex UMFPACK_UserGuide + pdflatex UMFPACK_UserGuide -QuickStart.pdf: QuickStart.tex - pdflatex QuickStart - pdflatex QuickStart +UMFPACK_QuickStart.pdf: UMFPACK_QuickStart.tex + pdflatex UMFPACK_QuickStart + pdflatex UMFPACK_QuickStart -dist: QuickStart.pdf UserGuide.pdf +dist: UMFPACK_QuickStart.pdf UMFPACK_UserGuide.pdf - $(RM) *.aux *.bbl *.blg *.log *.toc - - $(RM) UserGuide.tex + - $(RM) UMFPACK_UserGuide.tex diff --git a/SuiteSparse/UMFPACK/Include/umfpack.h b/SuiteSparse/UMFPACK/Include/umfpack.h index 62ef2f9ef..3b9282e12 100644 --- a/SuiteSparse/UMFPACK/Include/umfpack.h +++ b/SuiteSparse/UMFPACK/Include/umfpack.h @@ -95,7 +95,7 @@ extern "C" { /* Version, copyright, and license */ /* -------------------------------------------------------------------------- */ -#define UMFPACK_VERSION "UMFPACK V5.7.1 (Oct 10, 2014)" +#define UMFPACK_VERSION "UMFPACK V5.7.4 (Feb 1, 2016)" #define UMFPACK_COPYRIGHT \ "UMFPACK: Copyright (c) 2005-2013 by Timothy A. Davis. All Rights Reserved.\n" @@ -161,11 +161,11 @@ extern "C" { * above. */ -#define UMFPACK_DATE "Oct 10, 2014" +#define UMFPACK_DATE "Feb 1, 2016" #define UMFPACK_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define UMFPACK_MAIN_VERSION 5 #define UMFPACK_SUB_VERSION 7 -#define UMFPACK_SUBSUB_VERSION 1 +#define UMFPACK_SUBSUB_VERSION 4 #define UMFPACK_VER UMFPACK_VER_CODE(UMFPACK_MAIN_VERSION,UMFPACK_SUB_VERSION) /* -------------------------------------------------------------------------- */ diff --git a/SuiteSparse/UMFPACK/Lib/Makefile b/SuiteSparse/UMFPACK/Lib/Makefile index f9cb0ea25..776a630f3 100644 --- a/SuiteSparse/UMFPACK/Lib/Makefile +++ b/SuiteSparse/UMFPACK/Lib/Makefile @@ -1,482 +1,318 @@ #------------------------------------------------------------------------------- -# UMFPACK Makefile for compiling on Unix systems (for original make only) +# UMFPACK Makefile for compiling on Unix systems (for GNU Make) #------------------------------------------------------------------------------- -# This is a very ugly Makefile, and is only provided for those who do not -# have GNU make. Note that it is not used if you have GNU make. It ignores -# dependency checking and just compiles everything. +LIBRARY = libumfpack +VERSION = 5.7.4 +SO_VERSION = 5 -default: everything +default: library include ../../SuiteSparse_config/SuiteSparse_config.mk -C = $(CC) $(CF) $(UMFPACK_CONFIG) \ - -I../Include -I../Source -I../../AMD/Include -I../../SuiteSparse_config \ - -I../../CHOLMOD/Include - -everything: - $(C) -DDINT -c ../Source/umf_analyze.c -o umf_i_analyze.o - $(C) -DDINT -c ../Source/umf_apply_order.c -o umf_i_apply_order.o - $(C) -DDINT -c ../Source/umf_colamd.c -o umf_i_colamd.o - $(C) -DDINT -c ../Source/umf_cholmod.c -o umf_i_cholmod.o - $(C) -DDINT -c ../Source/umf_free.c -o umf_i_free.o - $(C) -DDINT -c ../Source/umf_fsize.c -o umf_i_fsize.o - $(C) -DDINT -c ../Source/umf_is_permutation.c -o umf_i_is_permutation.o - $(C) -DDINT -c ../Source/umf_malloc.c -o umf_i_malloc.o - $(C) -DDINT -c ../Source/umf_realloc.c -o umf_i_realloc.o - $(C) -DDINT -c ../Source/umf_report_perm.c -o umf_i_report_perm.o - $(C) -DDINT -c ../Source/umf_singletons.c -o umf_i_singletons.o - $(C) -DDLONG -c ../Source/umf_analyze.c -o umf_l_analyze.o - $(C) -DDLONG -c ../Source/umf_apply_order.c -o umf_l_apply_order.o - $(C) -DDLONG -c ../Source/umf_colamd.c -o umf_l_colamd.o - $(C) -DDLONG -c ../Source/umf_cholmod.c -o umf_l_cholmod.o - $(C) -DDLONG -c ../Source/umf_free.c -o umf_l_free.o - $(C) -DDLONG -c ../Source/umf_fsize.c -o umf_l_fsize.o - $(C) -DDLONG -c ../Source/umf_is_permutation.c -o umf_l_is_permutation.o - $(C) -DDLONG -c ../Source/umf_malloc.c -o umf_l_malloc.o - $(C) -DDLONG -c ../Source/umf_realloc.c -o umf_l_realloc.o - $(C) -DDLONG -c ../Source/umf_report_perm.c -o umf_l_report_perm.o - $(C) -DDLONG -c ../Source/umf_singletons.c -o umf_l_singletons.o - $(C) -c ../Source/umfpack_timer.c -o umfpack_gn_timer.o - $(C) -c ../Source/umfpack_tictoc.c -o umfpack_gn_tictoc.o - $(C) -DDINT -DCONJUGATE_SOLVE -c ../Source/umf_ltsolve.c -o umf_di_lhsolve.o - $(C) -DDINT -DCONJUGATE_SOLVE -c ../Source/umf_utsolve.c -o umf_di_uhsolve.o - $(C) -DDINT -DDO_MAP -c ../Source/umf_triplet.c -o umf_di_triplet_map_nox.o - $(C) -DDINT -DDO_VALUES -c ../Source/umf_triplet.c -o umf_di_triplet_nomap_x.o - $(C) -DDINT -c ../Source/umf_triplet.c -o umf_di_triplet_nomap_nox.o - $(C) -DDINT -DDO_MAP -DDO_VALUES -c ../Source/umf_triplet.c -o umf_di_triplet_map_x.o - $(C) -DDINT -DFIXQ -c ../Source/umf_assemble.c -o umf_di_assemble_fixq.o - $(C) -DDINT -DDROP -c ../Source/umf_store_lu.c -o umf_di_store_lu_drop.o - $(C) -DDINT -c ../Source/umf_assemble.c -o umf_di_assemble.o - $(C) -DDINT -c ../Source/umf_blas3_update.c -o umf_di_blas3_update.o - $(C) -DDINT -c ../Source/umf_build_tuples.c -o umf_di_build_tuples.o - $(C) -DDINT -c ../Source/umf_create_element.c -o umf_di_create_element.o - $(C) -DDINT -c ../Source/umf_dump.c -o umf_di_dump.o - $(C) -DDINT -c ../Source/umf_extend_front.c -o umf_di_extend_front.o - $(C) -DDINT -c ../Source/umf_garbage_collection.c -o umf_di_garbage_collection.o - $(C) -DDINT -c ../Source/umf_get_memory.c -o umf_di_get_memory.o - $(C) -DDINT -c ../Source/umf_init_front.c -o umf_di_init_front.o - $(C) -DDINT -c ../Source/umf_kernel.c -o umf_di_kernel.o - $(C) -DDINT -c ../Source/umf_kernel_init.c -o umf_di_kernel_init.o - $(C) -DDINT -c ../Source/umf_kernel_wrapup.c -o umf_di_kernel_wrapup.o - $(C) -DDINT -c ../Source/umf_local_search.c -o umf_di_local_search.o - $(C) -DDINT -c ../Source/umf_lsolve.c -o umf_di_lsolve.o - $(C) -DDINT -c ../Source/umf_ltsolve.c -o umf_di_ltsolve.o - $(C) -DDINT -c ../Source/umf_mem_alloc_element.c -o umf_di_mem_alloc_element.o - $(C) -DDINT -c ../Source/umf_mem_alloc_head_block.c -o umf_di_mem_alloc_head_block.o - $(C) -DDINT -c ../Source/umf_mem_alloc_tail_block.c -o umf_di_mem_alloc_tail_block.o - $(C) -DDINT -c ../Source/umf_mem_free_tail_block.c -o umf_di_mem_free_tail_block.o - $(C) -DDINT -c ../Source/umf_mem_init_memoryspace.c -o umf_di_mem_init_memoryspace.o - $(C) -DDINT -c ../Source/umf_report_vector.c -o umf_di_report_vector.o - $(C) -DDINT -c ../Source/umf_row_search.c -o umf_di_row_search.o - $(C) -DDINT -c ../Source/umf_scale_column.c -o umf_di_scale_column.o - $(C) -DDINT -c ../Source/umf_set_stats.c -o umf_di_set_stats.o - $(C) -DDINT -c ../Source/umf_solve.c -o umf_di_solve.o - $(C) -DDINT -c ../Source/umf_symbolic_usage.c -o umf_di_symbolic_usage.o - $(C) -DDINT -c ../Source/umf_transpose.c -o umf_di_transpose.o - $(C) -DDINT -c ../Source/umf_tuple_lengths.c -o umf_di_tuple_lengths.o - $(C) -DDINT -c ../Source/umf_usolve.c -o umf_di_usolve.o - $(C) -DDINT -c ../Source/umf_utsolve.c -o umf_di_utsolve.o - $(C) -DDINT -c ../Source/umf_valid_numeric.c -o umf_di_valid_numeric.o - $(C) -DDINT -c ../Source/umf_valid_symbolic.c -o umf_di_valid_symbolic.o - $(C) -DDINT -c ../Source/umf_grow_front.c -o umf_di_grow_front.o - $(C) -DDINT -c ../Source/umf_start_front.c -o umf_di_start_front.o - $(C) -DDINT -c ../Source/umf_store_lu.c -o umf_di_store_lu.o - $(C) -DDINT -c ../Source/umf_scale.c -o umf_di_scale.o - $(C) -DDINT -DWSOLVE -c ../Source/umfpack_solve.c -o umfpack_di_wsolve.o - $(C) -DDINT -c ../Source/umfpack_col_to_triplet.c -o umfpack_di_col_to_triplet.o - $(C) -DDINT -c ../Source/umfpack_defaults.c -o umfpack_di_defaults.o - $(C) -DDINT -c ../Source/umfpack_free_numeric.c -o umfpack_di_free_numeric.o - $(C) -DDINT -c ../Source/umfpack_free_symbolic.c -o umfpack_di_free_symbolic.o - $(C) -DDINT -c ../Source/umfpack_get_numeric.c -o umfpack_di_get_numeric.o - $(C) -DDINT -c ../Source/umfpack_get_lunz.c -o umfpack_di_get_lunz.o - $(C) -DDINT -c ../Source/umfpack_get_symbolic.c -o umfpack_di_get_symbolic.o - $(C) -DDINT -c ../Source/umfpack_get_determinant.c -o umfpack_di_get_determinant.o - $(C) -DDINT -c ../Source/umfpack_numeric.c -o umfpack_di_numeric.o - $(C) -DDINT -c ../Source/umfpack_qsymbolic.c -o umfpack_di_qsymbolic.o - $(C) -DDINT -c ../Source/umfpack_report_control.c -o umfpack_di_report_control.o - $(C) -DDINT -c ../Source/umfpack_report_info.c -o umfpack_di_report_info.o - $(C) -DDINT -c ../Source/umfpack_report_matrix.c -o umfpack_di_report_matrix.o - $(C) -DDINT -c ../Source/umfpack_report_numeric.c -o umfpack_di_report_numeric.o - $(C) -DDINT -c ../Source/umfpack_report_perm.c -o umfpack_di_report_perm.o - $(C) -DDINT -c ../Source/umfpack_report_status.c -o umfpack_di_report_status.o - $(C) -DDINT -c ../Source/umfpack_report_symbolic.c -o umfpack_di_report_symbolic.o - $(C) -DDINT -c ../Source/umfpack_report_triplet.c -o umfpack_di_report_triplet.o - $(C) -DDINT -c ../Source/umfpack_report_vector.c -o umfpack_di_report_vector.o - $(C) -DDINT -c ../Source/umfpack_solve.c -o umfpack_di_solve.o - $(C) -DDINT -c ../Source/umfpack_symbolic.c -o umfpack_di_symbolic.o - $(C) -DDINT -c ../Source/umfpack_transpose.c -o umfpack_di_transpose.o - $(C) -DDINT -c ../Source/umfpack_triplet_to_col.c -o umfpack_di_triplet_to_col.o - $(C) -DDINT -c ../Source/umfpack_scale.c -o umfpack_di_scale.o - $(C) -DDINT -c ../Source/umfpack_load_numeric.c -o umfpack_di_load_numeric.o - $(C) -DDINT -c ../Source/umfpack_save_numeric.c -o umfpack_di_save_numeric.o - $(C) -DDINT -c ../Source/umfpack_load_symbolic.c -o umfpack_di_load_symbolic.o - $(C) -DDINT -c ../Source/umfpack_save_symbolic.c -o umfpack_di_save_symbolic.o - $(C) -DDLONG -DCONJUGATE_SOLVE -c ../Source/umf_ltsolve.c -o umf_dl_lhsolve.o - $(C) -DDLONG -DCONJUGATE_SOLVE -c ../Source/umf_utsolve.c -o umf_dl_uhsolve.o - $(C) -DDLONG -DDO_MAP -c ../Source/umf_triplet.c -o umf_dl_triplet_map_nox.o - $(C) -DDLONG -DDO_VALUES -c ../Source/umf_triplet.c -o umf_dl_triplet_nomap_x.o - $(C) -DDLONG -c ../Source/umf_triplet.c -o umf_dl_triplet_nomap_nox.o - $(C) -DDLONG -DDO_MAP -DDO_VALUES -c ../Source/umf_triplet.c -o umf_dl_triplet_map_x.o - $(C) -DDLONG -DFIXQ -c ../Source/umf_assemble.c -o umf_dl_assemble_fixq.o - $(C) -DDLONG -DDROP -c ../Source/umf_store_lu.c -o umf_dl_store_lu_drop.o - $(C) -DDLONG -c ../Source/umf_assemble.c -o umf_dl_assemble.o - $(C) -DDLONG -c ../Source/umf_blas3_update.c -o umf_dl_blas3_update.o - $(C) -DDLONG -c ../Source/umf_build_tuples.c -o umf_dl_build_tuples.o - $(C) -DDLONG -c ../Source/umf_create_element.c -o umf_dl_create_element.o - $(C) -DDLONG -c ../Source/umf_dump.c -o umf_dl_dump.o - $(C) -DDLONG -c ../Source/umf_extend_front.c -o umf_dl_extend_front.o - $(C) -DDLONG -c ../Source/umf_garbage_collection.c -o umf_dl_garbage_collection.o - $(C) -DDLONG -c ../Source/umf_get_memory.c -o umf_dl_get_memory.o - $(C) -DDLONG -c ../Source/umf_init_front.c -o umf_dl_init_front.o - $(C) -DDLONG -c ../Source/umf_kernel.c -o umf_dl_kernel.o - $(C) -DDLONG -c ../Source/umf_kernel_init.c -o umf_dl_kernel_init.o - $(C) -DDLONG -c ../Source/umf_kernel_wrapup.c -o umf_dl_kernel_wrapup.o - $(C) -DDLONG -c ../Source/umf_local_search.c -o umf_dl_local_search.o - $(C) -DDLONG -c ../Source/umf_lsolve.c -o umf_dl_lsolve.o - $(C) -DDLONG -c ../Source/umf_ltsolve.c -o umf_dl_ltsolve.o - $(C) -DDLONG -c ../Source/umf_mem_alloc_element.c -o umf_dl_mem_alloc_element.o - $(C) -DDLONG -c ../Source/umf_mem_alloc_head_block.c -o umf_dl_mem_alloc_head_block.o - $(C) -DDLONG -c ../Source/umf_mem_alloc_tail_block.c -o umf_dl_mem_alloc_tail_block.o - $(C) -DDLONG -c ../Source/umf_mem_free_tail_block.c -o umf_dl_mem_free_tail_block.o - $(C) -DDLONG -c ../Source/umf_mem_init_memoryspace.c -o umf_dl_mem_init_memoryspace.o - $(C) -DDLONG -c ../Source/umf_report_vector.c -o umf_dl_report_vector.o - $(C) -DDLONG -c ../Source/umf_row_search.c -o umf_dl_row_search.o - $(C) -DDLONG -c ../Source/umf_scale_column.c -o umf_dl_scale_column.o - $(C) -DDLONG -c ../Source/umf_set_stats.c -o umf_dl_set_stats.o - $(C) -DDLONG -c ../Source/umf_solve.c -o umf_dl_solve.o - $(C) -DDLONG -c ../Source/umf_symbolic_usage.c -o umf_dl_symbolic_usage.o - $(C) -DDLONG -c ../Source/umf_transpose.c -o umf_dl_transpose.o - $(C) -DDLONG -c ../Source/umf_tuple_lengths.c -o umf_dl_tuple_lengths.o - $(C) -DDLONG -c ../Source/umf_usolve.c -o umf_dl_usolve.o - $(C) -DDLONG -c ../Source/umf_utsolve.c -o umf_dl_utsolve.o - $(C) -DDLONG -c ../Source/umf_valid_numeric.c -o umf_dl_valid_numeric.o - $(C) -DDLONG -c ../Source/umf_valid_symbolic.c -o umf_dl_valid_symbolic.o - $(C) -DDLONG -c ../Source/umf_grow_front.c -o umf_dl_grow_front.o - $(C) -DDLONG -c ../Source/umf_start_front.c -o umf_dl_start_front.o - $(C) -DDLONG -c ../Source/umf_store_lu.c -o umf_dl_store_lu.o - $(C) -DDLONG -c ../Source/umf_scale.c -o umf_dl_scale.o - $(C) -DDLONG -DWSOLVE -c ../Source/umfpack_solve.c -o umfpack_dl_wsolve.o - $(C) -DDLONG -c ../Source/umfpack_col_to_triplet.c -o umfpack_dl_col_to_triplet.o - $(C) -DDLONG -c ../Source/umfpack_defaults.c -o umfpack_dl_defaults.o - $(C) -DDLONG -c ../Source/umfpack_free_numeric.c -o umfpack_dl_free_numeric.o - $(C) -DDLONG -c ../Source/umfpack_free_symbolic.c -o umfpack_dl_free_symbolic.o - $(C) -DDLONG -c ../Source/umfpack_get_numeric.c -o umfpack_dl_get_numeric.o - $(C) -DDLONG -c ../Source/umfpack_get_lunz.c -o umfpack_dl_get_lunz.o - $(C) -DDLONG -c ../Source/umfpack_get_symbolic.c -o umfpack_dl_get_symbolic.o - $(C) -DDLONG -c ../Source/umfpack_get_determinant.c -o umfpack_dl_get_determinant.o - $(C) -DDLONG -c ../Source/umfpack_numeric.c -o umfpack_dl_numeric.o - $(C) -DDLONG -c ../Source/umfpack_qsymbolic.c -o umfpack_dl_qsymbolic.o - $(C) -DDLONG -c ../Source/umfpack_report_control.c -o umfpack_dl_report_control.o - $(C) -DDLONG -c ../Source/umfpack_report_info.c -o umfpack_dl_report_info.o - $(C) -DDLONG -c ../Source/umfpack_report_matrix.c -o umfpack_dl_report_matrix.o - $(C) -DDLONG -c ../Source/umfpack_report_numeric.c -o umfpack_dl_report_numeric.o - $(C) -DDLONG -c ../Source/umfpack_report_perm.c -o umfpack_dl_report_perm.o - $(C) -DDLONG -c ../Source/umfpack_report_status.c -o umfpack_dl_report_status.o - $(C) -DDLONG -c ../Source/umfpack_report_symbolic.c -o umfpack_dl_report_symbolic.o - $(C) -DDLONG -c ../Source/umfpack_report_triplet.c -o umfpack_dl_report_triplet.o - $(C) -DDLONG -c ../Source/umfpack_report_vector.c -o umfpack_dl_report_vector.o - $(C) -DDLONG -c ../Source/umfpack_solve.c -o umfpack_dl_solve.o - $(C) -DDLONG -c ../Source/umfpack_symbolic.c -o umfpack_dl_symbolic.o - $(C) -DDLONG -c ../Source/umfpack_transpose.c -o umfpack_dl_transpose.o - $(C) -DDLONG -c ../Source/umfpack_triplet_to_col.c -o umfpack_dl_triplet_to_col.o - $(C) -DDLONG -c ../Source/umfpack_scale.c -o umfpack_dl_scale.o - $(C) -DDLONG -c ../Source/umfpack_load_numeric.c -o umfpack_dl_load_numeric.o - $(C) -DDLONG -c ../Source/umfpack_save_numeric.c -o umfpack_dl_save_numeric.o - $(C) -DDLONG -c ../Source/umfpack_load_symbolic.c -o umfpack_dl_load_symbolic.o - $(C) -DDLONG -c ../Source/umfpack_save_symbolic.c -o umfpack_dl_save_symbolic.o - $(C) -DZINT -DCONJUGATE_SOLVE -c ../Source/umf_ltsolve.c -o umf_zi_lhsolve.o - $(C) -DZINT -DCONJUGATE_SOLVE -c ../Source/umf_utsolve.c -o umf_zi_uhsolve.o - $(C) -DZINT -DDO_MAP -c ../Source/umf_triplet.c -o umf_zi_triplet_map_nox.o - $(C) -DZINT -DDO_VALUES -c ../Source/umf_triplet.c -o umf_zi_triplet_nomap_x.o - $(C) -DZINT -c ../Source/umf_triplet.c -o umf_zi_triplet_nomap_nox.o - $(C) -DZINT -DDO_MAP -DDO_VALUES -c ../Source/umf_triplet.c -o umf_zi_triplet_map_x.o - $(C) -DZINT -DFIXQ -c ../Source/umf_assemble.c -o umf_zi_assemble_fixq.o - $(C) -DZINT -DDROP -c ../Source/umf_store_lu.c -o umf_zi_store_lu_drop.o - $(C) -DZINT -c ../Source/umf_assemble.c -o umf_zi_assemble.o - $(C) -DZINT -c ../Source/umf_blas3_update.c -o umf_zi_blas3_update.o - $(C) -DZINT -c ../Source/umf_build_tuples.c -o umf_zi_build_tuples.o - $(C) -DZINT -c ../Source/umf_create_element.c -o umf_zi_create_element.o - $(C) -DZINT -c ../Source/umf_dump.c -o umf_zi_dump.o - $(C) -DZINT -c ../Source/umf_extend_front.c -o umf_zi_extend_front.o - $(C) -DZINT -c ../Source/umf_garbage_collection.c -o umf_zi_garbage_collection.o - $(C) -DZINT -c ../Source/umf_get_memory.c -o umf_zi_get_memory.o - $(C) -DZINT -c ../Source/umf_init_front.c -o umf_zi_init_front.o - $(C) -DZINT -c ../Source/umf_kernel.c -o umf_zi_kernel.o - $(C) -DZINT -c ../Source/umf_kernel_init.c -o umf_zi_kernel_init.o - $(C) -DZINT -c ../Source/umf_kernel_wrapup.c -o umf_zi_kernel_wrapup.o - $(C) -DZINT -c ../Source/umf_local_search.c -o umf_zi_local_search.o - $(C) -DZINT -c ../Source/umf_lsolve.c -o umf_zi_lsolve.o - $(C) -DZINT -c ../Source/umf_ltsolve.c -o umf_zi_ltsolve.o - $(C) -DZINT -c ../Source/umf_mem_alloc_element.c -o umf_zi_mem_alloc_element.o - $(C) -DZINT -c ../Source/umf_mem_alloc_head_block.c -o umf_zi_mem_alloc_head_block.o - $(C) -DZINT -c ../Source/umf_mem_alloc_tail_block.c -o umf_zi_mem_alloc_tail_block.o - $(C) -DZINT -c ../Source/umf_mem_free_tail_block.c -o umf_zi_mem_free_tail_block.o - $(C) -DZINT -c ../Source/umf_mem_init_memoryspace.c -o umf_zi_mem_init_memoryspace.o - $(C) -DZINT -c ../Source/umf_report_vector.c -o umf_zi_report_vector.o - $(C) -DZINT -c ../Source/umf_row_search.c -o umf_zi_row_search.o - $(C) -DZINT -c ../Source/umf_scale_column.c -o umf_zi_scale_column.o - $(C) -DZINT -c ../Source/umf_set_stats.c -o umf_zi_set_stats.o - $(C) -DZINT -c ../Source/umf_solve.c -o umf_zi_solve.o - $(C) -DZINT -c ../Source/umf_symbolic_usage.c -o umf_zi_symbolic_usage.o - $(C) -DZINT -c ../Source/umf_transpose.c -o umf_zi_transpose.o - $(C) -DZINT -c ../Source/umf_tuple_lengths.c -o umf_zi_tuple_lengths.o - $(C) -DZINT -c ../Source/umf_usolve.c -o umf_zi_usolve.o - $(C) -DZINT -c ../Source/umf_utsolve.c -o umf_zi_utsolve.o - $(C) -DZINT -c ../Source/umf_valid_numeric.c -o umf_zi_valid_numeric.o - $(C) -DZINT -c ../Source/umf_valid_symbolic.c -o umf_zi_valid_symbolic.o - $(C) -DZINT -c ../Source/umf_grow_front.c -o umf_zi_grow_front.o - $(C) -DZINT -c ../Source/umf_start_front.c -o umf_zi_start_front.o - $(C) -DZINT -c ../Source/umf_store_lu.c -o umf_zi_store_lu.o - $(C) -DZINT -c ../Source/umf_scale.c -o umf_zi_scale.o - $(C) -DZINT -DWSOLVE -c ../Source/umfpack_solve.c -o umfpack_zi_wsolve.o - $(C) -DZINT -c ../Source/umfpack_col_to_triplet.c -o umfpack_zi_col_to_triplet.o - $(C) -DZINT -c ../Source/umfpack_defaults.c -o umfpack_zi_defaults.o - $(C) -DZINT -c ../Source/umfpack_free_numeric.c -o umfpack_zi_free_numeric.o - $(C) -DZINT -c ../Source/umfpack_free_symbolic.c -o umfpack_zi_free_symbolic.o - $(C) -DZINT -c ../Source/umfpack_get_numeric.c -o umfpack_zi_get_numeric.o - $(C) -DZINT -c ../Source/umfpack_get_lunz.c -o umfpack_zi_get_lunz.o - $(C) -DZINT -c ../Source/umfpack_get_symbolic.c -o umfpack_zi_get_symbolic.o - $(C) -DZINT -c ../Source/umfpack_get_determinant.c -o umfpack_zi_get_determinant.o - $(C) -DZINT -c ../Source/umfpack_numeric.c -o umfpack_zi_numeric.o - $(C) -DZINT -c ../Source/umfpack_qsymbolic.c -o umfpack_zi_qsymbolic.o - $(C) -DZINT -c ../Source/umfpack_report_control.c -o umfpack_zi_report_control.o - $(C) -DZINT -c ../Source/umfpack_report_info.c -o umfpack_zi_report_info.o - $(C) -DZINT -c ../Source/umfpack_report_matrix.c -o umfpack_zi_report_matrix.o - $(C) -DZINT -c ../Source/umfpack_report_numeric.c -o umfpack_zi_report_numeric.o - $(C) -DZINT -c ../Source/umfpack_report_perm.c -o umfpack_zi_report_perm.o - $(C) -DZINT -c ../Source/umfpack_report_status.c -o umfpack_zi_report_status.o - $(C) -DZINT -c ../Source/umfpack_report_symbolic.c -o umfpack_zi_report_symbolic.o - $(C) -DZINT -c ../Source/umfpack_report_triplet.c -o umfpack_zi_report_triplet.o - $(C) -DZINT -c ../Source/umfpack_report_vector.c -o umfpack_zi_report_vector.o - $(C) -DZINT -c ../Source/umfpack_solve.c -o umfpack_zi_solve.o - $(C) -DZINT -c ../Source/umfpack_symbolic.c -o umfpack_zi_symbolic.o - $(C) -DZINT -c ../Source/umfpack_transpose.c -o umfpack_zi_transpose.o - $(C) -DZINT -c ../Source/umfpack_triplet_to_col.c -o umfpack_zi_triplet_to_col.o - $(C) -DZINT -c ../Source/umfpack_scale.c -o umfpack_zi_scale.o - $(C) -DZINT -c ../Source/umfpack_load_numeric.c -o umfpack_zi_load_numeric.o - $(C) -DZINT -c ../Source/umfpack_save_numeric.c -o umfpack_zi_save_numeric.o - $(C) -DZINT -c ../Source/umfpack_load_symbolic.c -o umfpack_zi_load_symbolic.o - $(C) -DZINT -c ../Source/umfpack_save_symbolic.c -o umfpack_zi_save_symbolic.o - $(C) -DZLONG -DCONJUGATE_SOLVE -c ../Source/umf_ltsolve.c -o umf_zl_lhsolve.o - $(C) -DZLONG -DCONJUGATE_SOLVE -c ../Source/umf_utsolve.c -o umf_zl_uhsolve.o - $(C) -DZLONG -DDO_MAP -c ../Source/umf_triplet.c -o umf_zl_triplet_map_nox.o - $(C) -DZLONG -DDO_VALUES -c ../Source/umf_triplet.c -o umf_zl_triplet_nomap_x.o - $(C) -DZLONG -c ../Source/umf_triplet.c -o umf_zl_triplet_nomap_nox.o - $(C) -DZLONG -DDO_MAP -DDO_VALUES -c ../Source/umf_triplet.c -o umf_zl_triplet_map_x.o - $(C) -DZLONG -DFIXQ -c ../Source/umf_assemble.c -o umf_zl_assemble_fixq.o - $(C) -DZLONG -DDROP -c ../Source/umf_store_lu.c -o umf_zl_store_lu_drop.o - $(C) -DZLONG -c ../Source/umf_assemble.c -o umf_zl_assemble.o - $(C) -DZLONG -c ../Source/umf_blas3_update.c -o umf_zl_blas3_update.o - $(C) -DZLONG -c ../Source/umf_build_tuples.c -o umf_zl_build_tuples.o - $(C) -DZLONG -c ../Source/umf_create_element.c -o umf_zl_create_element.o - $(C) -DZLONG -c ../Source/umf_dump.c -o umf_zl_dump.o - $(C) -DZLONG -c ../Source/umf_extend_front.c -o umf_zl_extend_front.o - $(C) -DZLONG -c ../Source/umf_garbage_collection.c -o umf_zl_garbage_collection.o - $(C) -DZLONG -c ../Source/umf_get_memory.c -o umf_zl_get_memory.o - $(C) -DZLONG -c ../Source/umf_init_front.c -o umf_zl_init_front.o - $(C) -DZLONG -c ../Source/umf_kernel.c -o umf_zl_kernel.o - $(C) -DZLONG -c ../Source/umf_kernel_init.c -o umf_zl_kernel_init.o - $(C) -DZLONG -c ../Source/umf_kernel_wrapup.c -o umf_zl_kernel_wrapup.o - $(C) -DZLONG -c ../Source/umf_local_search.c -o umf_zl_local_search.o - $(C) -DZLONG -c ../Source/umf_lsolve.c -o umf_zl_lsolve.o - $(C) -DZLONG -c ../Source/umf_ltsolve.c -o umf_zl_ltsolve.o - $(C) -DZLONG -c ../Source/umf_mem_alloc_element.c -o umf_zl_mem_alloc_element.o - $(C) -DZLONG -c ../Source/umf_mem_alloc_head_block.c -o umf_zl_mem_alloc_head_block.o - $(C) -DZLONG -c ../Source/umf_mem_alloc_tail_block.c -o umf_zl_mem_alloc_tail_block.o - $(C) -DZLONG -c ../Source/umf_mem_free_tail_block.c -o umf_zl_mem_free_tail_block.o - $(C) -DZLONG -c ../Source/umf_mem_init_memoryspace.c -o umf_zl_mem_init_memoryspace.o - $(C) -DZLONG -c ../Source/umf_report_vector.c -o umf_zl_report_vector.o - $(C) -DZLONG -c ../Source/umf_row_search.c -o umf_zl_row_search.o - $(C) -DZLONG -c ../Source/umf_scale_column.c -o umf_zl_scale_column.o - $(C) -DZLONG -c ../Source/umf_set_stats.c -o umf_zl_set_stats.o - $(C) -DZLONG -c ../Source/umf_solve.c -o umf_zl_solve.o - $(C) -DZLONG -c ../Source/umf_symbolic_usage.c -o umf_zl_symbolic_usage.o - $(C) -DZLONG -c ../Source/umf_transpose.c -o umf_zl_transpose.o - $(C) -DZLONG -c ../Source/umf_tuple_lengths.c -o umf_zl_tuple_lengths.o - $(C) -DZLONG -c ../Source/umf_usolve.c -o umf_zl_usolve.o - $(C) -DZLONG -c ../Source/umf_utsolve.c -o umf_zl_utsolve.o - $(C) -DZLONG -c ../Source/umf_valid_numeric.c -o umf_zl_valid_numeric.o - $(C) -DZLONG -c ../Source/umf_valid_symbolic.c -o umf_zl_valid_symbolic.o - $(C) -DZLONG -c ../Source/umf_grow_front.c -o umf_zl_grow_front.o - $(C) -DZLONG -c ../Source/umf_start_front.c -o umf_zl_start_front.o - $(C) -DZLONG -c ../Source/umf_store_lu.c -o umf_zl_store_lu.o - $(C) -DZLONG -c ../Source/umf_scale.c -o umf_zl_scale.o - $(C) -DZLONG -DWSOLVE -c ../Source/umfpack_solve.c -o umfpack_zl_wsolve.o - $(C) -DZLONG -c ../Source/umfpack_col_to_triplet.c -o umfpack_zl_col_to_triplet.o - $(C) -DZLONG -c ../Source/umfpack_defaults.c -o umfpack_zl_defaults.o - $(C) -DZLONG -c ../Source/umfpack_free_numeric.c -o umfpack_zl_free_numeric.o - $(C) -DZLONG -c ../Source/umfpack_free_symbolic.c -o umfpack_zl_free_symbolic.o - $(C) -DZLONG -c ../Source/umfpack_get_numeric.c -o umfpack_zl_get_numeric.o - $(C) -DZLONG -c ../Source/umfpack_get_lunz.c -o umfpack_zl_get_lunz.o - $(C) -DZLONG -c ../Source/umfpack_get_symbolic.c -o umfpack_zl_get_symbolic.o - $(C) -DZLONG -c ../Source/umfpack_get_determinant.c -o umfpack_zl_get_determinant.o - $(C) -DZLONG -c ../Source/umfpack_numeric.c -o umfpack_zl_numeric.o - $(C) -DZLONG -c ../Source/umfpack_qsymbolic.c -o umfpack_zl_qsymbolic.o - $(C) -DZLONG -c ../Source/umfpack_report_control.c -o umfpack_zl_report_control.o - $(C) -DZLONG -c ../Source/umfpack_report_info.c -o umfpack_zl_report_info.o - $(C) -DZLONG -c ../Source/umfpack_report_matrix.c -o umfpack_zl_report_matrix.o - $(C) -DZLONG -c ../Source/umfpack_report_numeric.c -o umfpack_zl_report_numeric.o - $(C) -DZLONG -c ../Source/umfpack_report_perm.c -o umfpack_zl_report_perm.o - $(C) -DZLONG -c ../Source/umfpack_report_status.c -o umfpack_zl_report_status.o - $(C) -DZLONG -c ../Source/umfpack_report_symbolic.c -o umfpack_zl_report_symbolic.o - $(C) -DZLONG -c ../Source/umfpack_report_triplet.c -o umfpack_zl_report_triplet.o - $(C) -DZLONG -c ../Source/umfpack_report_vector.c -o umfpack_zl_report_vector.o - $(C) -DZLONG -c ../Source/umfpack_solve.c -o umfpack_zl_solve.o - $(C) -DZLONG -c ../Source/umfpack_symbolic.c -o umfpack_zl_symbolic.o - $(C) -DZLONG -c ../Source/umfpack_transpose.c -o umfpack_zl_transpose.o - $(C) -DZLONG -c ../Source/umfpack_triplet_to_col.c -o umfpack_zl_triplet_to_col.o - $(C) -DZLONG -c ../Source/umfpack_scale.c -o umfpack_zl_scale.o - $(C) -DZLONG -c ../Source/umfpack_load_numeric.c -o umfpack_zl_load_numeric.o - $(C) -DZLONG -c ../Source/umfpack_save_numeric.c -o umfpack_zl_save_numeric.o - $(C) -DZLONG -c ../Source/umfpack_load_symbolic.c -o umfpack_zl_load_symbolic.o - $(C) -DZLONG -c ../Source/umfpack_save_symbolic.c -o umfpack_zl_save_symbolic.o - $(ARCHIVE) ../Lib/libumfpack.a \ - umf_i_analyze.o umf_i_apply_order.o umf_i_colamd.o umf_i_free.o \ - umf_i_cholmod.o umf_i_fsize.o umf_i_is_permutation.o \ - umf_i_malloc.o umf_i_realloc.o \ - umf_i_report_perm.o umf_i_singletons.o \ - umf_l_analyze.o umf_l_apply_order.o umf_l_colamd.o umf_l_free.o \ - umf_l_cholmod.o umf_l_fsize.o umf_l_is_permutation.o \ - umf_l_malloc.o umf_l_realloc.o \ - umf_l_report_perm.o umf_l_singletons.o \ - umfpack_gn_timer.o umfpack_gn_tictoc.o \ - umf_di_lhsolve.o \ - umf_di_uhsolve.o umf_di_triplet_map_nox.o umf_di_triplet_nomap_x.o \ - umf_di_triplet_nomap_nox.o umf_di_triplet_map_x.o \ - umf_di_assemble_fixq.o umf_di_store_lu_drop.o umf_di_assemble.o \ - umf_di_blas3_update.o umf_di_build_tuples.o \ - umf_di_create_element.o umf_di_dump.o umf_di_extend_front.o \ - umf_di_garbage_collection.o umf_di_get_memory.o \ - umf_di_init_front.o umf_di_kernel.o umf_di_kernel_init.o \ - umf_di_kernel_wrapup.o umf_di_local_search.o umf_di_lsolve.o \ - umf_di_ltsolve.o umf_di_mem_alloc_element.o \ - umf_di_mem_alloc_head_block.o umf_di_mem_alloc_tail_block.o \ - umf_di_mem_free_tail_block.o umf_di_mem_init_memoryspace.o \ - umf_di_report_vector.o umf_di_row_search.o umf_di_scale_column.o \ - umf_di_set_stats.o umf_di_solve.o umf_di_symbolic_usage.o \ - umf_di_transpose.o umf_di_tuple_lengths.o umf_di_usolve.o \ - umf_di_utsolve.o umf_di_valid_numeric.o umf_di_valid_symbolic.o \ - umf_di_grow_front.o umf_di_start_front.o \ - umf_di_store_lu.o umf_di_scale.o umfpack_di_wsolve.o \ - umfpack_di_col_to_triplet.o umfpack_di_defaults.o \ - umfpack_di_free_numeric.o umfpack_di_free_symbolic.o \ - umfpack_di_get_numeric.o umfpack_di_get_lunz.o \ - umfpack_di_get_symbolic.o umfpack_di_get_determinant.o \ - umfpack_di_numeric.o \ - umfpack_di_qsymbolic.o umfpack_di_report_control.o \ - umfpack_di_report_info.o umfpack_di_report_matrix.o \ - umfpack_di_report_numeric.o umfpack_di_report_perm.o \ - umfpack_di_report_status.o umfpack_di_report_symbolic.o \ - umfpack_di_report_triplet.o umfpack_di_report_vector.o \ - umfpack_di_solve.o umfpack_di_symbolic.o umfpack_di_transpose.o \ - umfpack_di_triplet_to_col.o umfpack_di_scale.o \ - umfpack_di_load_numeric.o umfpack_di_save_numeric.o \ - umfpack_di_load_symbolic.o umfpack_di_save_symbolic.o \ - umf_dl_lhsolve.o \ - umf_dl_uhsolve.o umf_dl_triplet_map_nox.o umf_dl_triplet_nomap_x.o \ - umf_dl_triplet_nomap_nox.o umf_dl_triplet_map_x.o \ - umf_dl_assemble_fixq.o umf_dl_store_lu_drop.o umf_dl_assemble.o \ - umf_dl_blas3_update.o umf_dl_build_tuples.o \ - umf_dl_create_element.o umf_dl_dump.o umf_dl_extend_front.o \ - umf_dl_garbage_collection.o umf_dl_get_memory.o \ - umf_dl_init_front.o umf_dl_kernel.o umf_dl_kernel_init.o \ - umf_dl_kernel_wrapup.o umf_dl_local_search.o umf_dl_lsolve.o \ - umf_dl_ltsolve.o umf_dl_mem_alloc_element.o \ - umf_dl_mem_alloc_head_block.o umf_dl_mem_alloc_tail_block.o \ - umf_dl_mem_free_tail_block.o umf_dl_mem_init_memoryspace.o \ - umf_dl_report_vector.o umf_dl_row_search.o umf_dl_scale_column.o \ - umf_dl_set_stats.o umf_dl_solve.o umf_dl_symbolic_usage.o \ - umf_dl_transpose.o umf_dl_tuple_lengths.o umf_dl_usolve.o \ - umf_dl_utsolve.o umf_dl_valid_numeric.o umf_dl_valid_symbolic.o \ - umf_dl_grow_front.o umf_dl_start_front.o \ - umf_dl_store_lu.o umf_dl_scale.o umfpack_dl_wsolve.o \ - umfpack_dl_col_to_triplet.o umfpack_dl_defaults.o \ - umfpack_dl_free_numeric.o umfpack_dl_free_symbolic.o \ - umfpack_dl_get_numeric.o umfpack_dl_get_lunz.o \ - umfpack_dl_get_symbolic.o umfpack_dl_get_determinant.o \ - umfpack_dl_numeric.o \ - umfpack_dl_qsymbolic.o umfpack_dl_report_control.o \ - umfpack_dl_report_info.o umfpack_dl_report_matrix.o \ - umfpack_dl_report_numeric.o umfpack_dl_report_perm.o \ - umfpack_dl_report_status.o umfpack_dl_report_symbolic.o \ - umfpack_dl_report_triplet.o umfpack_dl_report_vector.o \ - umfpack_dl_solve.o umfpack_dl_symbolic.o umfpack_dl_transpose.o \ - umfpack_dl_triplet_to_col.o umfpack_dl_scale.o \ - umfpack_dl_load_numeric.o umfpack_dl_save_numeric.o \ - umfpack_dl_load_symbolic.o umfpack_dl_save_symbolic.o \ - umf_zi_lhsolve.o \ - umf_zi_uhsolve.o umf_zi_triplet_map_nox.o umf_zi_triplet_nomap_x.o \ - umf_zi_triplet_nomap_nox.o umf_zi_triplet_map_x.o \ - umf_zi_assemble_fixq.o umf_zi_store_lu_drop.o umf_zi_assemble.o \ - umf_zi_blas3_update.o umf_zi_build_tuples.o \ - umf_zi_create_element.o umf_zi_dump.o umf_zi_extend_front.o \ - umf_zi_garbage_collection.o umf_zi_get_memory.o \ - umf_zi_init_front.o umf_zi_kernel.o umf_zi_kernel_init.o \ - umf_zi_kernel_wrapup.o umf_zi_local_search.o umf_zi_lsolve.o \ - umf_zi_ltsolve.o umf_zi_mem_alloc_element.o \ - umf_zi_mem_alloc_head_block.o umf_zi_mem_alloc_tail_block.o \ - umf_zi_mem_free_tail_block.o umf_zi_mem_init_memoryspace.o \ - umf_zi_report_vector.o umf_zi_row_search.o umf_zi_scale_column.o \ - umf_zi_set_stats.o umf_zi_solve.o umf_zi_symbolic_usage.o \ - umf_zi_transpose.o umf_zi_tuple_lengths.o umf_zi_usolve.o \ - umf_zi_utsolve.o umf_zi_valid_numeric.o umf_zi_valid_symbolic.o \ - umf_zi_grow_front.o umf_zi_start_front.o \ - umf_zi_store_lu.o umf_zi_scale.o umfpack_zi_wsolve.o \ - umfpack_zi_col_to_triplet.o umfpack_zi_defaults.o \ - umfpack_zi_free_numeric.o umfpack_zi_free_symbolic.o \ - umfpack_zi_get_numeric.o umfpack_zi_get_lunz.o \ - umfpack_zi_get_symbolic.o umfpack_zi_get_determinant.o \ - umfpack_zi_numeric.o \ - umfpack_zi_qsymbolic.o umfpack_zi_report_control.o \ - umfpack_zi_report_info.o umfpack_zi_report_matrix.o \ - umfpack_zi_report_numeric.o umfpack_zi_report_perm.o \ - umfpack_zi_report_status.o umfpack_zi_report_symbolic.o \ - umfpack_zi_report_triplet.o umfpack_zi_report_vector.o \ - umfpack_zi_solve.o umfpack_zi_symbolic.o umfpack_zi_transpose.o \ - umfpack_zi_triplet_to_col.o umfpack_zi_scale.o \ - umfpack_zi_load_numeric.o umfpack_zi_save_numeric.o \ - umfpack_zi_load_symbolic.o umfpack_zi_save_symbolic.o \ - umf_zl_lhsolve.o \ - umf_zl_uhsolve.o umf_zl_triplet_map_nox.o umf_zl_triplet_nomap_x.o \ - umf_zl_triplet_nomap_nox.o umf_zl_triplet_map_x.o \ - umf_zl_assemble_fixq.o umf_zl_store_lu_drop.o umf_zl_assemble.o \ - umf_zl_blas3_update.o umf_zl_build_tuples.o \ - umf_zl_create_element.o umf_zl_dump.o umf_zl_extend_front.o \ - umf_zl_garbage_collection.o umf_zl_get_memory.o \ - umf_zl_init_front.o umf_zl_kernel.o umf_zl_kernel_init.o \ - umf_zl_kernel_wrapup.o umf_zl_local_search.o umf_zl_lsolve.o \ - umf_zl_ltsolve.o umf_zl_mem_alloc_element.o \ - umf_zl_mem_alloc_head_block.o umf_zl_mem_alloc_tail_block.o \ - umf_zl_mem_free_tail_block.o umf_zl_mem_init_memoryspace.o \ - umf_zl_report_vector.o umf_zl_row_search.o umf_zl_scale_column.o \ - umf_zl_set_stats.o umf_zl_solve.o umf_zl_symbolic_usage.o \ - umf_zl_transpose.o umf_zl_tuple_lengths.o umf_zl_usolve.o \ - umf_zl_utsolve.o umf_zl_valid_numeric.o umf_zl_valid_symbolic.o \ - umf_zl_grow_front.o umf_zl_start_front.o \ - umf_zl_store_lu.o umf_zl_scale.o umfpack_zl_wsolve.o \ - umfpack_zl_col_to_triplet.o umfpack_zl_defaults.o \ - umfpack_zl_free_numeric.o umfpack_zl_free_symbolic.o \ - umfpack_zl_get_numeric.o umfpack_zl_get_lunz.o \ - umfpack_zl_get_symbolic.o umfpack_zl_get_determinant.o \ - umfpack_zl_numeric.o \ - umfpack_zl_qsymbolic.o umfpack_zl_report_control.o \ - umfpack_zl_report_info.o umfpack_zl_report_matrix.o \ - umfpack_zl_report_numeric.o umfpack_zl_report_perm.o \ - umfpack_zl_report_status.o umfpack_zl_report_symbolic.o \ - umfpack_zl_report_triplet.o umfpack_zl_report_vector.o \ - umfpack_zl_solve.o umfpack_zl_symbolic.o umfpack_zl_transpose.o \ - umfpack_zl_triplet_to_col.o umfpack_zl_scale.o \ - umfpack_zl_load_numeric.o umfpack_zl_save_numeric.o \ - umfpack_zl_load_symbolic.o umfpack_zl_save_symbolic.o - - $(RANLIB) ../Lib/libumfpack.a +# UMFPACK depends on AMD, SuiteSparse_config, LAPACK, and the BLAS. +# It optionally relies on CHOLMOD +LDLIBS += -lamd -lsuitesparseconfig $(LAPACK) $(BLAS) + +# compile and install in SuiteSparse/lib +library: + $(MAKE) install INSTALL=$(SUITESPARSE) + +# UMFPACK can use CHOLMOD by default as an ordering option +ifneq (,$(findstring -DNCHOLMOD, $(UMFPACK_CONFIG))) + I = -I../Include -I../Source -I../../AMD/Include -I../../SuiteSparse_config +else + I = -I../Include -I../Source -I../../AMD/Include \ + -I../../SuiteSparse_config -I../../CHOLMOD/Include + LDLIBS += -lcholmod +endif + +C = $(CC) $(CF) $(UMFPACK_CONFIG) $(I) + +#------------------------------------------------------------------------------- +# source files +#------------------------------------------------------------------------------- + +# non-user-callable umf_*.[ch] files: +UMFCH = umf_assemble umf_blas3_update umf_build_tuples umf_create_element \ + umf_dump umf_extend_front umf_garbage_collection umf_get_memory \ + umf_init_front umf_kernel umf_kernel_init umf_kernel_wrapup \ + umf_local_search umf_lsolve umf_ltsolve umf_mem_alloc_element \ + umf_mem_alloc_head_block umf_mem_alloc_tail_block \ + umf_mem_free_tail_block umf_mem_init_memoryspace \ + umf_report_vector umf_row_search umf_scale_column \ + umf_set_stats umf_solve umf_symbolic_usage umf_transpose \ + umf_tuple_lengths umf_usolve umf_utsolve umf_valid_numeric \ + umf_valid_symbolic umf_grow_front umf_start_front \ + umf_store_lu umf_scale + +# non-user-callable umf_*.[ch] files, int/SuiteSparse_long versions only +# (no real/complex): +UMFINT = umf_analyze umf_apply_order umf_colamd umf_free umf_fsize \ + umf_is_permutation umf_malloc umf_realloc umf_report_perm \ + umf_singletons umf_cholmod + +# non-user-callable, created from umf_ltsolve.c, umf_utsolve.c, +# umf_triplet.c, and umf_assemble.c , with int/SuiteSparse_long +# and real/complex versions: +UMF_CREATED = umf_lhsolve umf_uhsolve umf_triplet_map_nox \ + umf_triplet_nomap_x umf_triplet_nomap_nox umf_triplet_map_x \ + umf_assemble_fixq umf_store_lu_drop + +# non-user-callable, int/SuiteSparse_long and real/complex versions: +UMF = $(UMF_CREATED) $(UMFCH) + +# user-callable umfpack_*.[ch] files (int/SuiteSparse_long and real/complex): +UMFPACK = umfpack_col_to_triplet umfpack_defaults umfpack_free_numeric \ + umfpack_free_symbolic umfpack_get_numeric umfpack_get_lunz \ + umfpack_get_symbolic umfpack_get_determinant umfpack_numeric \ + umfpack_qsymbolic umfpack_report_control umfpack_report_info \ + umfpack_report_matrix umfpack_report_numeric umfpack_report_perm \ + umfpack_report_status umfpack_report_symbolic umfpack_report_triplet \ + umfpack_report_vector umfpack_solve umfpack_symbolic \ + umfpack_transpose umfpack_triplet_to_col umfpack_scale \ + umfpack_load_numeric umfpack_save_numeric \ + umfpack_load_symbolic umfpack_save_symbolic + +# user-callable, created from umfpack_solve.c (umfpack_wsolve.h exists, though): +# with int/SuiteSparse_long and real/complex versions: +UMFPACKW = umfpack_wsolve + +USER = $(UMFPACKW) $(UMFPACK) + +# user-callable, only one version for int/SuiteSparse_long, +# real/complex, *.[ch] files: +GENERIC = umfpack_timer umfpack_tictoc + +#------------------------------------------------------------------------------- +# include files: +#------------------------------------------------------------------------------- + +INC = ../Include/umfpack.h ../../SuiteSparse_config/SuiteSparse_config.h \ + ../Source/umf_config.h ../Source/umf_version.h \ + ../Source/umf_internal.h ../Source/umf_triplet.h \ + $(addprefix ../Source/, $(addsuffix .h,$(UMFCH))) \ + $(addprefix ../Source/, $(addsuffix .h,$(UMFINT))) \ + $(addprefix ../Include/, $(addsuffix .h,$(USER))) \ + $(addprefix ../Include/, $(addsuffix .h,$(GENERIC))) \ + ../../AMD/Include/amd_internal.h ../../AMD/Include/amd.h + +#------------------------------------------------------------------------------- +# object files for each version +#------------------------------------------------------------------------------- + +DI = $(addsuffix .o, $(subst umf_,umf_di_,$(UMF)) $(subst umfpack_,umfpack_di_,$(USER))) +DL = $(addsuffix .o, $(subst umf_,umf_dl_,$(UMF)) $(subst umfpack_,umfpack_dl_,$(USER))) +ZI = $(addsuffix .o, $(subst umf_,umf_zi_,$(UMF)) $(subst umfpack_,umfpack_zi_,$(USER))) +ZL = $(addsuffix .o, $(subst umf_,umf_zl_,$(UMF)) $(subst umfpack_,umfpack_zl_,$(USER))) +II = $(addsuffix .o, $(subst umf_,umf_i_,$(UMFINT))) +LL = $(addsuffix .o, $(subst umf_,umf_l_,$(UMFINT))) +GN = $(addsuffix .o, $(subst umfpack_,umfpack_gn_,$(GENERIC))) + +#------------------------------------------------------------------------------- +# compile each int and SuiteSparse_long routine (with no real/complex version) +#------------------------------------------------------------------------------- + +umf_i_%.o: ../Source/umf_%.c $(INC) + $(C) -DDINT -c $< -o $@ + +umf_l_%.o: ../Source/umf_%.c $(INC) + $(C) -DDLONG -c $< -o $@ + +#------------------------------------------------------------------------------- +# compile each routine in the DI version +#------------------------------------------------------------------------------- + +umf_di_%.o: ../Source/umf_%.c $(INC) + $(C) -DDINT -c $< -o $@ + +umf_di_%hsolve.o: ../Source/umf_%tsolve.c $(INC) + $(C) -DDINT -DCONJUGATE_SOLVE -c $< -o $@ + +umf_di_triplet_map_x.o: ../Source/umf_triplet.c $(INC) + $(C) -DDINT -DDO_MAP -DDO_VALUES -c $< -o $@ + +umf_di_triplet_map_nox.o: ../Source/umf_triplet.c $(INC) + $(C) -DDINT -DDO_MAP -c $< -o $@ + +umf_di_triplet_nomap_x.o: ../Source/umf_triplet.c $(INC) + $(C) -DDINT -DDO_VALUES -c $< -o $@ + +umf_di_triplet_nomap_nox.o: ../Source/umf_triplet.c $(INC) + $(C) -DDINT -c $< -o $@ + +umf_di_assemble_fixq.o: ../Source/umf_assemble.c $(INC) + $(C) -DDINT -DFIXQ -c $< -o $@ + +umf_di_store_lu_drop.o: ../Source/umf_store_lu.c $(INC) + $(C) -DDINT -DDROP -c $< -o $@ + +umfpack_di_wsolve.o: ../Source/umfpack_solve.c $(INC) + $(C) -DDINT -DWSOLVE -c $< -o $@ + +umfpack_di_%.o: ../Source/umfpack_%.c $(INC) + $(C) -DDINT -c $< -o $@ + +#------------------------------------------------------------------------------- +# compile each routine in the DL version +#------------------------------------------------------------------------------- + +umf_dl_%.o: ../Source/umf_%.c $(INC) + $(C) -DDLONG -c $< -o $@ + +umf_dl_%hsolve.o: ../Source/umf_%tsolve.c $(INC) + $(C) -DDLONG -DCONJUGATE_SOLVE -c $< -o $@ + +umf_dl_triplet_map_x.o: ../Source/umf_triplet.c $(INC) + $(C) -DDLONG -DDO_MAP -DDO_VALUES -c $< -o $@ + +umf_dl_triplet_map_nox.o: ../Source/umf_triplet.c $(INC) + $(C) -DDLONG -DDO_MAP -c $< -o $@ + +umf_dl_triplet_nomap_x.o: ../Source/umf_triplet.c $(INC) + $(C) -DDLONG -DDO_VALUES -c $< -o $@ + +umf_dl_triplet_nomap_nox.o: ../Source/umf_triplet.c $(INC) + $(C) -DDLONG -c $< -o $@ + +umf_dl_assemble_fixq.o: ../Source/umf_assemble.c $(INC) + $(C) -DDLONG -DFIXQ -c $< -o $@ + +umf_dl_store_lu_drop.o: ../Source/umf_store_lu.c $(INC) + $(C) -DDLONG -DDROP -c $< -o $@ + +umfpack_dl_wsolve.o: ../Source/umfpack_solve.c $(INC) + $(C) -DDLONG -DWSOLVE -c $< -o $@ + +umfpack_dl_%.o: ../Source/umfpack_%.c $(INC) + $(C) -DDLONG -c $< -o $@ + +#------------------------------------------------------------------------------- +# compile each routine in the ZI version +#------------------------------------------------------------------------------- + +umf_zi_%.o: ../Source/umf_%.c $(INC) + $(C) -DZINT -c $< -o $@ + +umf_zi_%hsolve.o: ../Source/umf_%tsolve.c $(INC) + $(C) -DZINT -DCONJUGATE_SOLVE -c $< -o $@ + +umf_zi_triplet_map_x.o: ../Source/umf_triplet.c $(INC) + $(C) -DZINT -DDO_MAP -DDO_VALUES -c $< -o $@ + +umf_zi_triplet_map_nox.o: ../Source/umf_triplet.c $(INC) + $(C) -DZINT -DDO_MAP -c $< -o $@ + +umf_zi_triplet_nomap_x.o: ../Source/umf_triplet.c $(INC) + $(C) -DZINT -DDO_VALUES -c $< -o $@ + +umf_zi_triplet_nomap_nox.o: ../Source/umf_triplet.c $(INC) + $(C) -DZINT -c $< -o $@ + +umf_zi_assemble_fixq.o: ../Source/umf_assemble.c $(INC) + $(C) -DZINT -DFIXQ -c $< -o $@ + +umf_zi_store_lu_drop.o: ../Source/umf_store_lu.c $(INC) + $(C) -DZINT -DDROP -c $< -o $@ + +umfpack_zi_wsolve.o: ../Source/umfpack_solve.c $(INC) + $(C) -DZINT -DWSOLVE -c $< -o $@ + +umfpack_zi_%.o: ../Source/umfpack_%.c $(INC) + $(C) -DZINT -c $< -o $@ + +#------------------------------------------------------------------------------- +# compile each routine in the ZL version +#------------------------------------------------------------------------------- + +umf_zl_%.o: ../Source/umf_%.c $(INC) + $(C) -DZLONG -c $< -o $@ + +umf_zl_%hsolve.o: ../Source/umf_%tsolve.c $(INC) + $(C) -DZLONG -DCONJUGATE_SOLVE -c $< -o $@ + +umf_zl_triplet_map_x.o: ../Source/umf_triplet.c $(INC) + $(C) -DZLONG -DDO_MAP -DDO_VALUES -c $< -o $@ + +umf_zl_triplet_map_nox.o: ../Source/umf_triplet.c $(INC) + $(C) -DZLONG -DDO_MAP -c $< -o $@ + +umf_zl_triplet_nomap_x.o: ../Source/umf_triplet.c $(INC) + $(C) -DZLONG -DDO_VALUES -c $< -o $@ + +umf_zl_triplet_nomap_nox.o: ../Source/umf_triplet.c $(INC) + $(C) -DZLONG -c $< -o $@ + +umf_zl_assemble_fixq.o: ../Source/umf_assemble.c $(INC) + $(C) -DZLONG -DFIXQ -c $< -o $@ + +umf_zl_store_lu_drop.o: ../Source/umf_store_lu.c $(INC) + $(C) -DZLONG -DDROP -c $< -o $@ + +umfpack_zl_wsolve.o: ../Source/umfpack_solve.c $(INC) + $(C) -DZLONG -DWSOLVE -c $< -o $@ + +umfpack_zl_%.o: ../Source/umfpack_%.c $(INC) + $(C) -DZLONG -c $< -o $@ + +#------------------------------------------------------------------------------- +# Create the generic routines (GN) using a generic rule +#------------------------------------------------------------------------------- + +umfpack_gn_%.o: ../Source/umfpack_%.c $(INC) + $(C) -c $< -o $@ + +#------------------------------------------------------------------------------- +# Create the libumfpack.a library +#------------------------------------------------------------------------------- + +OBJ = $(II) $(LL) $(GN) $(DI) $(DL) $(ZI) $(ZL) + +$(AR_TARGET): $(OBJ) + $(ARCHIVE) $@ $^ + - $(RANLIB) $@ #------------------------------------------------------------------------------- # Remove all but the files in the original distribution #------------------------------------------------------------------------------- +distclean: purge + purge: clean - - $(RM) ../Lib/libumfpack.a + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) + +#------------------------------------------------------------------------------- +# install UMFPACK +install: $(AR_TARGET) $(INSTALL_LIB)/$(SO_TARGET) + +$(INSTALL_LIB)/$(SO_TARGET): $(OBJ) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) + $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_PLAIN) ) + ( cd $(INSTALL_LIB) ; ln -sf $(SO_TARGET) $(SO_MAIN) ) + $(CP) ../Include/umfpack*.h $(INSTALL_INCLUDE) + $(CP) ../Doc/UMFPACK_UserGuide.pdf $(INSTALL_DOC) + $(CP) ../Doc/UMFPACK_QuickStart.pdf $(INSTALL_DOC) + $(CP) ../README.txt $(INSTALL_DOC)/UMFPACK_README.txt + chmod 755 $(INSTALL_LIB)/$(SO_TARGET) + chmod 644 $(INSTALL_INCLUDE)/umfpack*.h + chmod 644 $(INSTALL_DOC)/UMFPACK_UserGuide.pdf + chmod 644 $(INSTALL_DOC)/UMFPACK_QuickStart.pdf + chmod 644 $(INSTALL_DOC)/UMFPACK_README.txt + +# uninstall UMFPACK +uninstall: + $(RM) $(INSTALL_LIB)/$(SO_TARGET) + $(RM) $(INSTALL_LIB)/$(SO_PLAIN) + $(RM) $(INSTALL_LIB)/$(SO_MAIN) + $(RM) $(INSTALL_INCLUDE)/umfpack*.h + $(RM) $(INSTALL_DOC)/UMFPACK_UserGuide.pdf + $(RM) $(INSTALL_DOC)/UMFPACK_QuickStart.pdf + $(RM) $(INSTALL_DOC)/UMFPACK_README.txt + + diff --git a/SuiteSparse/UMFPACK/MATLAB/Contents.m b/SuiteSparse/UMFPACK/MATLAB/Contents.m index 95af6fb9a..e9f506d0d 100644 --- a/SuiteSparse/UMFPACK/MATLAB/Contents.m +++ b/SuiteSparse/UMFPACK/MATLAB/Contents.m @@ -1,9 +1,9 @@ %Contents of the UMFPACK sparse matrix toolbox: % -% umfpack2 - computes x=A\b, x=A/b, or lu (A) for a sparse matrix A -% umfpack_make - to compile umfpack2 for use in MATLAB -% umfpack_install - to compile and install umfpack2 and amd2 for use in MATLAB -% umfpack_details - details on all the options for using umfpack2 in MATLAB +% umfpack - computes x=A\b, x=A/b, or lu (A) for a sparse matrix A +% umfpack_make - to compile umfpack for use in MATLAB +% umfpack_install - to compile and install umfpack and amd2 for use in MATLAB +% umfpack_details - details on all the options for using umfpack in MATLAB % umfpack_report - prints optional control settings and statistics % umfpack_demo - a lenghty demo % umfpack_simple - a simple demo @@ -11,21 +11,17 @@ % umfpack_solve - x = A\b or x = b/A % lu_normest - estimates norm (L*U-A, 1) without forming L*U-A % luflop - given L and U, computes # of flops required to compute them -% umfpack_test - for testing umfpack2 (requires UFget) +% umfpack_test - for testing umfpack (requires UFget) % % Example: -% x = umfpack2 (A, '\', b) ; % same as x = A\b, if A square and unsymmetric +% x = umfpack (A, '\', b) ; % same as x = A\b, if A square and unsymmetric % % See also these built-in functions: -% umfpack the built-in version of UMFPACK +% x=A\b uses the built-in version of UMFPACK % amd symmetric minimum degree ordering % colamd unsymmetric column approx minimum degree ordering % symamd symmetric approx minimum degree ordering, based on colamd % -% NOTE: UMFPACK is a built-in function in MATLAB, used in x=A\b. This is the -% source code for the built-in umfpack, but the MATLAB function has been renamed -% here to umfpack2, to avoid a filename clash with itself. -% % Copyright 1995-2009 by Timothy A. Davis. % All Rights Reserved. Type umfpack_details for License. diff --git a/SuiteSparse/UMFPACK/MATLAB/Makefile b/SuiteSparse/UMFPACK/MATLAB/Makefile index fc1eb6a10..55af04f8d 100644 --- a/SuiteSparse/UMFPACK/MATLAB/Makefile +++ b/SuiteSparse/UMFPACK/MATLAB/Makefile @@ -11,8 +11,11 @@ include ../../SuiteSparse_config/SuiteSparse_config.mk # Remove all but the files in the original distribution #------------------------------------------------------------------------------- +distclean: purge + purge: clean - - $(RM) *.mex* rename.h + - $(RM) luflop.mex* umfpack.mex* rename.h GKlib_util.c GKlib_graph.c + - $(RM) -r $(PURGE) clean: - - $(RM) $(CLEAN) + - $(RM) -r $(CLEAN) diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack2.m b/SuiteSparse/UMFPACK/MATLAB/umfpack2.m index f81137846..acc612e34 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack2.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack2.m @@ -1,65 +1,2 @@ -function [out1, out2, out3, out4, out5] = umfpack2(in1, in2, in3, in4, in5) %#ok -%UMFPACK2 computes x=A\b, x=A/b, or lu (A) for a sparse matrix A -% It is also a built-in function in MATLAB, used in x=A\b. -% -% Example: -% -% UMFPACK: | MATLAB approximate equivalent: -% --------------------------------------------------------------------- -% x = umfpack2 (A, '\', b) ; | x = A \ b -% | -% x = umfpack2 (b, '/', A) ; | x = b / A -% | -% [L,U,P,Q] = umfpack2 (A) ; | [m,n] = size (A) ; -% | I = speye (n) ; -% | Q = I (:, colamd (A)) ; -% | [L,U,P] = lu (A*Q) ; -% | -% [L,U,P,Q,R] = umfpack2 (A) ; | [m,n] = size (A) ; -% | I = speye (n) ; -% | Q = I (:, colamd (A)) ; -% | r = full (sum (abs (A), 2)) ; -% | r (find (r == 0)) = 1 ; -% | R = spdiags (r, 0, m, m) ; -% | [L,U,P] = lu ((R\A)*Q) ; -% | -% [P,Q,F,C] = umfpack2 (A, 'symbolic')| [m,n] = size (A) ; -% | I = speye (n) ; -% | Q = I (:, colamd (A)) ; -% | [count,h,parent,post] = ... -% | symbfact (A*Q, 'col') ; -% -% A must be sparse. It can be complex, singular, and/or rectangular. A must be -% square for '/' or '\'. b must be a full real or complex vector. For -% [L,U,P,Q,R] = umfpack2 (A), the factorization is L*U = P*(R\A)*Q. If A has a -% mostly symmetric nonzero pattern, then replace "colamd" with "amd" in the -% MATLAB-equivalent column in the table above. Type umfpack_details for more -% information. -% -% An optional final input argument provides control parameters: -% -% opts.prl >= 0, default 1 (errors only) -% opts.strategy 'auto', 'unsymmetric', 'symmetric', default auto -% opts.ordering 'amd' AMD for A+A', COLAMD for A'A -% 'default' use CHOLMOD (AMD then METIS; take best fount) -% 'metis' use METIS -% 'none' no fill-reducing ordering -% 'given' use Qinit (this is default if Qinit present) -% 'best' try AMD/COLAMD, METIS, and NESDIS; take best -% opts.tol default 0.1 -% opts.symtol default 0.001 -% opts.scale row scaling: 'none', 'sum', 'max' -% opts.irstep max # of steps of iterative refinement, default 2 -% opts.singletons 'enable','disable' default 'enable' -% -% An optional final output argument provides informational output, in a -% struct whos contents are mostly self-explanatory. -% -% See also: lu_normest, colamd, amd, umfpack. -% To use UMFPACK for an arbitrary b, see umfpack_solve. - -% Copyright 1995-2009 by Timothy A. Davis. - -help umfpack2 -error ('umfpack2 mexFunction not found') ; - +function umfpack2 +error ('Please use the function "umfpack" instead.') ; diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_btf.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_btf.m index f9699e727..67b16cdc2 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_btf.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_btf.m @@ -10,7 +10,7 @@ % MATLAB's \ operator. The Control parameter is optional (Type umfpack_details % and umfpack_report for details on its use). A must be square. % -% See also umfpack, umfpack2, umfpack_details, dmperm +% See also umfpack, umfpack_details, dmperm % Copyright 1995-2009 by Timothy A. Davis. @@ -31,7 +31,7 @@ end if (nargin < 3) - Control = umfpack2 ; + Control = umfpack ; end %------------------------------------------------------------------------------- @@ -56,7 +56,7 @@ % matrix is irreducible or structurally singular %--------------------------------------------------------------------------- - [x info2] = umfpack2 (A, '\', b, Control) ; + [x info2] = umfpack (A, '\', b, Control) ; info.nnz_in_L_plus_U = info2.nnz_in_L_plus_U ; else diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_demo.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_demo.m index ebca35875..80486bca2 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_demo.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_demo.m @@ -6,7 +6,7 @@ function umfpack_demo (c) % Example: % umfpack_demo % -% See also umfpack, umfpack2, umfpack_make, umfpack_details, umfpack_report, +% See also umfpack, umfpack_make, umfpack_details, umfpack_report, % and umfpack_simple. % Copyright 1995-2009 by Timothy A. Davis. @@ -15,7 +15,7 @@ function umfpack_demo (c) % get default control parameters %------------------------------------------------------------------------------- -control = umfpack2 ; +control = umfpack ; if (nargin < 1) fprintf ('\nEnter the printing level for UMFPACK''s output statistics:\n') ; fprintf ('0: none, 1: errors only, 2: statistics, 4: print some outputs\n'); @@ -44,7 +44,7 @@ function umfpack_demo (c) b = rand (n, 1) ; fprintf ('Solving Ax=b via UMFPACK:\n') ; -xu = umfpack2 (A, '\', b, control) ; +xu = umfpack (A, '\', b, control) ; fprintf ('Solving Ax=b via MATLAB:\n') ; xm = A\b ; @@ -63,7 +63,7 @@ function umfpack_demo (c) title ('The matrix A') ; subplot (2,3,2) -[P1, Q1, Fr, Ch, Info] = umfpack2 (A, 'symbolic') ; %#ok +[P1, Q1, Fr, Ch, Info] = umfpack (A, 'symbolic') ; %#ok treeplot (Fr (1:end-1,2)') ; title ('Supernodal column elimination tree') ; @@ -73,8 +73,8 @@ function umfpack_demo (c) subplot (2,3,4) fprintf ('\n--------------------------------------------------------------\n') ; -fprintf ('\nFactorizing [L, U, P, Q, R] = umfpack2 (A)\n') ; -[L, U, P, Q, R] = umfpack2 (A) ; +fprintf ('\nFactorizing [L, U, P, Q, R] = umfpack (A)\n') ; +[L, U, P, Q, R] = umfpack (A) ; spy (P*A*Q) title ('A, with final row/column order') ; @@ -122,7 +122,7 @@ function umfpack_demo (c) fprintf ('Solve A''x=b:\n') ; fprintf ('Solving A''x=b via UMFPACK:\n') ; -xu = umfpack2 (b', '/', A, control) ; +xu = umfpack (b', '/', A, control) ; xu = xu' ; fprintf ('Solving A''x=b via MATLAB:\n') ; @@ -144,7 +144,7 @@ function umfpack_demo (c) C = A' ; % factorize C (P,Q) = L*U -[L, U, P, Q, R, info] = umfpack2 (C, control) ; %#ok +[L, U, P, Q, R, info] = umfpack (C, control) ; %#ok fprintf ('\nP * (R\\C) * Q - L*U should be zero:\n') ; fprintf ('norm (P*(R\\C)*Q - L*U, 1) = %g (exact) %g (estimated)\n', ... @@ -193,4 +193,4 @@ function umfpack_demo (c) %------------------------------------------------------------------------------- fprintf ('\n--------------------------------------------------------------\n') ; -fprintf ('det(A): %g UMFPACK determinant: %g\n', det (A), umfpack2 (A, 'det')); +fprintf ('det(A): %g UMFPACK determinant: %g\n', det (A), umfpack (A, 'det')); diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_demo.m.out b/SuiteSparse/UMFPACK/MATLAB/umfpack_demo.m.out index cac4324ca..be35bc5b9 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_demo.m.out +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_demo.m.out @@ -11,7 +11,7 @@ Difference between UMFPACK and MATLAB solution: 0 -------------------------------------------------------------- -Factorizing [L, U, P, Q, R] = umfpack2 (A) +Factorizing [L, U, P, Q, R] = umfpack (A) P * (R\A) * Q - L*U should be zero: norm (P*(R\A)*Q - L*U, 1) = 2.77556e-16 (exact) 1.21864e-16 (estimated) diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_details.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_details.m index 0ef0b8203..10ca01a63 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_details.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_details.m @@ -1,5 +1,5 @@ function umfpack_details -%UMFPACK_DETAILS details on all the options for using umfpack2 in MATLAB +%UMFPACK_DETAILS details on all the options for using umfpack in MATLAB % % Factor or solve a sparse linear system, returning either the solution x to % Ax=b or A'x'=b', the factorization LU=PAQ, or LU=P(R\A)Q. A must be sparse. @@ -23,30 +23,30 @@ % elimination tree post-ordering, do not refine the column ordering % during factorization, and attempt to select pivots on the diagonal. % -% Each of the following uses of umfpack2 (except for "Control = umfpack2") is -% stand-alone. That is, no call to umfpack2 is required for any subsequent +% Each of the following uses of umfpack (except for "Control = umfpack") is +% stand-alone. That is, no call to umfpack is required for any subsequent % call. In each usage, the Info output argument is optional. % % Example: % -% [x, Info] = umfpack2 (A, '\', b) ; -% [x, Info] = umfpack2 (A, '\', b, Control) ; -% [x, Info] = umfpack2 (A, Qinit, '\', b, Control) ; -% [x, Info] = umfpack2 (A, Qinit, '\', b) ; +% [x, Info] = umfpack (A, '\', b) ; +% [x, Info] = umfpack (A, '\', b, Control) ; +% [x, Info] = umfpack (A, Qinit, '\', b, Control) ; +% [x, Info] = umfpack (A, Qinit, '\', b) ; % % Solves Ax=b (similar to x = A\b in MATLAB). % -% [x, Info] = umfpack2 (b, '/', A) ; -% [x, Info] = umfpack2 (b, '/', A, Control) ; -% [x, Info] = umfpack2 (b, '/', A, Qinit) ; -% [x, Info] = umfpack2 (b, '/', A, Qinit, Control) ; +% [x, Info] = umfpack (b, '/', A) ; +% [x, Info] = umfpack (b, '/', A, Control) ; +% [x, Info] = umfpack (b, '/', A, Qinit) ; +% [x, Info] = umfpack (b, '/', A, Qinit, Control) ; % % Solves A'x'=b' (similar to x = b/A in MATLAB). % -% [L, U, P, Q, R, Info] = umfpack2 (A) ; -% [L, U, P, Q, R, Info] = umfpack2 (A, Control) ; -% [L, U, P, Q, R, Info] = umfpack2 (A, Qinit) ; -% [L, U, P, Q, R, Info] = umfpack2 (A, Qinit, Control) ; +% [L, U, P, Q, R, Info] = umfpack (A) ; +% [L, U, P, Q, R, Info] = umfpack (A, Control) ; +% [L, U, P, Q, R, Info] = umfpack (A, Qinit) ; +% [L, U, P, Q, R, Info] = umfpack (A, Qinit, Control) ; % % Returns the LU factorization of A. P and Q are returned as permutation % matrices. R is a diagonal sparse matrix of scale factors for the rows @@ -55,18 +55,18 @@ % Control (17) to zero (in which case R = speye (m)), or by using the % following syntaxes (in which case Control (17) is ignored): % -% [L, U, P, Q] = umfpack2 (A) ; -% [L, U, P, Q] = umfpack2 (A, Control) ; -% [L, U, P, Q] = umfpack2 (A, Qinit) ; -% [L, U, P, Q] = umfpack2 (A, Qinit, Control) ; +% [L, U, P, Q] = umfpack (A) ; +% [L, U, P, Q] = umfpack (A, Control) ; +% [L, U, P, Q] = umfpack (A, Qinit) ; +% [L, U, P, Q] = umfpack (A, Qinit, Control) ; % % Same as above, except that no row scaling is performed. The Info array % is not returned, either. % -% [P1, Q1, Fr, Ch, Info] = umfpack2 (A, 'symbolic') ; -% [P1, Q1, Fr, Ch, Info] = umfpack2 (A, 'symbolic', Control) ; -% [P1, Q1, Fr, Ch, Info] = umfpack2 (A, Qinit, 'symbolic') ; -% [P1, Q1, Fr, Ch, Info] = umfpack2 (A, Qinit, 'symbolic', Control); +% [P1, Q1, Fr, Ch, Info] = umfpack (A, 'symbolic') ; +% [P1, Q1, Fr, Ch, Info] = umfpack (A, 'symbolic', Control) ; +% [P1, Q1, Fr, Ch, Info] = umfpack (A, Qinit, 'symbolic') ; +% [P1, Q1, Fr, Ch, Info] = umfpack (A, Qinit, 'symbolic', Control); % % Performs only the fill-reducing column pre-ordering (including the % elimination tree post-ordering) and symbolic factorization. Q1 is the @@ -103,21 +103,21 @@ % Chain (i,1) to Chain (i+1,1)-1, and the largest front in chain i is % Chain (i,2)-by-Chain (i,3). % -% This use of umfpack2 is not required to factor or solve a linear system +% This use of umfpack is not required to factor or solve a linear system % in MATLAB. It analyzes the matrix A and provides information only. % The MATLAB statement "treeplot (Fr (:,2)')" plots the column elimination % tree. % -% Control = umfpack2 ; +% Control = umfpack ; % -% Returns a struct of default parameter settings for umfpack2. +% Returns a struct of default parameter settings for umfpack. % % umfpack_report (Control, Info) ; % % Prints the current Control settings, and Info % -% det = umfpack2 (A, 'det') ; -% [det dexp] = umfpack2 (A, 'det') ; +% det = umfpack (A, 'det') ; +% [det dexp] = umfpack (A, 'det') ; % % Computes the determinant of A. The 2nd form returns the determinant % in the form det*10^dexp, where det is in the range +/- 1 to 10, @@ -167,7 +167,7 @@ % % Availability: http://www.suitesparse.com % -% See also umfpack, umfpack2, umfpack_make, umfpack_report, +% See also umfpack, umfpack_make, umfpack_report, % umfpack_demo, and umfpack_simple. more on diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_install.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_install.m index 921f2c56d..8b2fdb987 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_install.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_install.m @@ -1,23 +1,18 @@ function umfpack_install -%UMFPACK_INSTALL to compile and install umfpack2 and amd2 for use in MATLAB +%UMFPACK_INSTALL to compile and install umfpack and amd2 for use in MATLAB % Your current directory must be UMFPACK/MATLAB for this function to work. % % Example: % umfpack_install % -% See also umfpack2, amd2. +% See also umfpack, amd2. % Copyright 1995-2007 by Timothy A. Davis. % compile and install UMFPACK umfpack_path = pwd ; addpath (umfpack_path) ; -try - umfpack_make -catch - fprintf ('Trying to install with lcc_lib/libmwlapack.lib instead\n') ; - umfpack_make ('lcc_lib/libmwlapack.lib') ; -end +umfpack_make % compile and install AMD cd ../../AMD/MATLAB diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_make.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_make.m index 074674c51..939e336ec 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_make.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_make.m @@ -1,7 +1,7 @@ function umfpack_make -%UMFPACK_MAKE to compile umfpack2 for use in MATLAB +%UMFPACK_MAKE to compile umfpack for use in MATLAB % -% Compiles the umfpack2 mexFunction and then runs a simple demo. +% Compiles the umfpack mexFunction and then runs a simple demo. % % Example: % umfpack_make @@ -9,16 +9,16 @@ % UMFPACK relies on AMD and its own built-in version of COLAMD for its ordering % options. The default is for UMFPACK to also use CHOLMOD, CCOLAMD, CAMD, and % METIS for more ordering options as well. This results in lower fill-in and -% higher performance. A copy of METIS 4.0.1 must be placed in ../../metis-4.0. +% higher performance. METIS 5.1.0 should appear in ../../metis-5.1.0. % METIS is optional; if not present, it is not used. % -% See also: umfpack, umfpack2, umfpack_details, umfpack_report, umfpack_demo, +% See also: umfpack, umfpack_details, umfpack_report, umfpack_demo, % and umfpack_simple. -% Copyright 1995-2009 by Timothy A. Davis. +% Copyright 1995-2016 by Timothy A. Davis. -metis_path = '../../metis-4.0' ; -with_cholmod = exist ([metis_path '/Lib'], 'dir') ; +metis_path = '../../metis-5.1.0' ; +with_cholmod = exist (metis_path, 'dir') ; details = 0 ; % set to 1 to print out each mex command as it's executed @@ -62,13 +62,7 @@ % fine the LAPACK and BLAS libraries, which is a real portability nightmare. if (pc) - if (verLessThan ('matlab', '6.5')) - % MATLAB 6.1 and earlier: use the version supplied here - lapack = 'lcc_lib/libmwlapack.lib' ; - fprintf ('Using %s. If this fails with dgemm and others\n',lapack); - fprintf ('undefined, then edit umfpack_make.m and modify the') ; - fprintf (' statement:\nlapack = ''%s'' ;\n', lapack) ; - elseif (verLessThan ('matlab', '7.5')) + if (verLessThan ('matlab', '7.5')) lapack = 'libmwlapack.lib' ; else % MATLAB R2007b (7.5) made the problem worse @@ -106,31 +100,18 @@ if (with_cholmod) incdir = [incdir ' -I../../CCOLAMD/Include -I../../CAMD/Include ' ... - ' -I../../CHOLMOD/Include -I' metis_path '/Lib -I../../COLAMD/Include'] ; + ' -I../../CHOLMOD/Include -I../../COLAMD/Include'] ; + incdir = [incdir ' -I' metis_path '/include'] ; + incdir = [incdir ' -I' metis_path '/GKlib'] ; + incdir = [incdir ' -I' metis_path '/libmetis'] ; end %------------------------------------------------------------------------------- -% METIS patch +% METIS options %------------------------------------------------------------------------------- -% fix the METIS 4.0.1 rename.h file if (with_cholmod) fprintf ('with CHOLMOD, CAMD, CCOLAMD, and METIS\n') ; - f = fopen ('rename.h', 'w') ; - if (f == -1) - error ('unable to create rename.h in current directory') ; - end - fprintf (f, '/* do not edit this file; generated by umfpack_make.m */\n') ; - fprintf (f, '#undef log2\n') ; - fprintf (f, '#include "%s/Lib/rename.h"\n', metis_path) ; - fprintf (f, '#undef log2\n') ; - fprintf (f, '#define log2 METIS__log2\n') ; - fprintf (f, '#include "mex.h"\n') ; - fprintf (f, '#define malloc mxMalloc\n') ; - fprintf (f, '#define free mxFree\n') ; - fprintf (f, '#define calloc mxCalloc\n') ; - fprintf (f, '#define realloc mxRealloc\n') ; - fclose (f) ; flags = [' -DNSUPERNODAL -DNMODIFY -DNMATRIXOPS ' flags] ; else fprintf ('without CHOLMOD, CAMD, CCOLAMD, and METIS\n') ; @@ -202,63 +183,72 @@ '../../CAMD/Source/camd_preprocess', ... '../../CAMD/Source/camd_valid', ... '../../COLAMD/Source/colamd', ... - '../../COLAMD/Source/colamd_global', ... - '../../CCOLAMD/Source/ccolamd', ... - '../../CCOLAMD/Source/ccolamd_global' } ; + '../../CCOLAMD/Source/ccolamd' } ; + metis_src = { - 'Lib/balance', ... - 'Lib/bucketsort', ... - 'Lib/ccgraph', ... - 'Lib/coarsen', ... - 'Lib/compress', ... - 'Lib/debug', ... - 'Lib/estmem', ... - 'Lib/fm', ... - 'Lib/fortran', ... - 'Lib/frename', ... - 'Lib/graph', ... - 'Lib/initpart', ... - 'Lib/kmetis', ... - 'Lib/kvmetis', ... - 'Lib/kwayfm', ... - 'Lib/kwayrefine', ... - 'Lib/kwayvolfm', ... - 'Lib/kwayvolrefine', ... - 'Lib/match', ... - 'Lib/mbalance2', ... - 'Lib/mbalance', ... - 'Lib/mcoarsen', ... - 'Lib/memory', ... - 'Lib/mesh', ... - 'Lib/meshpart', ... - 'Lib/mfm2', ... - 'Lib/mfm', ... - 'Lib/mincover', ... - 'Lib/minitpart2', ... - 'Lib/minitpart', ... - 'Lib/mkmetis', ... - 'Lib/mkwayfmh', ... - 'Lib/mkwayrefine', ... - 'Lib/mmatch', ... - 'Lib/mmd', ... - 'Lib/mpmetis', ... - 'Lib/mrefine2', ... - 'Lib/mrefine', ... - 'Lib/mutil', ... - 'Lib/myqsort', ... - 'Lib/ometis', ... - 'Lib/parmetis', ... - 'Lib/pmetis', ... - 'Lib/pqueue', ... - 'Lib/refine', ... - 'Lib/separator', ... - 'Lib/sfm', ... - 'Lib/srefine', ... - 'Lib/stat', ... - 'Lib/subdomains', ... - 'Lib/timing', ... - 'Lib/util' } ; + 'GKlib/b64', ... + 'GKlib/blas', ... + 'GKlib/csr', ... + 'GKlib/error', ... + 'GKlib/evaluate', ... + 'GKlib/fkvkselect', ... + 'GKlib/fs', ... + 'GKlib/getopt', ... + 'GKlib/gkregex', ... + 'GKlib/graph', ... + 'GKlib/htable', ... + 'GKlib/io', ... + 'GKlib/itemsets', ... + 'GKlib/mcore', ... + 'GKlib/memory', ... + 'GKlib/omp', ... + 'GKlib/pdb', ... + 'GKlib/pqueue', ... + 'GKlib/random', ... + 'GKlib/rw', ... + 'GKlib/seq', ... + 'GKlib/sort', ... + 'GKlib/string', ... + 'GKlib/timers', ... + 'GKlib/tokenizer', ... + 'GKlib/util', ... + 'libmetis/auxapi', ... + 'libmetis/balance', ... + 'libmetis/bucketsort', ... + 'libmetis/checkgraph', ... + 'libmetis/coarsen', ... + 'libmetis/compress', ... + 'libmetis/contig', ... + 'libmetis/debug', ... + 'libmetis/fm', ... + 'libmetis/fortran', ... + 'libmetis/frename', ... + 'libmetis/gklib', ... + 'libmetis/graph', ... + 'libmetis/initpart', ... + 'libmetis/kmetis', ... + 'libmetis/kwayfm', ... + 'libmetis/kwayrefine', ... + 'libmetis/mcutil', ... + 'libmetis/mesh', ... + 'libmetis/meshpart', ... + 'libmetis/minconn', ... + 'libmetis/mincover', ... + 'libmetis/mmd', ... + 'libmetis/ometis', ... + 'libmetis/options', ... + 'libmetis/parmetis', ... + 'libmetis/pmetis', ... + 'libmetis/refine', ... + 'libmetis/separator', ... + 'libmetis/sfm', ... + 'libmetis/srefine', ... + 'libmetis/stat', ... + 'libmetis/timing', ... + 'libmetis/util', ... + 'libmetis/wspace', ... + } ; for i = 1:length (metis_src) metis_src {i} = [metis_path '/' metis_src{i}] ; @@ -311,23 +301,36 @@ mx = sprintf ('mex -O%s%s ', incdir, flags) ; % no optimization: %% mx = sprintf ('mex -g %s%s%s ', incdir, flags) ; -fprintf ('compile options:\n%s\n', mx) ; %------------------------------------------------------------------------------- % CHOLMOD, CAMD, C*OLAMD, METIS, SuiteSparse_config, and rand48 for Windows %------------------------------------------------------------------------------- for k = 1:length(other_source) - fs = other_source {k} ; - slash = strfind (fs, '/') ; - slash = slash (end) + 1 ; - o = fs (slash:end) ; - kk = cmd (sprintf ('%s -DDLONG -c %s.c', mx, fs), kk, details) ; + ff = other_source {k} ; + + if (isequal (ff, [metis_path '/GKlib/util'])) + % special case, since a file with the same name also exists in libmetis + cpfile ([ff '.c'], 'GKlib_util.c') ; + ff = 'GKlib_util' ; + o = 'GKlib_util' ; + elseif (isequal (ff, [metis_path '/GKlib/graph'])) + % special case, since a file with the same name also exist in libmetis + cpfile ([ff '.c'], 'GKlib_graph.c') ; + ff = 'GKlib_graph' ; + o = 'GKlib_graph' ; + else + slash = strfind (ff, '/') ; + slash = slash (end) + 1 ; + o = ff (slash:end) ; + end + + kk = cmd (sprintf ('%s -DDLONG -c %s.c', mx, ff), kk, details) ; M {end+1} = [o '.' obj] ; end %------------------------------------------------------------------------------- -% Create the umfpack2 and amd2 mexFunctions for MATLAB (int versions only) +% Create the umfpack and amd2 mexFunctions for MATLAB (int versions only) %------------------------------------------------------------------------------- for k = 1:length(umfint) @@ -409,10 +412,10 @@ end %---------------------------------------- -% compile the umfpack2 mexFunction +% compile the umfpack mexFunction %---------------------------------------- -C = sprintf ('%s -output umfpack2 umfpackmex.c', mx) ; +C = sprintf ('%s -output umfpack umfpackmex.c', mx) ; for i = 1:length (M) C = [C ' ' (M {i})] ; %#ok end @@ -427,6 +430,13 @@ rmfile (M {i}) ; end +%---------------------------------------- +% delete the renamed METIS files +%---------------------------------------- + +rmfile ('GKlib_util.c') ; +rmfile ('GKlib_graph.c') ; + %---------------------------------------- % compile the luflop mexFunction %---------------------------------------- diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_report.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_report.m index c69c58aed..98fc32863 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_report.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_report.m @@ -4,8 +4,8 @@ function umfpack_report (Control, Info) % Example: % umfpack_report (Control, Info) ; % -% Prints the current Control settings for umfpack2, and the statistical -% information returned by umfpack2 in the Info array. If Control is +% Prints the current Control settings for umfpack, and the statistical +% information returned by umfpack in the Info array. If Control is % an empty matrix, then the default control settings are printed. % % Control and Info are structs. @@ -17,7 +17,7 @@ function umfpack_report (Control, Info) % umfpack_report (Control) ; print the control parameters only. % umfpack_report ; print the default control parameters % -% See also umfpack, umfpack2, umfpack_make, umfpack_details, +% See also umfpack, umfpack_make, umfpack_details, % umfpack_demo, and umfpack_simple. % Copyright 1995-2007 by Timothy A. Davis. @@ -28,7 +28,7 @@ function umfpack_report (Control, Info) % The contents of Control and Info are defined in umfpack.h if (nargin < 1 || isempty (Control)) - Control = umfpack2 ; + Control = umfpack ; end fprintf ('\nUMFPACK Control:\n') ; disp (Control) ; diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_simple.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_simple.m index 4e3e281fc..04f94b853 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_simple.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_simple.m @@ -14,7 +14,7 @@ % License as published by the Free Software Foundation; either % version 2 of the License, or (at your option) any later version. % -% See also: umfpack, umfpack2, umfpack_details +% See also: umfpack, umfpack_details help umfpack_simple @@ -35,9 +35,9 @@ fprintf ('b = \n') ; disp (b) ; fprintf ('Solution to Ax=b via UMFPACK:\n') ; -fprintf ('x1 = umfpack2 (A, ''\\'', b)\n') ; +fprintf ('x1 = umfpack (A, ''\\'', b)\n') ; -x1 = umfpack2 (A, '\', b) ; +x1 = umfpack (A, '\', b) ; fprintf ('x1 = \n') ; disp (x1) ; fprintf ('Solution to Ax=b via MATLAB:\n') ; diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_simple.m.out b/SuiteSparse/UMFPACK/MATLAB/umfpack_simple.m.out index 61ec207b0..26a659e7b 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_simple.m.out +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_simple.m.out @@ -30,7 +30,7 @@ b = 19 Solution to Ax=b via UMFPACK: -x1 = umfpack2 (A, '\', b) +x1 = umfpack (A, '\', b) x1 = 1.0000 2.0000 diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_solve.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_solve.m index fca1702ad..37d685099 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_solve.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_solve.m @@ -8,7 +8,7 @@ % Computes x = A\b, or b/A, where A is square. Uses UMFPACK if A is sparse. % The Control argument is optional. % -% See also umfpack, umfpack2, umfpack_make, umfpack_details, umfpack_report, +% See also umfpack, umfpack_make, umfpack_details, umfpack_report, % and umfpack_simple. % Copyright 1995-2007 by Timothy A. Davis. @@ -42,7 +42,7 @@ if (nargin < 4) % get default controls - Control = umfpack2 ; + Control = umfpack ; end %------------------------------------------------------------------------------- @@ -60,12 +60,12 @@ elseif (n1 == 1 & ~issparse (b)) %#ok % the UMFPACK '\' requires b to be a dense column vector - [x info] = umfpack2 (A, '\', b, Control) ; + [x info] = umfpack (A, '\', b, Control) ; else % factorize with UMFPACK and do the forward/back solves in MATLAB - [L, U, P, Q, R, info] = umfpack2 (A, Control) ; + [L, U, P, Q, R, info] = umfpack (A, Control) ; x = Q * (U \ (L \ (P * (R \ b)))) ; end @@ -81,17 +81,17 @@ elseif (m1 == 1 & ~issparse (b)) %#ok % the UMFPACK '\' requires b to be a dense column vector - [x info] = umfpack2 (b, '/', A, Control) ; + [x info] = umfpack (b, '/', A, Control) ; else % factorize with UMFPACK and do the forward/back solves in MATLAB % this mimics the behavior of x = b/A, except for the row scaling - [L, U, P, Q, R, info] = umfpack2 (A.', Control) ; + [L, U, P, Q, R, info] = umfpack (A.', Control) ; x = (Q * (U \ (L \ (P * (R \ (b.')))))).' ; % an alternative method: - % [L, U, P, Q, r] = umfpack2 (A, Control) ; + % [L, U, P, Q, r] = umfpack (A, Control) ; % x = (R \ (P' * (L.' \ (U.' \ (Q' * b.'))))).' ; end diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_test.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_test.m index fc2bfe04e..c62a9686d 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_test.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_test.m @@ -1,10 +1,10 @@ function umfpack_test (nmat) -%UMFPACK_TEST for testing umfpack2 (requires UFget) +%UMFPACK_TEST for testing umfpack (requires UFget) % % Example: % umfpack_test % umfpack_test (100) % runs the first 100 matrices -% See also umfpack2 +% See also umfpack % Copyright 1995-2007 by Timothy A. Davis. @@ -22,7 +22,7 @@ function umfpack_test (nmat) nmat = max (nmat, 1) ; f = f (1:nmat) ; -Control = umfpack2 ; +Control = umfpack ; Control.prl = 0 ; clf @@ -50,7 +50,7 @@ function umfpack_test (nmat) % symbolic factorization %----------------------------------------------------------------------- - [P1, Q1, Fr, Ch, Info] = umfpack2 (A, 'symbolic') ; + [P1, Q1, Fr, Ch, Info] = umfpack (A, 'symbolic') ; subplot (2,2,1) spy (A) title ('A') @@ -63,7 +63,7 @@ function umfpack_test (nmat) % P(R\A)Q = LU %----------------------------------------------------------------------- - [L,U,P,Q,R,Info] = umfpack2 (A, struct ('details',1)) ; + [L,U,P,Q,R,Info] = umfpack (A, struct ('details',1)) ; err = lu_normest (P*(R\A)*Q, L, U) ; fprintf ('norm est PR\\AQ-LU: %g relative: %g\n', ... err, err / norm (A,1)) ; @@ -96,7 +96,7 @@ function umfpack_test (nmat) % PAQ = LU %----------------------------------------------------------------------- - [L,U,P,Q] = umfpack2 (A) ; + [L,U,P,Q] = umfpack (A) ; err = lu_normest (P*A*Q, L, U) ; fprintf ('norm est PAQ-LU: %g relative: %g\n', ... err, err / norm (A,1)) ; @@ -112,7 +112,7 @@ function umfpack_test (nmat) % factor the transpose Control.irstep = 2 ; - [x, info] = umfpack2 (A', '\', c, Control) ; + [x, info] = umfpack (A', '\', c, Control) ; lunz0 = info.nnz_in_L_plus_U ; r = norm (A'*x-c) ; @@ -121,7 +121,7 @@ function umfpack_test (nmat) % factor the original matrix and solve xA=b for ir = 0:4 Control.irstep = ir ; - [x, info] = umfpack2 (b, '/', A, Control) ; + [x, info] = umfpack (b, '/', A, Control) ; r = norm (b-x*A) ; if (ir == 0) lunz1 = info.nnz_in_L_plus_U ; @@ -132,7 +132,7 @@ function umfpack_test (nmat) % factor the original matrix and solve Ax=b for ir = 0:4 Control.irstep = ir ; - [x, info] = umfpack2 (A, '\', c, Control) ; + [x, info] = umfpack (A, '\', c, Control) ; r = norm (A*x-c) ; fprintf ('%d: %8.2e %d\n', ir, r, info.iterative_refinement_steps) ; end @@ -146,8 +146,8 @@ function umfpack_test (nmat) %----------------------------------------------------------------------- det1 = det (A) ; - det2 = umfpack2 (A, 'det') ; - [det3 dexp3] = umfpack2 (A, 'det') ; + det2 = umfpack (A, 'det') ; + [det3 dexp3] = umfpack (A, 'det') ; err = abs (det1-det2) ; err3 = abs (det1 - (det3 * 10^dexp3)) ; denom = det1 ; @@ -158,9 +158,9 @@ function umfpack_test (nmat) err3 = err3 / denom ; fprintf ('det: %20.12e + (%20.12e)i MATLAB\n', ... real(det1), imag(det1)) ; - fprintf ('det: %20.12e + (%20.12e)i umfpack2\n', ... + fprintf ('det: %20.12e + (%20.12e)i umfpack\n', ... real(det2), imag(det2)) ; - fprintf ('det: (%20.12e + (%20.12e)i) * 10^(%g) umfpack2\n', ... + fprintf ('det: (%20.12e + (%20.12e)i) * 10^(%g) umfpack\n', ... real(det3), imag(det3), dexp3) ; fprintf ('diff %g %g\n', err, err3) ; diff --git a/SuiteSparse/UMFPACK/MATLAB/umfpack_test2.m b/SuiteSparse/UMFPACK/MATLAB/umfpack_test2.m index e75d0c1e4..cdbdc6c7e 100644 --- a/SuiteSparse/UMFPACK/MATLAB/umfpack_test2.m +++ b/SuiteSparse/UMFPACK/MATLAB/umfpack_test2.m @@ -1,6 +1,6 @@ function umfpack_test2 %UMFPACK_TEST2 try all UMFPACK strategies and orderings. -% Requires UFget, CHOLMOD, CAMD, CCOLAMD, COLAMD, metis-4.0. +% Requires UFget, CHOLMOD, CAMD, CCOLAMD, COLAMD, METIS. Prob = UFget (45) ; A = Prob.A ; @@ -31,7 +31,7 @@ try tic ; - [L,U,P,Q,R] = umfpack2 (A, opts) ; + [L,U,P,Q,R] = umfpack (A, opts) ; t = toc ; lunz = nnz (L+U) ; catch diff --git a/SuiteSparse/UMFPACK/Makefile b/SuiteSparse/UMFPACK/Makefile index 606654eb9..e021d688d 100644 --- a/SuiteSparse/UMFPACK/Makefile +++ b/SuiteSparse/UMFPACK/Makefile @@ -2,9 +2,8 @@ # UMFPACK Makefile #------------------------------------------------------------------------------- -VERSION = 5.7.1 - -# UMFPACK requires the AMD package to be in ../AMD +SUITESPARSE ?= $(realpath $(CURDIR)/..) +export SUITESPARSE default: all @@ -36,6 +35,7 @@ clean: ( cd Lib ; $(MAKE) clean ) ( cd Demo ; $(MAKE) clean ) ( cd Doc ; $(MAKE) clean ) + ( cd MATLAB ; $(MAKE) clean ) ( cd MATLAB ; $(RM) $(CLEAN) rename.h ) # clean, and then remove compiled programs and library archives @@ -44,7 +44,7 @@ purge: ( cd Demo ; $(MAKE) purge ) ( cd Doc ; $(MAKE) purge ) ( cd Tcov ; $(MAKE) purge ) - ( cd MATLAB ; $(RM) $(CLEAN) rename.h *.mex* ) + ( cd MATLAB ; $(MAKE) purge ) # create PDF documents for the original distribution docs: @@ -63,18 +63,13 @@ lib: library # statement coverage (requires Linux; takes a lot of time and disk space) cov: purge - ( cd Tcov ; ./DO.all ) + ( cd Tcov ; $(MAKE) ) # install UMFPACK install: - $(CP) Lib/libumfpack.a $(INSTALL_LIB)/libumfpack.$(VERSION).a - ( cd $(INSTALL_LIB) ; ln -sf libumfpack.$(VERSION).a libumfpack.a ) - $(CP) Include/*.h $(INSTALL_INCLUDE) - chmod 644 $(INSTALL_LIB)/libumfpack*.a - chmod 644 $(INSTALL_INCLUDE)/umfpack*.h + ( cd Lib ; $(MAKE) install ) # uninstall UMFPACK uninstall: - $(RM) $(INSTALL_LIB)/libumfpack*.a - $(RM) $(INSTALL_INCLUDE)/umfpack*.h + ( cd Lib ; $(MAKE) uninstall ) diff --git a/SuiteSparse/UMFPACK/README.txt b/SuiteSparse/UMFPACK/README.txt index 4cdd79e84..d0adc7144 100644 --- a/SuiteSparse/UMFPACK/README.txt +++ b/SuiteSparse/UMFPACK/README.txt @@ -1,4 +1,4 @@ -UMFPACK, Copyright (c) 1995-2013 by Timothy A. Davis, +UMFPACK, Copyright (c) 1995-2016 by Timothy A. Davis, http://www.suitesparse.com UMFPACK : a set of routines solving sparse linear systems via LU @@ -11,32 +11,36 @@ UMFPACK : a set of routines solving sparse linear systems via LU 2.0 or later. Unless you compile with -DNCHOLMOD, addtional packages are required: - CHOLMOD, CAMD, CCOLAMD, COLAMD, and metis-4.0. + CHOLMOD, CAMD, CCOLAMD, COLAMD, and metis-5.1.0. The AMD, SuiteSparse_config, and UMFPACK directories must all reside in the same parent directory. If the -DNCHOLMOD is not used, the CHOLMOD, CAMD, -CCOLAMD, COLAMD, and metis-4.0 also also exist in the same parent. +CCOLAMD, COLAMD, and metis-5.1.0 also also exist in the same parent. Quick start (Unix, or Windows with Cygwin): To compile, test, and install both UMFPACK and AMD, the UMFPACK and AMD - directories must be in the same parent directory. To configure, edit the - SuiteSparse_config/SuiteSparse_config.mk file (otherwise, you may get - warnings that the BLAS (dgemm, etc) are not found). You may use - UMFPACK_CONFIG = -DNBLAS in the SuiteSparse_config/SuiteSparse_config.mk - file, to avoid using the BLAS, but UMFPACK will be slow. Next, cd to this - directory (UMFPACK) and type "make". To compile and run a FORTRAN demo - program for Harwell/Boeing matrices, type "make hb". To compile a FORTRAN - main program that calls the 32-bit C-callable UMFPACK library, type "make - fortran". When done, type "make clean" to remove unused *.o files (keeps - the compiled libraries and demo programs). See the User Guide - (Doc/UserGuide.pdf), or ../SuiteSparse_config/SuiteSparse_config.mk for - more details (including options for compiling in 64-bit mode). + directories must be in the same parent directory. To configure, you may + need to edit the SuiteSparse_config/SuiteSparse_config.mk file, but the + defaults should work on most systems. Next, type 'make' in this + directory. + + To compile and run a FORTRAN demo program for Harwell/Boeing matrices, type + "make hb". To compile a FORTRAN main program that calls the 32-bit + C-callable UMFPACK library, type "make fortran". When done, type "make + clean" to remove unused *.o files (keeps the compiled libraries and demo + programs). See the User Guide (Doc/UserGuide.pdf), or + ../SuiteSparse_config/SuiteSparse_config.mk for more details. + + To install into /usr/local/lib and /usr/local/include, use + "make install". To remove, do "make uninstall" + For installing in other locations, see SuiteSparse/README.txt. Quick start (for MATLAB users): To compile, test, and install the UMFPACK mexFunction, cd to the - UMFPACK/MATLAB directory and type umfpack_make at the MATLAB prompt. + UMFPACK/MATLAB directory and type umfpack_install at the MATLAB prompt. + Then save your path for future sessions. -------------------------------------------------------------------------------- diff --git a/SuiteSparse/UMFPACK/Source/umf_cholmod.c b/SuiteSparse/UMFPACK/Source/umf_cholmod.c index 96481b870..7c139af8b 100644 --- a/SuiteSparse/UMFPACK/Source/umf_cholmod.c +++ b/SuiteSparse/UMFPACK/Source/umf_cholmod.c @@ -226,7 +226,7 @@ int UMF_cholmod CHOLMOD_finish (&cm) ; return (TRUE) ; #else - /* CHOLMOD and its supporting packages (CAMD, CCOLAMD, COLAMD, metis-4.0) + /* CHOLMOD and its supporting packages (CAMD, CCOLAMD, COLAMD, METIS) not installed */ return (FALSE) ; #endif diff --git a/SuiteSparse/UMFPACK/Tcov/DO b/SuiteSparse/UMFPACK/Tcov/DO old mode 100644 new mode 100755 index 7abc628a7..a3a8b9f68 --- a/SuiteSparse/UMFPACK/Tcov/DO +++ b/SuiteSparse/UMFPACK/Tcov/DO @@ -1,68 +1,66 @@ #!/bin/csh echo '################################################################################' -echo 'Tcov test:' $1 $2 $3 +echo 'Tcov test:' $1 $2 $3 $4 echo '################################################################################' #------------------------------------------------------------------------------- -# get a clean directory -# /bin/mv Out/$1_$2 `mktemp -d Trash/XXXXXX` +mkdir -p $1/UMFPACK_TCOV_TMP -# delete the directory -/bin/rm -rf Out/$1_$2 +# delete the target directory +/bin/rm -rf $1/UMFPACK_TCOV_TMP/$2_$3 -mkdir Out/$1_$2 +# copy in the pre-compiled libraries +mkdir $1/UMFPACK_TCOV_TMP/$2_$3 +mkdir $1/UMFPACK_TCOV_TMP/$2_$3/doc +mkdir $1/UMFPACK_TCOV_TMP/$2_$3/bin +/bin/cp -pr ../../lib $1/UMFPACK_TCOV_TMP/$2_$3/lib +/bin/cp -pr ../../include $1/UMFPACK_TCOV_TMP/$2_$3/include -# put in UMFPACK (excluding Tcov and MATLAB directories) and AMD -mkdir Out/$1_$2/UMFPACK -mkdir Out/$1_$2/UMFPACK/Doc -/bin/cp -pr ../Source Out/$1_$2/UMFPACK -## /bin/cp -pr ../Lib Out/$1_$2/UMFPACK -( cd Out/$1_$2/UMFPACK ; ln -s Source Lib ) -/bin/cp -pr ../Include Out/$1_$2/UMFPACK -/bin/cp -pr ../Demo Out/$1_$2/UMFPACK -/bin/cp -pr Top_Makefile Out/$1_$2/UMFPACK/Makefile -/bin/cp -pr ../Lib/GNUmakefile Out/$1_$2/UMFPACK/Source/Makefile -/bin/cp -pr Demo_Makefile Out/$1_$2/UMFPACK/Demo/Makefile -/bin/cp -pr ../Doc/License Out/$1_$2/UMFPACK/Doc +# put in UMFPACK (excluding Tcov and MATLAB directories) +mkdir -p $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK/Doc +/bin/cp -pr ../Source $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK +/bin/cp -pr ../Include $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK +/bin/cp -pr ../Demo $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK +/bin/cp -pr ../Doc $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK +/bin/cp -pr ../Makefile $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK +/bin/cp -pr ../README.txt $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK +( cd $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK ; ln -s Source Lib ) +/bin/cp -pr ../Lib/Makefile $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK/Source/Makefile # put in AMD -/bin/cp -pr ../../AMD Out/$1_$2 -/bin/rm -rf Out/$1_$2/AMD/Lib -( cd Out/$1_$2/AMD ; ln -s Source Lib ) -/bin/cp -pr Top_Makefile Out/$1_$2/AMD/Makefile -/bin/cp -pr ../../AMD/Lib/GNUmakefile Out/$1_$2/AMD/Source/Makefile -/bin/cp -pr AMD_Demo_Makefile Out/$1_$2/AMD/Demo/Makefile +/bin/cp -pr ../../AMD $1/UMFPACK_TCOV_TMP/$2_$3 +/bin/rm -rf $1/UMFPACK_TCOV_TMP/$2_$3/AMD/Lib +( cd $1/UMFPACK_TCOV_TMP/$2_$3/AMD ; ln -s Source Lib ) +/bin/cp -pr ../../AMD/Lib/Makefile $1/UMFPACK_TCOV_TMP/$2_$3/AMD/Source/Makefile -# links to CHOLMOD, CAMD, CCOLAMD, and metis -ln -s ../../../../CHOLMOD Out/$1_$2/CHOLMOD -ln -s ../../../../CAMD Out/$1_$2/CAMD -ln -s ../../../../CCOLAMD Out/$1_$2/CCOLAMD -ln -s ../../../../COLAMD Out/$1_$2/COLAMD -ln -s ../../../../metis-4.0 Out/$1_$2/metis-4.0 +# put in links to include files +mkdir $1/UMFPACK_TCOV_TMP/$2_$3/CHOLMOD +( cd $1/UMFPACK_TCOV_TMP/$2_$3/CHOLMOD ; ln -s ../include Include ) -/bin/cp debug.* Out/$1_$2 +# put in the debug settings +/bin/cp debug.* $1/UMFPACK_TCOV_TMP/$2_$3 -# put in the makefile -/bin/cp GNUmakefile.$2 Out/$1_$2/GNUmakefile +# put in the SuiteSparse Makefile +/bin/cp Makefile.$3 $1/UMFPACK_TCOV_TMP/$2_$3/Makefile -# put in SuiteSparse_config -/bin/cp -pr ../../SuiteSparse_config Out/$1_$2 -/bin/rm -rf Out/$1_$2/SuiteSparse_config/xerbla -/bin/cp -f Make.$1 Out/$1_$2/SuiteSparse_config/SuiteSparse_config.mk +# put in SuiteSparse_config and the replacement SuiteSparse_config.mk file +/bin/cp -pr ../../SuiteSparse_config $1/UMFPACK_TCOV_TMP/$2_$3 +/bin/cp -f Make.$2 $1/UMFPACK_TCOV_TMP/$2_$3/SuiteSparse_config/SuiteSparse_config.mk +( cd $1/UMFPACK_TCOV_TMP/$2_$3/SuiteSparse_config ; make purge > $2_$3.out ) # put in the main program -/bin/cp ut.c Out/$1_$2 +/bin/cp ut.c $1/UMFPACK_TCOV_TMP/$2_$3 # put in the test matrices -/bin/cp -f badnum*.umf Out/$1_$2 -/bin/cp -f badsym*.umf Out/$1_$2 -/bin/cp -pr TestMat Out/$1_$2 +/bin/cp -f badnum*.umf $1/UMFPACK_TCOV_TMP/$2_$3 +/bin/cp -f badsym*.umf $1/UMFPACK_TCOV_TMP/$2_$3 +/bin/cp -pr TestMat $1/UMFPACK_TCOV_TMP/$2_$3 # put in the gcov files -/bin/cp -f ucov.* Out/$1_$2/UMFPACK/Source -/bin/cp -f acov.* Out/$1_$2/AMD/Source +/bin/cp -f ucov.* $1/UMFPACK_TCOV_TMP/$2_$3/UMFPACK/Source +/bin/cp -f acov.* $1/UMFPACK_TCOV_TMP/$2_$3/AMD/Source # compile and run -( cd Out/$1_$2 ; time make $3 > $1_$2.out ) +( cd $1/UMFPACK_TCOV_TMP/$2_$3 ; time make $4 >> $2_$3.out ) diff --git a/SuiteSparse/UMFPACK/Tcov/DO.all b/SuiteSparse/UMFPACK/Tcov/DO.all old mode 100644 new mode 100755 index 1949cb4f4..5a7ced1b9 --- a/SuiteSparse/UMFPACK/Tcov/DO.all +++ b/SuiteSparse/UMFPACK/Tcov/DO.all @@ -1,54 +1,57 @@ -# -# +# Test coverage for UMFPACK +# usage: DO.all tempdirectory # no BLAS, test for int overflow -./DO 1 di -./DO 1 dl -./DO 1 zi -./DO 1 zl +./DO $1 1 di all +./DO $1 1 dl all +./DO $1 1 zi all +./DO $1 1 zl all # BLAS, do not test for int overflow -./DO 2 di -./DO 2 dl -./DO 2 zi -./DO 2 zl +./DO $1 2 di all +./DO $1 2 dl all +./DO $1 2 zi all +./DO $1 2 zl all # no BLAS, test for int overflow, no reciprocal -./DO 5 di -./DO 5 dl -./DO 5 zi -./DO 5 zl +./DO $1 5 di all +./DO $1 5 dl all +./DO $1 5 zi all +./DO $1 5 zl all # BLAS, do not test for int overflow. No timers -./DO 6 di -./DO 6 dl -./DO 6 zi -./DO 6 zl +./DO $1 6 di all +./DO $1 6 dl all +./DO $1 6 zi all +./DO $1 6 zl all # no BLAS, test for int overflow, no divide-by-zero -./DO 7 di -./DO 7 dl -./DO 7 zi -./DO 7 zl +./DO $1 7 di all +./DO $1 7 dl all +./DO $1 7 zi all +./DO $1 7 zl all # BLAS, do not test for int overflow. No divide-by-zero -./DO 8 di -./DO 8 dl -./DO 8 zi -./DO 8 zl - -# no BLAS, test for int overflow. Optimizations turned on -./DO 3 di run -./DO 3 dl run -./DO 3 zi run -./DO 3 zl run - -# BLAS, do not test for int overflow. Optimizations turned on -./DO 4 di run -./DO 4 dl run -./DO 4 zi run -./DO 4 zl run +./DO $1 8 di all +./DO $1 8 dl all +./DO $1 8 zi all +./DO $1 8 zl all + +# no BLAS, test for int overflow. Optimizations turned on. +# These tests do not use statement coverage +./DO $1 3 di run +./DO $1 3 dl run +./DO $1 3 zi run +./DO $1 3 zl run + +# BLAS, do not test for int overflow. Optimizations turned on. +# These tests do not use statement coverage +./DO $1 4 di run +./DO $1 4 dl run +./DO $1 4 zi run +./DO $1 4 zl run # coverage summary. Any line with "24" is missed in all 24 tests. -./covall > cover.out +./covall $1 > cover.out 2>covall_err.out cat cover.out + diff --git a/SuiteSparse/UMFPACK/Tcov/Make.1 b/SuiteSparse/UMFPACK/Tcov/Make.1 index 6d3247421..d03f67636 100644 --- a/SuiteSparse/UMFPACK/Tcov/Make.1 +++ b/SuiteSparse/UMFPACK/Tcov/Make.1 @@ -2,15 +2,38 @@ # no BLAS, test for integer overflow. #=============================================================================== +INSTALL ?= /garbage +INSTALL_LIB = $(INSTALL)/lib +INSTALL_INCLUDE = $(INSTALL)/include +INSTALL_DOC = $(INSTALL)/doc + CC = gcc -CF = -O0 -g -ftest-coverage -fprofile-arcs -O0 +CF = -O0 -g --coverage -fPIC -fopenmp +LDFLAGS = --coverage UMFPACK_CONFIG = -DNBLAS -DTEST_FOR_INTEGER_OVERFLOW -DTESTING -LIB = -llapack -lblas -lgfortran -lgfortranbegin -lm -lrt +LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ + -Wl,-rpath=lib $(LIB2) -lgcov + +ifneq ($(CUDA),no) + CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") +endif +ifneq ($(wildcard $(CUDA_PATH)),) + # CHOLMOD was compiled to use CUDA + LDLIBS += $(CUDA_PATH)/lib64/libcudart.so $(CUDA_PATH)/lib64/libcublas.so +endif RANLIB = ranlib MV = mv -f +CP = cp -f ARCHIVE = ar rv +AR_TARGET = $(LIBRARY).a +SO_PLAIN = $(LIBRARY).so +SO_MAIN = $(LIBRARY).so.$(SO_VERSION) +SO_TARGET = $(LIBRARY).so.$(VERSION) +SO_OPTS = -shared -Wl,-soname -Wl,$(SO_MAIN) +SO_INSTALL_NAME = echo + #=============================================================================== CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.c.tcov *.c.gcov gmon.out diff --git a/SuiteSparse/UMFPACK/Tcov/Make.2 b/SuiteSparse/UMFPACK/Tcov/Make.2 index 608df87c0..cb8a21a6d 100644 --- a/SuiteSparse/UMFPACK/Tcov/Make.2 +++ b/SuiteSparse/UMFPACK/Tcov/Make.2 @@ -1,16 +1,39 @@ #=============================================================================== -# BLAS, do not test for integer overflow. +# BLAS, no test for integer overflow. #=============================================================================== +INSTALL ?= /garbage +INSTALL_LIB = $(INSTALL)/lib +INSTALL_INCLUDE = $(INSTALL)/include +INSTALL_DOC = $(INSTALL)/doc + CC = gcc -CF = -O0 -g -ftest-coverage -fprofile-arcs -O0 +CF = -O0 -g --coverage -fPIC -fopenmp +LDFLAGS = --coverage UMFPACK_CONFIG = -DTESTING -LIB = -llapack -lblas -lgfortran -lgfortranbegin -lm -lrt +LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ + -Wl,-rpath=lib -lgcov + +ifneq ($(CUDA),no) + CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") +endif +ifneq ($(wildcard $(CUDA_PATH)),) + # CHOLMOD was compiled to use CUDA + LDLIBS += $(CUDA_PATH)/lib64/libcudart.so $(CUDA_PATH)/lib64/libcublas.so +endif RANLIB = ranlib MV = mv -f +CP = cp -f ARCHIVE = ar rv +AR_TARGET = $(LIBRARY).a +SO_PLAIN = $(LIBRARY).so +SO_MAIN = $(LIBRARY).so.$(SO_VERSION) +SO_TARGET = $(LIBRARY).so.$(VERSION) +SO_OPTS = -shared -Wl,-soname -Wl,$(SO_MAIN) +SO_INSTALL_NAME = echo + #=============================================================================== CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.c.tcov *.c.gcov gmon.out diff --git a/SuiteSparse/UMFPACK/Tcov/Make.3 b/SuiteSparse/UMFPACK/Tcov/Make.3 index b0b0d60e6..4888f4149 100644 --- a/SuiteSparse/UMFPACK/Tcov/Make.3 +++ b/SuiteSparse/UMFPACK/Tcov/Make.3 @@ -2,15 +2,37 @@ # no BLAS, test for integer overflow. #=============================================================================== +INSTALL ?= /garbage +INSTALL_LIB = $(INSTALL)/lib +INSTALL_INCLUDE = $(INSTALL)/include +INSTALL_DOC = $(INSTALL)/doc + CC = gcc -CF = -O3 -fPIC +CF = -O3 -fPIC -fopenmp UMFPACK_CONFIG = -DNBLAS -DTEST_FOR_INTEGER_OVERFLOW -DTESTING -LIB = -llapack -lblas -lgfortran -lgfortranbegin -lm -lrt +LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ + -Wl,-rpath=lib + +ifneq ($(CUDA),no) + CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") +endif +ifneq ($(wildcard $(CUDA_PATH)),) + # CHOLMOD was compiled to use CUDA + LDLIBS += $(CUDA_PATH)/lib64/libcudart.so $(CUDA_PATH)/lib64/libcublas.so +endif RANLIB = ranlib MV = mv -f +CP = cp -f ARCHIVE = ar rv +AR_TARGET = $(LIBRARY).a +SO_PLAIN = $(LIBRARY).so +SO_MAIN = $(LIBRARY).so.$(SO_VERSION) +SO_TARGET = $(LIBRARY).so.$(VERSION) +SO_OPTS = -shared -Wl,-soname -Wl,$(SO_MAIN) +SO_INSTALL_NAME = echo + #=============================================================================== CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.c.tcov *.c.gcov gmon.out diff --git a/SuiteSparse/UMFPACK/Tcov/Make.4 b/SuiteSparse/UMFPACK/Tcov/Make.4 index 83bdc02ab..b97ffd792 100644 --- a/SuiteSparse/UMFPACK/Tcov/Make.4 +++ b/SuiteSparse/UMFPACK/Tcov/Make.4 @@ -1,16 +1,38 @@ #=============================================================================== -# BLAS, do not test for integer overflow. +# BLAS, no test for integer overflow. #=============================================================================== +INSTALL ?= /garbage +INSTALL_LIB = $(INSTALL)/lib +INSTALL_INCLUDE = $(INSTALL)/include +INSTALL_DOC = $(INSTALL)/doc + CC = gcc -CF = -O3 -fPIC +CF = -O3 -fPIC -fopenmp UMFPACK_CONFIG = -DTESTING -LIB = -llapack -lblas -lgfortran -lgfortranbegin -lm -lrt +LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ + -Wl,-rpath=lib + +ifneq ($(CUDA),no) + CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") +endif +ifneq ($(wildcard $(CUDA_PATH)),) + # CHOLMOD was compiled to use CUDA + LDLIBS += $(CUDA_PATH)/lib64/libcudart.so $(CUDA_PATH)/lib64/libcublas.so +endif RANLIB = ranlib MV = mv -f +CP = cp -f ARCHIVE = ar rv +AR_TARGET = $(LIBRARY).a +SO_PLAIN = $(LIBRARY).so +SO_MAIN = $(LIBRARY).so.$(SO_VERSION) +SO_TARGET = $(LIBRARY).so.$(VERSION) +SO_OPTS = -shared -Wl,-soname -Wl,$(SO_MAIN) +SO_INSTALL_NAME = echo + #=============================================================================== CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.c.tcov *.c.gcov gmon.out diff --git a/SuiteSparse/UMFPACK/Tcov/Make.5 b/SuiteSparse/UMFPACK/Tcov/Make.5 index f9390e76c..1774a0b08 100644 --- a/SuiteSparse/UMFPACK/Tcov/Make.5 +++ b/SuiteSparse/UMFPACK/Tcov/Make.5 @@ -1,16 +1,39 @@ #=============================================================================== -# no BLAS, test for integer overflow, no reciprocal +# no BLAS, test for integer overflow. No reciprocal #=============================================================================== +INSTALL ?= /garbage +INSTALL_LIB = $(INSTALL)/lib +INSTALL_INCLUDE = $(INSTALL)/include +INSTALL_DOC = $(INSTALL)/doc + CC = gcc -CF = -O0 -g -ftest-coverage -fprofile-arcs -O0 +CF = -O0 -g --coverage -fPIC -fopenmp +LDFLAGS = --coverage UMFPACK_CONFIG = -DNBLAS -DTEST_FOR_INTEGER_OVERFLOW -DTESTING -DNRECIPROCAL -LIB = -llapack -lblas -lgfortran -lgfortranbegin -lm -lrt +LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ + -Wl,-rpath=lib -lgcov + +ifneq ($(CUDA),no) + CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") +endif +ifneq ($(wildcard $(CUDA_PATH)),) + # CHOLMOD was compiled to use CUDA + LDLIBS += $(CUDA_PATH)/lib64/libcudart.so $(CUDA_PATH)/lib64/libcublas.so +endif RANLIB = ranlib MV = mv -f +CP = cp -f ARCHIVE = ar rv +AR_TARGET = $(LIBRARY).a +SO_PLAIN = $(LIBRARY).so +SO_MAIN = $(LIBRARY).so.$(SO_VERSION) +SO_TARGET = $(LIBRARY).so.$(VERSION) +SO_OPTS = -shared -Wl,-soname -Wl,$(SO_MAIN) +SO_INSTALL_NAME = echo + #=============================================================================== CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.c.tcov *.c.gcov gmon.out diff --git a/SuiteSparse/UMFPACK/Tcov/Make.6 b/SuiteSparse/UMFPACK/Tcov/Make.6 index 0ed2faa3f..d73b3e5c5 100644 --- a/SuiteSparse/UMFPACK/Tcov/Make.6 +++ b/SuiteSparse/UMFPACK/Tcov/Make.6 @@ -1,16 +1,39 @@ #=============================================================================== -# BLAS, do not test for integer overflow. No timers +# BLAS, no test for integer overflow. No timers #=============================================================================== +INSTALL ?= /garbage +INSTALL_LIB = $(INSTALL)/lib +INSTALL_INCLUDE = $(INSTALL)/include +INSTALL_DOC = $(INSTALL)/doc + CC = gcc -CF = -O0 -g -ftest-coverage -fprofile-arcs -O0 +CF = -O0 -g --coverage -fPIC -fopenmp +LDFLAGS = --coverage UMFPACK_CONFIG = -DTESTING -DNTIMER -LIB = -llapack -lblas -lgfortran -lgfortranbegin -lm -lrt +LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ + -Wl,-rpath=lib -lgcov + +ifneq ($(CUDA),no) + CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") +endif +ifneq ($(wildcard $(CUDA_PATH)),) + # CHOLMOD was compiled to use CUDA + LDLIBS += $(CUDA_PATH)/lib64/libcudart.so $(CUDA_PATH)/lib64/libcublas.so +endif RANLIB = ranlib MV = mv -f +CP = cp -f ARCHIVE = ar rv +AR_TARGET = $(LIBRARY).a +SO_PLAIN = $(LIBRARY).so +SO_MAIN = $(LIBRARY).so.$(SO_VERSION) +SO_TARGET = $(LIBRARY).so.$(VERSION) +SO_OPTS = -shared -Wl,-soname -Wl,$(SO_MAIN) +SO_INSTALL_NAME = echo + #=============================================================================== CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.c.tcov *.c.gcov gmon.out diff --git a/SuiteSparse/UMFPACK/Tcov/Make.7 b/SuiteSparse/UMFPACK/Tcov/Make.7 index 642c88c11..2f7ad3386 100644 --- a/SuiteSparse/UMFPACK/Tcov/Make.7 +++ b/SuiteSparse/UMFPACK/Tcov/Make.7 @@ -1,16 +1,39 @@ #=============================================================================== -# no BLAS, test for integer overflow. No divide by zero +# no BLAS, test for integer overflow. No divide by zero. #=============================================================================== +INSTALL ?= /garbage +INSTALL_LIB = $(INSTALL)/lib +INSTALL_INCLUDE = $(INSTALL)/include +INSTALL_DOC = $(INSTALL)/doc + CC = gcc -CF = -O0 -g -ftest-coverage -fprofile-arcs -O0 +CF = -O0 -g --coverage -fPIC -fopenmp +LDFLAGS = --coverage UMFPACK_CONFIG = -DNBLAS -DTEST_FOR_INTEGER_OVERFLOW -DTESTING -DNO_DIVIDE_BY_ZERO -LIB = -llapack -lblas -lgfortran -lgfortranbegin -lm -lrt +LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ + -Wl,-rpath=lib -lgcov + +ifneq ($(CUDA),no) + CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") +endif +ifneq ($(wildcard $(CUDA_PATH)),) + # CHOLMOD was compiled to use CUDA + LDLIBS += $(CUDA_PATH)/lib64/libcudart.so $(CUDA_PATH)/lib64/libcublas.so +endif RANLIB = ranlib MV = mv -f +CP = cp -f ARCHIVE = ar rv +AR_TARGET = $(LIBRARY).a +SO_PLAIN = $(LIBRARY).so +SO_MAIN = $(LIBRARY).so.$(SO_VERSION) +SO_TARGET = $(LIBRARY).so.$(VERSION) +SO_OPTS = -shared -Wl,-soname -Wl,$(SO_MAIN) +SO_INSTALL_NAME = echo + #=============================================================================== CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.c.tcov *.c.gcov gmon.out diff --git a/SuiteSparse/UMFPACK/Tcov/Make.8 b/SuiteSparse/UMFPACK/Tcov/Make.8 index 71d78b8ce..80e29fc53 100644 --- a/SuiteSparse/UMFPACK/Tcov/Make.8 +++ b/SuiteSparse/UMFPACK/Tcov/Make.8 @@ -1,16 +1,39 @@ #=============================================================================== -# BLAS, do not test for integer overflow. No divide by zero. +# BLAS, no test for integer overflow. #=============================================================================== +INSTALL ?= /garbage +INSTALL_LIB = $(INSTALL)/lib +INSTALL_INCLUDE = $(INSTALL)/include +INSTALL_DOC = $(INSTALL)/doc + CC = gcc -CF = -O0 -g -ftest-coverage -fprofile-arcs -O0 +CF = -O0 -g --coverage -fPIC -fopenmp +LDFLAGS = --coverage UMFPACK_CONFIG = -DTESTING -DNO_DIVIDE_BY_ZERO -LIB = -llapack -lblas -lgfortran -lgfortranbegin -lm -lrt +LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ + -Wl,-rpath=lib -lgcov + +ifneq ($(CUDA),no) + CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") +endif +ifneq ($(wildcard $(CUDA_PATH)),) + # CHOLMOD was compiled to use CUDA + LDLIBS += $(CUDA_PATH)/lib64/libcudart.so $(CUDA_PATH)/lib64/libcublas.so +endif RANLIB = ranlib MV = mv -f +CP = cp -f ARCHIVE = ar rv +AR_TARGET = $(LIBRARY).a +SO_PLAIN = $(LIBRARY).so +SO_MAIN = $(LIBRARY).so.$(SO_VERSION) +SO_TARGET = $(LIBRARY).so.$(VERSION) +SO_OPTS = -shared -Wl,-soname -Wl,$(SO_MAIN) +SO_INSTALL_NAME = echo + #=============================================================================== CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.c.tcov *.c.gcov gmon.out diff --git a/SuiteSparse/UMFPACK/Tcov/Makefile b/SuiteSparse/UMFPACK/Tcov/Makefile index 142c8c70b..b2bf9886f 100644 --- a/SuiteSparse/UMFPACK/Tcov/Makefile +++ b/SuiteSparse/UMFPACK/Tcov/Makefile @@ -1,14 +1,24 @@ +default: linux + include ../../SuiteSparse_config/SuiteSparse_config.mk linux: distclean - ./DO.all + # ( cd ../.. && $(MAKE) purge ) + ( cd ../.. && $(MAKE) metis ) + ( cd ../../SuiteSparse_config && $(MAKE) TCOV=yes ) + ( cd ../../AMD && $(MAKE) TCOV=yes ) + ( cd ../../CAMD && $(MAKE) TCOV=yes ) + ( cd ../../COLAMD && $(MAKE) TCOV=yes ) + ( cd ../../CCOLAMD && $(MAKE) TCOV=yes ) + ( cd ../../CHOLMOD && $(MAKE) TCOV=yes ) + ./DO.all $(TCOV_TMP) clean: - - $(RM) -r Out/* + - $(RM) -r $(TCOV_TMP)/UMFPACK_TCOV_TMP -distclean: - - $(RM) -r Out/* cover.out +distclean: clean + - $(RM) -r cover.out covall_err.out purge: distclean diff --git a/SuiteSparse/UMFPACK/Tcov/README.txt b/SuiteSparse/UMFPACK/Tcov/README.txt index 4cff69c16..216b1acda 100644 --- a/SuiteSparse/UMFPACK/Tcov/README.txt +++ b/SuiteSparse/UMFPACK/Tcov/README.txt @@ -1,24 +1,27 @@ This is the UMFPACK Tcov directory. It runs a large number of tests on -UMFPACK and checks the statement coverage (using gcc and gcov on Linux -or the Mac, or tcov on Solaris). +UMFPACK and checks the statement coverage (using gcc and gcov on Linux). Timothy A. Davis, http://www.suitesparse.com -METIS is required for this test. +To run the tests, type "make" in this directory. The METIS, CAMD, CCOLAMD, +COLAMD, and CHOLMOD libraries will be compiled with TCOV=yes (using gcc) +and placed in ../../lib. This will delete any prior compiled libraries placed +there. Compiled versions of UMFPACK and its output are placed in +$(TCOV_TMP)/UMFPACK_TCOV_TMP, where $(TCOV_TMP) defaults to /tmp +(it can be changed via 'make TCOV_TMP=/home/myself/mytempdirectory' for +example). -You must first do "make purge" in AMD and UMFPACK. Then type "make" in -this directory. +To remove the compiled copies (in $(TCOV_TMP)/UMFPACK_TCOV_TMP) do 'make clean'. +This will keep the statement coverage summary, ./cover.out. + +To remove all but the distributed files, do 'make purge' or 'make distclean'. You terminal output will look something like this: ################################################################################ Tcov test: 1 di ################################################################################ -make[2]: [run] Error 1 (ignored) -make[2]: [run] Error 1 (ignored) -make[2]: [run] Error 1 (ignored) -make[2]: [run] Error 1 (ignored) -ALL TESTS PASSED: rnorm 2.22e-10 (1.79e-07 shl0, 9.16e-05 arc130 8.81e-08 omega2) cputime 45.7908 +ALL TESTS PASSED: rnorm 2.22e-10 (1.79e-07 shl0, 9.16e-05 arc130 8.81e-08 omega2) 58.048u 26.549s 1:59.54 70.7% 0+0k 3+340io 0pf+0w ################################################################################ Tcov test: 1 dl @@ -36,22 +39,16 @@ ALL TESTS PASSED: rnorm 1e-07 ( ... ) These lines are summarized at the end of the "DO.all" test. If you see "TEST FAILURE" then something went wrong. "ERROR" messages -in the output files tmp/*.out are OK. Those are supposed to be there; +in the output files $(TCOV_TMP)/*.out are OK. Those are supposed to be there; the test exercises the error-reporting features of UMFPACK. Files and directories: -../../UMFPACK UMFPACK original distribution -../../AMD AMD original distribution -../../SuiteSparse_config configuration directory for all of SuiteSparse - acov.di AMD test coverage scripts acov.dl acov.zi acov.zl -AMD_Demo_Makefile replacement for AMD/Demo/Makefile, for testing - badnum2.umf intentionally corrupted files to test umfpack_load_* functions badnum.umf badsym2.umf @@ -61,18 +58,16 @@ cov for summarizing tcov output covall cover.awk -debug.amd +debug.amd sets the debug levels in AMD and UMFPACK debug.umf -Demo_Makefile replacement for UMFPACK/Demo/Makefile, for testing - DO runs one test DO.all run all tests -GNUmakefile.di UMFPACK/Lib/Makefile replacements, for testing -GNUmakefile.dl -GNUmakefile.zi -GNUmakefile.zl +Makefile.di UMFPACK/Lib/Makefile replacements, for testing +Makefile.dl +Makefile.zi +Makefile.zl Make.1 no optimize, no BLAS, test int overflow Make.2 no optimize, BLAS @@ -85,12 +80,50 @@ Make.8 no optimize, no test for int overflow, no divide-by-zero Makefile top-level Makefile for Tcov tests -Out/* subdirectories for each test, +$(TCOV_TMP)/UMFPACK_TCOV_TMP/* subdirectories for each test, contents can be destroyed when done. README.txt this file -TestMat test matrices for ut.c +TestMat test matrices for ut.c: + + adlittle + arc130 + cage3 + d_dyn + galenet + matrix1 + matrix10 + matrix11 + matrix12 + matrix13 + matrix14 + matrix15 + matrix16 + matrix17 + matrix18 + matrix19 + matrix2 + matrix20 + matrix21 + matrix22 + matrix23 + matrix24 + matrix25 + matrix26 + matrix27 + matrix28 + matrix29 + matrix3 + matrix30 + matrix4 + matrix5 + matrix6 + matrix7 + matrix8 + nug07 + S_d2q06c + shl0 Top_Makefile replacement for AMD/Makefile and UMFPACK/Makefile, for testing diff --git a/SuiteSparse/UMFPACK/Tcov/acov.di b/SuiteSparse/UMFPACK/Tcov/acov.di old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Tcov/acov.dl b/SuiteSparse/UMFPACK/Tcov/acov.dl old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Tcov/acov.zi b/SuiteSparse/UMFPACK/Tcov/acov.zi old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Tcov/acov.zl b/SuiteSparse/UMFPACK/Tcov/acov.zl old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Tcov/cov b/SuiteSparse/UMFPACK/Tcov/cov old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Tcov/covall b/SuiteSparse/UMFPACK/Tcov/covall old mode 100644 new mode 100755 index 91584f90b..4606669cd --- a/SuiteSparse/UMFPACK/Tcov/covall +++ b/SuiteSparse/UMFPACK/Tcov/covall @@ -1,4 +1,6 @@ #!/bin/csh +# +# usage: covall tempdirectory # only print those lines that are "#####" in all tests. @@ -34,11 +36,11 @@ foreach file ( \ echo '================================================================================' echo $file echo '================================================================================' - cat /dev/null > Out/tcov_tmp - foreach fdirs (Out/?_??) - cat -n $fdirs/UMFPACK/Source/$file.gcov | grep '#####' >> Out/tcov_tmp + cat /dev/null > $1/UMFPACK_TCOV_TMP/tcov_tmp + foreach fdirs ($1/UMFPACK_TCOV_TMP/?_??) + cat -n $fdirs/UMFPACK/Source/$file.gcov | grep '#####' >> $1/UMFPACK_TCOV_TMP/tcov_tmp end - sort -n Out/tcov_tmp | uniq -c + sort -n $1/UMFPACK_TCOV_TMP/tcov_tmp | uniq -c end foreach file ( \ @@ -49,11 +51,11 @@ foreach file ( \ echo '================================================================================' echo $file echo '================================================================================' - cat /dev/null > Out/tcov_tmp - foreach fdirs (Out/?_??) - cat -n $fdirs/AMD/Source/$file.gcov | grep '#####' >> Out/tcov_tmp + cat /dev/null > $1/UMFPACK_TCOV_TMP/tcov_tmp + foreach fdirs ($1/UMFPACK_TCOV_TMP/?_??) + cat -n $fdirs/AMD/Source/$file.gcov | grep '#####' >> $1/UMFPACK_TCOV_TMP/tcov_tmp end - sort -n Out/tcov_tmp | uniq -c + sort -n $1/UMFPACK_TCOV_TMP/tcov_tmp | uniq -c end @@ -61,7 +63,7 @@ echo '========================================================================== echo 'Last line of each output file: ' echo '================================================================================' -foreach file (Out/*_*/ut.out) +foreach file ($1/UMFPACK_TCOV_TMP/*_*/ut.out) echo $file tail -1 $file echo '=================================================================' diff --git a/SuiteSparse/UMFPACK/Tcov/ucov.di b/SuiteSparse/UMFPACK/Tcov/ucov.di old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Tcov/ucov.dl b/SuiteSparse/UMFPACK/Tcov/ucov.dl old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Tcov/ucov.zi b/SuiteSparse/UMFPACK/Tcov/ucov.zi old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Tcov/ucov.zl b/SuiteSparse/UMFPACK/Tcov/ucov.zl old mode 100644 new mode 100755 diff --git a/SuiteSparse/UMFPACK/Tcov/ut.c b/SuiteSparse/UMFPACK/Tcov/ut.c index d8b3c4355..3f2845dc5 100644 --- a/SuiteSparse/UMFPACK/Tcov/ut.c +++ b/SuiteSparse/UMFPACK/Tcov/ut.c @@ -7806,12 +7806,12 @@ int main (int argc, char **argv) ttt = umfpack_timer ( ) ; fprintf (stderr, - "ALL TESTS PASSED: rnorm %8.2e (%8.2e shl0, %8.2e arc130 %8.2e omega2) cputime %g\n", - maxrnorm, maxrnorm_shl0, maxrnorm_arc130, rnorm_omega2, ttt) ; + "ALL TESTS PASSED: rnorm %8.2e (%8.2e %8.2e %8.2e )\n", + maxrnorm, maxrnorm_shl0, maxrnorm_arc130, rnorm_omega2) ; printf ( - "ALL TESTS PASSED: rnorm %8.2e (%8.2e shl0, %8.2e arc130 %8.2e omega2) cputime %g\n", - maxrnorm, maxrnorm_shl0, maxrnorm_arc130, rnorm_omega2, ttt) ; + "ALL TESTS PASSED: rnorm %8.2e (%8.2e %8.2e %8.2e)\n", + maxrnorm, maxrnorm_shl0, maxrnorm_arc130, rnorm_omega2) ; #if defined (UMF_MALLOC_COUNT) || !defined (NDEBUG) if (UMF_malloc_count != 0) error ("umfpack memory leak!!\n",0.) ; diff --git a/metis/GKlib/GKlib.h b/metis/GKlib/GKlib.h index 492c90f2e..733939e93 100644 --- a/metis/GKlib/GKlib.h +++ b/metis/GKlib/GKlib.h @@ -22,7 +22,6 @@ #include "gk_arch.h" /*!< This should be here, prior to the includes */ - /************************************************************************* * Header file inclusion section **************************************************************************/ @@ -37,8 +36,26 @@ #include #include #include + +/* -------------------------------------------------------------------------- */ +/* Added for SuiteSparse, to disable signal handling when incorporated into + * a MATLAB mexFunction. Tim Davis, Jan 30, 2016, Texas A&M University. */ +#ifdef MATLAB_MEX_FILE +#include "mex.h" +#define SIGABRT 6 +#define SIGTERM 15 +#define jmp_buf int +#define raise(sig) { mexErrMsgTxt ("METIS error") ; } +#define signal(sig,func) NULL +#define longjmp(env,val) { mexErrMsgTxt ("METIS error") ; } +#define setjmp(x) (0) +#define exit(x) { mexErrMsgTxt ("METIS error") ; } +#else #include #include +#endif +/* -------------------------------------------------------------------------- */ + #include #include @@ -58,6 +75,23 @@ #include #endif +/* -------------------------------------------------------------------------- */ +/* Added for SuiteSparse, for incorporation into MATLAB, using MATLAB's + version of malloc, calloc, realloc, free, and printf. + Tim Davis, Jan 30, 2016, Texas A&M University. */ +#ifdef MATLAB_MEX_FILE +#define malloc mxMalloc +#define calloc mxCalloc +#define free(p) { \ + if ((p) == NULL) mexErrMsgTxt ("double mxFree!") ; \ + mxFree (p) ; \ + (p) = NULL ; \ + } +#define realloc mxRealloc +#define printf mexPrintf +#endif +/* -------------------------------------------------------------------------- */ + diff --git a/metis/GKlib/b64.c b/metis/GKlib/b64.c index afacd68a1..914a45286 100644 --- a/metis/GKlib/b64.c +++ b/metis/GKlib/b64.c @@ -37,7 +37,6 @@ void encodeblock(unsigned char *in, unsigned char *out) out[2] += B64OFFSET; out[3] += B64OFFSET; -// printf("%c %c %c %c %2x %2x %2x %2x %2x %2x %2x\n", out[0], out[1], out[2], out[3], out[0], out[1], out[2], out[3], in[0], in[1], in[2]); } /****************************************************************************** @@ -71,7 +70,6 @@ void GKEncodeBase64(int nbytes, unsigned char *inbuffer, unsigned char *outbuffe for (j=0, i=0; i error ? fabs(prnew[i]-prold[i]) : error); - //printf("nrm1: %le maxfabserr: %le\n", gk_dsum(nrows, prnew, 1), error); - if (error < eps) break; } diff --git a/metis/GKlib/seq.c b/metis/GKlib/seq.c index f267a3ea0..9eb203dd2 100644 --- a/metis/GKlib/seq.c +++ b/metis/GKlib/seq.c @@ -168,7 +168,6 @@ void gk_seq_free(gk_seq_t *seq) gk_iFreeMatrix(&seq->pssm, seq->len, seq->nsymbols); gk_iFreeMatrix(&seq->psfm, seq->len, seq->nsymbols); gk_free((void **)&seq->name, &seq->sequence, LTERM); - //gk_free((void **)&seq, LTERM); gk_free((void **) &seq, LTERM); } diff --git a/metis/GKlib/timers.c b/metis/GKlib/timers.c index bb8f29620..6e7ae0165 100644 --- a/metis/GKlib/timers.c +++ b/metis/GKlib/timers.c @@ -35,7 +35,6 @@ double gk_WClockSeconds(void) **************************************************************************/ double gk_CPUSeconds(void) { -//#ifdef __OPENMP__ #ifdef __OPENMPXXXX__ return omp_get_wtime(); #else diff --git a/metis/include/metis.h b/metis/include/metis.h index 2fedebcf7..a295fa925 100644 --- a/metis/include/metis.h +++ b/metis/include/metis.h @@ -5,6 +5,42 @@ \author George \date Started 8/9/02 \version\verbatim $Id$\endverbatim + +-------------------------------------------------------------------------------- +This file appears as SuiteSparse/metis-5.1.0/include/metis.h. This copy of +SuiteSparse/metis-5.1.0 is changed from the original metis-5.1.0 distribution: + +(1) In metis-5.1.0/include/metis.h, the default integer size has been changed + from 32 bits to 64 (IDXTYPEWIDTH). METIS 5.1.0 gives this flexility to the + user, asking the user to modify this file. That has been done here. You + may instead use the original METIS 5.1.0, with 32-bit integers. When + compiled, SuiteSparse will properly detect the size of the METIS idx_t, and + it will work gracefully with both versions. The only constraint is that + SuiteSparse will not be able to use METIS on the largest problems, if you + limit its version of METIS to 32-bit integers. + +(2) The files b64.c, rw.c, seq.c, timers.c, in metis-5.1.0/GKlib, and the files + coarsen.c, fm.c, macros.h, mcutil.c, mincon.c, ometis.c, in + metis-5.1.0/libmetis had C++ style comments (//) which break some C + compilers (the MATLAB mex command on Linux, in particular). They have been + removed. If your compiler is OK with //-style comments, then this fix + is optional. + +(3) The files metis-5.1.0/GKlib/GKLib.h and metis-5.1.0/GKlib/memory.c have + been modified to disable the signal-handing in METIS when used via the + MATLAB interface to METIS in CHOLMOD/MATLAB. These signals are used when + METIS runs out of memory, but they break MATLAB (you will get a segfault). + This change is essential if METIS is to be used in MATLAB. + +(4) The abs and iabs functions in the original metis-5.1.0/libmetis/parmetis.c + and metis-5.1.0/libmetis/balance.c give compiler warnings when IDXTYPEWIDTH + is 64, so they have been replaced with a type-agnostic macro, ABS. This is + just a compiler warning, so the fix is optional. + +If these changes do not affect you then you can use the original METIS 5.1.0. + +Tim Davis, Feb 1, 2016, Texas A&M University +-------------------------------------------------------------------------------- */ #ifndef _METIS_H_ @@ -98,7 +134,6 @@ typedef __int64 int64_t; #define iabs abs #elif IDXTYPEWIDTH == 64 typedef int64_t idx_t; - typedef idx_t idxtype; #define IDX_MAX INT64_MAX #define IDX_MIN INT64_MIN diff --git a/metis/libmetis/CMakeLists.txt b/metis/libmetis/CMakeLists.txt index 6566b07cd..2f99e3ce1 100644 --- a/metis/libmetis/CMakeLists.txt +++ b/metis/libmetis/CMakeLists.txt @@ -14,13 +14,13 @@ if(METIS_INSTALL) RUNTIME DESTINATION lib ARCHIVE DESTINATION lib) endif() - - set_target_properties(metis PROPERTIES PUBLIC_HEADER "../include/metis.h") - install(TARGETS metis ## this line is also the string pattern to check if the modification had already done - EXPORT SuiteSparse - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib64 - ARCHIVE DESTINATION lib64 - PUBLIC_HEADER DESTINATION include - ) + + set_target_properties(metis PROPERTIES PUBLIC_HEADER "../include/metis.h") + install(TARGETS metis ## this line is also the string pattern to check if the modification had already done + EXPORT SuiteSparse + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib64 + ARCHIVE DESTINATION lib64 + PUBLIC_HEADER DESTINATION include + ) \ No newline at end of file diff --git a/metis/libmetis/balance.c b/metis/libmetis/balance.c index 3fb0e6e56..60a76ac33 100644 --- a/metis/libmetis/balance.c +++ b/metis/libmetis/balance.c @@ -10,6 +10,13 @@ #include "metislib.h" +/* -------------------------------------------------------------------------- */ +/* Added for SuiteSparse, to silence compiler warnings. + Tim Davis, Jan 12, 2016, Texas A&M University +*/ +#define ABS(a) (((a) < 0) ? (-(a)) : (a)) +/* -------------------------------------------------------------------------- */ + /************************************************************************* * This function is the entry poidx_t of the bisection balancing algorithms. **************************************************************************/ @@ -20,8 +27,18 @@ void Balance2Way(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts) if (graph->ncon == 1) { /* return right away if the balance is OK */ + + /* [ + old: if (iabs(ntpwgts[0]*graph->tvwgt[0]-graph->pwgts[0]) < 3*graph->tvwgt[0]/graph->nvtxs) return; + modified for SuiteSparse: */ + real_t t = + (ntpwgts[0]*graph->tvwgt[0]-graph->pwgts[0]) ; + t = ABS (t) ; + if (t < 3*graph->tvwgt[0]/graph->nvtxs) + return; + /* ] */ if (graph->nbnd > 0) Bnd2WayBalance(ctrl, graph, ntpwgts); @@ -67,7 +84,16 @@ void Bnd2WayBalance(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts) /* Determine from which domain you will be moving data */ tpwgts[0] = graph->tvwgt[0]*ntpwgts[0]; tpwgts[1] = graph->tvwgt[0] - tpwgts[0]; + + /* [ + old: mindiff = iabs(tpwgts[0]-pwgts[0]); + modified for SuiteSparse: + */ + mindiff = (tpwgts[0]-pwgts[0]); + mindiff = ABS(mindiff) ; + /* ] */ + from = (pwgts[0] < tpwgts[0] ? 1 : 0); to = (from+1)%2; @@ -195,7 +221,16 @@ void General2WayBalance(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts) /* Determine from which domain you will be moving data */ tpwgts[0] = graph->tvwgt[0]*ntpwgts[0]; tpwgts[1] = graph->tvwgt[0] - tpwgts[0]; + + /* [ + old: mindiff = iabs(tpwgts[0]-pwgts[0]); + modified for SuiteSparse: + */ + mindiff = (tpwgts[0]-pwgts[0]); + mindiff = ABS(mindiff) ; + /* ] */ + from = (pwgts[0] < tpwgts[0] ? 1 : 0); to = (from+1)%2; diff --git a/metis/libmetis/coarsen.c b/metis/libmetis/coarsen.c index 165344e6e..55fd269f8 100644 --- a/metis/libmetis/coarsen.c +++ b/metis/libmetis/coarsen.c @@ -237,7 +237,6 @@ idx_t Match_RM(ctrl_t *ctrl, graph_t *graph) } } - //printf("nunmatched: %zu\n", nunmatched); /* see if a 2-hop matching is required/allowed */ if (!ctrl->no2hop && nunmatched > UNMATCHEDFOR2HOP*nvtxs) @@ -378,7 +377,6 @@ idx_t Match_SHEM(ctrl_t *ctrl, graph_t *graph) } } - //printf("nunmatched: %zu\n", nunmatched); /* see if a 2-hop matching is required/allowed */ if (!ctrl->no2hop && nunmatched > UNMATCHEDFOR2HOP*nvtxs) diff --git a/metis/libmetis/fm.c b/metis/libmetis/fm.c index 7f5ea6b01..54617d068 100644 --- a/metis/libmetis/fm.c +++ b/metis/libmetis/fm.c @@ -288,8 +288,10 @@ void FM_Mc2WayCutRefine(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, idx_t nit i = bndind[perm[ii]]; ASSERT(ed[i] > 0 || id[i] == 0); ASSERT(bndptr[i] != -1); - //rgain = 1.0*(ed[i]-id[i])/sqrt(vwgt[i*ncon+qnum[i]]+1); - //rgain = (ed[i]-id[i] > 0 ? 1.0*(ed[i]-id[i])/sqrt(vwgt[i*ncon+qnum[i]]+1) : ed[i]-id[i]); + /* + rgain = 1.0*(ed[i]-id[i])/sqrt(vwgt[i*ncon+qnum[i]]+1); + rgain = (ed[i]-id[i] > 0 ? 1.0*(ed[i]-id[i])/sqrt(vwgt[i*ncon+qnum[i]]+1) : ed[i]-id[i]); + */ rgain = ed[i]-id[i]; rpqInsert(queues[2*qnum[i]+where[i]], i, rgain); } @@ -360,9 +362,11 @@ void FM_Mc2WayCutRefine(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, idx_t nit } else { /* If it has not been moved, update its position in the queue */ if (moved[k] == -1) { - //rgain = 1.0*(ed[k]-id[k])/sqrt(vwgt[k*ncon+qnum[k]]+1); - //rgain = (ed[k]-id[k] > 0 ? - // 1.0*(ed[k]-id[k])/sqrt(vwgt[k*ncon+qnum[k]]+1) : ed[k]-id[k]); + /* + rgain = 1.0*(ed[k]-id[k])/sqrt(vwgt[k*ncon+qnum[k]]+1); + rgain = (ed[k]-id[k] > 0 ? + 1.0*(ed[k]-id[k])/sqrt(vwgt[k*ncon+qnum[k]]+1) : ed[k]-id[k]); + */ rgain = ed[k]-id[k]; rpqUpdate(queues[2*qnum[k]+where[k]], k, rgain); } @@ -372,9 +376,11 @@ void FM_Mc2WayCutRefine(ctrl_t *ctrl, graph_t *graph, real_t *ntpwgts, idx_t nit if (ed[k] > 0) { /* It will now become a boundary vertex */ BNDInsert(nbnd, bndind, bndptr, k); if (moved[k] == -1) { - //rgain = 1.0*(ed[k]-id[k])/sqrt(vwgt[k*ncon+qnum[k]]+1); - //rgain = (ed[k]-id[k] > 0 ? - // 1.0*(ed[k]-id[k])/sqrt(vwgt[k*ncon+qnum[k]]+1) : ed[k]-id[k]); + /* + rgain = 1.0*(ed[k]-id[k])/sqrt(vwgt[k*ncon+qnum[k]]+1); + rgain = (ed[k]-id[k] > 0 ? + 1.0*(ed[k]-id[k])/sqrt(vwgt[k*ncon+qnum[k]]+1) : ed[k]-id[k]); + */ rgain = ed[k]-id[k]; rpqInsert(queues[2*qnum[k]+where[k]], k, rgain); } diff --git a/metis/libmetis/macros.h b/metis/libmetis/macros.h index 3f6f7d9ed..e1b7d8589 100644 --- a/metis/libmetis/macros.h +++ b/metis/libmetis/macros.h @@ -22,7 +22,6 @@ #define OR(a, b) ((a) < 0 ? -((-(a))|(b)) : ((a)|(b))) #define XOR(a, b) ((a) < 0 ? -((-(a))^(b)) : ((a)^(b))) -//#define icopy(n, a, b) (idx_t *)memcpy((void *)(b), (void *)(a), sizeof(idx_t)*(n)) #define HASHFCT(key, size) ((key)%(size)) #define SWAP gk_SWAP diff --git a/metis/libmetis/mcutil.c b/metis/libmetis/mcutil.c index 6e20f556a..b1aae90e3 100644 --- a/metis/libmetis/mcutil.c +++ b/metis/libmetis/mcutil.c @@ -195,21 +195,14 @@ int BetterBalanceKWay(idx_t ncon, idx_t *vwgt, real_t *ubvec, for (i=0; i max1 ? tmp : max1); tmp = bm2[i]*(pt2[i]+a2*vwgt[i]) - ubvec[i]; - //printf("%+.4f ", (float)tmp); nrm2 += tmp*tmp; max2 = (tmp > max2 ? tmp : max2); - //printf("%4d %4d %4d %4d %4d %4d %4d %.2f\n", - // (int)vwgt[i], - // (int)a1, (int)pt1[i], (int)tpt1[i], - // (int)a2, (int)pt2[i], (int)tpt2[i], ubvec[i]); } - //printf(" %.3f %.3f %.3f %.3f\n", (float)max1, (float)nrm1, (float)max2, (float)nrm2); if (max2 < max1) return 1; diff --git a/metis/libmetis/minconn.c b/metis/libmetis/minconn.c index 86dc90fbe..85d1d40a5 100644 --- a/metis/libmetis/minconn.c +++ b/metis/libmetis/minconn.c @@ -585,8 +585,6 @@ void MoveGroupMinConnForVol(ctrl_t *ctrl, graph_t *graph, idx_t to, idx_t nind, xgain = (myrinfo->nid == 0 && myrinfo->ned > 0 ? vsize[i] : 0); - //printf("Moving %"PRIDX" from %"PRIDX" to %"PRIDX" [vsize: %"PRIDX"] [xgain: %"PRIDX"]\n", - // i, from, to, vsize[i], xgain); /* find the location of 'to' in myrinfo or create it if it is not there */ for (k=0; knnbrs; k++) { @@ -595,7 +593,6 @@ void MoveGroupMinConnForVol(ctrl_t *ctrl, graph_t *graph, idx_t to, idx_t nind, } if (k == myrinfo->nnbrs) { - //printf("Missing neighbor\n"); if (myrinfo->nid > 0) xgain -= vsize[i]; @@ -608,7 +605,6 @@ void MoveGroupMinConnForVol(ctrl_t *ctrl, graph_t *graph, idx_t to, idx_t nind, onbrs = ctrl->vnbrpool + orinfo->inbr; ASSERT(other != to) - //printf(" %8d %8d %3d\n", (int)ii, (int)vsize[ii], (int)other); if (from == other) { /* Same subdomain vertex: Decrease the gain if 'to' is a new neighbor. */ diff --git a/metis/libmetis/ometis.c b/metis/libmetis/ometis.c index 51e39754c..53a37966e 100644 --- a/metis/libmetis/ometis.c +++ b/metis/libmetis/ometis.c @@ -109,7 +109,6 @@ int METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, ctrl->cfactor = 1.0*(*nvtxs)/nnvtxs; if (ctrl->cfactor > 1.5 && ctrl->nseps == 1) ctrl->nseps = 2; - //ctrl->nseps = (idx_t)(ctrl->cfactor*ctrl->nseps); } } diff --git a/metis/libmetis/parmetis.c b/metis/libmetis/parmetis.c index 631d811bc..316ab230d 100644 --- a/metis/libmetis/parmetis.c +++ b/metis/libmetis/parmetis.c @@ -14,6 +14,12 @@ #include "metislib.h" +/* -------------------------------------------------------------------------- */ +/* Added for SuiteSparse, to silence compiler warnings. + Tim Davis, Jan 12, 2016, Texas A&M University +*/ +#define ABS(a) (((a) < 0) ? (-(a)) : (a)) +/* -------------------------------------------------------------------------- */ /*************************************************************************/ /*! This function is the entry point for the node ND code for ParMETIS. @@ -308,7 +314,16 @@ void FM_2WayNodeRefine1SidedP(ctrl_t *ctrl, graph_t *graph, * Get into the FM loop *******************************************************/ mptr[0] = nmind = nbad = 0; + + /* [ + old: mindiff = abs(pwgts[0]-pwgts[1]); + modified for SuiteSparse: + */ + mindiff = (pwgts[0]-pwgts[1]); + mindiff = ABS(mindiff) ; + /* ] */ + for (nswaps=0; nswaps