| 1 |
############################################################################ |
| 2 |
# This file is part of FreeFEM. # |
| 3 |
# # |
| 4 |
# FreeFEM is free software: you can redistribute it and/or modify # |
| 5 |
# it under the terms of the GNU Lesser General Public License as # |
| 6 |
# published by the Free Software Foundation, either version 3 of # |
| 7 |
# the License, or (at your option) any later version. # |
| 8 |
# # |
| 9 |
# FreeFEM is distributed in the hope that it will be useful, # |
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
| 12 |
# GNU Lesser General Public License for more details. # |
| 13 |
# # |
| 14 |
# You should have received a copy of the GNU Lesser General Public License # |
| 15 |
# along with FreeFEM. If not, see <http://www.gnu.org/licenses/>. # |
| 16 |
############################################################################ |
| 17 |
# SUMMARY : Downloading and compiling extra libraries for Umfpack |
| 18 |
# LICENSE : LGPLv3 |
| 19 |
# ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE |
| 20 |
# AUTHORS : ... |
| 21 |
# E-MAIL : ... |
| 22 |
|
| 23 |
# see [[file:../../configure.ac::DOWNLOAD_UMFPACK]] |
| 24 |
all-local: $(DOWNLOAD_UMFPACK) |
| 25 |
EXTRA_DIST= SuiteSparse_config.mk.in |
| 26 |
|
| 27 |
# Downloading and compiling UMFPACK |
| 28 |
# --------------------------------- |
| 29 |
|
| 30 |
DIRPKG=../pkg |
| 31 |
SUITESPARSE_TGZ=$(DIRPKG)/SuiteSparse-4.4.4.tar.gz |
| 32 |
|
| 33 |
UMFPACKLIB=../lib/libumfpack.a |
| 34 |
AMDLIB=../lib/libamd.a |
| 35 |
CAMDLIB=../lib/libcamd.a |
| 36 |
CHOLMODLIB=../lib/libcholmod.a |
| 37 |
COLAMDLIB=../lib/libcolamd.a |
| 38 |
SUITESPARSECONFIGLIB=../lib/libsuitesparseconfig.a |
| 39 |
|
| 40 |
# ALH - 4/9/13 - parallel make crashes ("pipe from processes is a directory"?). make sure that everything is run |
| 41 |
# sequentially |
| 42 |
|
| 43 |
umfpack: |
| 44 |
$(MAKE) MAKEFLAGS= $(AMDLIB) |
| 45 |
$(MAKE) MAKEFLAGS= $(UMFPACKLIB) |
| 46 |
$(MAKE) MAKEFLAGS= $(SUITESPARSECONFIGLIB) |
| 47 |
# |
| 48 |
# ALH - 19/9/13 - cholmod part built sequentially |
| 49 |
# |
| 50 |
$(MAKE) MAKEFLAGS= $(CAMDLIB) |
| 51 |
$(MAKE) MAKEFLAGS= $(COLAMDLIB) |
| 52 |
$(MAKE) MAKEFLAGS= $(AMDLIB) |
| 53 |
$(MAKE) MAKEFLAGS= $(CHOLMODLIB) |
| 54 |
$(MAKE) MAKEFLAGS= $(SUITESPARSECONFIGLIB) |
| 55 |
|
| 56 |
# FFCS: SuiteSparse/*/Source are not able to compile in parallel from scratch ("pipe from processes is a |
| 57 |
# directory"?). But specifying "make -j 1" is not enough (another error pops up). Use "$(MAKE) MAKEFLAGS=" instead |
| 58 |
# (using "make MAKEFLAGS=" still produces an error on Cygwin). |
| 59 |
|
| 60 |
$(SUITESPARSECONFIGLIB): SuiteSparse/FF |
| 61 |
cd SuiteSparse/SuiteSparse_config && $(MAKE) MAKEFLAGS= |
| 62 |
mkdir -p ../include ../lib |
| 63 |
cp -f SuiteSparse/SuiteSparse_config/SuiteSparse_config.h ../include |
| 64 |
cp SuiteSparse/SuiteSparse_config/libsuitesparseconfig.a ../lib/libsuitesparseconfig.a |
| 65 |
$(RANLIB) ../lib/libsuitesparseconfig.a |
| 66 |
|
| 67 |
$(UMFPACKLIB): SuiteSparse/FF |
| 68 |
cd SuiteSparse/UMFPACK/Lib && $(MAKE) MAKEFLAGS= |
| 69 |
mkdir -p ../include ../lib |
| 70 |
cp -f SuiteSparse/UMFPACK/Include/*.h ../include |
| 71 |
cp -f SuiteSparse/SuiteSparse_config/SuiteSparse_config.h ../include |
| 72 |
cp SuiteSparse/UMFPACK/Lib/libumfpack.a ../lib/libumfpack.a |
| 73 |
$(RANLIB) ../lib/libumfpack.a |
| 74 |
|
| 75 |
$(AMDLIB): SuiteSparse/FF |
| 76 |
cd SuiteSparse/AMD/Lib && $(MAKE) MAKEFLAGS= |
| 77 |
mkdir -p ../include ../lib |
| 78 |
cp -f SuiteSparse/AMD/Include/*.h ../include |
| 79 |
cp SuiteSparse/AMD/Lib/libamd.a ../lib/libamd.a |
| 80 |
$(RANLIB) ../lib/libamd.a |
| 81 |
|
| 82 |
$(CAMDLIB): SuiteSparse/FF |
| 83 |
cd SuiteSparse/CAMD/Lib && $(MAKE) MAKEFLAGS= |
| 84 |
mkdir -p ../include ../lib |
| 85 |
cp -f SuiteSparse/CAMD/Include/*.h ../include |
| 86 |
cp SuiteSparse/CAMD/Lib/libcamd.a ../lib/libcamd.a |
| 87 |
$(RANLIB) ../lib/libcamd.a |
| 88 |
|
| 89 |
$(CHOLMODLIB): SuiteSparse/FF |
| 90 |
cd SuiteSparse/CHOLMOD/Lib && $(MAKE) MAKEFLAGS= |
| 91 |
mkdir -p ../include ../lib |
| 92 |
cp -f SuiteSparse/CHOLMOD/Include/*.h ../include |
| 93 |
cp SuiteSparse/CHOLMOD/Lib/libcholmod.a ../lib/libcholmod.a |
| 94 |
$(RANLIB) ../lib/libcholmod.a |
| 95 |
|
| 96 |
$(COLAMDLIB): SuiteSparse/FF |
| 97 |
cd SuiteSparse/COLAMD/Lib && $(MAKE) MAKEFLAGS= |
| 98 |
mkdir -p ../include ../lib |
| 99 |
cp -f SuiteSparse/COLAMD/Include/*.h ../include |
| 100 |
cp SuiteSparse/COLAMD/Lib/libcolamd.a ../lib/libcolamd.a |
| 101 |
$(RANLIB) ../lib/libcolamd.a |
| 102 |
|
| 103 |
UMFPACKv4.4: |
| 104 |
tar xzf UMFPACKv4.4.tar.gz |
| 105 |
|
| 106 |
# The 'lib' goal is replaced with 'libb' to avoid problems with the existing 'Lib' subdirectory on case-insensitive file |
| 107 |
# systems the lib depend of the Makefile to force the reconstruction if the parameter change |
| 108 |
|
| 109 |
UMFPACKv4.4/AMD/Makefile2 UMFPACKv4.4/UMFPACK/Makefile2: UMFPACKv4.4 |
| 110 |
sed 's/lib:/libb:/' < UMFPACKv4.4/UMFPACK/`basename $@ 2` >$@ |
| 111 |
|
| 112 |
SuiteSparse/DATE:$(SUITESPARSE_TGZ) |
| 113 |
tar zxf $(SUITESPARSE_TGZ) |
| 114 |
touch SuiteSparse/DATE |
| 115 |
|
| 116 |
SuiteSparse/FF:SuiteSparse/DATE SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk |
| 117 |
touch SuiteSparse/FF |
| 118 |
|
| 119 |
SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk:SuiteSparse/DATE Makefile SuiteSparse_config.mk.in |
| 120 |
../../config.status --file="SuiteSparse_config.mk:SuiteSparse_config.mk.in" |
| 121 |
-if diff SuiteSparse_config.mk SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk 2>&1 >/dev/null; then \ |
| 122 |
echo " same flags => no recompilation ! " ; \ |
| 123 |
else \ |
| 124 |
echo " recompile umfpack (some flags change) => clean umfpack colmod amd " ;\ |
| 125 |
mkdir -p SuiteSparse/SuiteSparse_config ;\ |
| 126 |
cp SuiteSparse_config.mk SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk ; \ |
| 127 |
(cd SuiteSparse/UMFPACK && make clean); \ |
| 128 |
(cd SuiteSparse/CHOLMOD && make clean); \ |
| 129 |
(cd SuiteSparse/COLAMD && make clean); \ |
| 130 |
(cd SuiteSparse/CAMD && make clean); \ |
| 131 |
(cd SuiteSparse/CAMD && make clean); \ |
| 132 |
(cd SuiteSparse/AMD && make clean); \ |
| 133 |
find . -name '*.exe'|xargs rm; \ |
| 134 |
fi; |
| 135 |
touch SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk |
| 136 |
|
| 137 |
UMFPACK_Make.m4: Makefile UMFPACKv4.4 |
| 138 |
m4 -DFF_CC="$(CC)" \ |
| 139 |
-DFF_CFLAGS="@CPPFLAGS@ @CFLAGS@ @BLASINC@" \ |
| 140 |
-DFF_LIB="@BLASLIB@ @LIBS@" \ |
| 141 |
-DFF_CONFIG="@FF_UMFPACK_CONFIG@" \ |
| 142 |
UMFPACK_Make.m4 >Make.include |
| 143 |
-if diff Make.include UMFPACKv4.4/UMFPACK/Make/Make.include 2>&1 >/dev/null; then \ |
| 144 |
echo " same flags => no recompilation ! " ; \ |
| 145 |
else \ |
| 146 |
echo " recompile umfpack (some flags change) => clean umfpack" ;\ |
| 147 |
cp Make.include UMFPACKv4.4/UMFPACK/Make/Make.include; \ |
| 148 |
cd UMFPACKv4.4/UMFPACK && make clean; \ |
| 149 |
find . -name '*.exe'|xargs rm; \ |
| 150 |
fi; |
| 151 |
UMFPACKv4.4.tar.gz: |
| 152 |
@WGET@ -N http://www.cise.ufl.edu/research/sparse/umfpack/v4.4/UMFPACKv4.4.tar.gz |
| 153 |
$(SUITESPARSE_TGZ): |
| 154 |
../getall -o SuiteSparse -a |
| 155 |
|
| 156 |
clean-local: |
| 157 |
-rm $(AMDLIB) $(CAMDLIB) $(CHOLMODLIB) $(COLAMDLIB) $(SUITESPARSECONFIGLIB) |
| 158 |
-rm ../include/amd*.h |
| 159 |
-rm ../include/umfpack*.h |
| 160 |
-rm ../include/colmod*.h |
| 161 |
-rm ../include/camd*.h |
| 162 |
-rm ../include/amd*.h |
| 163 |
-rm ../include/SuiteSparse_config.h |
| 164 |
-rm -rf UMFPACKv4.?.tar.gz UMFPACKv4.? |
| 165 |
-rm SuiteSparse*gz |
| 166 |
-rm -rf SuiteSparse |
| 167 |
# -rm ../pkg/SuiteSparse-* |
| 168 |
-rm SuiteSparse_config.mk |
| 169 |
|
| 170 |
# Local Variables: |
| 171 |
# mode:makefile |
| 172 |
# ispell-local-dictionary:"british" |
| 173 |
# coding:utf-8 |
| 174 |
# End: |