From c8405b4b5f788ee968a0a7eb0ef0bfaaaf6b15cc Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Wed, 4 Jan 2017 13:55:08 -0700 Subject: Renaming mkl to intel-mkl --- .../repos/builtin/packages/intel-mkl/package.py | 98 ++++++++++++++++++++++ var/spack/repos/builtin/packages/mkl/package.py | 98 ---------------------- 2 files changed, 98 insertions(+), 98 deletions(-) create mode 100644 var/spack/repos/builtin/packages/intel-mkl/package.py delete mode 100644 var/spack/repos/builtin/packages/mkl/package.py diff --git a/var/spack/repos/builtin/packages/intel-mkl/package.py b/var/spack/repos/builtin/packages/intel-mkl/package.py new file mode 100644 index 0000000000..451ee1427e --- /dev/null +++ b/var/spack/repos/builtin/packages/intel-mkl/package.py @@ -0,0 +1,98 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# 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 +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# 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 +# conditions of the GNU Lesser General Public License for more details. +# +# 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 +############################################################################## +from spack import * +import os + +from spack.pkg.builtin.intel import IntelInstaller + + +class IntelMkl(IntelInstaller): + """Intel Math Kernel Library. + + Note: You will have to add the download file to a + mirror so that Spack can find it. For instructions on how to set up a + mirror, see http://spack.readthedocs.io/en/latest/mirrors.html. + + To set the threading layer at run time set MKL_THREADING_LAYER + variable to one of the following values: INTEL (default), SEQUENTIAL, PGI. + To set interface layer at run time, use set the MKL_INTERFACE_LAYER + variable to LP64 (default) or ILP64. + """ + + homepage = "https://software.intel.com/en-us/intel-mkl" + + version('11.3.2.181', '536dbd82896d6facc16de8f961d17d65', + url="file://%s/l_mkl_11.3.2.181.tgz" % os.getcwd()) + version('11.3.3.210', 'f72546df27f5ebb0941b5d21fd804e34', + url="file://%s/l_mkl_11.3.3.210.tgz" % os.getcwd()) + + variant('shared', default=True, description='Builds shared library') + variant('ilp64', default=False, description='64 bit integers') + variant('openmp', default=False, description='OpenMP multithreading layer') + + # virtual dependency + provides('blas') + provides('lapack') + # TODO: MKL also provides implementation of Scalapack. + + @property + def blas_libs(self): + shared = True if '+shared' in self.spec else False + suffix = dso_suffix if '+shared' in self.spec else 'a' + mkl_integer = ['libmkl_intel_ilp64'] if '+ilp64' in self.spec else ['libmkl_intel_lp64'] # NOQA: ignore=E501 + mkl_threading = ['libmkl_sequential'] + if '+openmp' in self.spec: + mkl_threading = ['libmkl_intel_thread', 'libiomp5'] if '%intel' in self.spec else ['libmkl_gnu_thread'] # NOQA: ignore=E501 + # TODO: TBB threading: ['libmkl_tbb_thread', 'libtbb', 'libstdc++'] + mkl_libs = find_libraries( + mkl_integer + ['libmkl_core'] + mkl_threading, + root=join_path(self.prefix.lib, 'intel64'), + shared=shared + ) + system_libs = [ + 'libpthread.{0}'.format(suffix), + 'libm.{0}'.format(suffix), + 'libdl.{0}'.format(suffix) + ] + return mkl_libs + system_libs + + @property + def lapack_libs(self): + return self.blas_libs + + def install(self, spec, prefix): + self.intel_prefix = os.path.join(prefix, "pkg") + IntelInstaller.install(self, spec, prefix) + + mkl_dir = os.path.join(self.intel_prefix, "mkl") + for f in os.listdir(mkl_dir): + os.symlink(os.path.join(mkl_dir, f), os.path.join(self.prefix, f)) + + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + # set up MKLROOT for everyone using MKL package + spack_env.set('MKLROOT', self.prefix) + + def setup_environment(self, spack_env, env): + env.set('MKLROOT', self.prefix) diff --git a/var/spack/repos/builtin/packages/mkl/package.py b/var/spack/repos/builtin/packages/mkl/package.py deleted file mode 100644 index db133eefcb..0000000000 --- a/var/spack/repos/builtin/packages/mkl/package.py +++ /dev/null @@ -1,98 +0,0 @@ -############################################################################## -# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# 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 -# it under the terms of the GNU Lesser General Public License (as -# published by the Free Software Foundation) version 2.1, February 1999. -# -# 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 -# conditions of the GNU Lesser General Public License for more details. -# -# 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 -############################################################################## -from spack import * -import os - -from spack.pkg.builtin.intel import IntelInstaller - - -class Mkl(IntelInstaller): - """Intel Math Kernel Library. - - Note: You will have to add the download file to a - mirror so that Spack can find it. For instructions on how to set up a - mirror, see http://spack.readthedocs.io/en/latest/mirrors.html. - - To set the threading layer at run time set MKL_THREADING_LAYER - variable to one of the following values: INTEL (default), SEQUENTIAL, PGI. - To set interface layer at run time, use set the MKL_INTERFACE_LAYER - variable to LP64 (default) or ILP64. - """ - - homepage = "https://software.intel.com/en-us/intel-mkl" - - version('11.3.2.181', '536dbd82896d6facc16de8f961d17d65', - url="file://%s/l_mkl_11.3.2.181.tgz" % os.getcwd()) - version('11.3.3.210', 'f72546df27f5ebb0941b5d21fd804e34', - url="file://%s/l_mkl_11.3.3.210.tgz" % os.getcwd()) - - variant('shared', default=True, description='Builds shared library') - variant('ilp64', default=False, description='64 bit integers') - variant('openmp', default=False, description='OpenMP multithreading layer') - - # virtual dependency - provides('blas') - provides('lapack') - # TODO: MKL also provides implementation of Scalapack. - - @property - def blas_libs(self): - shared = True if '+shared' in self.spec else False - suffix = dso_suffix if '+shared' in self.spec else 'a' - mkl_integer = ['libmkl_intel_ilp64'] if '+ilp64' in self.spec else ['libmkl_intel_lp64'] # NOQA: ignore=E501 - mkl_threading = ['libmkl_sequential'] - if '+openmp' in self.spec: - mkl_threading = ['libmkl_intel_thread', 'libiomp5'] if '%intel' in self.spec else ['libmkl_gnu_thread'] # NOQA: ignore=E501 - # TODO: TBB threading: ['libmkl_tbb_thread', 'libtbb', 'libstdc++'] - mkl_libs = find_libraries( - mkl_integer + ['libmkl_core'] + mkl_threading, - root=join_path(self.prefix.lib, 'intel64'), - shared=shared - ) - system_libs = [ - 'libpthread.{0}'.format(suffix), - 'libm.{0}'.format(suffix), - 'libdl.{0}'.format(suffix) - ] - return mkl_libs + system_libs - - @property - def lapack_libs(self): - return self.blas_libs - - def install(self, spec, prefix): - self.intel_prefix = os.path.join(prefix, "pkg") - IntelInstaller.install(self, spec, prefix) - - mkl_dir = os.path.join(self.intel_prefix, "mkl") - for f in os.listdir(mkl_dir): - os.symlink(os.path.join(mkl_dir, f), os.path.join(self.prefix, f)) - - def setup_dependent_environment(self, spack_env, run_env, dependent_spec): - # set up MKLROOT for everyone using MKL package - spack_env.set('MKLROOT', self.prefix) - - def setup_environment(self, spack_env, env): - env.set('MKLROOT', self.prefix) -- cgit v1.2.3-60-g2f50 From 01406251c9ab2be6b6dba6e789ab4445c4ade349 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Wed, 4 Jan 2017 14:02:23 -0700 Subject: Intel-mkl provides mkl --- var/spack/repos/builtin/packages/intel-mkl/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/intel-mkl/package.py b/var/spack/repos/builtin/packages/intel-mkl/package.py index 451ee1427e..f369e10d38 100644 --- a/var/spack/repos/builtin/packages/intel-mkl/package.py +++ b/var/spack/repos/builtin/packages/intel-mkl/package.py @@ -55,6 +55,7 @@ class IntelMkl(IntelInstaller): # virtual dependency provides('blas') provides('lapack') + provides('mkl') # TODO: MKL also provides implementation of Scalapack. @property -- cgit v1.2.3-60-g2f50