pkgbuild_suitesparse 1.7 KB
Newer Older
Antonio Cervone's avatar
Antonio Cervone committed
1
2
3
4
5
6
7
8
9
#! /bin/bash
#
# author: Alessio Fumagalli <alessio.fumagalli@mail.polimi.it>
# date:   27-03-2012
#

ver='3.4.0'

download_suitesparse() {
10
  wget -c "http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-${ver}.tar.gz"
Antonio Cervone's avatar
Antonio Cervone committed
11
12
13
}

unpack_suitesparse() {
14
  tar xzf SuiteSparse-${ver}.tar.gz
Antonio Cervone's avatar
Antonio Cervone committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
}

build_suitesparse() {
  # Configure and make
  cd ${src_dir}/SuiteSparse
  sed -e 's/(METIS_PATH)\/Lib/(METIS_PATH)/g' -i CHOLMOD/Lib/Makefile
  sed -e 's/(METIS_PATH)\/Lib/(METIS_PATH)/g' -i CHOLMOD/Tcov/Makefile
  _blas="-lblas"
  if [ "${blas_name}" != "" ]; then
    _blas="${blas_lib}/${blas_name}"
  fi

  _lapack="-llapack"
  if [ "${lapack_name}" != "" ]; then
    _lapack="${lapack_lib}/${lapack_name}"
  fi

  # Configure
  cat > UFconfig/UFconfig.mk <<EOF
CPLUSPLUS = ${mpi_bin}/mpicxx
RANLIB = ranlib
AR = ar cr
RM = rm -f
MV = mv -f
LIB = -lm
MEX =
MAKE = make
BLAS = $_blas
LAPACK = $_lapack
METIS_PATH = ${parmetis_include}/metis
METIS = -L${parmetis_lib} -lmetis
UMFPACK_CONFIG =
CHOLMOD_CONFIG =
SPQR_CONFIG =
TBB =
RTLIB =
CC = ${mpi_bin}/mpicc
F77 = ${mpi_bin}/mpif90
F77FLAGS = $FFLAGS -m64 -fPIC
CFLAGS = $CFLAGS -fexceptions -m64 -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.tcov *.gcov gmon.out *.bak *.d *.gcda *.gcno
XERBLA =
EOF

59
  make clean || true
60
  make library
Antonio Cervone's avatar
Antonio Cervone committed
61
62
63
64
}

install_suitesparse() {
  # Installing
65
  install -m 775 -d ${install_dir}/{lib,include}
Antonio Cervone's avatar
Antonio Cervone committed
66
  install -m 664 {CAMD,COLAMD,LDL,CHOLMOD,SPQR,CXSparse,KLU,BTF,UMFPACK,CCOLAMD,AMD}/Include/*.h \
67
    "${install_dir}/include";
Antonio Cervone's avatar
Antonio Cervone committed
68
  install -m 664 {CAMD,COLAMD,LDL,CHOLMOD,SPQR,CXSparse,KLU,BTF,UMFPACK,CCOLAMD,AMD}/Lib/*.a \
69
70
    "${install_dir}/lib";
  install -m 664 UFconfig/UFconfig.h ${install_dir}/include;
Antonio Cervone's avatar
Antonio Cervone committed
71
72
}