From d60b42fa532a0703a3f7b79125889cbd823183f9 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Tue, 16 Nov 2010 19:05:50 +0100 Subject: improvements for packages: metis suitesparse --- src/metis-undef-log2.patch | 31 ------------------------------- src/metis.mk | 26 ++++++++++++++++++-------- src/suitesparse.mk | 35 ++++++++++++++++++++++++++++++----- 3 files changed, 48 insertions(+), 44 deletions(-) delete mode 100644 src/metis-undef-log2.patch diff --git a/src/metis-undef-log2.patch b/src/metis-undef-log2.patch deleted file mode 100644 index 020e42c..0000000 --- a/src/metis-undef-log2.patch +++ /dev/null @@ -1,31 +0,0 @@ -This file is part of mingw-cross-env. -See doc/index.html for further information. - -diff urM a/metis-4.0/Lib/util.c b/metis-4.0/Lib/util.c -*** a/metis-4.0/Lib/util.c 1998-11-30 17:26:50.000000000 +0100 ---- b/metis-4.0/Lib/util.c 2010-06-21 23:32:33.783674276 +0200 -@@ -506,13 +506,3 @@ - } - } - -- /************************************************************************* -- * This function returns the log2(x) -- **************************************************************************/ -- int log2(int a) -- { -- int i; -- -- for (i=1; a > 1; i++, a = a>>1); -- return i-1; -- } - -diff urM a/metis-4.0/Lib/proto.h b/metis-4.0/Lib/proto.h -*** a/metis-4.0/Lib/proto.h 1998-11-30 17:26:50.000000000 +0100 ---- b/metis-4.0/Lib/proto.h 2010-06-21 23:33:24.194921631 +0200 -@@ -459,4 +459,3 @@ - void srand48(long); - int ispow2(int); - void InitRandom(int); -- int log2(int); - - diff --git a/src/metis.mk b/src/metis.mk index 1dd5336..f6f821a 100644 --- a/src/metis.mk +++ b/src/metis.mk @@ -11,18 +11,28 @@ $(PKG)_FILE := metis-$($(PKG)_VERSION).tar.gz $(PKG)_WEBSITE := http://glaros.dtc.umn.edu $(PKG)_URL := http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-4.0.tar.gz $(PKG)_DEPS := gcc + define $(PKG)_UPDATE wget -q -O- 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/' | \ $(SED) -n 's,.*metis-\([0-9]\.[0-9]\)\.tar.gz,\1,ip' | \ head -1 endef -define $(PKG)_BUILD - cd '$(1)' && CHOST='$(TARGET)' -# cd '$(1)' && CHOST='$(TARGET)' ./configure \ -# --prefix='$(PREFIX)/$(TARGET)' \ -# --static - $(MAKE) -C '$(1)' -j '$(JOBS)' +define $(PKG)_NO_BUILD + # Don't build metis here, build inline with suitesparse instead + # since it looks in an odd location for the headers + # Change this to $(PKG)_BUILD to actually build and install + $(SED) -i 's,cc,$(TARGET)-gcc,' $(1)/Makefile.in + $(SED) -i 's,ar ,$(TARGET)-ar ,' $(1)/Makefile.in + $(SED) -i 's,ranlib,$(TARGET)-ranlib,' $(1)/Makefile.in + $(MAKE) -C '$(1)/Lib' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib' + $(INSTALL) -m664 '$(1)/libmetis.a' '$(PREFIX)/$(TARGET)/lib/libmetis.a' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/include/metis/Lib' + $(INSTALL) -m664 '$(1)/Lib/metis.h' '$(PREFIX)/$(TARGET)/include/metis/Lib/metis.h' + $(INSTALL) -m664 '$(1)/Lib/defs.h' '$(PREFIX)/$(TARGET)/include/metis/Lib/defs.h' + $(INSTALL) -m664 '$(1)/Lib/struct.h' '$(PREFIX)/$(TARGET)/include/metis/Lib/struct.h' + $(INSTALL) -m664 '$(1)/Lib/macros.h' '$(PREFIX)/$(TARGET)/include/metis/Lib/macros.h' + $(INSTALL) -m664 '$(1)/Lib/rename.h' '$(PREFIX)/$(TARGET)/include/metis/Lib/rename.h' + $(INSTALL) -m664 '$(1)/Lib/proto.h' '$(PREFIX)/$(TARGET)/include/metis/Lib/proto.h' endef - - diff --git a/src/suitesparse.mk b/src/suitesparse.mk index 4b9f428..eaa5184 100644 --- a/src/suitesparse.mk +++ b/src/suitesparse.mk @@ -11,6 +11,7 @@ $(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)_DEPS := gcc metis + define $(PKG)_UPDATE wget -q -O- 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/' | \ $(SED) -n 's,.*SuiteSparse-\([0-9]\.[0-9]\.[0-9]\)\.tar.*,\1,ip' | \ @@ -18,11 +19,35 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD - cd '$(1)' && CHOST='$(TARGET)' -# cd '$(1)' && CHOST='$(TARGET)' ./configure \ -# --prefix='$(PREFIX)/$(TARGET)' \ -# --static - $(MAKE) -C '$(1)' -j '$(JOBS)' + + # If not building metis in it's makefile, then + # build it here since the config seems to expect it + cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,metis) + $(SED) -i 's,cc,$(TARGET)-gcc,' $(1)/$(metis_SUBDIR)/Makefile.in + $(SED) -i 's,ar ,$(TARGET)-ar ,' $(1)/$(metis_SUBDIR)/Makefile.in + $(SED) -i 's,ranlib,$(TARGET)-ranlib,' $(1)/$(metis_SUBDIR)/Makefile.in + $(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 + + # use cross tools + $(SED) -i 's,cc,$(TARGET)-gcc,' $(1)/UFconfig/UFconfig.mk + $(SED) -i 's,g++,$(TARGET)-g++,' $(1)/UFconfig/UFconfig.mk + $(SED) -i 's,f77,$(TARGET)-gfortran,' $(1)/UFconfig/UFconfig.mk + $(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 + $(SED) -i 's,-lblas -lgfortran -lgfortranbegin -lg2c,-lgslcblas -lgfortran -lgfortranbegin,' $(1)/UFconfig/UFconfig.mk + + # however, we get linking errros + #$(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)' + endef -- cgit v0.12