annotate src/suitesparse.mk @ 3671:95454fa2df8b

suitesparse: fix native mingw build * src/suitesparse.mk: use PKG_DESTDIR for destination installation, use -lblas instead of PKG_BLAS_LIB
author John Donoghue
date Mon, 28 Jul 2014 15:41:31 -0400
parents a0eaddc0b7ba
children c734f4d39243
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2333
f653602a0500 Rebrand to new project name MXE
Volker Grabsch <vog@notjusthosting.com>
parents: 2240
diff changeset
1 # This file is part of MXE.
2353
99516e73b368 Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2349
diff changeset
2 # See index.html for further information.
1371
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
3
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
4 PKG := suitesparse
3553
c27b154dab6c suitesparse: fix typo, update to 4.2.1
John Donoghue <john.donoghue@ieee.org>
parents: 3551
diff changeset
5 $(PKG)_VERSION := 4.2.1
3551
1f81856eba40 suitesparse: update to 4.1.2
John Donoghue <john.donoghue@ieee.org>
parents: 3545
diff changeset
6 $(PKG)_CHECKSUM := 2fec3bf93314bd14cbb7470c0a2c294988096ed6
1371
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
7 $(PKG)_SUBDIR := SuiteSparse
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
8 $(PKG)_FILE := SuiteSparse-$($(PKG)_VERSION).tar.gz
1385
08b296ec290e cleanup packages: blas cblas lapack metis suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1377
diff changeset
9 $(PKG)_URL := http://www.cise.ufl.edu/research/sparse/SuiteSparse/$($(PKG)_FILE)
2738
3b14416f4c51 package suitesparse: add secondary url
Tony Theodore <tonyt@logyst.com>
parents: 2726
diff changeset
10 $(PKG)_URL_2 := https://distfiles.macports.org/SuiteSparse/$($(PKG)_FILE)
3545
c21ca79d7980 Remove ENABLE_OPEN_BLAS from .mk files and use just to add openblass to the distribution
John Donoghue
parents: 3480
diff changeset
11 $(PKG)_DEPS := blas lapack
3069
076acecb9c21 Update octave dependancies that use blas to also use openblas
John Donoghue <john.donoghue@ieee.org>
parents: 3048
diff changeset
12
3671
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
13 ifeq ($(MXE_NATIVE_MINGW_BUILD),yes)
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
14 $(PKG)_DESTDIR :=
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
15 else
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
16 $(PKG)_DESTDIR := $(3)
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
17 endif
1372
4c3f4e0e3194 improvements for packages: metis suitesparse
Tony Theodore <tonyt@logyst.com>
parents: 1371
diff changeset
18
1371
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
19 define $(PKG)_UPDATE
2525
4d0f3a9da57e all packages: use $(WGET) portability variable
Tony Theodore <tonyt@logyst.com>
parents: 2483
diff changeset
20 $(WGET) -q -O- 'http://www.cise.ufl.edu/research/sparse/SuiteSparse/' | \
1385
08b296ec290e cleanup packages: blas cblas lapack metis suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1377
diff changeset
21 $(SED) -n 's,.*SuiteSparse-\([0-9][^"]*\)\.tar.*,\1,p' | \
1371
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
22 head -1
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
23 endef
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
24
2887
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
25 $(PKG)_STATICLIBS_1 := \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
26 SuiteSparse_config/libsuitesparseconfig.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
27 SuiteSparse_config/xerbla/libcerbla.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
28 AMD/Lib/libamd.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
29 CAMD/Lib/libcamd.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
30 COLAMD/Lib/libcolamd.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
31 CCOLAMD/Lib/libccolamd.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
32 CSparse/Lib/libcsparse.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
33 CXSparse/Lib/libcxsparse.a \
3114
fcf98b1d15f1 [MSVC] enable SuiteSparse compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3078
diff changeset
34 CHOLMOD/Lib/libcholmod.a \
2887
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
35 SPQR/Lib/libspqr.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
36 BTF/Lib/libbtf.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
37 LDL/Lib/libldl.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
38 KLU/Lib/libklu.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
39 RBio/Lib/librbio.a \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
40 UMFPACK/Lib/libumfpack.a
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
41
3477
6a36441bfafd suitesparse.mk: Add -DLONGBLAS to CPPFLAGS for --enable-64 Windows builds.
John W. Eaton <jwe@octave.org>
parents: 3469
diff changeset
42 $(PKG)_CPPFLAGS := -DNTIMER
6a36441bfafd suitesparse.mk: Add -DLONGBLAS to CPPFLAGS for --enable-64 Windows builds.
John W. Eaton <jwe@octave.org>
parents: 3469
diff changeset
43
6a36441bfafd suitesparse.mk: Add -DLONGBLAS to CPPFLAGS for --enable-64 Windows builds.
John W. Eaton <jwe@octave.org>
parents: 3469
diff changeset
44 ifeq ($(MXE_WINDOWS_BUILD),yes)
6a36441bfafd suitesparse.mk: Add -DLONGBLAS to CPPFLAGS for --enable-64 Windows builds.
John W. Eaton <jwe@octave.org>
parents: 3469
diff changeset
45 ifeq ($(ENABLE_64),yes)
6a36441bfafd suitesparse.mk: Add -DLONGBLAS to CPPFLAGS for --enable-64 Windows builds.
John W. Eaton <jwe@octave.org>
parents: 3469
diff changeset
46 $(PKG)_CPPFLAGS += -DLONGBLAS='long long'
6a36441bfafd suitesparse.mk: Add -DLONGBLAS to CPPFLAGS for --enable-64 Windows builds.
John W. Eaton <jwe@octave.org>
parents: 3469
diff changeset
47 endif
6a36441bfafd suitesparse.mk: Add -DLONGBLAS to CPPFLAGS for --enable-64 Windows builds.
John W. Eaton <jwe@octave.org>
parents: 3469
diff changeset
48 endif
6a36441bfafd suitesparse.mk: Add -DLONGBLAS to CPPFLAGS for --enable-64 Windows builds.
John W. Eaton <jwe@octave.org>
parents: 3469
diff changeset
49
1371
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
50 define $(PKG)_BUILD
1386
0f61e783e13a fix build issues of packages: lapack suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1385
diff changeset
51 # exclude demos
0f61e783e13a fix build issues of packages: lapack suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1385
diff changeset
52 find '$(1)' -name 'Makefile' \
0f61e783e13a fix build issues of packages: lapack suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1385
diff changeset
53 -exec $(SED) -i 's,( cd Demo,#( cd Demo,' {} \;
1385
08b296ec290e cleanup packages: blas cblas lapack metis suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1377
diff changeset
54
3114
fcf98b1d15f1 [MSVC] enable SuiteSparse compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3078
diff changeset
55 if test $(MXE_SYSTEM) = msvc; then \
fcf98b1d15f1 [MSVC] enable SuiteSparse compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3078
diff changeset
56 (cd '$(1)'; \
fcf98b1d15f1 [MSVC] enable SuiteSparse compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3078
diff changeset
57 (cd CXSparse_newfiles && tar cfz ../CXSparse_newfiles.tar.gz .); \
fcf98b1d15f1 [MSVC] enable SuiteSparse compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3078
diff changeset
58 ./CSparse_to_CXSparse CSparse CXSparse CXSparse_newfiles.tar.gz) \
fcf98b1d15f1 [MSVC] enable SuiteSparse compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3078
diff changeset
59 fi
fcf98b1d15f1 [MSVC] enable SuiteSparse compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3078
diff changeset
60
1385
08b296ec290e cleanup packages: blas cblas lapack metis suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1377
diff changeset
61 # build all
1439
b505b699c280 cleanup package: suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1390
diff changeset
62 $(MAKE) -C '$(1)' -j '$(JOBS)' \
3477
6a36441bfafd suitesparse.mk: Add -DLONGBLAS to CPPFLAGS for --enable-64 Windows builds.
John W. Eaton <jwe@octave.org>
parents: 3469
diff changeset
63 CPPFLAGS="$($(PKG)_CPPFLAGS)" \
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2887
diff changeset
64 CC='$(MXE_CC)' \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2887
diff changeset
65 CXX='$(MXE_CXX)' \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2887
diff changeset
66 CPLUSPLUS='$(MXE_CXX)' \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2887
diff changeset
67 F77='$(MXE_F77)' \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2887
diff changeset
68 FFLAGS='$(MXE_FFLAGS)' \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2887
diff changeset
69 CFLAGS='$(MXE_CFLAGS)' \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2887
diff changeset
70 CXXFLAGS='$(MXE_CXXFLAGS)' \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2887
diff changeset
71 AR='$(MXE_AR)' \
3031
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3014
diff changeset
72 RANLIB='$(MXE_RANLIB)' \
3671
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
73 BLAS='-lblas -lgfortran -lgfortranbegin' \
1440
30fed101654f remove package metis because it is not (yet) Free Software
Volker Grabsch <vog@notjusthosting.com>
parents: 1439
diff changeset
74 CHOLMOD_CONFIG='-DNPARTITION'
1372
4c3f4e0e3194 improvements for packages: metis suitesparse
Tony Theodore <tonyt@logyst.com>
parents: 1371
diff changeset
75
1385
08b296ec290e cleanup packages: blas cblas lapack metis suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1377
diff changeset
76 # install library files
3671
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
77 $(INSTALL) -d '$($(PKG)_DESTDIR)$(HOST_LIBDIR)'
2887
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
78
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
79 for f in $(addprefix $(1)/, $($(PKG)_STATICLIBS_1)); do \
2868
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
80 if [ $(BUILD_SHARED) = yes ]; then \
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
81 lib=`basename $$f .a`; \
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
82 dir=`dirname $$f`; \
2887
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
83 echo "building and installing shared libraries for $$lib"; \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
84 deplibs=""; \
2868
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
85 case $$lib in \
2887
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
86 libcholmod) \
3671
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
87 deplibs="-lamd -lcamd -lcolamd -lccolamd -lsuitesparseconfig -llapack -lblas"; \
2887
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
88 ;; \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
89 libklu) \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
90 deplibs="-lbtf -lamd -lcolamd -lsuitesparseconfig"; \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
91 ;; \
2868
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
92 librbio) \
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
93 deplibs="-lsuitesparseconfig"; \
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
94 ;; \
2887
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
95 libspqr) \
3671
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
96 deplibs="-lcholmod -lsuitesparseconfig -llapack -lblas"; \
2887
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
97 ;; \
2868
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
98 libumfpack) \
3671
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
99 deplibs="-lcholmod -lamd -lsuitesparseconfig -lblas"; \
2868
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
100 ;; \
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
101 esac; \
2887
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
102 if [ -n "$deplibs" ]; then \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
103 echo " deplibs = $$deplibs"; \
7811f0697a7a fix suitesparse build
John W. Eaton <jwe@octave.org>
parents: 2876
diff changeset
104 fi; \
3671
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
105 $(MAKE_SHARED_FROM_STATIC) --ar '$(MXE_AR)' --ld '$(MXE_CXX)' $$f --install '$(INSTALL)' --libdir '$($(PKG)_DESTDIR)$(HOST_LIBDIR)' --bindir '$($(PKG)_DESTDIR)$(HOST_BINDIR)' $$deplibs; \
2868
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
106 fi; \
1c18d3bb1829 Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents: 2738
diff changeset
107 done
1376
896bc60de2a9 improvements for packages: cblas lapack suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents: 1375
diff changeset
108
1385
08b296ec290e cleanup packages: blas cblas lapack metis suitesparse
Volker Grabsch <vog@notjusthosting.com>
parents: 1377
diff changeset
109 # install include files
3671
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
110 $(INSTALL) -d '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
111 $(INSTALL) -m644 '$(1)/SuiteSparse_config/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
112 $(INSTALL) -m644 '$(1)/AMD/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
113 $(INSTALL) -m644 '$(1)/BTF/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
114 $(INSTALL) -m644 '$(1)/CAMD/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
115 $(INSTALL) -m644 '$(1)/CCOLAMD/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
116 $(INSTALL) -m644 '$(1)/CHOLMOD/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
117 $(INSTALL) -m644 '$(1)/COLAMD/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
118 $(INSTALL) -m644 '$(1)/CSparse/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
119 $(INSTALL) -m644 '$(1)/CXSparse/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
120 $(INSTALL) -m644 '$(1)/KLU/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
121 $(INSTALL) -m644 '$(1)/LDL/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
122 $(INSTALL) -m644 '$(1)/SPQR/Include/'* '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
95454fa2df8b suitesparse: fix native mingw build
John Donoghue
parents: 3555
diff changeset
123 $(INSTALL) -m644 '$(1)/UMFPACK/Include/'*.h '$($(PKG)_DESTDIR)$(HOST_INCDIR)/suitesparse/'
1371
c9905856c931 new packages: metis suitesparse
Alois Schlögl <alois.schloegl@gmail.com>
parents:
diff changeset
124 endef