diff src/suitesparse.mk @ 1376:896bc60de2a9

improvements for packages: cblas lapack suitesparse
author Alois Schlögl <alois.schloegl@gmail.com>
date Tue, 16 Nov 2010 19:13:33 +0100
parents 05c3c35ab91e
children 948166ab4657
line wrap: on
line diff
--- a/src/suitesparse.mk	Tue Nov 16 19:10:40 2010 +0100
+++ b/src/suitesparse.mk	Tue Nov 16 19:13:33 2010 +0100
@@ -9,7 +9,7 @@
 $(PKG)_SUBDIR   := SuiteSparse
 $(PKG)_FILE     := SuiteSparse-$($(PKG)_VERSION).tar.gz
 $(PKG)_WEBSITE  := http://www.cise.ufl.edu/
-$(PKG)_URL      := http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-3.4.0.tar.gz
+$(PKG)_URL      := http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-$($(PKG)_VERSION).tar.gz
 $(PKG)_DEPS     := gcc metis lapack
 
 define $(PKG)_UPDATE
@@ -29,8 +29,8 @@
     $(MAKE) -C '$(1)/$(metis_SUBDIR)/Lib' -j '$(JOBS)'
 
     # Otherwise hack the config so it can find metis
-    #$(SED) -i 's,\(METIS_PATH = \)\(../../metis-4.0\),\1'$(PREFIX)/$(TARGET)/include/metis',' $(1)/UFconfig/UFconfig.mk
-    #$(SED) -i 's,\(METIS = \)\(../../metis-4.0/libmetis.a\),\1'$(PREFIX)/$(TARGET)/lib/libmetis.a',' $(1)/UFconfig/UFconfig.mk
+    #$(SED) -i 's,\(METIS_PATH = \)\(.    $(INSTALL) -m664 '$(1)/.    $(INSTALL) -m664 '$(1)/metis-4.0\),\1'$(PREFIX)/$(TARGET)/include/metis',' $(1)/UFconfig/UFconfig.mk
+    #$(SED) -i 's,\(METIS = \)\(.    $(INSTALL) -m664 '$(1)/.    $(INSTALL) -m664 '$(1)/metis-4.0/libmetis.a\),\1'$(PREFIX)/$(TARGET)/lib/libmetis.a',' $(1)/UFconfig/UFconfig.mk
     
     # use cross tools
     $(SED) -i 's,cc,$(TARGET)-gcc,'        $(1)/UFconfig/UFconfig.mk
@@ -39,14 +39,40 @@
     $(SED) -i 's,ar ,$(TARGET)-ar ,'       $(1)/UFconfig/UFconfig.mk
     $(SED) -i 's,ranlib,$(TARGET)-ranlib,' $(1)/UFconfig/UFconfig.mk
 
-    # use BLAS from GSL since it's already part of mingw-cross-env
+    # gfortran does not need libg2c 
     $(SED) -i 's,-lblas -lgfortran -lgfortranbegin -lg2c,-lblas -lgfortran -lgfortranbegin,' $(1)/UFconfig/UFconfig.mk
     
-    # however, we get linking errros
+    # Missing _drand48 and _srand48 cause problems in demos 	
+    #$(TARGET)-gcc -c $(1)/CHOLMOD/MATLAB/Windows/rand48.c -o $(1)/CHOLMOD/Lib/rand48.o 
+    #$(SED) -i 's,libcholmod.a: $$(OBJ),libcholmod.a: $$(OBJ) rand48.o,' $(1)/CHOLMOD/Lib/Makefile
+    #$(SED) -i 's,$$(AR) libcholmod.a $$(OBJ),$$(AR) libcholmod.a $$(OBJ) rand48.o,' $(1)/CHOLMOD/Lib/Makefile
+    # Here we choose to exclude the demos from building in order to avoid the _rand48 problems
+    $(SED) -i 's,( cd Demo ; $$(MAKE) ),#( cd Demo ; $$(MAKE) ),' $(1)/CHOLMOD/Makefile
+    $(SED) -i 's,( cd Demo ; $$(MAKE) ),#( cd Demo ; $$(MAKE) ),' $(1)/SPQR/Makefile
+
+    # Built all
     $(MAKE) -C '$(1)' -j '$(JOBS)'
 
-    # CHOLMOD has no errors on it's own though, but seems to be missing a link step
-    $(MAKE) -C '$(1)/CHOLMOD/Lib' -j '$(JOBS)'
+    # Install library files 
+    $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
+    for i in `cd $(1) && find . -name *.a`; do \
+    	$(INSTALL) -m664 '$(1)/'$$i '$(PREFIX)/$(TARGET)/lib/' ; \
+    done;
+
+    # Install include files 
+    $(INSTALL) -d '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/AMD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/BTF/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/CAMD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/CCOLAMD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/CHOLMOD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/COLAMD/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/CXSparse/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/KLU/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/LDL/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/SPQR/Include/'* '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/UFconfig/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
+    $(INSTALL) -m664 '$(1)/UMFPACK/Include/'*.h '$(PREFIX)/$(TARGET)/include/suitesparse/'
 
 endef