summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/flex/package.py1
-rw-r--r--var/spack/repos/builtin/packages/python/package.py42
-rw-r--r--var/spack/repos/builtin/packages/suite-sparse/package.py29
-rw-r--r--var/spack/repos/builtin/packages/suite-sparse/tbb_453.patch13
-rw-r--r--var/spack/repos/builtin/packages/tcl/package.py16
-rw-r--r--var/spack/repos/builtin/packages/tk/package.py19
6 files changed, 92 insertions, 28 deletions
diff --git a/var/spack/repos/builtin/packages/flex/package.py b/var/spack/repos/builtin/packages/flex/package.py
index 800e4b9d96..9b173bb0dd 100644
--- a/var/spack/repos/builtin/packages/flex/package.py
+++ b/var/spack/repos/builtin/packages/flex/package.py
@@ -35,6 +35,7 @@ class Flex(Package):
version('2.5.39', 'e133e9ead8ec0a58d81166b461244fde')
depends_on("bison", type='build')
+ depends_on("m4", type='build')
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
index 516b5c6cfe..bbb1e9c13a 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -53,6 +53,7 @@ class Python(Package):
extendable = True
+ variant('tk', default=False, description='Provide support for Tkinter')
variant('ucs4', default=False, description='Enable UCS4 (wide) unicode strings')
# From https://docs.python.org/2/c-api/unicode.html: Python's default
# builds use a 16-bit type for Py_UNICODE and store Unicode values
@@ -68,6 +69,8 @@ class Python(Package):
depends_on("ncurses")
depends_on("sqlite")
depends_on("zlib")
+ depends_on("tk", when="+tk")
+ depends_on("tcl", when="+tk")
def install(self, spec, prefix):
# Need this to allow python build to find the Python installation.
@@ -77,24 +80,32 @@ class Python(Package):
# Rest of install is pretty standard except setup.py needs to
# be able to read the CPPFLAGS and LDFLAGS as it scans for the
# library and headers to build
- cppflags = ' -I'.join([
+ include_dirs = [
spec['openssl'].prefix.include, spec['bzip2'].prefix.include,
spec['readline'].prefix.include, spec['ncurses'].prefix.include,
spec['sqlite'].prefix.include, spec['zlib'].prefix.include
- ])
+ ]
- ldflags = ' -L'.join([
+ library_dirs = [
spec['openssl'].prefix.lib, spec['bzip2'].prefix.lib,
spec['readline'].prefix.lib, spec['ncurses'].prefix.lib,
spec['sqlite'].prefix.lib, spec['zlib'].prefix.lib
- ])
+ ]
+
+ if '+tk' in spec:
+ include_dirs.extend([
+ spec['tk'].prefix.include, spec['tcl'].prefix.include
+ ])
+ library_dirs.extend([
+ spec['tk'].prefix.lib, spec['tcl'].prefix.lib
+ ])
config_args = [
"--prefix={0}".format(prefix),
"--with-threads",
"--enable-shared",
- "CPPFLAGS=-I{0}".format(cppflags),
- "LDFLAGS=-L{0}".format(ldflags)
+ "CPPFLAGS=-I{0}".format(" -I".join(include_dirs)),
+ "LDFLAGS=-L{0}".format(" -L".join(library_dirs))
]
if '+ucs4' in spec:
@@ -116,6 +127,25 @@ class Python(Package):
self.filter_compilers(spec, prefix)
+ # TODO: Once better testing support is integrated, add the following tests
+ # https://wiki.python.org/moin/TkInter
+ #
+ # if '+tk' in spec:
+ # env['TK_LIBRARY'] = join_path(spec['tk'].prefix.lib,
+ # 'tk{0}'.format(spec['tk'].version.up_to(2)))
+ # env['TCL_LIBRARY'] = join_path(spec['tcl'].prefix.lib,
+ # 'tcl{0}'.format(spec['tcl'].version.up_to(2)))
+ #
+ # $ python
+ # >>> import _tkinter
+ #
+ # if spec.satisfies('@3:')
+ # >>> import tkinter
+ # >>> tkinter._test()
+ # else:
+ # >>> import Tkinter
+ # >>> Tkinter._test()
+
def filter_compilers(self, spec, prefix):
"""Run after install to tell the configuration files and Makefiles
to use the compilers that Spack built the package with.
diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py
index 2cc89b843f..a71bfd8bd4 100644
--- a/var/spack/repos/builtin/packages/suite-sparse/package.py
+++ b/var/spack/repos/builtin/packages/suite-sparse/package.py
@@ -32,21 +32,20 @@ class SuiteSparse(Package):
homepage = 'http://faculty.cse.tamu.edu/davis/suitesparse.html'
url = 'http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.1.tar.gz'
- version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319')
version('4.5.3', '8ec57324585df3c6483ad7f556afccbd')
+ version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319')
- # FIXME: (see below)
- # variant('tbb', default=True, description='Build with Intel TBB')
+ variant('tbb', default=True, description='Build with Intel TBB')
depends_on('blas')
depends_on('lapack')
depends_on('metis@5.1.0', when='@4.5.1:')
- # FIXME:
# in @4.5.1. TBB support in SPQR seems to be broken as TBB-related linkng
# flags does not seem to be used, which leads to linking errors on Linux.
- # Try re-enabling in future versions.
- # depends_on('tbb', when='+tbb')
+ depends_on('tbb', when='@4.5.3:+tbb')
+
+ patch('tbb_453.patch', when='@4.5.3')
def install(self, spec, prefix):
# The build system of SuiteSparse is quite old-fashioned.
@@ -73,20 +72,24 @@ class SuiteSparse(Package):
])
# Intel TBB in SuiteSparseQR
- if '+tbb' in spec:
+ if 'tbb' in spec:
make_args.extend([
'SPQR_CONFIG=-DHAVE_TBB',
'TBB=-L%s -ltbb' % spec['tbb'].prefix.lib,
])
- # BLAS arguments require path to libraries
- # FIXME: (blas/lapack always provide libblas and liblapack as aliases)
+ # Make sure Spack's Blas/Lapack is used. Otherwise System's
+ # Blas/Lapack might be picked up.
+ blas = to_link_flags(spec['blas'].blas_shared_lib)
+ lapack = to_link_flags(spec['lapack'].lapack_shared_lib)
if '@4.5.1' in spec:
# adding -lstdc++ is clearly an ugly way to do this, but it follows
# with the TCOV path of SparseSuite 4.5.1's Suitesparse_config.mk
- make_args.extend([
- 'BLAS=-lblas -lstdc++',
- 'LAPACK=-llapack'
- ])
+ blas += ' -lstdc++'
+
+ make_args.extend([
+ 'BLAS=%s' % blas,
+ 'LAPACK=%s' % lapack
+ ])
make('install', *make_args)
diff --git a/var/spack/repos/builtin/packages/suite-sparse/tbb_453.patch b/var/spack/repos/builtin/packages/suite-sparse/tbb_453.patch
new file mode 100644
index 0000000000..70241ed017
--- /dev/null
+++ b/var/spack/repos/builtin/packages/suite-sparse/tbb_453.patch
@@ -0,0 +1,13 @@
+diff --git a/SPQR/Lib/Makefile b/SPQR/Lib/Makefile
+index eaade58..d0de852 100644
+--- a/SPQR/Lib/Makefile
++++ b/SPQR/Lib/Makefile
+@@ -13,7 +13,7 @@ ccode: all
+ include ../../SuiteSparse_config/SuiteSparse_config.mk
+
+ # SPQR depends on CHOLMOD, AMD, COLAMD, LAPACK, the BLAS and SuiteSparse_config
+-LDLIBS += -lamd -lcolamd -lcholmod -lsuitesparseconfig $(LAPACK) $(BLAS)
++LDLIBS += -lamd -lcolamd -lcholmod -lsuitesparseconfig $(TBB) $(LAPACK) $(BLAS)
+
+ # compile and install in SuiteSparse/lib
+ library:
diff --git a/var/spack/repos/builtin/packages/tcl/package.py b/var/spack/repos/builtin/packages/tcl/package.py
index a4d8b515bb..ef922314d8 100644
--- a/var/spack/repos/builtin/packages/tcl/package.py
+++ b/var/spack/repos/builtin/packages/tcl/package.py
@@ -24,6 +24,7 @@
##############################################################################
from spack import *
+
class Tcl(Package):
"""Tcl (Tool Command Language) is a very powerful but easy to
learn dynamic programming language, suitable for a very wide
@@ -34,9 +35,6 @@ class Tcl(Package):
extensible."""
homepage = "http://www.tcl.tk"
- def url_for_version(self, version):
- return 'http://prdownloads.sourceforge.net/tcl/tcl%s-src.tar.gz' % version
-
version('8.6.5', '0e6426a4ca9401825fbc6ecf3d89a326')
version('8.6.4', 'd7cbb91f1ded1919370a30edd1534304')
version('8.6.3', 'db382feca91754b7f93da16dc4cdad1f')
@@ -44,8 +42,18 @@ class Tcl(Package):
depends_on('zlib')
+ def url_for_version(self, version):
+ base_url = 'http://prdownloads.sourceforge.net/tcl'
+ return '{0}/tcl{1}-src.tar.gz'.format(base_url, version)
+
+ def setup_environment(self, spack_env, env):
+ # When using Tkinter from within spack provided python+tk, python
+ # will not be able to find Tcl/Tk unless TCL_LIBRARY is set.
+ env.set('TCL_LIBRARY', join_path(self.prefix.lib, 'tcl{0}'.format(
+ self.spec.version.up_to(2))))
+
def install(self, spec, prefix):
with working_dir('unix'):
- configure("--prefix=%s" % prefix)
+ configure("--prefix={0}".format(prefix))
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/tk/package.py b/var/spack/repos/builtin/packages/tk/package.py
index 330e1c77f5..894d3af6cc 100644
--- a/var/spack/repos/builtin/packages/tk/package.py
+++ b/var/spack/repos/builtin/packages/tk/package.py
@@ -24,6 +24,7 @@
##############################################################################
from spack import *
+
class Tk(Package):
"""Tk is a graphical user interface toolkit that takes developing
desktop applications to a higher level than conventional
@@ -33,16 +34,24 @@ class Tk(Package):
and more."""
homepage = "http://www.tcl.tk"
- def url_for_version(self, version):
- return "http://prdownloads.sourceforge.net/tcl/tk%s-src.tar.gz" % version
-
+ version('8.6.5', '11dbbd425c3e0201f20d6a51482ce6c4')
version('8.6.3', '85ca4dbf4dcc19777fd456f6ee5d0221')
depends_on("tcl")
+ def url_for_version(self, version):
+ base_url = "http://prdownloads.sourceforge.net/tcl"
+ return "{0}/tk{1}-src.tar.gz".format(base_url, version)
+
+ def setup_environment(self, spack_env, env):
+ # When using Tkinter from within spack provided python+tk, python
+ # will not be able to find Tcl/Tk unless TK_LIBRARY is set.
+ env.set('TK_LIBRARY', join_path(self.prefix.lib, 'tk{0}'.format(
+ self.spec.version.up_to(2))))
+
def install(self, spec, prefix):
with working_dir('unix'):
- configure("--prefix=%s" % prefix,
- "--with-tcl=%s" % spec['tcl'].prefix.lib)
+ configure("--prefix={0}".format(prefix),
+ "--with-tcl={0}".format(spec['tcl'].prefix.lib))
make()
make("install")