Partial commit of more packages.
This commit is contained in:
parent
8738a3a88c
commit
c55041e9d4
10 changed files with 210 additions and 36 deletions
18
README.md
18
README.md
|
@ -35,4 +35,20 @@ for Spack is also available.
|
||||||
Authors
|
Authors
|
||||||
----------------
|
----------------
|
||||||
Spack was written by Todd Gamblin, tgamblin@llnl.gov.
|
Spack was written by Todd Gamblin, tgamblin@llnl.gov.
|
||||||
LLNL-CODE-647188
|
|
||||||
|
Significant contributions were also made by the following awesome
|
||||||
|
people:
|
||||||
|
|
||||||
|
* David Beckingsale
|
||||||
|
* David Boehme
|
||||||
|
* Luc Jaulmes
|
||||||
|
* Matt Legendre
|
||||||
|
* Greg Lee
|
||||||
|
* Adam Moody
|
||||||
|
|
||||||
|
Release
|
||||||
|
----------------
|
||||||
|
Spack is released under an LGPL license. For more details see the
|
||||||
|
LICENSE file.
|
||||||
|
|
||||||
|
``LLNL-CODE-647188``
|
||||||
|
|
|
@ -124,8 +124,19 @@ def expand_user(path):
|
||||||
return path.replace('%u', username)
|
return path.replace('%u', username)
|
||||||
|
|
||||||
|
|
||||||
|
def mkdirp(*paths):
|
||||||
|
for path in paths:
|
||||||
|
if not os.path.exists(path):
|
||||||
|
os.makedirs(path)
|
||||||
|
elif not os.path.isdir(path):
|
||||||
|
raise OSError(errno.EEXIST, "File alredy exists", path)
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def working_dir(dirname):
|
def working_dir(dirname, **kwargs):
|
||||||
|
if kwargs.get('create', False):
|
||||||
|
mkdirp(dirname)
|
||||||
|
|
||||||
orig_dir = os.getcwd()
|
orig_dir = os.getcwd()
|
||||||
os.chdir(dirname)
|
os.chdir(dirname)
|
||||||
yield
|
yield
|
||||||
|
@ -137,14 +148,6 @@ def touch(path):
|
||||||
os.utime(path, None)
|
os.utime(path, None)
|
||||||
|
|
||||||
|
|
||||||
def mkdirp(*paths):
|
|
||||||
for path in paths:
|
|
||||||
if not os.path.exists(path):
|
|
||||||
os.makedirs(path)
|
|
||||||
elif not os.path.isdir(path):
|
|
||||||
raise OSError(errno.EEXIST, "File alredy exists", path)
|
|
||||||
|
|
||||||
|
|
||||||
def join_path(prefix, *args):
|
def join_path(prefix, *args):
|
||||||
path = str(prefix)
|
path = str(prefix)
|
||||||
for elt in args:
|
for elt in args:
|
||||||
|
|
|
@ -153,6 +153,9 @@ def set_module_variables_for_package(pkg):
|
||||||
m.make = MakeExecutable('make', pkg.parallel)
|
m.make = MakeExecutable('make', pkg.parallel)
|
||||||
m.gmake = MakeExecutable('gmake', pkg.parallel)
|
m.gmake = MakeExecutable('gmake', pkg.parallel)
|
||||||
|
|
||||||
|
# easy shortcut to os.environ
|
||||||
|
m.env = os.environ
|
||||||
|
|
||||||
# number of jobs spack prefers to build with.
|
# number of jobs spack prefers to build with.
|
||||||
m.make_jobs = multiprocessing.cpu_count()
|
m.make_jobs = multiprocessing.cpu_count()
|
||||||
|
|
||||||
|
@ -168,7 +171,7 @@ def set_module_variables_for_package(pkg):
|
||||||
|
|
||||||
# standard CMake arguments
|
# standard CMake arguments
|
||||||
m.std_cmake_args = ['-DCMAKE_INSTALL_PREFIX=%s' % pkg.prefix,
|
m.std_cmake_args = ['-DCMAKE_INSTALL_PREFIX=%s' % pkg.prefix,
|
||||||
'-DCMAKE_BUILD_TYPE=None']
|
'-DCMAKE_BUILD_TYPE=RelWithDebInfo']
|
||||||
if platform.mac_ver()[0]:
|
if platform.mac_ver()[0]:
|
||||||
m.std_cmake_args.append('-DCMAKE_FIND_FRAMEWORK=LAST')
|
m.std_cmake_args.append('-DCMAKE_FIND_FRAMEWORK=LAST')
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,9 @@ def setup_parser(subparser):
|
||||||
subparser.add_argument(
|
subparser.add_argument(
|
||||||
'--keep-stage', action='store_true', dest='keep_stage',
|
'--keep-stage', action='store_true', dest='keep_stage',
|
||||||
help="Don't clean up staging area when command completes.")
|
help="Don't clean up staging area when command completes.")
|
||||||
|
subparser.add_argument(
|
||||||
|
'-n', '--name', dest='alternate_name', default=None,
|
||||||
|
help="Override the autodetected name for the created package.")
|
||||||
subparser.add_argument(
|
subparser.add_argument(
|
||||||
'-f', '--force', action='store_true', dest='force',
|
'-f', '--force', action='store_true', dest='force',
|
||||||
help="Overwrite any existing package file with the same name.")
|
help="Overwrite any existing package file with the same name.")
|
||||||
|
@ -121,30 +124,27 @@ def make_version_calls(ver_hash_tuples):
|
||||||
return '\n'.join(format % ("'%s'" % v, h) for v, h in ver_hash_tuples)
|
return '\n'.join(format % ("'%s'" % v, h) for v, h in ver_hash_tuples)
|
||||||
|
|
||||||
|
|
||||||
def get_name():
|
|
||||||
"""Prompt user to input a package name."""
|
|
||||||
name = ""
|
|
||||||
while not name:
|
|
||||||
new_name = raw_input("Name: ")
|
|
||||||
if spack.db.valid_name(name):
|
|
||||||
name = new_name
|
|
||||||
else:
|
|
||||||
print "Package name can only contain A-Z, a-z, 0-9, '_' and '-'"
|
|
||||||
return name
|
|
||||||
|
|
||||||
|
|
||||||
def create(parser, args):
|
def create(parser, args):
|
||||||
url = args.url
|
url = args.url
|
||||||
|
|
||||||
# Try to deduce name and version of the new package from the URL
|
# Try to deduce name and version of the new package from the URL
|
||||||
name, version = spack.url.parse_name_and_version(url)
|
name, version = spack.url.parse_name_and_version(url)
|
||||||
if not name:
|
|
||||||
tty.msg("Couldn't guess a name for this package.")
|
# Use a user-supplied name if one is present
|
||||||
name = get_name()
|
name = kwargs.get(args, 'alternate_name', False)
|
||||||
|
if args.name:
|
||||||
|
name = args.name
|
||||||
|
|
||||||
if not version:
|
if not version:
|
||||||
tty.die("Couldn't guess a version string from %s." % url)
|
tty.die("Couldn't guess a version string from %s." % url)
|
||||||
|
|
||||||
|
if not name:
|
||||||
|
tty.die("Couldn't guess a name for this package. Try running:", "",
|
||||||
|
"spack create --name <name> <url>")
|
||||||
|
|
||||||
|
if not spack.db.valid_name(name):
|
||||||
|
tty.die("Package name can only contain A-Z, a-z, 0-9, '_' and '-'")
|
||||||
|
|
||||||
tty.msg("This looks like a URL for %s version %s." % (name, version))
|
tty.msg("This looks like a URL for %s version %s." % (name, version))
|
||||||
tty.msg("Creating template for package %s" % name)
|
tty.msg("Creating template for package %s" % name)
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
from spack.util.compression import allowed_archive, extension
|
from spack.util.compression import allowed_archive, extension
|
||||||
|
|
||||||
"""Allowed URL schemes for spack packages."""
|
"""Allowed URL schemes for spack packages."""
|
||||||
_ALLOWED_URL_SCHEMES = ["http", "https", "ftp", "file"]
|
_ALLOWED_URL_SCHEMES = ["http", "https", "ftp", "file", "git"]
|
||||||
|
|
||||||
|
|
||||||
class Package(object):
|
class Package(object):
|
||||||
|
|
|
@ -121,7 +121,7 @@ def which(name, **kwargs):
|
||||||
|
|
||||||
for dir in path:
|
for dir in path:
|
||||||
exe = os.path.join(dir, name)
|
exe = os.path.join(dir, name)
|
||||||
if os.access(exe, os.X_OK):
|
if os.path.isfile(exe) and os.access(exe, os.X_OK):
|
||||||
return Executable(exe)
|
return Executable(exe)
|
||||||
|
|
||||||
if required:
|
if required:
|
||||||
|
|
47
var/spack/packages/clang/package.py
Normal file
47
var/spack/packages/clang/package.py
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
##############################################################################
|
||||||
|
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
|
||||||
|
# Produced at the Lawrence Livermore National Laboratory.
|
||||||
|
#
|
||||||
|
# This file is part of Spack.
|
||||||
|
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
|
||||||
|
# LLNL-CODE-647188
|
||||||
|
#
|
||||||
|
# For details, see https://scalability-llnl.github.io/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 General Public License (as published by
|
||||||
|
# the Free Software Foundation) version 2.1 dated 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 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 *
|
||||||
|
|
||||||
|
class Clang(Package):
|
||||||
|
"""The goal of the Clang project is to create a new C, C++,
|
||||||
|
Objective C and Objective C++ front-end for the LLVM compiler.
|
||||||
|
"""
|
||||||
|
homepage = "http://clang.llvm.org"
|
||||||
|
url = "http://llvm.org/releases/3.4.2/cfe-3.4.2.src.tar.gz"
|
||||||
|
|
||||||
|
depends_on("llvm")
|
||||||
|
|
||||||
|
version('3.4.2', '87945973b7c73038871c5f849a818588')
|
||||||
|
|
||||||
|
def install(self, spec, prefix):
|
||||||
|
env['CXXFLAGS'] = '-std=c++11'
|
||||||
|
|
||||||
|
with working_dir('spack-build', create=True):
|
||||||
|
cmake('..',
|
||||||
|
'-DCLANG_PATH_TO_LLVM_BUILD=%s' % spec['llvm'].prefix,
|
||||||
|
'-DLLVM_MAIN_SRC_DIR=%s' % spec['llvm'].prefix,
|
||||||
|
*std_cmake_args)
|
||||||
|
make()
|
||||||
|
make("install")
|
57
var/spack/packages/llvm-compiler-rt/package.py
Normal file
57
var/spack/packages/llvm-compiler-rt/package.py
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
##############################################################################
|
||||||
|
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
|
||||||
|
# Produced at the Lawrence Livermore National Laboratory.
|
||||||
|
#
|
||||||
|
# This file is part of Spack.
|
||||||
|
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
|
||||||
|
# LLNL-CODE-647188
|
||||||
|
#
|
||||||
|
# For details, see https://scalability-llnl.github.io/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 General Public License (as published by
|
||||||
|
# the Free Software Foundation) version 2.1 dated 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 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 *
|
||||||
|
|
||||||
|
class LlvmCompilerRt(Package):
|
||||||
|
"""Compiler-rt consists of several libraries to be used with LLVM:
|
||||||
|
basics:
|
||||||
|
A simple library that provides an implementation of the
|
||||||
|
low-level target-specific hooks required by code
|
||||||
|
generation and other runtime components.
|
||||||
|
|
||||||
|
sanitizer runtimes:
|
||||||
|
Runtime libraries that are required to run the code with
|
||||||
|
sanitizer instrumentation.
|
||||||
|
|
||||||
|
profiler:
|
||||||
|
Library used to collect coverage information.
|
||||||
|
|
||||||
|
BlocksRuntime:
|
||||||
|
A target-independent implementation of Apple "Blocks"
|
||||||
|
runtime interfaces.
|
||||||
|
"""
|
||||||
|
homepage = "http://compiler-rt.llvm.org"
|
||||||
|
url = "http://llvm.org/releases/3.4/compiler-rt-3.4.src.tar.gz"
|
||||||
|
|
||||||
|
depends_on("clang")
|
||||||
|
depends_on("llvm")
|
||||||
|
|
||||||
|
version('3.4', '7938353e3a3bda85733a165e7ac4bb84')
|
||||||
|
|
||||||
|
def install(self, spec, prefix):
|
||||||
|
cmake(".", *std_cmake_args)
|
||||||
|
|
||||||
|
make()
|
||||||
|
make("install")
|
46
var/spack/packages/llvm-lld/package.py
Normal file
46
var/spack/packages/llvm-lld/package.py
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
##############################################################################
|
||||||
|
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
|
||||||
|
# Produced at the Lawrence Livermore National Laboratory.
|
||||||
|
#
|
||||||
|
# This file is part of Spack.
|
||||||
|
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
|
||||||
|
# LLNL-CODE-647188
|
||||||
|
#
|
||||||
|
# For details, see https://scalability-llnl.github.io/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 General Public License (as published by
|
||||||
|
# the Free Software Foundation) version 2.1 dated 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 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 *
|
||||||
|
|
||||||
|
class LlvmLld(Package):
|
||||||
|
"""lld - The LLVM Linker
|
||||||
|
lld is a new set of modular code for creating linker tools."""
|
||||||
|
homepage = "http://lld.llvm.org"
|
||||||
|
url = "http://llvm.org/releases/3.4/lld-3.4.src.tar.gz"
|
||||||
|
|
||||||
|
depends_on('llvm')
|
||||||
|
|
||||||
|
version('3.4', '3b6a17e58c8416c869c14dd37682f78e')
|
||||||
|
|
||||||
|
def install(self, spec, prefix):
|
||||||
|
env['CXXFLAGS'] = '-std=c++11'
|
||||||
|
|
||||||
|
with working_dir('spack-build', create=True):
|
||||||
|
cmake('..',
|
||||||
|
'-DLLD_PATH_TO_LLVM_BUILD=%s' % spec['llvm'].prefix,
|
||||||
|
'-DLLVM_MAIN_SRC_DIR=%s' % spec['llvm'].prefix,
|
||||||
|
*std_cmake_args)
|
||||||
|
make('VERBOSE=1')
|
||||||
|
make("install")
|
|
@ -37,12 +37,14 @@ class Llvm(Package):
|
||||||
version('3.4.2', 'a20669f75967440de949ac3b1bad439c')
|
version('3.4.2', 'a20669f75967440de949ac3b1bad439c')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
configure("--prefix=%s" % prefix,
|
env['CXXFLAGS'] = '-std=c++11'
|
||||||
"--enable-optimized",
|
|
||||||
"--enable-debug-runtime",
|
|
||||||
"--enable-debug-symbols",
|
|
||||||
"--disable-assertions",
|
|
||||||
"REQUIRES_RTTI=1")
|
|
||||||
|
|
||||||
|
with working_dir('spack-build', create=True):
|
||||||
|
cmake('..',
|
||||||
|
'-DLLVM_REQUIRES_RTTI=1',
|
||||||
|
'-DPYTHON_EXECUTABLE=/usr/bin/python',
|
||||||
|
'-DPYTHON_INCLUDE_DIR=/usr/include/python2.6',
|
||||||
|
'-DPYTHON_LIBRARY=/usr/lib64/libpython2.6.so',
|
||||||
|
*std_cmake_args)
|
||||||
make()
|
make()
|
||||||
make("install")
|
make("install")
|
||||||
|
|
Loading…
Reference in a new issue