2016-01-20 00:26:26 +08:00
|
|
|
##############################################################################
|
2016-05-12 12:22:25 +08:00
|
|
|
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
|
2016-01-20 00:26:26 +08:00
|
|
|
# Produced at the Lawrence Livermore National Laboratory.
|
|
|
|
#
|
|
|
|
# This file is part of Spack.
|
2016-05-12 12:22:25 +08:00
|
|
|
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
|
2016-01-20 00:26:26 +08:00
|
|
|
# LLNL-CODE-647188
|
|
|
|
#
|
|
|
|
# For details, see https://github.com/llnl/spack
|
|
|
|
# Please also see the LICENSE file for our notice and the LGPL.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
2016-05-12 12:22:25 +08:00
|
|
|
# it under the terms of the GNU Lesser General Public License (as
|
|
|
|
# published by the Free Software Foundation) version 2.1, February 1999.
|
2016-01-20 00:26:26 +08:00
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful, but
|
|
|
|
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
|
2016-05-12 12:22:25 +08:00
|
|
|
# conditions of the GNU Lesser General Public License for more details.
|
2016-01-20 00:26:26 +08:00
|
|
|
#
|
2016-05-12 12:22:25 +08:00
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2016-01-20 00:26:26 +08:00
|
|
|
##############################################################################
|
|
|
|
from spack import *
|
|
|
|
|
|
|
|
|
|
|
|
class Eigen(Package):
|
2016-08-24 23:32:29 +08:00
|
|
|
"""Eigen is a C++ template library for linear algebra matrices,
|
2016-08-31 05:28:55 +08:00
|
|
|
vectors, numerical solvers, and related algorithms.
|
|
|
|
"""
|
2016-01-20 00:26:26 +08:00
|
|
|
|
|
|
|
homepage = 'http://eigen.tuxfamily.org/'
|
|
|
|
url = 'http://bitbucket.org/eigen/eigen/get/3.2.7.tar.bz2'
|
|
|
|
|
2016-08-10 16:50:00 +08:00
|
|
|
version('3.2.7', 'cc1bacbad97558b97da6b77c9644f184',
|
|
|
|
url='http://bitbucket.org/eigen/eigen/get/3.2.7.tar.bz2')
|
2016-01-20 00:26:26 +08:00
|
|
|
|
2016-08-10 16:50:00 +08:00
|
|
|
variant('debug', default=False,
|
|
|
|
description='Builds the library in debug mode')
|
2016-01-20 00:26:26 +08:00
|
|
|
|
|
|
|
variant('metis', default=True, description='Enables metis backend')
|
|
|
|
variant('scotch', default=True, description='Enables scotch backend')
|
|
|
|
variant('fftw', default=True, description='Enables FFTW backend')
|
2016-08-10 16:50:00 +08:00
|
|
|
variant('suitesparse', default=True,
|
|
|
|
description='Enables SuiteSparse support')
|
|
|
|
variant('mpfr', default=True,
|
|
|
|
description='Enables support for multi-precisions FP via mpfr')
|
2016-01-20 00:26:26 +08:00
|
|
|
|
2016-02-04 23:27:26 +08:00
|
|
|
# TODO : dependency on googlehash, superlu, adolc missing
|
2016-03-09 23:46:56 +08:00
|
|
|
depends_on('cmake', type='build')
|
2016-04-06 10:00:28 +08:00
|
|
|
depends_on('metis@5:', when='+metis')
|
2016-01-20 00:26:26 +08:00
|
|
|
depends_on('scotch', when='+scotch')
|
|
|
|
depends_on('fftw', when='+fftw')
|
2016-03-22 16:43:10 +08:00
|
|
|
depends_on('suite-sparse', when='+suitesparse')
|
2016-06-03 18:52:19 +08:00
|
|
|
depends_on('mpfr@2.3.0:', when="+mpfr")
|
2016-05-31 16:52:14 +08:00
|
|
|
depends_on('gmp', when="+mpfr")
|
2016-01-20 00:26:26 +08:00
|
|
|
|
|
|
|
def install(self, spec, prefix):
|
|
|
|
|
|
|
|
options = []
|
|
|
|
options.extend(std_cmake_args)
|
|
|
|
|
|
|
|
build_directory = join_path(self.stage.path, 'spack-build')
|
|
|
|
source_directory = self.stage.source_path
|
|
|
|
|
|
|
|
if '+debug' in spec:
|
|
|
|
options.append('-DCMAKE_BUILD_TYPE:STRING=Debug')
|
|
|
|
|
|
|
|
with working_dir(build_directory, create=True):
|
|
|
|
cmake(source_directory, *options)
|
|
|
|
make()
|
|
|
|
make("install")
|