summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rwxr-xr-xlib/spack/env/cc231
-rw-r--r--lib/spack/llnl/util/filesystem.py33
-rw-r--r--lib/spack/spack/cmd/pkg.py3
-rw-r--r--lib/spack/spack/cmd/stage.py5
-rw-r--r--lib/spack/spack/fetch_strategy.py10
-rw-r--r--lib/spack/spack/modules.py4
-rw-r--r--lib/spack/spack/package.py9
-rw-r--r--lib/spack/spack/stage.py7
-rw-r--r--lib/spack/spack/test/cc.py127
-rw-r--r--var/spack/repos/builtin/packages/apr-util/package.py44
-rw-r--r--var/spack/repos/builtin/packages/apr/package.py38
-rw-r--r--var/spack/repos/builtin/packages/arpack-ng/package.py7
-rw-r--r--var/spack/repos/builtin/packages/astyle/package.py17
-rw-r--r--var/spack/repos/builtin/packages/boost/package.py63
-rw-r--r--var/spack/repos/builtin/packages/cmake/package.py1
-rw-r--r--var/spack/repos/builtin/packages/cuda/package.py47
-rw-r--r--var/spack/repos/builtin/packages/dbus/package.py1
-rw-r--r--var/spack/repos/builtin/packages/dealii/package.py238
-rw-r--r--var/spack/repos/builtin/packages/doxygen/package.py5
-rw-r--r--var/spack/repos/builtin/packages/espresso/package.py17
-rw-r--r--var/spack/repos/builtin/packages/gcc/darwin/gcc-4.9.patch142
-rw-r--r--var/spack/repos/builtin/packages/gcc/darwin/gcc-4.9.patch228
-rw-r--r--var/spack/repos/builtin/packages/gcc/package.py61
-rw-r--r--var/spack/repos/builtin/packages/gdal/package.py69
-rw-r--r--var/spack/repos/builtin/packages/geos/package.py24
-rw-r--r--var/spack/repos/builtin/packages/googletest/package.py24
-rw-r--r--var/spack/repos/builtin/packages/graphviz/package.py12
-rw-r--r--var/spack/repos/builtin/packages/hoomd-blue/package.py73
-rw-r--r--var/spack/repos/builtin/packages/hypre/package.py8
-rw-r--r--var/spack/repos/builtin/packages/kealib/package.py35
-rw-r--r--var/spack/repos/builtin/packages/libdrm/package.py4
-rw-r--r--var/spack/repos/builtin/packages/libpng/package.py2
-rw-r--r--var/spack/repos/builtin/packages/metis/package.py6
-rw-r--r--var/spack/repos/builtin/packages/mpich/package.py3
-rw-r--r--var/spack/repos/builtin/packages/mumps/Makefile.inc5
-rw-r--r--var/spack/repos/builtin/packages/mumps/package.py60
-rw-r--r--var/spack/repos/builtin/packages/muparser/package.py2
-rw-r--r--var/spack/repos/builtin/packages/netcdf-cxx/package.py15
-rw-r--r--var/spack/repos/builtin/packages/netlib-scalapack/package.py5
-rw-r--r--var/spack/repos/builtin/packages/ninja/package.py6
-rw-r--r--var/spack/repos/builtin/packages/numdiff/package.py44
-rw-r--r--var/spack/repos/builtin/packages/oce/null.patch482
-rw-r--r--var/spack/repos/builtin/packages/oce/package.py28
-rw-r--r--var/spack/repos/builtin/packages/openjpeg/package.py26
-rw-r--r--var/spack/repos/builtin/packages/parmetis/package.py6
-rw-r--r--var/spack/repos/builtin/packages/petsc/package.py65
-rw-r--r--var/spack/repos/builtin/packages/py-bottleneck/package.py14
-rw-r--r--var/spack/repos/builtin/packages/py-cython/package.py8
-rw-r--r--var/spack/repos/builtin/packages/py-dateutil/package.py1
-rw-r--r--var/spack/repos/builtin/packages/py-libxml2/package.py15
-rw-r--r--var/spack/repos/builtin/packages/py-matplotlib/package.py2
-rw-r--r--var/spack/repos/builtin/packages/py-netcdf/package.py16
-rw-r--r--var/spack/repos/builtin/packages/py-nose/package.py1
-rw-r--r--var/spack/repos/builtin/packages/py-numexpr/package.py3
-rw-r--r--var/spack/repos/builtin/packages/py-numpy/package.py1
-rw-r--r--var/spack/repos/builtin/packages/py-pandas/package.py11
-rw-r--r--var/spack/repos/builtin/packages/py-pytz/package.py1
-rw-r--r--var/spack/repos/builtin/packages/py-setuptools/package.py1
-rw-r--r--var/spack/repos/builtin/packages/py-six/package.py1
-rw-r--r--var/spack/repos/builtin/packages/py-tuiview/package.py19
-rw-r--r--var/spack/repos/builtin/packages/py-virtualenv/package.py1
-rw-r--r--var/spack/repos/builtin/packages/subversion/package.py77
-rw-r--r--var/spack/repos/builtin/packages/suite-sparse/package.py12
-rw-r--r--var/spack/repos/builtin/packages/superlu-dist/package.py11
-rw-r--r--var/spack/repos/builtin/packages/trilinos/package.py212
-rw-r--r--var/spack/repos/builtin/packages/trilinos/umfpack_from_suitesparse.patch12
-rw-r--r--var/spack/repos/builtin/packages/vtk/package.py18
68 files changed, 2141 insertions, 341 deletions
diff --git a/README.md b/README.md
index 8664953c0c..1977a4fee9 100644
--- a/README.md
+++ b/README.md
@@ -59,7 +59,8 @@ can join it here:
At the moment, contributing to Spack is relatively simple. Just send us
a [pull request](https://help.github.com/articles/using-pull-requests/).
-When you send your request, make ``develop`` the destination branch.
+When you send your request, make ``develop`` the destination branch on the
+[Spack repository](https://github.com/LLNL/spack).
Spack is using a rough approximation of the [Git
Flow](http://nvie.com/posts/a-successful-git-branching-model/)
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index 4a3e6eddc9..2eb6f46afe 100755
--- a/lib/spack/env/cc
+++ b/lib/spack/env/cc
@@ -65,7 +65,7 @@ function die {
}
for param in $parameters; do
- if [ -z "${!param}" ]; then
+ if [[ -z ${!param} ]]; then
die "Spack compiler must be run from spack! Input $param was missing!"
fi
done
@@ -78,12 +78,17 @@ done
# 'command' is set based on the input command to $SPACK_[CC|CXX|F77|F90]
#
# 'mode' is set to one of:
+# cpp preprocess
# cc compile
+# as assemble
# ld link
# ccld compile & link
-# cpp preprocessor
# vcheck version check
#
+# Depending on the mode, we may or may not add extra rpaths.
+# This variable controls whether they are added.
+add_rpaths=true
+
command=$(basename "$0")
case "$command" in
cc|c89|c99|gcc|clang|icc|pgcc|xlc)
@@ -107,13 +112,26 @@ case "$command" in
;;
ld)
mode=ld
+
+ # Darwin's linker has a -r argument that merges object files
+ # together. It doesn't work with -rpath.
+ if [[ $OSTYPE = darwin* ]]; then
+ for arg in "$@"; do
+ if [ "$arg" = -r ]; then
+ add_rpaths=false
+ break
+ fi
+ done
+ fi
;;
*)
die "Unkown compiler: $command"
;;
esac
-# If any of the arguments below is present then the mode is vcheck. In vcheck mode nothing is added in terms of extra search paths or libraries
+# If any of the arguments below is present then the mode is vcheck. In
+# vcheck mode nothing is added in terms of extra search paths or
+# libraries
if [ -z "$mode" ]; then
for arg in "$@"; do
if [ "$arg" = -v -o "$arg" = -V -o "$arg" = --version -o "$arg" = -dumpversion ]; then
@@ -124,13 +142,15 @@ if [ -z "$mode" ]; then
fi
# Finish setting up the mode.
-
if [ -z "$mode" ]; then
mode=ccld
for arg in "$@"; do
if [ "$arg" = -E ]; then
mode=cpp
break
+ elif [ "$arg" = -S ]; then
+ mode=as
+ break
elif [ "$arg" = -c ]; then
mode=cc
break
@@ -146,168 +166,56 @@ fi
# Check that at least one of the real commands was actually selected,
# otherwise we don't know what to execute.
-if [ -z "$command" ]; then
+if [[ -z $command ]]; then
die "ERROR: Compiler '$SPACK_COMPILER_SPEC' does not support compiling $language programs."
fi
-# Save original command for debug logging
-input_command="$@"
-
if [ "$mode" == vcheck ] ; then
exec ${command} "$@"
fi
-#
-# Now do real parsing of the command line args, trying hard to keep
-# non-rpath linker arguments in the proper order w.r.t. other command
-# line arguments. This is important for things like groups.
-#
-includes=()
-libraries=()
-libs=()
-rpaths=()
-other_args=()
-
-while [ -n "$1" ]; do
- case "$1" in
- -I*)
- arg="${1#-I}"
- if [ -z "$arg" ]; then shift; arg="$1"; fi
- includes+=("$arg")
- ;;
- -L*)
- arg="${1#-L}"
- if [ -z "$arg" ]; then shift; arg="$1"; fi
- libraries+=("$arg")
- ;;
- -l*)
- arg="${1#-l}"
- if [ -z "$arg" ]; then shift; arg="$1"; fi
- libs+=("$arg")
- ;;
- -Wl,*)
- arg="${1#-Wl,}"
- # TODO: Handle multiple -Wl, continuations of -Wl,-rpath
- if [[ $arg == -rpath=* ]]; then
- arg="${arg#-rpath=}"
- for rpath in ${arg//,/ }; do
- rpaths+=("$rpath")
- done
- elif [[ $arg == -rpath,* ]]; then
- arg="${arg#-rpath,}"
- for rpath in ${arg//,/ }; do
- rpaths+=("$rpath")
- done
- elif [[ $arg == -rpath ]]; then
- shift; arg="$1"
- if [[ $arg != '-Wl,'* ]]; then
- die "-Wl,-rpath was not followed by -Wl,*"
- fi
- arg="${arg#-Wl,}"
- for rpath in ${arg//,/ }; do
- rpaths+=("$rpath")
- done
- else
- other_args+=("-Wl,$arg")
- fi
- ;;
- -Xlinker)
- shift; arg="$1";
- if [[ $arg = -rpath=* ]]; then
- rpaths+=("${arg#-rpath=}")
- elif [[ $arg = -rpath ]]; then
- shift; arg="$1"
- if [[ $arg != -Xlinker ]]; then
- die "-Xlinker -rpath was not followed by -Xlinker <arg>"
- fi
- shift; arg="$1"
- rpaths+=("$arg")
- else
- other_args+=("-Xlinker")
- other_args+=("$arg")
- fi
- ;;
- *)
- other_args+=("$1")
- ;;
- esac
- shift
-done
-
-# Dump parsed values for unit testing if asked for
-if [ -n "$SPACK_TEST_COMMAND" ]; then
- IFS=$'\n'
- case "$SPACK_TEST_COMMAND" in
- dump-includes) echo "${includes[*]}";;
- dump-libraries) echo "${libraries[*]}";;
- dump-libs) echo "${libs[*]}";;
- dump-rpaths) echo "${rpaths[*]}";;
- dump-other-args) echo "${other_args[*]}";;
- dump-all)
- echo "INCLUDES:"
- echo "${includes[*]}"
- echo
- echo "LIBRARIES:"
- echo "${libraries[*]}"
- echo
- echo "LIBS:"
- echo "${libs[*]}"
- echo
- echo "RPATHS:"
- echo "${rpaths[*]}"
- echo
- echo "ARGS:"
- echo "${other_args[*]}"
- ;;
- *)
- echo "ERROR: Unknown test command"
- exit 1 ;;
- esac
- exit
-fi
+# Save original command for debug logging
+input_command="$@"
+args=("$@")
# Read spack dependencies from the path environment variable
IFS=':' read -ra deps <<< "$SPACK_DEPENDENCIES"
for dep in "${deps[@]}"; do
- if [ -d "$dep/include" ]; then
- includes+=("$dep/include")
+ # Prepend include directories
+ if [[ -d $dep/include ]]; then
+ if [[ $mode = cpp || $mode = cc || $mode = as || $mode = ccld ]]; then
+ args=("-I$dep/include" "${args[@]}")
+ fi
fi
- if [ -d "$dep/lib" ]; then
- libraries+=("$dep/lib")
- rpaths+=("$dep/lib")
+ # Prepend lib and RPATH directories
+ if [[ -d $dep/lib ]]; then
+ if [[ $mode = ccld ]]; then
+ $add_rpaths && args=("-Wl,-rpath,$dep/lib" "${args[@]}")
+ args=("-L$dep/lib" "${args[@]}")
+ elif [[ $mode = ld ]]; then
+ $add_rpaths && args=("-rpath" "$dep/lib" "${args[@]}")
+ args=("-L$dep/lib" "${args[@]}")
+ fi
fi
- if [ -d "$dep/lib64" ]; then
- libraries+=("$dep/lib64")
- rpaths+=("$dep/lib64")
+ # Prepend lib64 and RPATH directories
+ if [[ -d $dep/lib64 ]]; then
+ if [[ $mode = ccld ]]; then
+ $add_rpaths && args=("-Wl,-rpath,$dep/lib64" "${args[@]}")
+ args=("-L$dep/lib64" "${args[@]}")
+ elif [[ $mode = ld ]]; then
+ $add_rpaths && args=("-rpath" "$dep/lib64" "${args[@]}")
+ args=("-L$dep/lib64" "${args[@]}")
+ fi
fi
done
# Include all -L's and prefix/whatever dirs in rpath
-for dir in "${libraries[@]}"; do
- [[ dir = $SPACK_INSTALL* ]] && rpaths+=("$dir")
-done
-rpaths+=("$SPACK_PREFIX/lib")
-rpaths+=("$SPACK_PREFIX/lib64")
-
-# Put the arguments together
-args=()
-for dir in "${includes[@]}"; do args+=("-I$dir"); done
-args+=("${other_args[@]}")
-for dir in "${libraries[@]}"; do args+=("-L$dir"); done
-for lib in "${libs[@]}"; do args+=("-l$lib"); done
-
-if [ "$mode" = ccld ]; then
- for dir in "${rpaths[@]}"; do
- args+=("-Wl,-rpath")
- args+=("-Wl,$dir");
- done
-elif [ "$mode" = ld ]; then
- for dir in "${rpaths[@]}"; do
- args+=("-rpath")
- args+=("$dir");
- done
+if [[ $mode = ccld ]]; then
+ $add_rpaths && args=("-Wl,-rpath,$SPACK_PREFIX/lib" "-Wl,-rpath,$SPACK_PREFIX/lib64" "${args[@]}")
+elif [[ $mode = ld ]]; then
+ $add_rpaths && args=("-rpath" "$SPACK_PREFIX/lib" "-rpath" "$SPACK_PREFIX/lib64" "${args[@]}")
fi
#
@@ -323,34 +231,37 @@ unset DYLD_LIBRARY_PATH
#
IFS=':' read -ra env_path <<< "$PATH"
IFS=':' read -ra spack_env_dirs <<< "$SPACK_ENV_PATH"
-spack_env_dirs+=(".")
+spack_env_dirs+=("" ".")
PATH=""
for dir in "${env_path[@]}"; do
remove=""
for rm_dir in "${spack_env_dirs[@]}"; do
- if [ "$dir" = "$rm_dir" ]; then remove=True; fi
+ if [[ $dir = $rm_dir ]]; then remove=True; fi
done
- if [ -z "$remove" ]; then
- if [ -z "$PATH" ]; then
- PATH="$dir"
- else
- PATH="$PATH:$dir"
- fi
+ if [[ -z $remove ]]; then
+ PATH="${PATH:+$PATH:}$dir"
fi
done
export PATH
-full_command=("$command")
-full_command+=("${args[@]}")
+full_command=("$command" "${args[@]}")
+
+# In test command mode, write out full command for Spack tests.
+if [[ $SPACK_TEST_COMMAND = dump-args ]]; then
+ echo "${full_command[@]}"
+ exit
+elif [[ -n $SPACK_TEST_COMMAND ]]; then
+ die "ERROR: Unknown test command"
+fi
#
# Write the input and output commands to debug logs if it's asked for.
#
-if [ "$SPACK_DEBUG" = "TRUE" ]; then
+if [[ $SPACK_DEBUG = TRUE ]]; then
input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.in.log"
output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.out.log"
- echo "$input_command" >> $input_log
- echo "$mode ${full_command[@]}" >> $output_log
+ echo "[$mode] $command $input_command" >> $input_log
+ echo "[$mode] ${full_command[@]}" >> $output_log
fi
exec "${full_command[@]}"
diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py
index 92f9ca2983..70d46a7f77 100644
--- a/lib/spack/llnl/util/filesystem.py
+++ b/lib/spack/llnl/util/filesystem.py
@@ -27,9 +27,11 @@ __all__ = ['set_install_permissions', 'install', 'install_tree', 'traverse_tree'
'force_remove', 'join_path', 'ancestor', 'can_access', 'filter_file',
'FileFilter', 'change_sed_delimiter', 'is_exe', 'force_symlink',
'set_executable', 'copy_mode', 'unset_executable_mode',
- 'remove_dead_links', 'remove_linked_tree', 'find_library_path']
+ 'remove_dead_links', 'remove_linked_tree', 'find_library_path',
+ 'fix_darwin_install_name']
import os
+import glob
import sys
import re
import shutil
@@ -38,6 +40,7 @@ import errno
import getpass
from contextlib import contextmanager, closing
from tempfile import NamedTemporaryFile
+import subprocess
import llnl.util.tty as tty
from spack.util.compression import ALLOWED_ARCHIVE_TYPES
@@ -394,6 +397,33 @@ def remove_linked_tree(path):
shutil.rmtree(path, True)
+def fix_darwin_install_name(path):
+ """
+ Fix install name of dynamic libraries on Darwin to have full path.
+ There are two parts of this task:
+ (i) use install_name('-id',...) to change install name of a single lib;
+ (ii) use install_name('-change',...) to change the cross linking between libs.
+ The function assumes that all libraries are in one folder and currently won't
+ follow subfolders.
+
+ Args:
+ path: directory in which .dylib files are alocated
+
+ """
+ libs = glob.glob(join_path(path,"*.dylib"))
+ for lib in libs:
+ # fix install name first:
+ subprocess.Popen(["install_name_tool", "-id",lib,lib], stdout=subprocess.PIPE).communicate()[0]
+ long_deps = subprocess.Popen(["otool", "-L",lib], stdout=subprocess.PIPE).communicate()[0].split('\n')
+ deps = [dep.partition(' ')[0][1::] for dep in long_deps[2:-1]]
+ # fix all dependencies:
+ for dep in deps:
+ for loc in libs:
+ if dep == os.path.basename(loc):
+ subprocess.Popen(["install_name_tool", "-change",dep,loc,lib], stdout=subprocess.PIPE).communicate()[0]
+ break
+
+
def find_library_path(libname, *paths):
"""Searches for a file called <libname> in each path.
@@ -406,4 +436,3 @@ def find_library_path(libname, *paths):
if os.path.exists(library):
return path
return None
-
diff --git a/lib/spack/spack/cmd/pkg.py b/lib/spack/spack/cmd/pkg.py
index cf478d3763..20a3fc5fc2 100644
--- a/lib/spack/spack/cmd/pkg.py
+++ b/lib/spack/spack/cmd/pkg.py
@@ -77,7 +77,8 @@ def get_git():
def list_packages(rev):
git = get_git()
- relpath = spack.packages_path[len(spack.prefix + os.path.sep):] + os.path.sep
+ pkgpath = os.path.join(spack.packages_path, 'packages')
+ relpath = pkgpath[len(spack.prefix + os.path.sep):] + os.path.sep
output = git('ls-tree', '--full-tree', '--name-only', rev, relpath,
output=str)
return sorted(line[len(relpath):] for line in output.split('\n') if line)
diff --git a/lib/spack/spack/cmd/stage.py b/lib/spack/spack/cmd/stage.py
index 5786780efb..975bb54ef7 100644
--- a/lib/spack/spack/cmd/stage.py
+++ b/lib/spack/spack/cmd/stage.py
@@ -35,6 +35,9 @@ def setup_parser(subparser):
subparser.add_argument(
'-n', '--no-checksum', action='store_true', dest='no_checksum',
help="Do not check downloaded packages against checksum")
+ subparser.add_argument(
+ '-p', '--path', dest='path',
+ help="Path to stage package, does not add to spack tree")
subparser.add_argument(
'specs', nargs=argparse.REMAINDER, help="specs of packages to stage")
@@ -50,4 +53,6 @@ def stage(parser, args):
specs = spack.cmd.parse_specs(args.specs, concretize=True)
for spec in specs:
package = spack.repo.get(spec)
+ if args.path:
+ package.path = args.path
package.do_stage()
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index 0d0a7db8a9..4ea87bea7e 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -289,8 +289,14 @@ class URLFetchStrategy(FetchStrategy):
if not self.archive_file:
raise NoArchiveFileError("Tried to reset URLFetchStrategy before fetching",
"Failed on reset() for URL %s" % self.url)
- if self.stage.source_path:
- shutil.rmtree(self.stage.source_path, ignore_errors=True)
+
+ # Remove everythigng but the archive from the stage
+ for filename in os.listdir(self.stage.path):
+ abspath = os.path.join(self.stage.path, filename)
+ if abspath != self.archive_file:
+ shutil.rmtree(abspath, ignore_errors=True)
+
+ # Expand the archive again
self.expand()
def __repr__(self):
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py
index d45fdde703..f6a11c92e3 100644
--- a/lib/spack/spack/modules.py
+++ b/lib/spack/spack/modules.py
@@ -278,6 +278,6 @@ class TclModule(EnvModule):
# Long description
if self.long_description:
module_file.write('proc ModulesHelp { } {\n')
- doc = re.sub(r'"', '\"', self.long_description)
- module_file.write("puts stderr \"%s\"\n" % doc)
+ for line in textwrap.wrap(self.long_description, 72):
+ module_file.write("puts stderr \"%s\"\n" % line)
module_file.write('}\n\n')
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index c17bec4a14..4065553131 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -335,6 +335,9 @@ class Package(object):
if '.' in self.name:
self.name = self.name[self.name.rindex('.') + 1:]
+ # Allow custom staging paths for packages
+ self.path=None
+
# Sanity check attributes required by Spack directives.
spack.directives.ensure_dicts(type(self))
@@ -445,7 +448,8 @@ class Package(object):
resource_stage_folder = self._resource_stage(resource)
resource_mirror = join_path(self.name, os.path.basename(fetcher.url))
stage = ResourceStage(resource.fetcher, root=root_stage, resource=resource,
- name=resource_stage_folder, mirror_path=resource_mirror)
+ name=resource_stage_folder, mirror_path=resource_mirror,
+ path=self.path)
return stage
def _make_root_stage(self, fetcher):
@@ -455,7 +459,7 @@ class Package(object):
s = self.spec
stage_name = "%s-%s-%s" % (s.name, s.version, s.dag_hash())
# Build the composite stage
- stage = Stage(fetcher, mirror_path=mp, name=stage_name)
+ stage = Stage(fetcher, mirror_path=mp, name=stage_name, path=self.path)
return stage
def _make_stage(self):
@@ -709,7 +713,6 @@ class Package(object):
if spack.do_checksum and self.version in self.versions:
self.stage.check()
-
def do_stage(self, mirror_only=False):
"""Unpacks the fetched tarball, then changes into the expanded tarball
directory."""
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index f88f82fc2d..d711752c20 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -89,7 +89,7 @@ class Stage(object):
"""
def __init__(self, url_or_fetch_strategy,
- name=None, mirror_path=None, keep=False):
+ name=None, mirror_path=None, keep=False, path=None):
"""Create a stage object.
Parameters:
url_or_fetch_strategy
@@ -135,7 +135,10 @@ class Stage(object):
# Try to construct here a temporary name for the stage directory
# If this is a named stage, then construct a named path.
- self.path = join_path(spack.stage_path, self.name)
+ if path is not None:
+ self.path = path
+ else:
+ self.path = join_path(spack.stage_path, self.name)
# Flag to decide whether to delete the stage folder on exit or not
self.keep = keep
diff --git a/lib/spack/spack/test/cc.py b/lib/spack/spack/test/cc.py
index f3f6d4a22e..0b1aeb2a8f 100644
--- a/lib/spack/spack/test/cc.py
+++ b/lib/spack/spack/test/cc.py
@@ -28,6 +28,8 @@ arguments correctly.
"""
import os
import unittest
+import tempfile
+import shutil
from llnl.util.filesystem import *
import spack
@@ -55,13 +57,40 @@ class CompilerTest(unittest.TestCase):
self.ld = Executable(join_path(spack.build_env_path, "ld"))
self.cpp = Executable(join_path(spack.build_env_path, "cpp"))
- os.environ['SPACK_CC'] = "/bin/mycc"
- os.environ['SPACK_PREFIX'] = "/usr"
+ self.realcc = "/bin/mycc"
+ self.prefix = "/spack-test-prefix"
+
+ os.environ['SPACK_CC'] = self.realcc
+ os.environ['SPACK_PREFIX'] = self.prefix
os.environ['SPACK_ENV_PATH']="test"
os.environ['SPACK_DEBUG_LOG_DIR'] = "."
os.environ['SPACK_COMPILER_SPEC'] = "gcc@4.4.7"
os.environ['SPACK_SHORT_SPEC'] = "foo@1.2"
+ # Make some fake dependencies
+ self.tmp_deps = tempfile.mkdtemp()
+ self.dep1 = join_path(self.tmp_deps, 'dep1')
+ self.dep2 = join_path(self.tmp_deps, 'dep2')
+ self.dep3 = join_path(self.tmp_deps, 'dep3')
+ self.dep4 = join_path(self.tmp_deps, 'dep4')
+
+ mkdirp(join_path(self.dep1, 'include'))
+ mkdirp(join_path(self.dep1, 'lib'))
+
+ mkdirp(join_path(self.dep2, 'lib64'))
+
+ mkdirp(join_path(self.dep3, 'include'))
+ mkdirp(join_path(self.dep3, 'lib64'))
+
+ mkdirp(join_path(self.dep4, 'include'))
+
+ if 'SPACK_DEPENDENCIES' in os.environ:
+ del os.environ['SPACK_DEPENDENCIES']
+
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_deps, True)
+
def check_cc(self, command, args, expected):
os.environ['SPACK_TEST_COMMAND'] = command
@@ -92,6 +121,10 @@ class CompilerTest(unittest.TestCase):
self.check_cpp('dump-mode', [], "cpp")
+ def test_as_mode(self):
+ self.check_cc('dump-mode', ['-S'], "as")
+
+
def test_ccld_mode(self):
self.check_cc('dump-mode', [], "ccld")
self.check_cc('dump-mode', ['foo.c', '-o', 'foo'], "ccld")
@@ -104,27 +137,85 @@ class CompilerTest(unittest.TestCase):
self.check_ld('dump-mode', ['foo.o', 'bar.o', 'baz.o', '-o', 'foo', '-Wl,-rpath,foo'], "ld")
- def test_includes(self):
- self.check_cc('dump-includes', test_command,
- "\n".join(["/test/include", "/other/include"]))
+ def test_dep_rpath(self):
+ """Ensure RPATHs for root package are added."""
+ self.check_cc('dump-args', test_command,
+ self.realcc + ' ' +
+ '-Wl,-rpath,' + self.prefix + '/lib ' +
+ '-Wl,-rpath,' + self.prefix + '/lib64 ' +
+ ' '.join(test_command))
+
+
+ def test_dep_include(self):
+ """Ensure a single dependency include directory is added."""
+ os.environ['SPACK_DEPENDENCIES'] = self.dep4
+ self.check_cc('dump-args', test_command,
+ self.realcc + ' ' +
+ '-Wl,-rpath,' + self.prefix + '/lib ' +
+ '-Wl,-rpath,' + self.prefix + '/lib64 ' +
+ '-I' + self.dep4 + '/include ' +
+ ' '.join(test_command))
+
+
+ def test_dep_lib(self):
+ """Ensure a single dependency RPATH is added."""
+ os.environ['SPACK_DEPENDENCIES'] = self.dep2
+ self.check_cc('dump-args', test_command,
+ self.realcc + ' ' +
+ '-Wl,-rpath,' + self.prefix + '/lib ' +
+ '-Wl,-rpath,' + self.prefix + '/lib64 ' +
+ '-L' + self.dep2 + '/lib64 ' +
+ '-Wl,-rpath,' + self.dep2 + '/lib64 ' +
+ ' '.join(test_command))
+
+
+ def test_all_deps(self):
+ """Ensure includes and RPATHs for all deps are added. """
+ os.environ['SPACK_DEPENDENCIES'] = ':'.join([
+ self.dep1, self.dep2, self.dep3, self.dep4])
+
+ # This is probably more constrained than it needs to be; it
+ # checks order within prepended args and doesn't strictly have
+ # to. We could loosen that if it becomes necessary
+ self.check_cc('dump-args', test_command,
+ self.realcc + ' ' +
+ '-Wl,-rpath,' + self.prefix + '/lib ' +
+ '-Wl,-rpath,' + self.prefix + '/lib64 ' +
+
+ '-I' + self.dep4 + '/include ' +
+
+ '-L' + self.dep3 + '/lib64 ' +
+ '-Wl,-rpath,' + self.dep3 + '/lib64 ' +
+ '-I' + self.dep3 + '/include ' +
+
+ '-L' + self.dep2 + '/lib64 ' +
+ '-Wl,-rpath,' + self.dep2 + '/lib64 ' +
+
+ '-L' + self.dep1 + '/lib ' +
+ '-Wl,-rpath,' + self.dep1 + '/lib ' +
+ '-I' + self.dep1 + '/include ' +
+
+ ' '.join(test_command))
- def test_libraries(self):
- self.check_cc('dump-libraries', test_command,
- "\n".join(["/test/lib", "/other/lib"]))
+ def test_ld_deps(self):
+ """Ensure no (extra) -I args or -Wl, are passed in ld mode."""
+ os.environ['SPACK_DEPENDENCIES'] = ':'.join([
+ self.dep1, self.dep2, self.dep3, self.dep4])
+ self.check_ld('dump-args', test_command,
+ 'ld ' +
+ '-rpath ' + self.prefix + '/lib ' +
+ '-rpath ' + self.prefix + '/lib64 ' +
- def test_libs(self):
- self.check_cc('dump-libs', test_command,
- "\n".join(["lib1", "lib2", "lib3", "lib4"]))
+ '-L' + self.dep3 + '/lib64 ' +
+ '-rpath ' + self.dep3 + '/lib64 ' +
+ '-L' + self.dep2 + '/lib64 ' +
+ '-rpath ' + self.dep2 + '/lib64 ' +
- def test_rpaths(self):
- self.check_cc('dump-rpaths', test_command,
- "\n".join(["/first/rpath", "/second/rpath", "/third/rpath", "/fourth/rpath"]))
+ '-L' + self.dep1 + '/lib ' +
+ '-rpath ' + self.dep1 + '/lib ' +
+ ' '.join(test_command))
- def test_other_args(self):
- self.check_cc('dump-other-args', test_command,
- "\n".join(["arg1", "-Wl,--start-group", "arg2", "arg3", "arg4",
- "-Wl,--end-group", "arg5", "arg6"]))
diff --git a/var/spack/repos/builtin/packages/apr-util/package.py b/var/spack/repos/builtin/packages/apr-util/package.py
new file mode 100644
index 0000000000..8f19c84d22
--- /dev/null
+++ b/var/spack/repos/builtin/packages/apr-util/package.py
@@ -0,0 +1,44 @@
+##############################################################################
+# 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://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 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 AprUtil(Package):
+ """Apache Portable Runtime Utility"""
+ homepage = 'https://apr.apache.org/'
+ url = 'http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz'
+
+ version('1.5.4', '866825c04da827c6e5f53daff5569f42')
+
+ depends_on('apr')
+
+ def install(self, spec, prefix):
+
+ # configure, build, install:
+ options = ['--prefix=%s' % prefix]
+ options.append('--with-apr=%s' % spec['apr'].prefix)
+
+ configure(*options)
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/apr/package.py b/var/spack/repos/builtin/packages/apr/package.py
new file mode 100644
index 0000000000..8a440766ec
--- /dev/null
+++ b/var/spack/repos/builtin/packages/apr/package.py
@@ -0,0 +1,38 @@
+##############################################################################
+# 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://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 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 Apr(Package):
+ """Apache portable runtime."""
+ homepage = 'https://apr.apache.org/'
+ url = 'http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz'
+
+ version('1.5.2', '98492e965963f852ab29f9e61b2ad700')
+
+ def install(self, spec, prefix):
+ options = ['--prefix=%s' % prefix]
+ configure(*options)
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py
index dd86b17a53..6b152f7863 100644
--- a/var/spack/repos/builtin/packages/arpack-ng/package.py
+++ b/var/spack/repos/builtin/packages/arpack-ng/package.py
@@ -41,10 +41,17 @@ class ArpackNg(Package):
depends_on('blas')
depends_on('lapack')
+ depends_on('automake')
+ depends_on('autoconf')
+ depends_on('libtool@2.4.2:')
+
depends_on('mpi', when='+mpi')
def install(self, spec, prefix):
# Apparently autotools are not bootstrapped
+ # TODO: switch to use the CMake build in the next version
+ # rather than bootstrapping.
+ which('libtoolize')()
bootstrap = Executable('./bootstrap')
options = ['--prefix=%s' % prefix]
diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py
new file mode 100644
index 0000000000..7260fd74a1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/astyle/package.py
@@ -0,0 +1,17 @@
+from spack import *
+import os
+
+class Astyle(Package):
+ """A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, Objective-C, C#, and Java Source Code."""
+ homepage = "http://astyle.sourceforge.net/"
+ url = "http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.04/astyle_2.04_linux.tar.gz"
+
+ version('2.04', '30b1193a758b0909d06e7ee8dd9627f6')
+
+ def install(self, spec, prefix):
+
+ with working_dir('src'):
+ make('-f',
+ join_path(self.stage.source_path,'build','clang','Makefile'),
+ parallel=False)
+ install(join_path(self.stage.source_path, 'src','bin','astyle'), self.prefix.bin)
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py
index fb1f5daee7..f889da21f2 100644
--- a/var/spack/repos/builtin/packages/boost/package.py
+++ b/var/spack/repos/builtin/packages/boost/package.py
@@ -1,5 +1,9 @@
from spack import *
import spack
+import sys
+
+import os
+import sys
class Boost(Package):
"""Boost provides free peer-reviewed portable C++ source
@@ -45,34 +49,34 @@ class Boost(Package):
version('1.34.1', '2d938467e8a448a2c9763e0a9f8ca7e5')
version('1.34.0', 'ed5b9291ffad776f8757a916e1726ad0')
- default_install_libs = set(['atomic',
- 'chrono',
- 'date_time',
- 'filesystem',
+ default_install_libs = set(['atomic',
+ 'chrono',
+ 'date_time',
+ 'filesystem',
'graph',
'iostreams',
'locale',
'log',
- 'math',
+ 'math',
'program_options',
- 'random',
- 'regex',
- 'serialization',
- 'signals',
- 'system',
- 'test',
- 'thread',
+ 'random',
+ 'regex',
+ 'serialization',
+ 'signals',
+ 'system',
+ 'test',
+ 'thread',
'wave'])
- # mpi/python are not installed by default because they pull in many
- # dependencies and/or because there is a great deal of customization
+ # mpi/python are not installed by default because they pull in many
+ # dependencies and/or because there is a great deal of customization
# possible (and it would be difficult to choose sensible defaults)
default_noinstall_libs = set(['mpi', 'python'])
all_libs = default_install_libs | default_noinstall_libs
for lib in all_libs:
- variant(lib, default=(lib not in default_noinstall_libs),
+ variant(lib, default=(lib not in default_noinstall_libs),
description="Compile with {0} library".format(lib))
variant('debug', default=False, description='Switch to the debug version of Boost')
@@ -124,9 +128,9 @@ class Boost(Package):
with open('user-config.jam', 'w') as f:
compiler_wrapper = join_path(spack.build_env_path, 'c++')
- f.write("using {0} : : {1} ;\n".format(boostToolsetId,
+ f.write("using {0} : : {1} ;\n".format(boostToolsetId,
compiler_wrapper))
-
+
if '+mpi' in spec:
f.write('using mpi : %s ;\n' %
join_path(spec['mpi'].prefix.bin, 'mpicxx'))
@@ -155,7 +159,7 @@ class Boost(Package):
linkTypes = ['static']
if '+shared' in spec:
linkTypes.append('shared')
-
+
threadingOpts = []
if '+multithreaded' in spec:
threadingOpts.append('multi')
@@ -163,28 +167,38 @@ class Boost(Package):
threadingOpts.append('single')
if not threadingOpts:
raise RuntimeError("At least one of {singlethreaded, multithreaded} must be enabled")
-
+
options.extend([
'toolset=%s' % self.determine_toolset(spec),
'link=%s' % ','.join(linkTypes),
'--layout=tagged'])
-
+
return threadingOpts
def install(self, spec, prefix):
+ # On Darwin, Boost expects the Darwin libtool. However, one of the
+ # dependencies may have pulled in Spack's GNU libtool, and these two are
+ # not compatible. We thus create a symlink to Darwin's libtool and add
+ # it at the beginning of PATH.
+ if sys.platform == 'darwin':
+ newdir = os.path.abspath('darwin-libtool')
+ mkdirp(newdir)
+ force_symlink('/usr/bin/libtool', join_path(newdir, 'libtool'))
+ env['PATH'] = newdir + ':' + env['PATH']
+
withLibs = list()
for lib in Boost.all_libs:
if "+{0}".format(lib) in spec:
withLibs.append(lib)
if not withLibs:
- # if no libraries are specified for compilation, then you dont have
+ # if no libraries are specified for compilation, then you dont have
# to configure/build anything, just copy over to the prefix directory.
src = join_path(self.stage.source_path, 'boost')
mkdirp(join_path(prefix, 'include'))
dst = join_path(prefix, 'include', 'boost')
install_tree(src, dst)
return
-
+
# to make Boost find the user-config.jam
env['BOOST_BUILD_PATH'] = './'
@@ -207,4 +221,7 @@ class Boost(Package):
# Boost.MPI if the threading options are not separated.
for threadingOpt in threadingOpts:
b2('install', 'threading=%s' % threadingOpt, *b2_options)
-
+
+ # The shared libraries are not installed correctly on Darwin; correct this
+ if (sys.platform == 'darwin') and ('+shared' in spec):
+ fix_darwin_install_name(prefix.lib)
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py
index 1f93d39769..91a4e3b415 100644
--- a/var/spack/repos/builtin/packages/cmake/package.py
+++ b/var/spack/repos/builtin/packages/cmake/package.py
@@ -30,6 +30,7 @@ class Cmake(Package):
homepage = 'https://www.cmake.org'
url = 'https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz'
+ version('3.5.1', 'ca051f4a66375c89d1a524e726da0296')
version('3.5.0', '33c5d09d4c33d4ffcc63578a6ba8777e')
version('3.4.3', '4cb3ff35b2472aae70f542116d616e63')
version('3.4.0', 'cd3034e0a44256a0917e254167217fc8')
diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py
new file mode 100644
index 0000000000..ea083d8651
--- /dev/null
+++ b/var/spack/repos/builtin/packages/cuda/package.py
@@ -0,0 +1,47 @@
+from spack import *
+from glob import glob
+import os
+
+class Cuda(Package):
+ """CUDA is a parallel computing platform and programming model invented by
+ NVIDIA. It enables dramatic increases in computing performance by harnessing
+ the power of the graphics processing unit (GPU).
+
+ Note: NVIDIA does not provide a download URL for CUDA so you will need to
+ download it yourself. Go to https://developer.nvidia.com/cuda-downloads
+ and select your Operating System, Architecture, Distribution, and Version.
+ For the Installer Type, select runfile and click Download. Spack will search
+ your current directory for this file. Alternatively, add this file to a
+ mirror so that Spack can find it. For instructions on how to set up a mirror,
+ see http://software.llnl.gov/spack/mirrors.html
+
+ Note: This package does not currently install the drivers necessary to run
+ CUDA. These will need to be installed manually. See:
+ http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux for details."""
+
+ homepage = "http://www.nvidia.com/object/cuda_home_new.html"
+
+ version('7.5.18', '4b3bcecf0dfc35928a0898793cf3e4c6', expand=False,
+ url="file://%s/cuda_7.5.18_linux.run" % os.getcwd())
+ version('6.5.14', '90b1b8f77313600cc294d9271741f4da', expand=False,
+ url="file://%s/cuda_6.5.14_linux_64.run" % os.getcwd())
+
+
+ def install(self, spec, prefix):
+ runfile = glob(os.path.join(self.stage.path, 'cuda*.run'))[0]
+ chmod = which('chmod')
+ chmod('+x', runfile)
+ runfile = which(runfile)
+
+ # Note: NVIDIA does not officially support many newer versions of compilers.
+ # For example, on CentOS 6, you must use GCC 4.4.7 or older. See:
+ # http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#system-requirements
+ # for details.
+
+ runfile(
+ '--silent', # disable interactive prompts
+ '--verbose', # create verbose log file
+ '--toolkit', # install CUDA Toolkit
+ '--toolkitpath=%s' % prefix
+ )
+
diff --git a/var/spack/repos/builtin/packages/dbus/package.py b/var/spack/repos/builtin/packages/dbus/package.py
index 294b0de54e..422f5a19eb 100644
--- a/var/spack/repos/builtin/packages/dbus/package.py
+++ b/var/spack/repos/builtin/packages/dbus/package.py
@@ -13,6 +13,7 @@ class Dbus(Package):
homepage = "http://dbus.freedesktop.org/"
url = "http://dbus.freedesktop.org/releases/dbus/dbus-1.8.8.tar.gz"
+ version('1.11.2', '957a07f066f3730d2bb3ea0932f0081b')
version('1.9.0', 'ec6895a4d5c0637b01f0d0e7689e2b36')
version('1.8.8', 'b9f4a18ee3faa1e07c04aa1d83239c43')
version('1.8.6', '6a08ba555d340e9dfe2d623b83c0eea8')
diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py
new file mode 100644
index 0000000000..0b76db3827
--- /dev/null
+++ b/var/spack/repos/builtin/packages/dealii/package.py
@@ -0,0 +1,238 @@
+from spack import *
+import sys
+
+class Dealii(Package):
+ """C++ software library providing well-documented tools to build finite element codes for a broad variety of PDEs."""
+ homepage = "https://www.dealii.org"
+ url = "https://github.com/dealii/dealii/releases/download/v8.4.0/dealii-8.4.0.tar.gz"
+
+ version('8.4.0', 'ac5dbf676096ff61e092ce98c80c2b00')
+ version('dev', git='https://github.com/dealii/dealii.git')
+
+ variant('mpi', default=True, description='Compile with MPI')
+ variant('arpack', default=True, description='Compile with Arpack and PArpack (only with MPI)')
+ variant('doc', default=False, description='Compile with documentation')
+ variant('hdf5', default=True, description='Compile with HDF5 (only with MPI)')
+ variant('metis', default=True, description='Compile with Metis')
+ variant('netcdf', default=True, description='Compile with Netcdf (only with MPI)')
+ variant('oce', default=True, description='Compile with OCE')
+ variant('p4est', default=True, description='Compile with P4est (only with MPI)')
+ variant('petsc', default=True, description='Compile with Petsc (only with MPI)')
+ variant('slepc', default=True, description='Compile with Slepc (only with Petsc and MPI)')
+ variant('trilinos', default=True, description='Compile with Trilinos (only with MPI)')
+
+ # required dependencies, light version
+ depends_on ("blas")
+ depends_on ("boost", when='~mpi')
+ depends_on ("boost+mpi", when='+mpi')
+ depends_on ("bzip2")
+ depends_on ("cmake")
+ depends_on ("lapack")
+ depends_on ("muparser")
+ depends_on ("suite-sparse")
+ depends_on ("tbb")
+ depends_on ("zlib")
+
+ # optional dependencies
+ depends_on ("mpi", when="+mpi")
+ depends_on ("arpack-ng+mpi", when='+arpack+mpi')
+ depends_on ("doxygen", when='+doc')
+ depends_on ("hdf5+mpi~cxx", when='+hdf5+mpi') #FIXME NetCDF declares dependency with ~cxx, why?
+ depends_on ("metis", when='+metis')
+ depends_on ("netcdf+mpi", when="+netcdf+mpi")
+ depends_on ("netcdf-cxx", when='+netcdf+mpi')
+ depends_on ("oce", when='+oce')
+ depends_on ("p4est", when='+p4est+mpi')
+ depends_on ("petsc+mpi", when='+petsc+mpi')
+ depends_on ("slepc", when='+slepc+petsc+mpi')
+ depends_on ("trilinos", when='+trilinos+mpi')
+
+ # developer dependnecies
+ #depends_on ("numdiff") #FIXME
+ #depends_on ("astyle") #FIXME
+
+ def install(self, spec, prefix):
+ options = []
+ options.extend(std_cmake_args)
+
+ # CMAKE_BUILD_TYPE should be DebugRelease | Debug | Release
+ for word in options[:]:
+ if word.startswith('-DCMAKE_BUILD_TYPE'):
+ options.remove(word)
+
+ dsuf = 'dylib' if sys.platform == 'darwin' else 'so'
+ options.extend([
+ '-DCMAKE_BUILD_TYPE=DebugRelease',
+ '-DDEAL_II_COMPONENT_EXAMPLES=ON',
+ '-DDEAL_II_WITH_THREADS:BOOL=ON',
+ '-DBOOST_DIR=%s' % spec['boost'].prefix,
+ '-DBZIP2_DIR=%s' % spec['bzip2'].prefix,
+ # CMake's FindBlas/Lapack may pickup system's blas/lapack instead of Spack's.
+ # Be more specific to avoid this.
+ # Note that both lapack and blas are provided in -DLAPACK_XYZ variables
+ '-DLAPACK_FOUND=true',
+ '-DLAPACK_INCLUDE_DIRS=%s;%s' %
+ (spec['lapack'].prefix.include,
+ spec['blas'].prefix.include),
+ '-DLAPACK_LIBRARIES=%s;%s' %
+ (join_path(spec['lapack'].prefix.lib,'liblapack.%s' % dsuf), # FIXME don't hardcode names
+ join_path(spec['blas'].prefix.lib,'libblas.%s' % dsuf)), # FIXME don't hardcode names
+ '-DMUPARSER_DIR=%s ' % spec['muparser'].prefix,
+ '-DP4EST_DIR=%s' % spec['p4est'].prefix,
+ '-DUMFPACK_DIR=%s' % spec['suite-sparse'].prefix,
+ '-DTBB_DIR=%s' % spec['tbb'].prefix,
+ '-DZLIB_DIR=%s' % spec['zlib'].prefix
+ ])
+
+ # MPI
+ if '+mpi' in spec:
+ options.extend([
+ '-DDEAL_II_WITH_MPI:BOOL=ON',
+ '-DCMAKE_C_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # FIXME: avoid hardcoding mpi wrappers names
+ '-DCMAKE_CXX_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'),
+ '-DCMAKE_Fortran_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'),
+ ])
+ else:
+ options.extend([
+ '-DDEAL_II_WITH_MPI:BOOL=OFF',
+ ])
+
+ # Optional dependencies for which librariy names are the same as CMake variables
+ for library in ('hdf5', 'p4est','petsc', 'slepc','trilinos','metis'):
+ if library in spec:
+ options.extend([
+ '-D{library}_DIR={value}'.format(library=library.upper(), value=spec[library].prefix),
+ '-DDEAL_II_WITH_{library}:BOOL=ON'.format(library=library.upper())
+ ])
+ else:
+ options.extend([
+ '-DDEAL_II_WITH_{library}:BOOL=OFF'.format(library=library.upper())
+ ])
+
+ # doxygen
+ options.extend([
+ '-DDEAL_II_COMPONENT_DOCUMENTATION=%s' % ('ON' if '+doc' in spec else 'OFF'),
+ ])
+
+
+ # arpack
+ if '+arpack' in spec:
+ options.extend([
+ '-DARPACK_DIR=%s' % spec['arpack-ng'].prefix,
+ '-DDEAL_II_WITH_ARPACK=ON',
+ '-DDEAL_II_ARPACK_WITH_PARPACK=ON'
+ ])
+ else:
+ options.extend([
+ '-DDEAL_II_WITH_ARPACK=OFF'
+ ])
+
+ # since Netcdf is spread among two, need to do it by hand:
+ if '+netcdf' in spec:
+ options.extend([
+ '-DNETCDF_FOUND=true',
+ '-DNETCDF_LIBRARIES=%s;%s' %
+ (join_path(spec['netcdf-cxx'].prefix.lib,'libnetcdf_c++.%s' % dsuf),
+ join_path(spec['netcdf'].prefix.lib,'libnetcdf.%s' % dsuf)),
+ '-DNETCDF_INCLUDE_DIRS=%s;%s' %
+ (spec['netcdf-cxx'].prefix.include,
+ spec['netcdf'].prefix.include),
+ ])
+ else:
+ options.extend([
+ '-DDEAL_II_WITH_NETCDF=OFF'
+ ])
+
+ # Open Cascade
+ if '+oce' in spec:
+ options.extend([
+ '-DOPENCASCADE_DIR=%s' % spec['oce'].prefix,
+ '-DDEAL_II_WITH_OPENCASCADE=ON'
+ ])
+ else:
+ options.extend([
+ '-DDEAL_II_WITH_OPENCASCADE=OFF'
+ ])
+
+ cmake('.', *options)
+
+ make()
+ make("test")
+ make("install")
+
+ # run some MPI examples with different solvers from PETSc and Trilinos
+ env['DEAL_II_DIR'] = prefix
+ print('=====================================')
+ print('============ EXAMPLES ===============')
+ print('=====================================')
+ # take bare-bones step-3
+ print('=====================================')
+ print('============ Step-3 =================')
+ print('=====================================')
+ with working_dir('examples/step-3'):
+ cmake('.')
+ make('release')
+ make('run',parallel=False)
+
+ # take step-40 which can use both PETSc and Trilinos
+ # FIXME: switch step-40 to MPI run
+ with working_dir('examples/step-40'):
+ print('=====================================')
+ print('========== Step-40 PETSc ============')
+ print('=====================================')
+ # list the number of cycles to speed up
+ filter_file(r'(const unsigned int n_cycles = 8;)', ('const unsigned int n_cycles = 2;'), 'step-40.cc')
+ cmake('.')
+ if '^petsc' in spec:
+ make('release')
+ make('run',parallel=False)
+
+ print('=====================================')
+ print('========= Step-40 Trilinos ==========')
+ print('=====================================')
+ # change Linear Algebra to Trilinos
+ filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc')
+ if '^trilinos+hypre' in spec:
+ make('release')
+ make('run',parallel=False)
+
+ print('=====================================')
+ print('=== Step-40 Trilinos SuperluDist ====')
+ print('=====================================')
+ # change to direct solvers
+ filter_file(r'(LA::SolverCG solver\(solver_control\);)', ('TrilinosWrappers::SolverDirect::AdditionalData data(false,"Amesos_Superludist"); TrilinosWrappers::SolverDirect solver(solver_control,data);'), 'step-40.cc')
+ filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)', (''), 'step-40.cc')
+ filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)', (''), 'step-40.cc')
+ filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', (''), 'step-40.cc')
+ filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc')
+ filter_file(r'(preconditioner\);)', (''), 'step-40.cc')
+ if '^trilinos+superlu-dist' in spec:
+ make('release')
+ make('run',paralle=False)
+
+ print('=====================================')
+ print('====== Step-40 Trilinos MUMPS =======')
+ print('=====================================')
+ # switch to Mumps
+ filter_file(r'(Amesos_Superludist)', ('Amesos_Mumps'), 'step-40.cc')
+ if '^trilinos+mumps' in spec:
+ make('release')
+ make('run',parallel=False)
+
+ print('=====================================')
+ print('============ Step-36 ================')
+ print('=====================================')
+ with working_dir('examples/step-36'):
+ if 'slepc' in spec:
+ cmake('.')
+ make('release')
+ make('run',parallel=False)
+
+ print('=====================================')
+ print('============ Step-54 ================')
+ print('=====================================')
+ with working_dir('examples/step-54'):
+ if 'oce' in spec:
+ cmake('.')
+ make('release')
+ make('run',parallel=False)
diff --git a/var/spack/repos/builtin/packages/doxygen/package.py b/var/spack/repos/builtin/packages/doxygen/package.py
index 3d4a4e47a7..3a1deba9e1 100644
--- a/var/spack/repos/builtin/packages/doxygen/package.py
+++ b/var/spack/repos/builtin/packages/doxygen/package.py
@@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
from spack import *
+import sys
class Doxygen(Package):
"""Doxygen is the de facto standard tool for generating documentation
@@ -17,6 +18,10 @@ class Doxygen(Package):
version('1.8.10', '79767ccd986f12a0f949015efb5f058f')
depends_on("cmake@2.8.12:")
+ # flex does not build on OSX, but it's provided there anyway
+ depends_on("flex", sys.platform != 'darwin')
+ depends_on("bison", sys.platform != 'darwin')
+
def install(self, spec, prefix):
cmake('.', *std_cmake_args)
diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py
index 59f362ab46..0dad57a9f6 100644
--- a/var/spack/repos/builtin/packages/espresso/package.py
+++ b/var/spack/repos/builtin/packages/espresso/package.py
@@ -24,7 +24,7 @@ class Espresso(Package):
depends_on('fftw~mpi', when='~mpi')
depends_on('fftw+mpi', when='+mpi')
depends_on('scalapack', when='+scalapack+mpi') # TODO : + mpi needed to avoid false dependencies installation
-
+
def check_variants(self, spec):
error = 'you cannot ask for \'+{variant}\' when \'+mpi\' is not active'
if '+scalapack' in spec and '~mpi' in spec:
@@ -32,14 +32,11 @@ class Espresso(Package):
if '+elpa' in spec and ('~mpi' in spec or '~scalapack' in spec):
raise RuntimeError(error.format(variant='elpa'))
- def setup_environment(self, spack_env, run_env):
- # Espresso copies every executable in prefix without creating sub-folders
- run_env.prepend_path('PATH', self.prefix)
-
def install(self, spec, prefix):
+ from glob import glob
self.check_variants(spec)
- options = ['-prefix=%s' % prefix]
+ options = ['-prefix=%s' % prefix.bin]
if '+mpi' in spec:
options.append('--enable-parallel')
@@ -65,5 +62,11 @@ class Espresso(Package):
configure(*options)
make('all')
- make('install')
+
+ if spec.architecture.startswith('darwin'):
+ mkdirp(prefix.bin)
+ for filename in glob("bin/*.x"):
+ install(filename, prefix.bin)
+ else:
+ make('install')
diff --git a/var/spack/repos/builtin/packages/gcc/darwin/gcc-4.9.patch1 b/var/spack/repos/builtin/packages/gcc/darwin/gcc-4.9.patch1
new file mode 100644
index 0000000000..444e292786
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gcc/darwin/gcc-4.9.patch1
@@ -0,0 +1,42 @@
+diff --git a/gcc/configure b/gcc/configure
+index 9523773..52b0bf7 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -24884,7 +24884,7 @@ if test "${gcc_cv_as_ix86_filds+set}" = set; then :
+ else
+ gcc_cv_as_ix86_filds=no
+ if test x$gcc_cv_as != x; then
+- $as_echo 'filds mem; fists mem' > conftest.s
++ $as_echo 'filds (%ebp); fists (%ebp)' > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+@@ -24915,7 +24915,7 @@ if test "${gcc_cv_as_ix86_fildq+set}" = set; then :
+ else
+ gcc_cv_as_ix86_fildq=no
+ if test x$gcc_cv_as != x; then
+- $as_echo 'fildq mem; fistpq mem' > conftest.s
++ $as_echo 'fildq (%ebp); fistpq (%ebp)' > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 68b0ee8..bd53978 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -3869,13 +3869,13 @@ foo: nop
+
+ gcc_GAS_CHECK_FEATURE([filds and fists mnemonics],
+ gcc_cv_as_ix86_filds,,,
+- [filds mem; fists mem],,
++ [filds (%ebp); fists (%ebp)],,
+ [AC_DEFINE(HAVE_AS_IX86_FILDS, 1,
+ [Define if your assembler uses filds and fists mnemonics.])])
+
+ gcc_GAS_CHECK_FEATURE([fildq and fistpq mnemonics],
+ gcc_cv_as_ix86_fildq,,,
+- [fildq mem; fistpq mem],,
++ [fildq (%ebp); fistpq (%ebp)],,
+ [AC_DEFINE(HAVE_AS_IX86_FILDQ, 1,
+ [Define if your assembler uses fildq and fistq mnemonics.])])
+
diff --git a/var/spack/repos/builtin/packages/gcc/darwin/gcc-4.9.patch2 b/var/spack/repos/builtin/packages/gcc/darwin/gcc-4.9.patch2
new file mode 100644
index 0000000000..b065997f45
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gcc/darwin/gcc-4.9.patch2
@@ -0,0 +1,28 @@
+From 82f81877458ea372176eabb5de36329431dce99b Mon Sep 17 00:00:00 2001
+From: Iain Sandoe <iain@codesourcery.com>
+Date: Sat, 21 Dec 2013 00:30:18 +0000
+Subject: [PATCH] don't try to mark local symbols as no-dead-strip
+
+---
+ gcc/config/darwin.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
+index 40804b8..0080299 100644
+--- a/gcc/config/darwin.c
++++ b/gcc/config/darwin.c
+@@ -1259,6 +1259,11 @@ darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
+ void
+ darwin_mark_decl_preserved (const char *name)
+ {
++ /* Actually we shouldn't mark any local symbol this way, but for now
++ this only happens with ObjC meta-data. */
++ if (darwin_label_is_anonymous_local_objc_name (name))
++ return;
++
+ fprintf (asm_out_file, "\t.no_dead_strip ");
+ assemble_name (asm_out_file, name);
+ fputc ('\n', asm_out_file);
+--
+2.2.1
+
diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py
index f8958ee290..6043b62279 100644
--- a/var/spack/repos/builtin/packages/gcc/package.py
+++ b/var/spack/repos/builtin/packages/gcc/package.py
@@ -26,6 +26,8 @@ from spack import *
from contextlib import closing
from glob import glob
+import sys
+import os
class Gcc(Package):
"""The GNU Compiler Collection includes front ends for C, C++,
@@ -47,24 +49,33 @@ class Gcc(Package):
version('4.6.4', 'b407a3d1480c11667f293bfb1f17d1a4')
version('4.5.4', '27e459c2566b8209ab064570e1b378f7')
- variant('gold', default=True, description="Build the gold linker plugin for ld-based LTO")
+ variant('binutils', default=sys.platform != 'darwin',
+ description="Build via binutils")
+ variant('gold', default=sys.platform != 'darwin',
+ description="Build the gold linker plugin for ld-based LTO")
depends_on("mpfr")
depends_on("gmp")
depends_on("mpc", when='@4.5:')
depends_on("isl", when='@5.0:')
- depends_on("binutils~libiberty", when='~gold')
- depends_on("binutils~libiberty+gold", when='+gold')
+ depends_on("binutils~libiberty", when='+binutils ~gold')
+ depends_on("binutils~libiberty+gold", when='+binutils +gold')
+ # TODO: integrate these libraries.
#depends_on("ppl")
#depends_on("cloog")
+ if sys.platform == 'darwin':
+ patch('darwin/gcc-4.9.patch1', when='@4.9.3')
+ patch('darwin/gcc-4.9.patch2', when='@4.9.3')
def install(self, spec, prefix):
# libjava/configure needs a minor fix to install into spack paths.
- filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure', string=True)
+ filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure',
+ string=True)
enabled_languages = set(('c', 'c++', 'fortran', 'java', 'objc'))
- if spec.satisfies("@4.7.1:"):
+
+ if spec.satisfies("@4.7.1:") and sys.platform != 'darwin':
enabled_languages.add('go')
# Generic options to compile GCC
@@ -72,32 +83,40 @@ class Gcc(Package):
"--libdir=%s/lib64" % prefix,
"--disable-multilib",
"--enable-languages=" + ','.join(enabled_languages),
- "--with-mpc=%s" % spec['mpc'].prefix,
- "--with-mpfr=%s" % spec['mpfr'].prefix,
- "--with-gmp=%s" % spec['gmp'].prefix,
+ "--with-mpc=%s" % spec['mpc'].prefix,
+ "--with-mpfr=%s" % spec['mpfr'].prefix,
+ "--with-gmp=%s" % spec['gmp'].prefix,
"--enable-lto",
- "--with-gnu-ld",
- "--with-gnu-as",
"--with-quad"]
# Binutils
- static_bootstrap_flags = "-static-libstdc++ -static-libgcc"
- binutils_options = ["--with-sysroot=/",
- "--with-stage1-ldflags=%s %s" % (self.rpath_args, static_bootstrap_flags),
- "--with-boot-ldflags=%s %s" % (self.rpath_args, static_bootstrap_flags),
- "--with-ld=%s/bin/ld" % spec['binutils'].prefix,
- "--with-as=%s/bin/as" % spec['binutils'].prefix]
- options.extend(binutils_options)
+ if spec.satisfies('+binutils'):
+ static_bootstrap_flags = "-static-libstdc++ -static-libgcc"
+ binutils_options = ["--with-sysroot=/",
+ "--with-stage1-ldflags=%s %s" %
+ (self.rpath_args, static_bootstrap_flags),
+ "--with-boot-ldflags=%s %s" %
+ (self.rpath_args, static_bootstrap_flags),
+ "--with-gnu-ld",
+ "--with-ld=%s/bin/ld" % spec['binutils'].prefix,
+ "--with-gnu-as",
+ "--with-as=%s/bin/as" % spec['binutils'].prefix]
+ options.extend(binutils_options)
# Isl
if 'isl' in spec:
isl_options = ["--with-isl=%s" % spec['isl'].prefix]
options.extend(isl_options)
+ if sys.platform == 'darwin' :
+ darwin_options = [ "--with-build-config=bootstrap-debug" ]
+ options.extend(darwin_options)
+
build_dir = join_path(self.stage.path, 'spack-build')
configure = Executable( join_path(self.stage.source_path, 'configure') )
with working_dir(build_dir, create=True):
# Rest of install is straightforward.
configure(*options)
- make()
+ if sys.platform == 'darwin' : make("bootstrap")
+ else: make()
make("install")
self.write_rpath_specs()
@@ -114,7 +133,8 @@ class Gcc(Package):
"""Generate a spec file so the linker adds a rpath to the libs
the compiler used to build the executable."""
if not self.spec_dir:
- tty.warn("Could not install specs for %s." % self.spec.format('$_$@'))
+ tty.warn("Could not install specs for %s." %
+ self.spec.format('$_$@'))
return
gcc = Executable(join_path(self.prefix.bin, 'gcc'))
@@ -124,5 +144,6 @@ class Gcc(Package):
for line in lines:
out.write(line + "\n")
if line.startswith("*link:"):
- out.write("-rpath %s/lib:%s/lib64 \\\n"% (self.prefix, self.prefix))
+ out.write("-rpath %s/lib:%s/lib64 \\\n" %
+ (self.prefix, self.prefix))
set_install_permissions(specs_file)
diff --git a/var/spack/repos/builtin/packages/gdal/package.py b/var/spack/repos/builtin/packages/gdal/package.py
new file mode 100644
index 0000000000..4f1f1ec2dd
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gdal/package.py
@@ -0,0 +1,69 @@
+from spack import *
+
+class Gdal(Package):
+ """
+ GDAL is a translator library for raster and vector geospatial
+ data formats that is released under an X/MIT style Open Source
+ license by the Open Source Geospatial Foundation. As a library,
+ it presents a single raster abstract data model and vector
+ abstract data model to the calling application for all supported
+ formats. It also comes with a variety of useful command line
+ utilities for data translation and processing
+ """
+
+ homepage = "http://www.gdal.org/"
+ url = "http://download.osgeo.org/gdal/2.0.2/gdal-2.0.2.tar.gz"
+ list_url = "http://download.osgeo.org/gdal/"
+ list_depth = 2
+
+ version('2.0.2', '573865f3f59ba7b4f8f4cddf223b52a5')
+
+ extends('python')
+
+ variant('hdf5', default=False, description='Enable HDF5 support')
+ variant('hdf', default=False, description='Enable HDF4 support')
+ variant('openjpeg', default=False, description='Enable JPEG2000 support')
+ variant('geos', default=False, description='Enable GEOS support')
+ variant('kea', default=False, description='Enable KEA support')
+ variant('netcdf', default=False, description='Enable netcdf support')
+
+ depends_on('swig')
+ depends_on("hdf5", when='+hdf5')
+ depends_on("hdf", when='+hdf')
+ depends_on("openjpeg", when='+openjpeg')
+ depends_on("geos", when='+geos')
+ depends_on("kealib", when='+kea')
+ depends_on("netcdf", when='+netcdf')
+ depends_on("libtiff")
+ depends_on("libpng")
+ depends_on("zlib")
+ depends_on("proj")
+ depends_on("py-numpy")
+
+ parallel = False
+
+ def install(self, spec, prefix):
+ args = []
+ args.append("--prefix=%s" % prefix)
+ args.append("--with-liblzma=yes")
+ args.append("--with-zlib=%s" % spec['zlib'].prefix)
+ args.append("--with-python=%s" % spec['python'].prefix.bin + "/python")
+ args.append("--without-libtool")
+
+ if '+geos' in spec:
+ args.append('--with-geos=yes')
+ if '+hdf' in spec:
+ args.append('--with-hdf4=%s' % spec['hdf'].prefix)
+ if '+hdf5' in spec:
+ args.append('--with-hdf5=%s' % spec['hdf5'].prefix)
+ if '+openjpeg' in spec:
+ args.append('--with-openjpeg=%s' % spec['openjpeg'].prefix)
+ if '+kea' in spec:
+ args.append('--with-kea=yes')
+ if '+netcdf' in spec:
+ args.append('--with-netcdf=%s' % spec['netcdf'].prefix)
+
+ configure(*args)
+
+ make()
+ make("install")
diff --git a/var/spack/repos/builtin/packages/geos/package.py b/var/spack/repos/builtin/packages/geos/package.py
index 4a2657e32f..030703f286 100644
--- a/var/spack/repos/builtin/packages/geos/package.py
+++ b/var/spack/repos/builtin/packages/geos/package.py
@@ -1,4 +1,5 @@
from spack import *
+import os
class Geos(Package):
"""GEOS (Geometry Engine - Open Source) is a C++ port of the Java
@@ -10,6 +11,10 @@ class Geos(Package):
homepage = "http://trac.osgeo.org/geos/"
url = "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2"
+ # Verison 3.5.0 supports Autotools and CMake
+ version('3.5.0', '136842690be7f504fba46b3c539438dd')
+
+ # Versions through 3.4.2 have CMake, but only Autotools is supported
version('3.4.2', 'fc5df2d926eb7e67f988a43a92683bae')
version('3.4.1', '4c930dec44c45c49cd71f3e0931ded7e')
version('3.4.0', 'e41318fc76b5dc764a69d43ac6b18488')
@@ -21,11 +26,22 @@ class Geos(Package):
version('3.3.4', '1bb9f14d57ef06ffa41cb1d67acb55a1')
version('3.3.3', '8454e653d7ecca475153cc88fd1daa26')
- extends('python')
- depends_on('swig')
+# # Python3 is not supported.
+# variant('python', default=False, description='Enable Python support')
+
+# extends('python', when='+python')
+# depends_on('python', when='+python')
+# depends_on('swig', when='+python')
def install(self, spec, prefix):
- configure("--prefix=%s" % prefix,
- "--enable-python")
+ args = ["--prefix=%s" % prefix]
+# if '+python' in spec:
+# os.environ['PYTHON'] = join_path(spec['python'].prefix, 'bin',
+# 'python' if spec['python'].version[:1][0] <= 2 else 'python3')
+# os.environ['SWIG'] = join_path(spec['swig'].prefix, 'bin', 'swig')
+#
+# args.append("--enable-python")
+
+ configure(*args)
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/googletest/package.py b/var/spack/repos/builtin/packages/googletest/package.py
new file mode 100644
index 0000000000..663b758747
--- /dev/null
+++ b/var/spack/repos/builtin/packages/googletest/package.py
@@ -0,0 +1,24 @@
+from spack import *
+
+class Googletest(Package):
+ """Google test framework for C++. Also called gtest."""
+ homepage = "https://github.com/google/googletest"
+ url = "https://github.com/google/googletest/tarball/release-1.7.0"
+
+ version('1.7.0', '5eaf03ed925a47b37c8e1d559eb19bc4')
+
+ depends_on("cmake")
+
+ def install(self, spec, prefix):
+ which('cmake')('.', *std_cmake_args)
+
+ make()
+
+ # Google Test doesn't have a make install
+ # We have to do our own install here.
+ install_tree('include', prefix.include)
+
+ mkdirp(prefix.lib)
+ install('./libgtest.a', '%s' % prefix.lib)
+ install('./libgtest_main.a', '%s' % prefix.lib)
+
diff --git a/var/spack/repos/builtin/packages/graphviz/package.py b/var/spack/repos/builtin/packages/graphviz/package.py
index 7af7da1881..ecf92620d4 100644
--- a/var/spack/repos/builtin/packages/graphviz/package.py
+++ b/var/spack/repos/builtin/packages/graphviz/package.py
@@ -7,6 +7,12 @@ class Graphviz(Package):
version('2.38.0', '5b6a829b2ac94efcd5fa3c223ed6d3ae')
+ # By default disable optional Perl language support to prevent build issues
+ # related to missing Perl packages. If spack begins support for Perl in the
+ # future, this package can be updated to depend_on('perl') and the
+ # ncecessary devel packages.
+ variant('perl', default=False, description='Enable if you need the optional Perl language bindings.')
+
parallel = False
depends_on("swig")
@@ -14,8 +20,10 @@ class Graphviz(Package):
depends_on("ghostscript")
def install(self, spec, prefix):
- configure("--prefix=%s" %prefix)
+ options = ['--prefix=%s' % prefix]
+ if not '+perl' in spec:
+ options.append('--disable-perl')
+ configure(*options)
make()
make("install")
-
diff --git a/var/spack/repos/builtin/packages/hoomd-blue/package.py b/var/spack/repos/builtin/packages/hoomd-blue/package.py
new file mode 100644
index 0000000000..d310b7687a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/hoomd-blue/package.py
@@ -0,0 +1,73 @@
+from spack import *
+import os
+
+class HoomdBlue(Package):
+ """HOOMD-blue is a general-purpose particle simulation toolkit. It scales
+ from a single CPU core to thousands of GPUs.
+
+ You define particle initial conditions and interactions in a high-level
+ python script. Then tell HOOMD-blue how you want to execute the job and it
+ takes care of the rest. Python job scripts give you unlimited flexibility
+ to create custom initialization routines, control simulation parameters,
+ and perform in situ analysis."""
+
+ homepage = "https://codeblue.umich.edu/hoomd-blue/index.html"
+ url = "https://bitbucket.org/glotzer/hoomd-blue/get/v1.3.3.tar.bz2"
+
+ version('1.3.3', '1469ef4531dc14b579c0acddbfe6a273')
+
+ variant('mpi', default=True, description='Compile with MPI enabled')
+ variant('cuda', default=True, description='Compile with CUDA Toolkit')
+ variant('doc', default=True, description='Generate documentation')
+
+ extends('python')
+ depends_on('py-numpy')
+ depends_on('boost+python')
+ depends_on('cmake')
+ depends_on('mpi', when='+mpi')
+ depends_on('cuda', when='+cuda')
+ depends_on('doxygen', when='+doc')
+
+ def install(self, spec, prefix):
+
+ cmake_args = [
+ '-DPYTHON_EXECUTABLE=%s/python' % spec['python'].prefix.bin,
+ '-DBOOST_ROOT=%s' % spec['boost' ].prefix
+ ]
+
+ # MPI support
+ if '+mpi' in spec:
+ os.environ['MPI_HOME'] = spec['mpi'].prefix
+ cmake_args.append('-DENABLE_MPI=ON')
+ else:
+ cmake_args.append('-DENABLE_MPI=OFF')
+
+ # CUDA support
+ if '+cuda' in spec:
+ cmake_args.append('-DENABLE_CUDA=ON')
+ else:
+ cmake_args.append('-DENABLE_CUDA=OFF')
+
+ # CUDA-aware MPI library support
+ #if '+cuda' in spec and '+mpi' in spec:
+ # cmake_args.append('-DENABLE_MPI_CUDA=ON')
+ #else:
+ # cmake_args.append('-DENABLE_MPI_CUDA=OFF')
+
+ # There may be a bug in the MPI-CUDA code. See:
+ # https://groups.google.com/forum/#!msg/hoomd-users/2griTESmc5I/E69s_M5fDwAJ
+ # This prevented "make test" from passing for me.
+ cmake_args.append('-DENABLE_MPI_CUDA=OFF')
+
+ # Documentation
+ if '+doc' in spec:
+ cmake_args.append('-DENABLE_DOXYGEN=ON')
+ else:
+ cmake_args.append('-DENABLE_DOXYGEN=OFF')
+
+ cmake_args.extend(std_cmake_args)
+ cmake('.', *cmake_args)
+
+ make()
+ make("test")
+ make("install")
diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py
index 8d93d48d1f..4b915daa68 100644
--- a/var/spack/repos/builtin/packages/hypre/package.py
+++ b/var/spack/repos/builtin/packages/hypre/package.py
@@ -14,6 +14,8 @@ class Hypre(Package):
# hypre does not know how to build shared libraries on Darwin
variant('shared', default=sys.platform!='darwin', description="Build shared library version (disables static library)")
+ # SuperluDist have conflicting headers with those in Hypre
+ variant('internal-superlu', default=True, description="Use internal Superlu routines")
depends_on("mpi")
depends_on("blas")
@@ -38,6 +40,12 @@ class Hypre(Package):
if '+shared' in self.spec:
configure_args.append("--enable-shared")
+ if '~internal-superlu' in self.spec:
+ configure_args.append("--without-superlu")
+ # MLI and FEI do not build without superlu on Linux
+ configure_args.append("--without-mli")
+ configure_args.append("--without-fei")
+
# Hypre's source is staged under ./src so we'll have to manually
# cd into it.
with working_dir("src"):
diff --git a/var/spack/repos/builtin/packages/kealib/package.py b/var/spack/repos/builtin/packages/kealib/package.py
new file mode 100644
index 0000000000..475d21e1d8
--- /dev/null
+++ b/var/spack/repos/builtin/packages/kealib/package.py
@@ -0,0 +1,35 @@
+from spack import *
+
+class Kealib(Package):
+ """An HDF5 Based Raster File Format
+
+ KEALib provides an implementation of the GDAL data model.
+ The format supports raster attribute tables, image pyramids,
+ meta-data and in-built statistics while also handling very
+ large files and compression throughout.
+
+ Based on the HDF5 standard, it also provides a base from which
+ other formats can be derived and is a good choice for long
+ term data archiving. An independent software library (libkea)
+ provides complete access to the KEA image format and a GDAL
+ driver allowing KEA images to be used from any GDAL supported software.
+
+ Development work on this project has been funded by Landcare Research.
+ """
+ homepage = "http://kealib.org/"
+ url = "https://bitbucket.org/chchrsc/kealib/get/kealib-1.4.5.tar.gz"
+
+ version('1.4.5', '112e9c42d980b2d2987a3c15d0833a5d')
+
+ depends_on("hdf5")
+
+ def install(self, spec, prefix):
+ with working_dir('trunk', create=False):
+ cmake_args = []
+ cmake_args.append("-DCMAKE_INSTALL_PREFIX=%s" % prefix)
+ cmake_args.append("-DHDF5_INCLUDE_DIR=%s" % spec['hdf5'].prefix.include)
+ cmake_args.append("-DHDF5_LIB_PATH=%s" % spec['hdf5'].prefix.lib)
+ cmake('.', *cmake_args)
+
+ make()
+ make("install")
diff --git a/var/spack/repos/builtin/packages/libdrm/package.py b/var/spack/repos/builtin/packages/libdrm/package.py
index 00736b7811..d5d779f796 100644
--- a/var/spack/repos/builtin/packages/libdrm/package.py
+++ b/var/spack/repos/builtin/packages/libdrm/package.py
@@ -2,7 +2,7 @@ from spack import *
class Libdrm(Package):
"""A userspace library for accessing the DRM, direct
- rendering manager, on Linux, BSD and other operating
+ rendering manager, on Linux, BSD and other operating
systems that support the ioctl interface."""
homepage = "http://dri.freedesktop.org/libdrm/" # no real website...
@@ -11,6 +11,8 @@ class Libdrm(Package):
version('2.4.59', '105ac7af1afcd742d402ca7b4eb168b6')
version('2.4.33', '86e4e3debe7087d5404461e0032231c8')
+ depends_on('libpciaccess')
+
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
diff --git a/var/spack/repos/builtin/packages/libpng/package.py b/var/spack/repos/builtin/packages/libpng/package.py
index e02b08663e..73c8c62341 100644
--- a/var/spack/repos/builtin/packages/libpng/package.py
+++ b/var/spack/repos/builtin/packages/libpng/package.py
@@ -9,6 +9,8 @@ class Libpng(Package):
version('1.6.15', '829a256f3de9307731d4f52dc071916d')
version('1.6.14', '2101b3de1d5f348925990f9aa8405660')
+ depends_on('zlib')
+
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
make()
diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py
index 68b9f6fd30..9301135f9f 100644
--- a/var/spack/repos/builtin/packages/metis/package.py
+++ b/var/spack/repos/builtin/packages/metis/package.py
@@ -24,7 +24,7 @@
##############################################################################
from spack import *
-import glob
+import glob,sys
class Metis(Package):
"""
@@ -90,3 +90,7 @@ class Metis(Package):
fs = glob.glob(join_path(source_directory,'GKlib',"*.h"))
for f in fs:
install(f, GKlib_dist)
+
+ # The shared library is not installed correctly on Darwin; correct this
+ if (sys.platform == 'darwin') and ('+shared' in spec):
+ fix_darwin_install_name(prefix.lib)
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py
index b20dc8dd60..2d7955e08d 100644
--- a/var/spack/repos/builtin/packages/mpich/package.py
+++ b/var/spack/repos/builtin/packages/mpich/package.py
@@ -78,6 +78,9 @@ class Mpich(Package):
if not self.compiler.fc:
config_args.append("--disable-fc")
+ if not self.compiler.fc and not self.compiler.f77:
+ config_args.append("--disable-fortran")
+
configure(*config_args)
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/mumps/Makefile.inc b/var/spack/repos/builtin/packages/mumps/Makefile.inc
index 2e6a041878..22d8f5518a 100644
--- a/var/spack/repos/builtin/packages/mumps/Makefile.inc
+++ b/var/spack/repos/builtin/packages/mumps/Makefile.inc
@@ -8,12 +8,9 @@ IORDERINGSF = $(ISCOTCH)
IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)
PLAT =
-LIBEXT = .a
-OUTC = -o
+OUTC = -o
OUTF = -o
RM = /bin/rm -f
-AR = ar vr
-RANLIB = ranlib
INCSEQ = -I$(topdir)/libseq
LIBSEQ = -L$(topdir)/libseq -lmpiseq
diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py
index 5a254dfd00..26440ab7c8 100644
--- a/var/spack/repos/builtin/packages/mumps/package.py
+++ b/var/spack/repos/builtin/packages/mumps/package.py
@@ -1,6 +1,5 @@
from spack import *
-import os
-
+import os, sys
class Mumps(Package):
"""MUMPS: a MUltifrontal Massively Parallel sparse direct Solver"""
@@ -19,6 +18,7 @@ class Mumps(Package):
variant('float', default=True, description='Activate the compilation of smumps')
variant('complex', default=True, description='Activate the compilation of cmumps and/or zmumps')
variant('idx64', default=False, description='Use int64_t/integer*8 as default index type')
+ variant('shared', default=True, description='Build shared libraries')
depends_on('scotch + esmumps', when='~ptscotch+scotch')
@@ -70,6 +70,9 @@ class Mumps(Package):
makefile_conf.append("ORDERINGSF = %s" % (' '.join(orderings)))
+ # when building shared libs need -fPIC, otherwise
+ # /usr/bin/ld: graph.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
+ fpic = '-fPIC' if '+shared' in self.spec else ''
# TODO: test this part, it needs a full blas, scalapack and
# partitionning environment with 64bit integers
if '+idx64' in self.spec:
@@ -77,14 +80,14 @@ class Mumps(Package):
# the fortran compilation flags most probably are
# working only for intel and gnu compilers this is
# perhaps something the compiler should provide
- ['OPTF = -O -DALLOW_NON_INIT %s' % '-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8',
- 'OPTL = -O ',
- 'OPTC = -O -DINTSIZE64'])
+ ['OPTF = %s -O -DALLOW_NON_INIT %s' % (fpic,'-fdefault-integer-8' if self.compiler.name == "gcc" else '-i8'),
+ 'OPTL = %s -O ' % fpic,
+ 'OPTC = %s -O -DINTSIZE64' % fpic])
else:
makefile_conf.extend(
- ['OPTF = -O -DALLOW_NON_INIT',
- 'OPTL = -O ',
- 'OPTC = -O '])
+ ['OPTF = %s -O -DALLOW_NON_INIT' % fpic,
+ 'OPTL = %s -O ' % fpic,
+ 'OPTC = %s -O ' % fpic])
if '+mpi' in self.spec:
@@ -105,6 +108,27 @@ class Mumps(Package):
# compiler possible values are -DAdd_, -DAdd__ and/or -DUPPER
makefile_conf.append("CDEFS = -DAdd_")
+ if '+shared' in self.spec:
+ if sys.platform == 'darwin':
+ # Building dylibs with mpif90 causes segfaults on 10.8 and 10.10. Use gfortran. (Homebrew)
+ makefile_conf.extend([
+ 'LIBEXT=.dylib',
+ 'AR=%s -dynamiclib -Wl,-install_name -Wl,%s/$(notdir $@) -undefined dynamic_lookup -o ' % (os.environ['FC'],prefix.lib),
+ 'RANLIB=echo'
+ ])
+ else:
+ makefile_conf.extend([
+ 'LIBEXT=.so',
+ 'AR=$(FL) -shared -Wl,-soname -Wl,%s/$(notdir $@) -o' % prefix.lib,
+ 'RANLIB=echo'
+ ])
+ else:
+ makefile_conf.extend([
+ 'LIBEXT = .a',
+ 'AR = ar vr',
+ 'RANLIB = ranlib'
+ ])
+
makefile_inc_template = join_path(os.path.dirname(self.module.__file__),
'Makefile.inc')
@@ -121,7 +145,7 @@ class Mumps(Package):
def install(self, spec, prefix):
make_libs = []
- # the coice to compile ?examples is to have kind of a sanity
+ # the choice to compile ?examples is to have kind of a sanity
# check on the libraries generated.
if '+float' in spec:
make_libs.append('sexamples')
@@ -135,10 +159,24 @@ class Mumps(Package):
self.write_makefile_inc()
- # Build fails in parallel, at least on OS-X
+ # Build fails in parallel
make(*make_libs, parallel=False)
install_tree('lib', prefix.lib)
install_tree('include', prefix.include)
if '~mpi' in spec:
- install('libseq/libmpiseq.a', prefix.lib)
+ lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so'
+ lib_suffix = lib_dsuffix if '+shared' in spec else '.a'
+ install('libseq/libmpiseq%s' % lib_suffix, prefix.lib)
+
+ # FIXME: extend the tests to mpirun -np 2 (or alike) when build with MPI
+ # FIXME: use something like numdiff to compare blessed output with the current
+ with working_dir('examples'):
+ if '+float' in spec:
+ os.system('./ssimpletest < input_simpletest_real')
+ if '+complex' in spec:
+ os.system('./csimpletest < input_simpletest_real')
+ if '+double' in spec:
+ os.system('./dsimpletest < input_simpletest_real')
+ if '+complex' in spec:
+ os.system('./zsimpletest < input_simpletest_cmplx')
diff --git a/var/spack/repos/builtin/packages/muparser/package.py b/var/spack/repos/builtin/packages/muparser/package.py
index a1a9ff90e5..19ca8ce287 100644
--- a/var/spack/repos/builtin/packages/muparser/package.py
+++ b/var/spack/repos/builtin/packages/muparser/package.py
@@ -14,5 +14,5 @@ class Muparser(Package):
configure(*options)
- make()
+ make(parallel=False)
make("install")
diff --git a/var/spack/repos/builtin/packages/netcdf-cxx/package.py b/var/spack/repos/builtin/packages/netcdf-cxx/package.py
new file mode 100644
index 0000000000..5334dfb853
--- /dev/null
+++ b/var/spack/repos/builtin/packages/netcdf-cxx/package.py
@@ -0,0 +1,15 @@
+from spack import *
+
+class NetcdfCxx(Package):
+ """C++ compatibility bindings for NetCDF"""
+ homepage = "http://www.unidata.ucar.edu/software/netcdf"
+ url = "http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx-4.2.tar.gz"
+
+ version('4.2', 'd32b20c00f144ae6565d9e98d9f6204c')
+
+ depends_on('netcdf')
+
+ def install(self, spec, prefix):
+ configure('--prefix=%s' % prefix)
+ make()
+ make("install")
diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
index c3e6822cdf..d59f8e41fe 100644
--- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
@@ -41,6 +41,11 @@ class NetlibScalapack(Package):
make()
make("install")
+ # The shared libraries are not installed correctly on Darwin; correct this
+ if (sys.platform == 'darwin') and ('+shared' in spec):
+ fix_darwin_install_name(prefix.lib)
+
+
def setup_dependent_package(self, module, dependent_spec):
spec = self.spec
lib_dsuffix = '.dylib' if sys.platform == 'darwin' else '.so'
diff --git a/var/spack/repos/builtin/packages/ninja/package.py b/var/spack/repos/builtin/packages/ninja/package.py
index 9e6bf4e358..0722dd49a6 100644
--- a/var/spack/repos/builtin/packages/ninja/package.py
+++ b/var/spack/repos/builtin/packages/ninja/package.py
@@ -16,7 +16,7 @@ class Ninja(Package):
cp = which('cp')
- bindir = os.path.join(prefix, 'bin')
+ bindir = os.path.join(prefix, 'bin/')
mkdir(bindir)
- cp('-a', '-t', bindir, 'ninja')
- cp('-ra', 'misc', prefix)
+ cp('-a', 'ninja', bindir)
+ cp('-a', 'misc', prefix)
diff --git a/var/spack/repos/builtin/packages/numdiff/package.py b/var/spack/repos/builtin/packages/numdiff/package.py
new file mode 100644
index 0000000000..e72c60fadb
--- /dev/null
+++ b/var/spack/repos/builtin/packages/numdiff/package.py
@@ -0,0 +1,44 @@
+##############################################################################
+# 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://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 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 *
+import sys
+
+class Numdiff(Package):
+ """Numdiff is a little program that can be used to compare putatively
+ similar files line by line and field by field, ignoring small numeric
+ differences or/and different numeric formats."""
+
+ homepage = 'https://www.nongnu.org/numdiff'
+ url = 'http://nongnu.askapache.com/numdiff/numdiff-5.8.1.tar.gz'
+
+ version('5.8.1', 'a295eb391f6cb1578209fc6b4f9d994e')
+
+ depends_on('gettext', sys.platform=='darwin')
+
+ def install(self, spec, prefix):
+ options = ['--prefix=%s' % prefix]
+ configure(*options)
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/oce/null.patch b/var/spack/repos/builtin/packages/oce/null.patch
new file mode 100644
index 0000000000..42a3f0e44f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/oce/null.patch
@@ -0,0 +1,482 @@
+From 61cb965b9ffeca419005bc15e635e67589c421dd Mon Sep 17 00:00:00 2001
+From: Martin Siggel <martin.siggel@dlr.de>
+Date: Thu, 28 Jan 2016 19:05:00 +0100
+Subject: [PATCH] Workaround clang optimizations for null references
+
+OCCT/OCE includes some evil code that uses NULL references,
+which are normally not possible. Clang removes code in
+branches like if(&myNullRef==NULL) as it assumes this can
+never be true. This fix was inspired from the mantis issue
+http://tracker.dev.opencascade.org/view.php?id=26042. This
+code will be fixed in OCCT 7, but we might require the fix
+for earlier releases as well.
+
+Fixes issue #576
+---
+ inc/PLib.hxx | 2 +-
+ src/BSplCLib/BSplCLib.cxx | 16 ++++++-------
+ src/BSplCLib/BSplCLib_2.cxx | 6 ++---
+ src/BSplCLib/BSplCLib_CurveComputation.gxx | 26 ++++++++++-----------
+ src/BSplSLib/BSplSLib.cxx | 36 +++++++++++++++---------------
+ src/BSplSLib/BSplSLib_BzSyntaxes.cxx | 2 +-
+ src/PLib/PLib.cxx | 10 ++++-----
+ 7 files changed, 49 insertions(+), 49 deletions(-)
+
+diff --git a/inc/PLib.hxx b/inc/PLib.hxx
+index 7513234..52b1f84 100644
+--- a/inc/PLib.hxx
++++ b/inc/PLib.hxx
+@@ -343,6 +343,6 @@ friend class PLib_DoubleJacobiPolynomial;
+
+
+
+-
++#define IS_NULL_REF(ref) ((reinterpret_cast<size_t>(&ref) & 0xFFFFFF) == 0)
+
+ #endif // _PLib_HeaderFile
+diff --git a/src/BSplCLib/BSplCLib.cxx b/src/BSplCLib/BSplCLib.cxx
+index 683e4ab..2a2d9ea 100644
+--- a/src/BSplCLib/BSplCLib.cxx
++++ b/src/BSplCLib/BSplCLib.cxx
+@@ -298,7 +298,7 @@ void BSplCLib::LocateParameter
+ Standard_Real& NewU)
+ {
+ Standard_Integer first,last;
+- if (&Mults) {
++ if (!IS_NULL_REF(Mults)) {
+ if (Periodic) {
+ first = Knots.Lower();
+ last = Knots.Upper();
+@@ -1434,7 +1434,7 @@ void BSplCLib::BuildKnots(const Standard_Integer Degree,
+ const Standard_Real * pkn = &Knots(KLower);
+ pkn -= KLower;
+ Standard_Real *knot = &LK;
+- if (&Mults == NULL) {
++ if (IS_NULL_REF(Mults)) {
+ switch (Degree) {
+ case 1 : {
+ Standard_Integer j = Index ;
+@@ -1672,7 +1672,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots
+ const Standard_Real Tolerance,
+ const Standard_Boolean Add)
+ {
+- Standard_Boolean addflat = &AddMults == NULL;
++ Standard_Boolean addflat = IS_NULL_REF(AddMults);
+
+ Standard_Integer first,last;
+ if (Periodic) {
+@@ -1856,7 +1856,7 @@ void BSplCLib::InsertKnots
+ const Standard_Real Tolerance,
+ const Standard_Boolean Add)
+ {
+- Standard_Boolean addflat = &AddMults == NULL;
++ Standard_Boolean addflat = IS_NULL_REF(AddMults);
+
+ Standard_Integer i,k,mult,firstmult;
+ Standard_Integer index,kn,curnk,curk;
+@@ -3902,7 +3902,7 @@ void BSplCLib::Resolution( Standard_Real& Poles,
+ num_poles = FlatKnots.Length() - Deg1;
+ switch (ArrayDimension) {
+ case 2 : {
+- if (&Weights != NULL) {
++ if (!IS_NULL_REF(Weights)) {
+ const Standard_Real * WG = &Weights(Weights.Lower());
+ min_weights = WG[0];
+
+@@ -3970,7 +3970,7 @@ void BSplCLib::Resolution( Standard_Real& Poles,
+ break;
+ }
+ case 3 : {
+- if (&Weights != NULL) {
++ if (!IS_NULL_REF(Weights)) {
+ const Standard_Real * WG = &Weights(Weights.Lower());
+ min_weights = WG[0];
+
+@@ -4047,7 +4047,7 @@ void BSplCLib::Resolution( Standard_Real& Poles,
+ break;
+ }
+ case 4 : {
+- if (&Weights != NULL) {
++ if (!IS_NULL_REF(Weights)) {
+ const Standard_Real * WG = &Weights(Weights.Lower());
+ min_weights = WG[0];
+
+@@ -4134,7 +4134,7 @@ void BSplCLib::Resolution( Standard_Real& Poles,
+ }
+ default : {
+ Standard_Integer kk;
+- if (&Weights != NULL) {
++ if (!IS_NULL_REF(Weights)) {
+ const Standard_Real * WG = &Weights(Weights.Lower());
+ min_weights = WG[0];
+
+diff --git a/src/BSplCLib/BSplCLib_2.cxx b/src/BSplCLib/BSplCLib_2.cxx
+index 35c4639..653b7cd 100644
+--- a/src/BSplCLib/BSplCLib_2.cxx
++++ b/src/BSplCLib/BSplCLib_2.cxx
+@@ -70,7 +70,7 @@ void BSplCLib::BuildEval(const Standard_Integer Degree,
+ Standard_Integer i;
+ Standard_Integer ip = PLower + Index - 1;
+ Standard_Real w, *pole = &LP;
+- if (&Weights == NULL) {
++ if (IS_NULL_REF(Weights)) {
+
+ for (i = 0; i <= Degree; i++) {
+ ip++;
+@@ -115,13 +115,13 @@ static void PrepareEval
+
+ // make the knots
+ BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots);
+- if (&Mults == NULL)
++ if (IS_NULL_REF(Mults))
+ index -= Knots.Lower() + Degree;
+ else
+ index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults);
+
+ // check truly rational
+- rational = (&Weights != NULL);
++ rational = (!IS_NULL_REF(Weights));
+ if (rational) {
+ Standard_Integer WLower = Weights.Lower() + index;
+ rational = BSplCLib::IsRational(Weights, WLower, WLower + Degree);
+diff --git a/src/BSplCLib/BSplCLib_CurveComputation.gxx b/src/BSplCLib/BSplCLib_CurveComputation.gxx
+index e71b4e0..9d42643 100644
+--- a/src/BSplCLib/BSplCLib_CurveComputation.gxx
++++ b/src/BSplCLib/BSplCLib_CurveComputation.gxx
+@@ -92,7 +92,7 @@ Standard_Boolean BSplCLib::RemoveKnot
+ TColStd_Array1OfInteger& NewMults,
+ const Standard_Real Tolerance)
+ {
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim;
+ dim = Dimension_gen;
+ if (rational) dim++;
+@@ -133,7 +133,7 @@ void BSplCLib::InsertKnots
+ const Standard_Real Epsilon,
+ const Standard_Boolean Add)
+ {
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim;
+ dim = Dimension_gen;
+ if (rational) dim++;
+@@ -222,7 +222,7 @@ void BSplCLib::IncreaseDegree
+ TColStd_Array1OfReal& NewKnots,
+ TColStd_Array1OfInteger& NewMults)
+ {
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim;
+ dim = Dimension_gen;
+ if (rational) dim++;
+@@ -256,7 +256,7 @@ void BSplCLib::Unperiodize
+ Array1OfPoints& NewPoles,
+ TColStd_Array1OfReal& NewWeights)
+ {
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim;
+ dim = Dimension_gen;
+ if (rational) dim++;
+@@ -292,7 +292,7 @@ void BSplCLib::Trimming(const Standard_Integer Degree,
+ Array1OfPoints& NewPoles,
+ TColStd_Array1OfReal& NewWeights)
+ {
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim;
+ dim = Dimension_gen;
+ if (rational) dim++;
+@@ -339,7 +339,7 @@ void BSplCLib::BuildEval(const Standard_Integer Degree,
+ Standard_Integer PUpper = Poles.Upper();
+ Standard_Integer i;
+ Standard_Integer ip = PLower + Index - 1;
+- if (&Weights == NULL) {
++ if (IS_NULL_REF(Weights)) {
+ for (i = 0; i <= Degree; i++) {
+ ip++;
+ if (ip > PUpper) ip = PLower;
+@@ -384,13 +384,13 @@ static void PrepareEval
+
+ // make the knots
+ BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots);
+- if (&Mults == NULL)
++ if (IS_NULL_REF(Mults))
+ index -= Knots.Lower() + Degree;
+ else
+ index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults);
+
+ // check truly rational
+- rational = (&Weights != NULL);
++ rational = (!IS_NULL_REF(Weights));
+ if (rational) {
+ Standard_Integer WLower = Weights.Lower() + index;
+ rational = BSplCLib::IsRational(Weights, WLower, WLower + Degree);
+@@ -741,7 +741,7 @@ void BSplCLib::CacheD0(const Standard_Real Parameter,
+ Degree * Dimension_gen,
+ PArray[0],
+ myPoint[0]) ;
+- if (&WeightsArray != NULL) {
++ if (!IS_NULL_REF(WeightsArray)) {
+ Standard_Real *
+ WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ;
+ PLib::NoDerivativeEvalPolynomial(NewParameter,
+@@ -798,7 +798,7 @@ void BSplCLib::CacheD1(const Standard_Real Parameter,
+
+ ModifyCoords (LocalPDerivatives + Dimension_gen, /= SpanLenght);
+
+- if (&WeightsArray != NULL) {
++ if (!IS_NULL_REF(WeightsArray)) {
+ Standard_Real *
+ WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ;
+ PLib::EvalPolynomial(NewParameter,
+@@ -878,7 +878,7 @@ void BSplCLib::CacheD2(const Standard_Real Parameter,
+ Index += Dimension_gen;
+ }
+
+- if (&WeightsArray != NULL) {
++ if (!IS_NULL_REF(WeightsArray)) {
+ Standard_Real *
+ WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ;
+
+@@ -971,7 +971,7 @@ void BSplCLib::CacheD3(const Standard_Real Parameter,
+ Index += Dimension_gen;
+ }
+
+- if (&WeightsArray != NULL) {
++ if (!IS_NULL_REF(WeightsArray)) {
+ Standard_Real *
+ WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ;
+
+@@ -1081,7 +1081,7 @@ void BSplCLib::BuildCache
+ LocalValue *= SpanDomain / (Standard_Real) ii ;
+ }
+
+- if (&Weights != NULL) {
++ if (!IS_NULL_REF(Weights)) {
+ for (ii = 1 ; ii <= Degree + 1 ; ii++)
+ CacheWeights(ii) = 0.0e0 ;
+ CacheWeights(1) = 1.0e0 ;
+diff --git a/src/BSplSLib/BSplSLib.cxx b/src/BSplSLib/BSplSLib.cxx
+index 5ad633c..07040d5 100644
+--- a/src/BSplSLib/BSplSLib.cxx
++++ b/src/BSplSLib/BSplSLib.cxx
+@@ -309,12 +309,12 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
+ BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots1);
+ BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots2);
+
+- if (&UMults == NULL)
++ if (IS_NULL_REF(UMults))
+ uindex -= UKLower + UDegree;
+ else
+ uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,UMults);
+
+- if (&VMults == NULL)
++ if (IS_NULL_REF(VMults))
+ vindex -= VKLower + VDegree;
+ else
+ vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,VMults);
+@@ -460,12 +460,12 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
+ BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots2);
+ BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots1);
+
+- if (&UMults == NULL)
++ if (IS_NULL_REF(UMults))
+ uindex -= UKLower + UDegree;
+ else
+ uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,UMults);
+
+- if (&VMults == NULL)
++ if (IS_NULL_REF(VMults))
+ vindex -= VKLower + VDegree;
+ else
+ vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,VMults);
+@@ -1299,7 +1299,7 @@ void BSplSLib::Iso(const Standard_Real Param,
+ {
+ Standard_Integer index = 0;
+ Standard_Real u = Param;
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim = rational ? 4 : 3;
+
+ // compute local knots
+@@ -1307,7 +1307,7 @@ void BSplSLib::Iso(const Standard_Real Param,
+ NCollection_LocalArray<Standard_Real> locknots1 (2*Degree);
+ BSplCLib::LocateParameter(Degree,Knots,Mults,u,Periodic,index,u);
+ BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*locknots1);
+- if (&Mults == NULL)
++ if (IS_NULL_REF(Mults))
+ index -= Knots.Lower() + Degree;
+ else
+ index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults);
+@@ -1381,7 +1381,7 @@ void BSplSLib::Iso(const Standard_Real Param,
+ }
+
+ // if the input is not rational but weights are wanted
+- if (!rational && (&CWeights != NULL)) {
++ if (!rational && (!IS_NULL_REF(CWeights))) {
+
+ for (i = CWeights.Lower(); i <= CWeights.Upper(); i++)
+ CWeights(i) = 1.;
+@@ -1741,7 +1741,7 @@ void BSplSLib::InsertKnots(const Standard_Boolean UDirection,
+ const Standard_Real Epsilon,
+ const Standard_Boolean Add )
+ {
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim = 3;
+ if (rational) dim++;
+
+@@ -1787,7 +1787,7 @@ Standard_Boolean BSplSLib::RemoveKnot
+ TColStd_Array1OfInteger& NewMults,
+ const Standard_Real Tolerance)
+ {
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim = 3;
+ if (rational) dim++;
+
+@@ -1834,7 +1834,7 @@ void BSplSLib::IncreaseDegree
+ TColStd_Array1OfReal& NewKnots,
+ TColStd_Array1OfInteger& NewMults)
+ {
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim = 3;
+ if (rational) dim++;
+
+@@ -1876,7 +1876,7 @@ void BSplSLib::Unperiodize
+ TColgp_Array2OfPnt& NewPoles,
+ TColStd_Array2OfReal& NewWeights)
+ {
+- Standard_Boolean rational = &Weights != NULL;
++ Standard_Boolean rational = !IS_NULL_REF(Weights);
+ Standard_Integer dim = 3;
+ if (rational) dim++;
+
+@@ -1929,7 +1929,7 @@ void BSplSLib::BuildCache
+ Standard_Boolean rational,rational_u,rational_v,flag_u_or_v;
+ Standard_Integer kk,d1,d1p1,d2,d2p1,ii,jj,iii,jjj,Index;
+ Standard_Real u1,min_degree_domain,max_degree_domain,f,factor[2],u2;
+- if (&Weights != NULL)
++ if (!IS_NULL_REF(Weights))
+ rational_u = rational_v = Standard_True;
+ else
+ rational_u = rational_v = Standard_False;
+@@ -2025,7 +2025,7 @@ void BSplSLib::BuildCache
+ }
+ factor[0] *= max_degree_domain / (Standard_Real) (iii) ;
+ }
+- if (&Weights != NULL) {
++ if (!IS_NULL_REF(Weights)) {
+ //
+ // means that PrepareEval did found out that the surface was
+ // locally polynomial but since the surface is constructed
+@@ -2110,7 +2110,7 @@ void BSplSLib::CacheD0(const Standard_Real UParameter,
+ (min_degree << 1) + min_degree,
+ locpoles[0],
+ myPoint[0]) ;
+- if (&WeightsArray != NULL) {
++ if (!IS_NULL_REF(WeightsArray)) {
+ dimension = min_degree + 1 ;
+ Standard_Real *
+ WArray = (Standard_Real *)
+@@ -2190,7 +2190,7 @@ void BSplSLib::CacheD1(const Standard_Real UParameter,
+ // the coefficients
+ //
+ //
+- if (&WeightsArray != NULL) {
++ if (!IS_NULL_REF(WeightsArray)) {
+
+ local_poles_array [0][0][0] = 0.0e0 ;
+ local_poles_array [0][0][1] = 0.0e0 ;
+@@ -2275,7 +2275,7 @@ void BSplSLib::CacheD1(const Standard_Real UParameter,
+ locpoles[dimension],
+ local_poles_array[1][0][0]) ;
+
+- if (&WeightsArray != NULL) {
++ if (!IS_NULL_REF(WeightsArray)) {
+ dimension = min_degree + 1 ;
+ Standard_Real *
+ WArray = (Standard_Real *)
+@@ -2435,7 +2435,7 @@ void BSplSLib::CacheD2(const Standard_Real UParameter,
+ // the coefficients
+ //
+ //
+- if (&WeightsArray != NULL) {
++ if (!IS_NULL_REF(WeightsArray)) {
+
+ local_poles_and_weights_array[0][0][0] = 0.0e0 ;
+ local_poles_and_weights_array[0][0][1] = 0.0e0 ;
+@@ -2564,7 +2564,7 @@ void BSplSLib::CacheD2(const Standard_Real UParameter,
+ locpoles[dimension + dimension],
+ local_poles_array[2][0][0]) ;
+
+- if (&WeightsArray != NULL) {
++ if (!IS_NULL_REF(WeightsArray)) {
+ dimension = min_degree + 1 ;
+ Standard_Real *
+ WArray = (Standard_Real *)
+diff --git a/src/BSplSLib/BSplSLib_BzSyntaxes.cxx b/src/BSplSLib/BSplSLib_BzSyntaxes.cxx
+index 0faf6b6..f2c0f74 100644
+--- a/src/BSplSLib/BSplSLib_BzSyntaxes.cxx
++++ b/src/BSplSLib/BSplSLib_BzSyntaxes.cxx
+@@ -68,7 +68,7 @@ void BSplSLib::PolesCoefficients (const TColgp_Array2OfPnt& Poles,
+ biduflatknots,bidvflatknots,
+ Poles,Weights,
+ CPoles,CWeights);
+- if (&Weights == NULL) {
++ if (IS_NULL_REF(Weights)) {
+
+ for (ii = 1; ii <= uclas; ii++) {
+
+diff --git a/src/PLib/PLib.cxx b/src/PLib/PLib.cxx
+index 23fa302..7ee231f 100644
+--- a/src/PLib/PLib.cxx
++++ b/src/PLib/PLib.cxx
+@@ -2427,7 +2427,7 @@ void PLib::CoefficientsPoles (const Standard_Integer dim,
+ TColStd_Array1OfReal& Poles,
+ TColStd_Array1OfReal& Weights)
+ {
+- Standard_Boolean rat = &WCoefs != NULL;
++ Standard_Boolean rat = !IS_NULL_REF(WCoefs);
+ Standard_Integer loc = Coefs.Lower();
+ Standard_Integer lop = Poles.Lower();
+ Standard_Integer lowc=0;
+@@ -2550,7 +2550,7 @@ void PLib::Trimming(const Standard_Real U1,
+ Standard_Integer indc, indw=0;
+ Standard_Integer upc = Coefs.Upper() - dim + 1, upw=0;
+ Standard_Integer len = Coefs.Length()/dim;
+- Standard_Boolean rat = &WCoefs != NULL;
++ Standard_Boolean rat = !IS_NULL_REF(WCoefs);
+
+ if (rat) {
+ if(len != WCoefs.Length())
+@@ -2607,7 +2607,7 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
+ TColgp_Array2OfPnt& Poles,
+ TColStd_Array2OfReal& Weights)
+ {
+- Standard_Boolean rat = (&WCoefs != NULL);
++ Standard_Boolean rat = (!IS_NULL_REF(WCoefs));
+ Standard_Integer LowerRow = Poles.LowerRow();
+ Standard_Integer UpperRow = Poles.UpperRow();
+ Standard_Integer LowerCol = Poles.LowerCol();
+@@ -2701,7 +2701,7 @@ void PLib::UTrimming(const Standard_Real U1,
+ TColgp_Array2OfPnt& Coeffs,
+ TColStd_Array2OfReal& WCoeffs)
+ {
+- Standard_Boolean rat = &WCoeffs != NULL;
++ Standard_Boolean rat = !IS_NULL_REF(WCoeffs);
+ Standard_Integer lr = Coeffs.LowerRow();
+ Standard_Integer ur = Coeffs.UpperRow();
+ Standard_Integer lc = Coeffs.LowerCol();
+@@ -2735,7 +2735,7 @@ void PLib::VTrimming(const Standard_Real V1,
+ TColgp_Array2OfPnt& Coeffs,
+ TColStd_Array2OfReal& WCoeffs)
+ {
+- Standard_Boolean rat = &WCoeffs != NULL;
++ Standard_Boolean rat = !IS_NULL_REF(WCoeffs);
+ Standard_Integer lr = Coeffs.LowerRow();
+ Standard_Integer ur = Coeffs.UpperRow();
+ Standard_Integer lc = Coeffs.LowerCol(); \ No newline at end of file
diff --git a/var/spack/repos/builtin/packages/oce/package.py b/var/spack/repos/builtin/packages/oce/package.py
index 06acb96736..3fe6638e66 100644
--- a/var/spack/repos/builtin/packages/oce/package.py
+++ b/var/spack/repos/builtin/packages/oce/package.py
@@ -1,5 +1,5 @@
from spack import *
-import platform
+import platform, sys
class Oce(Package):
"""
@@ -13,9 +13,20 @@ class Oce(Package):
version('0.17' , 'f1a89395c4b0d199bea3db62b85f818d')
version('0.16.1', '4d591b240c9293e879f50d86a0cb2bb3')
version('0.16' , '7a4b4df5a104d75a537e25e7dd387eca')
- version('0.15' , '7ec541a1c350ca8a684f74980e48801c')
+
+ variant('tbb', default=True, description='Build with Intel Threading Building Blocks')
depends_on('cmake@2.8:')
+ depends_on('tbb', when='+tbb')
+
+ # There is a bug in OCE which appears with Clang (version?) or GCC 6.0
+ # and has to do with compiler optimization, see
+ # https://github.com/tpaviot/oce/issues/576
+ # http://tracker.dev.opencascade.org/view.php?id=26042
+ # https://github.com/tpaviot/oce/issues/605
+ # https://github.com/tpaviot/oce/commit/61cb965b9ffeca419005bc15e635e67589c421dd.patch
+ patch('null.patch',when='@0.16:0.17.1')
+
def install(self, spec, prefix):
options = []
@@ -23,12 +34,12 @@ class Oce(Package):
options.extend([
'-DOCE_INSTALL_PREFIX=%s' % prefix,
'-DOCE_BUILD_SHARED_LIB:BOOL=ON',
- '-DOCE_BUILD_TYPE:STRING=Release',
+ '-DCMAKE_BUILD_TYPE:STRING=Release',
'-DOCE_DATAEXCHANGE:BOOL=ON',
'-DOCE_DISABLE_X11:BOOL=ON',
'-DOCE_DRAW:BOOL=OFF',
'-DOCE_MODEL:BOOL=ON',
- '-DOCE_MULTITHREAD_LIBRARY:STRING=NONE', # FIXME: add tbb
+ '-DOCE_MULTITHREAD_LIBRARY:STRING=%s' % ('TBB' if '+tbb' in spec else 'NONE'),
'-DOCE_OCAF:BOOL=ON',
'-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=OFF',
'-DOCE_VISUALISATION:BOOL=OFF',
@@ -45,3 +56,12 @@ class Oce(Package):
cmake('.', *options)
make("install/strip")
+
+ # OCE tests build is brocken at least on Darwin.
+ # Unit tests are linked against libTKernel.10.dylib isntead of /full/path/libTKernel.10.dylib
+ # see https://github.com/tpaviot/oce/issues/612
+ # make("test")
+
+ # The shared libraries are not installed correctly on Darwin; correct this
+ if (sys.platform == 'darwin'):
+ fix_darwin_install_name(prefix.lib)
diff --git a/var/spack/repos/builtin/packages/openjpeg/package.py b/var/spack/repos/builtin/packages/openjpeg/package.py
new file mode 100644
index 0000000000..afec197d11
--- /dev/null
+++ b/var/spack/repos/builtin/packages/openjpeg/package.py
@@ -0,0 +1,26 @@
+from spack import *
+
+class Openjpeg(Package):
+ """
+ OpenJPEG is an open-source JPEG 2000 codec written in C language.
+ It has been developed in order to promote the use of JPEG 2000, a
+ still-image compression standard from the Joint Photographic
+ Experts Group (JPEG).
+ Since April 2015, it is officially recognized by ISO/IEC and
+ ITU-T as a JPEG 2000 Reference Software.
+ """
+ homepage = "https://github.com/uclouvain/openjpeg"
+ url = "https://github.com/uclouvain/openjpeg/archive/version.2.1.tar.gz"
+
+ version('2.1' , '3e1c451c087f8462955426da38aa3b3d')
+ version('2.0.1', '105876ed43ff7dbb2f90b41b5a43cfa5')
+ version('2.0' , 'cdf266530fee8af87454f15feb619609')
+ version('1.5.2', '545f98923430369a6b046ef3632ef95c')
+ version('1.5.1', 'd774e4b5a0db5f0f171c4fc0aabfa14e')
+
+
+ def install(self, spec, prefix):
+ cmake('.', *std_cmake_args)
+
+ make()
+ make("install")
diff --git a/var/spack/repos/builtin/packages/parmetis/package.py b/var/spack/repos/builtin/packages/parmetis/package.py
index f5b8b6de91..ff4370aa4b 100644
--- a/var/spack/repos/builtin/packages/parmetis/package.py
+++ b/var/spack/repos/builtin/packages/parmetis/package.py
@@ -24,7 +24,7 @@
##############################################################################
from spack import *
-
+import sys
class Parmetis(Package):
"""
@@ -83,3 +83,7 @@ class Parmetis(Package):
cmake(source_directory, *options)
make()
make("install")
+
+ # The shared library is not installed correctly on Darwin; correct this
+ if (sys.platform == 'darwin') and ('+shared' in spec):
+ fix_darwin_install_name(prefix.lib)
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py
index 3dd117eed1..5c1fc6cc92 100644
--- a/var/spack/repos/builtin/packages/petsc/package.py
+++ b/var/spack/repos/builtin/packages/petsc/package.py
@@ -17,14 +17,18 @@ class Petsc(Package):
version('3.5.1', 'a557e029711ebf425544e117ffa44d8f')
version('3.4.4', '7edbc68aa6d8d6a3295dd5f6c2f6979d')
- variant('shared', default=True, description='Enables the build of shared libraries')
- variant('mpi', default=True, description='Activates MPI support')
- variant('double', default=True, description='Switches between single and double precision')
-
- variant('metis', default=True, description='Activates support for metis and parmetis')
- variant('hdf5', default=True, description='Activates support for HDF5 (only parallel)')
- variant('boost', default=True, description='Activates support for Boost')
- variant('hypre', default=True, description='Activates support for Hypre')
+ variant('shared', default=True, description='Enables the build of shared libraries')
+ variant('mpi', default=True, description='Activates MPI support')
+ variant('double', default=True, description='Switches between single and double precision')
+ variant('complex', default=False, description='Build with complex numbers')
+ variant('debug', default=False, description='Compile in debug mode')
+
+ variant('metis', default=True, description='Activates support for metis and parmetis')
+ variant('hdf5', default=True, description='Activates support for HDF5 (only parallel)')
+ variant('boost', default=True, description='Activates support for Boost')
+ variant('hypre', default=True, description='Activates support for Hypre (only parallel)')
+ variant('mumps', default=True, description='Activates support for MUMPS (only parallel)')
+ variant('superlu-dist', default=True, description='Activates support for SuperluDist (only parallel)')
# Virtual dependencies
depends_on('blas')
@@ -40,7 +44,13 @@ class Petsc(Package):
depends_on('hdf5+mpi', when='+hdf5+mpi')
depends_on('parmetis', when='+metis+mpi')
- depends_on('hypre', when='+hypre+mpi')
+ # Hypre does not support complex numbers.
+ # Also PETSc prefer to build it without internal superlu, likely due to conflict in headers
+ # see https://bitbucket.org/petsc/petsc/src/90564b43f6b05485163c147b464b5d6d28cde3ef/config/BuildSystem/config/packages/hypre.py
+ depends_on('hypre~internal-superlu', when='+hypre+mpi~complex')
+ depends_on('superlu-dist', when='+superlu-dist+mpi')
+ depends_on('mumps+mpi', when='+mumps+mpi')
+ depends_on('scalapack', when='+mumps+mpi')
def mpi_dependent_options(self):
if '~mpi' in self.spec:
@@ -55,38 +65,30 @@ class Petsc(Package):
# If mpi is disabled (~mpi), it's an error to have any of these enabled.
# This generates a list of any such errors.
errors = [error_message_fmt.format(library=x)
- for x in ('hdf5', 'hypre', 'parmetis')
+ for x in ('hdf5', 'hypre', 'parmetis','mumps','superlu-dist')
if ('+'+x) in self.spec]
if errors:
errors = ['incompatible variants given'] + errors
raise RuntimeError('\n'.join(errors))
else:
- if self.compiler.name == "clang":
- compiler_opts = [
- '--with-mpi=1',
- '--with-cc=%s -Qunused-arguments' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # Avoid confusing PETSc config by clang: warning: argument unused during compilation
- '--with-cxx=%s -Qunused-arguments' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'),
- '--with-fc=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'),
- '--with-f77=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif77'),
- ]
- else:
- compiler_opts = [
- '--with-mpi=1',
- '--with-mpi-dir=%s' % self.spec['mpi'].prefix,
- ]
+ compiler_opts = [
+ '--with-mpi=1',
+ '--with-mpi-dir=%s' % self.spec['mpi'].prefix,
+ ]
return compiler_opts
def install(self, spec, prefix):
- options = ['--with-debugging=0',
- '--with-ssl=0']
+ options = ['--with-ssl=0']
options.extend(self.mpi_dependent_options())
options.extend([
'--with-precision=%s' % ('double' if '+double' in spec else 'single'),
+ '--with-scalar-type=%s' % ('complex' if '+complex' in spec else 'real'),
'--with-shared-libraries=%s' % ('1' if '+shared' in spec else '0'),
+ '--with-debugging=%s' % ('1' if '+debug' in spec else '0'),
'--with-blas-lapack-dir=%s' % spec['lapack'].prefix
])
# Activates library support if needed
- for library in ('metis', 'boost', 'hdf5', 'hypre', 'parmetis'):
+ for library in ('metis', 'boost', 'hdf5', 'hypre', 'parmetis','mumps','scalapack'):
options.append(
'--with-{library}={value}'.format(library=library, value=('1' if library in spec else '0'))
)
@@ -94,6 +96,17 @@ class Petsc(Package):
options.append(
'--with-{library}-dir={path}'.format(library=library, path=spec[library].prefix)
)
+ # PETSc does not pick up SuperluDist from the dir as they look for superlu_dist_4.1.a
+ if 'superlu-dist' in spec:
+ options.extend([
+ '--with-superlu_dist-include=%s' % spec['superlu-dist'].prefix.include,
+ '--with-superlu_dist-lib=%s' % join_path(spec['superlu-dist'].prefix.lib, 'libsuperlu_dist.a'),
+ '--with-superlu_dist=1'
+ ])
+ else:
+ options.append(
+ '--with-superlu_dist=0'
+ )
configure('--prefix=%s' % prefix, *options)
diff --git a/var/spack/repos/builtin/packages/py-bottleneck/package.py b/var/spack/repos/builtin/packages/py-bottleneck/package.py
new file mode 100644
index 0000000000..0aa4208b4d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-bottleneck/package.py
@@ -0,0 +1,14 @@
+from spack import *
+
+class PyBottleneck(Package):
+ """Bottleneck is a collection of fast NumPy array functions written in Cython."""
+ homepage = "https://pypi.python.org/pypi/Bottleneck/1.0.0"
+ url = "https://pypi.python.org/packages/source/B/Bottleneck/Bottleneck-1.0.0.tar.gz"
+
+ version('1.0.0', '380fa6f275bd24f27e7cf0e0d752f5d2')
+
+ extends('python', ignore=r'bin/f2py$')
+ depends_on('py-numpy')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-cython/package.py b/var/spack/repos/builtin/packages/py-cython/package.py
index 68eb735ad9..072355026e 100644
--- a/var/spack/repos/builtin/packages/py-cython/package.py
+++ b/var/spack/repos/builtin/packages/py-cython/package.py
@@ -3,10 +3,14 @@ from spack import *
class PyCython(Package):
"""The Cython compiler for writing C extensions for the Python language."""
homepage = "https://pypi.python.org/pypi/cython"
- url = "https://pypi.python.org/packages/source/C/Cython/cython-0.22.tar.gz"
+ url = "https://pypi.python.org/packages/source/C/Cython/Cython-0.22.tar.gz"
- version('0.21.2', 'd21adb870c75680dc857cd05d41046a4')
+ version('0.23.5', '66b62989a67c55af016c916da36e7514')
+ version('0.23.4', '157df1f69bcec6b56fd97e0f2e057f6e')
+
+ # These versions contain illegal Python3 code...
version('0.22', '1ae25add4ef7b63ee9b4af697300d6b6')
+ version('0.21.2', 'd21adb870c75680dc857cd05d41046a4')
extends('python')
diff --git a/var/spack/repos/builtin/packages/py-dateutil/package.py b/var/spack/repos/builtin/packages/py-dateutil/package.py
index 0a17f2f2d2..b67e91ace6 100644
--- a/var/spack/repos/builtin/packages/py-dateutil/package.py
+++ b/var/spack/repos/builtin/packages/py-dateutil/package.py
@@ -7,6 +7,7 @@ class PyDateutil(Package):
version('2.4.0', '75714163bb96bedd07685cdb2071b8bc')
version('2.4.2', '4ef68e1c485b09e9f034e10473e5add2')
+ version('2.5.2', 'eafe168e8f404bf384514f5116eedbb6')
extends('python')
depends_on('py-setuptools')
diff --git a/var/spack/repos/builtin/packages/py-libxml2/package.py b/var/spack/repos/builtin/packages/py-libxml2/package.py
deleted file mode 100644
index 59005428e4..0000000000
--- a/var/spack/repos/builtin/packages/py-libxml2/package.py
+++ /dev/null
@@ -1,15 +0,0 @@
-from spack import *
-
-class PyLibxml2(Package):
- """A Python wrapper around libxml2."""
- homepage = "https://xmlsoft.org/python.html"
- url = "ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.21.tar.gz"
-
- version('2.6.21', '229dd2b3d110a77defeeaa73af83f7f3')
-
- extends('python')
- depends_on('libxml2')
- depends_on('libxslt')
-
- def install(self, spec, prefix):
- python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-matplotlib/package.py b/var/spack/repos/builtin/packages/py-matplotlib/package.py
index 2167735fb8..45e77dd631 100644
--- a/var/spack/repos/builtin/packages/py-matplotlib/package.py
+++ b/var/spack/repos/builtin/packages/py-matplotlib/package.py
@@ -12,7 +12,7 @@ class PyMatplotlib(Package):
variant('gui', default=False, description='Enable GUI')
variant('ipython', default=False, description='Enable ipython support')
- extends('python', ignore=r'bin/nosetests.*$|bin/pbr$')
+ extends('python', ignore=r'bin/nosetests.*$|bin/pbr$|bin/f2py$')
depends_on('py-pyside', when='+gui')
depends_on('py-ipython', when='+ipython')
diff --git a/var/spack/repos/builtin/packages/py-netcdf/package.py b/var/spack/repos/builtin/packages/py-netcdf/package.py
new file mode 100644
index 0000000000..7faa15ad25
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-netcdf/package.py
@@ -0,0 +1,16 @@
+from spack import *
+
+class PyNetcdf(Package):
+ """Python interface to the netCDF Library."""
+ homepage = "http://unidata.github.io/netcdf4-python"
+ url = "https://github.com/Unidata/netcdf4-python/tarball/v1.2.3.1rel"
+
+ version('1.2.3.1', '4fc4320d4f2a77b894ebf8da1c9895af')
+
+ extends('python')
+ depends_on('py-numpy')
+ depends_on('py-cython')
+ depends_on('netcdf')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-nose/package.py b/var/spack/repos/builtin/packages/py-nose/package.py
index 4fee99098e..c2c2b52e03 100644
--- a/var/spack/repos/builtin/packages/py-nose/package.py
+++ b/var/spack/repos/builtin/packages/py-nose/package.py
@@ -10,6 +10,7 @@ class PyNose(Package):
version('1.3.4', '6ed7169887580ddc9a8e16048d38274d')
version('1.3.6', '0ca546d81ca8309080fc80cb389e7a16')
+ version('1.3.7', '4d3ad0ff07b61373d2cefc89c5d0b20b')
extends('python', ignore=r'bin/nosetests.*$')
depends_on('py-setuptools')
diff --git a/var/spack/repos/builtin/packages/py-numexpr/package.py b/var/spack/repos/builtin/packages/py-numexpr/package.py
index 89f8a525b1..081a79dec6 100644
--- a/var/spack/repos/builtin/packages/py-numexpr/package.py
+++ b/var/spack/repos/builtin/packages/py-numexpr/package.py
@@ -7,8 +7,9 @@ class PyNumexpr(Package):
url = "https://pypi.python.org/packages/source/n/numexpr/numexpr-2.4.6.tar.gz"
version('2.4.6', '17ac6fafc9ea1ce3eb970b9abccb4fbd')
+ version('2.5', '84f66cced45ba3e30dcf77a937763aaa')
- extends('python')
+ extends('python', ignore=r'bin/f2py$')
depends_on('py-numpy')
def install(self, spec, prefix):
diff --git a/var/spack/repos/builtin/packages/py-numpy/package.py b/var/spack/repos/builtin/packages/py-numpy/package.py
index a08e612df6..40988fb44a 100644
--- a/var/spack/repos/builtin/packages/py-numpy/package.py
+++ b/var/spack/repos/builtin/packages/py-numpy/package.py
@@ -9,6 +9,7 @@ class PyNumpy(Package):
homepage = "http://www.numpy.org/"
url = "https://pypi.python.org/packages/source/n/numpy/numpy-1.9.1.tar.gz"
+ version('1.11.0', 'bc56fb9fc2895aa4961802ffbdb31d0b')
version('1.10.4', 'aed294de0aa1ac7bd3f9745f4f1968ad')
version('1.9.2', 'a1ed53432dbcd256398898d35bc8e645')
version('1.9.1', '78842b73560ec378142665e712ae4ad9')
diff --git a/var/spack/repos/builtin/packages/py-pandas/package.py b/var/spack/repos/builtin/packages/py-pandas/package.py
index 5b9997faa9..2320b1f92f 100644
--- a/var/spack/repos/builtin/packages/py-pandas/package.py
+++ b/var/spack/repos/builtin/packages/py-pandas/package.py
@@ -8,18 +8,15 @@ class PyPandas(Package):
version('0.16.0', 'bfe311f05dc0c351f8955fbd1e296e73')
version('0.16.1', 'fac4f25748f9610a3e00e765474bdea8')
+ version('0.18.0', 'f143762cd7a59815e348adf4308d2cf6')
- extends('python')
+ extends('python', ignore=r'bin/f2py$')
depends_on('py-dateutil')
depends_on('py-numpy')
- depends_on('py-matplotlib')
- depends_on('py-scipy')
depends_on('py-setuptools')
depends_on('py-pytz')
- depends_on('libdrm')
- depends_on('libpciaccess')
- depends_on('llvm')
- depends_on('mesa')
+ depends_on('py-numexpr')
+ depends_on('py-bottleneck')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-pytz/package.py b/var/spack/repos/builtin/packages/py-pytz/package.py
index da6311a784..060cf0cde4 100644
--- a/var/spack/repos/builtin/packages/py-pytz/package.py
+++ b/var/spack/repos/builtin/packages/py-pytz/package.py
@@ -7,6 +7,7 @@ class PyPytz(Package):
version('2014.10', 'eb1cb941a20c5b751352c52486aa1dd7')
version('2015.4', '417a47b1c432d90333e42084a605d3d8')
+ version('2016.3', 'abae92c3301b27bd8a9f56b14f52cb29')
extends('python')
diff --git a/var/spack/repos/builtin/packages/py-setuptools/package.py b/var/spack/repos/builtin/packages/py-setuptools/package.py
index 26c048bfd4..c6d9be1add 100644
--- a/var/spack/repos/builtin/packages/py-setuptools/package.py
+++ b/var/spack/repos/builtin/packages/py-setuptools/package.py
@@ -9,6 +9,7 @@ class PySetuptools(Package):
version('16.0', '0ace0b96233516fc5f7c857d086aa3ad')
version('18.1', 'f72e87f34fbf07f299f6cb46256a0b06')
version('19.2', '78353b1f80375ca5e088f4b4627ffe03')
+ version('20.5', 'fadc1e1123ddbe31006e5e43e927362b')
extends('python')
diff --git a/var/spack/repos/builtin/packages/py-six/package.py b/var/spack/repos/builtin/packages/py-six/package.py
index 05c5bd00a9..df277100f7 100644
--- a/var/spack/repos/builtin/packages/py-six/package.py
+++ b/var/spack/repos/builtin/packages/py-six/package.py
@@ -6,6 +6,7 @@ class PySix(Package):
url = "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz"
version('1.9.0', '476881ef4012262dfc8adc645ee786c4')
+ version('1.10.0', '34eed507548117b2ab523ab14b2f8b55')
extends('python')
depends_on('py-setuptools')
diff --git a/var/spack/repos/builtin/packages/py-tuiview/package.py b/var/spack/repos/builtin/packages/py-tuiview/package.py
new file mode 100644
index 0000000000..984b4196b1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-tuiview/package.py
@@ -0,0 +1,19 @@
+from spack import *
+
+class PyTuiview(Package):
+ """
+ TuiView is a lightweight raster GIS with powerful raster attribute
+ table manipulation abilities.
+ """
+ homepage = "https://bitbucket.org/chchrsc/tuiview"
+ url = "https://bitbucket.org/chchrsc/tuiview/get/tuiview-1.1.7.tar.gz"
+
+ version('1.1.7', '4b3b38a820cc239c8ab4a181ac5d4c30')
+
+ extends("python")
+ depends_on("py-pyqt")
+ depends_on("py-numpy")
+ depends_on("gdal")
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-virtualenv/package.py b/var/spack/repos/builtin/packages/py-virtualenv/package.py
index 037a6fc59f..09303d37b4 100644
--- a/var/spack/repos/builtin/packages/py-virtualenv/package.py
+++ b/var/spack/repos/builtin/packages/py-virtualenv/package.py
@@ -8,6 +8,7 @@ class PyVirtualenv(Package):
version('1.11.6', 'f61cdd983d2c4e6aeabb70b1060d6f49')
version('13.0.1', '1ffc011bde6667f0e37ecd976f4934db')
+ version('15.0.1', '28d76a0d9cbd5dc42046dd14e76a6ecc')
extends('python')
depends_on('py-setuptools')
diff --git a/var/spack/repos/builtin/packages/subversion/package.py b/var/spack/repos/builtin/packages/subversion/package.py
new file mode 100644
index 0000000000..5db1c3eb92
--- /dev/null
+++ b/var/spack/repos/builtin/packages/subversion/package.py
@@ -0,0 +1,77 @@
+##############################################################################
+# 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://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 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 *
+#import os
+
+class Subversion(Package):
+ """Apache Subversion - an open source version control system."""
+ homepage = 'https://subversion.apache.org/'
+ url = 'http://archive.apache.org/dist/subversion/subversion-1.8.13.tar.gz'
+
+ version('1.8.13', '8065b3698d799507fb72dd7926ed32b6')
+ version('1.9.3', 'a92bcfaec4e5038f82c74a7b5bbd2f46')
+
+ depends_on('apr')
+ depends_on('apr-util')
+ depends_on('zlib')
+ depends_on('sqlite')
+
+ # Optional: We need swig if we want the Perl, Python or Ruby
+ # bindings.
+ #depends_on('swig')
+ #depends_on('python')
+ #depends_on('perl')
+ #depends_on('ruby')
+
+ def install(self, spec, prefix):
+
+ # configure, build, install:
+ # Ref: http://www.linuxfromscratch.org/blfs/view/svn/general/subversion.html
+ options = ['--prefix=%s' % prefix]
+ options.append('--with-apr=%s' % spec['apr'].prefix)
+ options.append('--with-apr-util=%s' % spec['apr-util'].prefix)
+ options.append('--with-zlib=%s' % spec['zlib'].prefix)
+ options.append('--with-sqlite=%s' % spec['sqlite'].prefix)
+ #options.append('--with-swig=%s' % spec['swig'].prefix)
+
+ configure(*options)
+ make()
+ make('install')
+
+ # python bindings
+ #make('swig-py',
+ # 'swig-pydir=/usr/lib/python2.7/site-packages/libsvn',
+ # 'swig_pydir_extra=/usr/lib/python2.7/site-packages/svn')
+ #make('install-swig-py',
+ # 'swig-pydir=/usr/lib/python2.7/site-packages/libsvn',
+ # 'swig_pydir_extra=/usr/lib/python2.7/site-packages/svn')
+
+ # perl bindings
+ #make('swig-pl')
+ #make('install-swig-pl')
+
+ # ruby bindings
+ #make('swig-rb')
+ #make('isntall-swig-rb')
diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py
index b57f9967c3..c2196dcec4 100644
--- a/var/spack/repos/builtin/packages/suite-sparse/package.py
+++ b/var/spack/repos/builtin/packages/suite-sparse/package.py
@@ -23,4 +23,14 @@ class SuiteSparse(Package):
# FIXME : this actually uses the current workaround
# FIXME : (blas / lapack always provide libblas and liblapack as aliases)
- make('install', 'INSTALL=%s' % prefix, 'BLAS=-lblas', 'LAPACK=-llapack')
+ make('install', 'INSTALL=%s' % prefix,
+
+ # inject Spack compiler wrappers
+ 'AUTOCC=no',
+ 'CC=cc',
+ 'CXX=c++',
+ 'F77=f77',
+
+ # BLAS arguments require path to libraries
+ 'BLAS=-lblas',
+ 'LAPACK=-llapack')
diff --git a/var/spack/repos/builtin/packages/superlu-dist/package.py b/var/spack/repos/builtin/packages/superlu-dist/package.py
index 9a94de8ba5..ddcb7f9225 100644
--- a/var/spack/repos/builtin/packages/superlu-dist/package.py
+++ b/var/spack/repos/builtin/packages/superlu-dist/package.py
@@ -1,4 +1,5 @@
from spack import *
+import glob
class SuperluDist(Package):
"""A general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear equations on high performance machines."""
@@ -52,13 +53,13 @@ class SuperluDist(Package):
# system "make"
# need to install by hand
- headers_location = join_path(self.prefix.include,'superlu_dist')
+ headers_location = self.prefix.include
mkdirp(headers_location)
mkdirp(prefix.lib)
- # FIXME: fetch all headers in the folder automatically
- for header in ['Cnames.h','cublas_utils.h','dcomplex.h','html_mainpage.h','machines.h','old_colamd.h','psymbfact.h','superlu_ddefs.h','superlu_defs.h','superlu_enum_consts.h','superlu_zdefs.h','supermatrix.h','util_dist.h']:
- superludist_header = join_path(self.stage.source_path, 'SRC/',header)
- install(superludist_header, headers_location)
+
+ headers = glob.glob(join_path(self.stage.source_path, 'SRC','*.h'))
+ for h in headers:
+ install(h,headers_location)
superludist_lib = join_path(self.stage.source_path, 'lib/libsuperlu_dist.a')
install(superludist_lib,self.prefix.lib)
diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py
index edc40476e3..6223848c68 100644
--- a/var/spack/repos/builtin/packages/trilinos/package.py
+++ b/var/spack/repos/builtin/packages/trilinos/package.py
@@ -1,15 +1,22 @@
from spack import *
+import os, sys, glob
-
+# Trilinos is complicated to build, as an inspiration a couple of links to other repositories which build it:
+# https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/t/trilinos.py#L111
+# https://github.com/koecher/candi/blob/master/deal.II-toolchain/packages/trilinos.package
+# https://gitlab.com/configurations/cluster-config/blob/master/trilinos.sh
+# https://github.com/Homebrew/homebrew-science/blob/master/trilinos.rb
+# and some relevant documentation/examples:
+# https://github.com/trilinos/Trilinos/issues/175
class Trilinos(Package):
- """
- The Trilinos Project is an effort to develop algorithms and enabling technologies within an object-oriented
+ """The Trilinos Project is an effort to develop algorithms and enabling technologies within an object-oriented
software framework for the solution of large-scale, complex multi-physics engineering and scientific problems.
A unique design feature of Trilinos is its focus on packages.
"""
homepage = "https://trilinos.org/"
url = "http://trilinos.csbsju.edu/download/files/trilinos-12.2.1-Source.tar.gz"
+ version('12.6.1', 'adcf2d3aab74cdda98f88fee19cd1442604199b0515ee3da4d80cbe8f37d00e4')
version('12.4.2', '7c830f7f0f68b8ad324690603baf404e')
version('12.2.1', '6161926ea247863c690e927687f83be9')
version('12.0.1', 'bd99741d047471e127b8296b2ec08017')
@@ -17,8 +24,16 @@ class Trilinos(Package):
version('11.14.2', 'a43590cf896c677890d75bfe75bc6254')
version('11.14.1', '40febc57f76668be8b6a77b7607bb67f')
- variant('shared', default=True, description='Enables the build of shared libraries')
- variant('debug', default=False, description='Builds a debug version of the libraries')
+ variant('metis', default=True, description='Compile with METIS and ParMETIS')
+ variant('mumps', default=True, description='Compile with support for MUMPS solvers')
+ variant('superlu-dist', default=True, description='Compile with SuperluDist solvers')
+ variant('hypre', default=True, description='Compile with Hypre preconditioner')
+ variant('hdf5', default=True, description='Compile with HDF5')
+ variant('suite-sparse', default=True, description='Compile with SuiteSparse solvers')
+ # not everyone has py-numpy activated, keep it disabled by default to avoid configure errors
+ variant('python', default=False, description='Build python wrappers')
+ variant('shared', default=True, description='Enables the build of shared libraries')
+ variant('debug', default=False, description='Builds a debug version of the libraries')
# Everything should be compiled with -fpic
depends_on('blas')
@@ -27,28 +42,205 @@ class Trilinos(Package):
depends_on('matio')
depends_on('glm')
depends_on('swig')
+ depends_on('metis',when='+metis')
+ depends_on('suite-sparse',when='+suite-sparse')
# MPI related dependencies
depends_on('mpi')
depends_on('netcdf+mpi')
+ depends_on('parmetis',when='+metis')
+ # Trilinos' Tribits config system is limited which makes it
+ # very tricky to link Amesos with static MUMPS, see
+ # https://trilinos.org/docs/dev/packages/amesos2/doc/html/classAmesos2_1_1MUMPS.html
+ # One could work it out by getting linking flags from mpif90 --showme:link (or alike)
+ # and adding results to -DTrilinos_EXTRA_LINK_FLAGS
+ # together with Blas and Lapack and ScaLAPACK and Blacs and -lgfortran and
+ # it may work at the end. But let's avoid all this by simply using shared libs
+ depends_on('mumps@5.0:+mpi+shared',when='+mumps')
+ depends_on('scalapack',when='+mumps')
+ depends_on('superlu-dist',when='+superlu-dist')
+ depends_on('hypre~internal-superlu',when='+hypre')
+ depends_on('hdf5+mpi',when='+hdf5')
+
+ depends_on('python',when='+python')
- depends_on('python') # Needs py-numpy activated
+ patch('umfpack_from_suitesparse.patch')
+
+ # check that the combination of variants makes sense
+ def variants_check(self):
+ if '+superlu-dist' in self.spec and self.spec.satisfies('@:11.4.3'):
+ # For Trilinos v11 we need to force SuperLUDist=OFF,
+ # since only the deprecated SuperLUDist v3.3 together with an Amesos patch
+ # is working.
+ raise RuntimeError('The superlu-dist variant can only be used with Trilinos @12.0.1:')
def install(self, spec, prefix):
+ self.variants_check()
+
+ cxx_flags = []
options = []
options.extend(std_cmake_args)
+ mpi_bin = spec['mpi'].prefix.bin
options.extend(['-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON',
+ '-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON',
+ '-DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF',
'-DTrilinos_ENABLE_TESTS:BOOL=OFF',
'-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF',
- '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'),
+ '-DCMAKE_BUILD_TYPE:STRING=%s' % ('DEBUG' if '+debug' in spec else 'RELEASE'),
'-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'),
- '-DTPL_ENABLE_MPI:STRING=ON',
- '-DBLAS_LIBRARY_DIRS:PATH=%s' % spec['blas'].prefix,
- '-DLAPACK_LIBRARY_DIRS:PATH=%s' % spec['lapack'].prefix
+ '-DTPL_ENABLE_MPI:BOOL=ON',
+ '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix,
+ '-DTPL_ENABLE_BLAS=ON',
+ '-DBLAS_LIBRARY_NAMES=blas', # FIXME: don't hardcode names
+ '-DBLAS_LIBRARY_DIRS=%s' % spec['blas'].prefix.lib,
+ '-DTPL_ENABLE_LAPACK=ON',
+ '-DLAPACK_LIBRARY_NAMES=lapack',
+ '-DLAPACK_LIBRARY_DIRS=%s' % spec['lapack'].prefix,
+ '-DTPL_ENABLE_Boost:BOOL=ON',
+ '-DBoost_INCLUDE_DIRS:PATH=%s' % spec['boost'].prefix.include,
+ '-DBoost_LIBRARY_DIRS:PATH=%s' % spec['boost'].prefix.lib,
+ '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON',
+ '-DTrilinos_ENABLE_CXX11:BOOL=ON',
+ '-DTPL_ENABLE_Netcdf:BOOL=ON',
+ '-DTPL_ENABLE_HYPRE:BOOL=%s' % ('ON' if '+hypre' in spec else 'OFF'),
+ '-DTPL_ENABLE_HDF5:BOOL=%s' % ('ON' if '+hdf5' in spec else 'OFF'),
])
+ # Fortran lib
+ libgfortran = os.path.dirname (os.popen('%s --print-file-name libgfortran.a' % join_path(mpi_bin,'mpif90') ).read())
+ options.extend([
+ '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L%s/ -lgfortran' % libgfortran,
+ '-DTrilinos_ENABLE_Fortran=ON'
+ ])
+
+ # for build-debug only:
+ #options.extend([
+ # '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE'
+ #])
+
+ # suite-sparse related
+ if '+suite-sparse' in spec:
+ options.extend([
+ '-DTPL_ENABLE_Cholmod:BOOL=OFF', # FIXME: Trilinos seems to be looking for static libs only, patch CMake TPL file?
+ #'-DTPL_ENABLE_Cholmod:BOOL=ON',
+ #'-DCholmod_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib,
+ #'-DCholmod_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include,
+ '-DTPL_ENABLE_UMFPACK:BOOL=ON',
+ '-DUMFPACK_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib,
+ '-DUMFPACK_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include,
+ '-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig'
+ ])
+ else:
+ options.extend([
+ '-DTPL_ENABLE_Cholmod:BOOL=OFF',
+ '-DTPL_ENABLE_UMFPACK:BOOL=OFF',
+ ])
+
+ # metis / parmetis
+ if '+metis' in spec:
+ options.extend([
+ '-DTPL_ENABLE_METIS:BOOL=ON',
+ '-DMETIS_LIBRARY_DIRS=%s' % spec['metis'].prefix.lib,
+ '-DMETIS_LIBRARY_NAMES=metis',
+ '-DTPL_METIS_INCLUDE_DIRS=%s' % spec['metis'].prefix.include,
+ '-DTPL_ENABLE_ParMETIS:BOOL=ON',
+ '-DParMETIS_LIBRARY_DIRS=%s;%s' % (spec['parmetis'].prefix.lib,spec['metis'].prefix.lib),
+ '-DParMETIS_LIBRARY_NAMES=parmetis;metis',
+ '-DTPL_ParMETIS_INCLUDE_DIRS=%s' % spec['parmetis'].prefix.include
+ ])
+ else:
+ options.extend([
+ '-DTPL_ENABLE_METIS:BOOL=OFF',
+ '-DTPL_ENABLE_ParMETIS:BOOL=OFF',
+ ])
+
+ # mumps / scalapack
+ if '+mumps' in spec:
+ options.extend([
+ '-DTPL_ENABLE_MUMPS:BOOL=ON',
+ '-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib,
+ '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord', # order is important!
+ '-DTPL_ENABLE_SCALAPACK:BOOL=ON',
+ '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64
+ ])
+ # see https://github.com/trilinos/Trilinos/blob/master/packages/amesos/README-MUMPS
+ cxx_flags.extend([
+ '-DMUMPS_5_0'
+ ])
+ else:
+ options.extend([
+ '-DTPL_ENABLE_MUMPS:BOOL=OFF',
+ '-DTPL_ENABLE_SCALAPACK:BOOL=OFF',
+ ])
+
+ # superlu-dist:
+ if '+superlu-dist' in spec:
+ # Amesos, conflicting types of double and complex SLU_D
+ # see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html
+ # and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html
+ options.extend([
+ '-DTeuchos_ENABLE_COMPLEX:BOOL=OFF',
+ '-DKokkosTSQR_ENABLE_Complex:BOOL=OFF'
+ ])
+ options.extend([
+ '-DTPL_ENABLE_SuperLUDist:BOOL=ON',
+ '-DSuperLUDist_LIBRARY_DIRS=%s' % spec['superlu-dist'].prefix.lib,
+ '-DSuperLUDist_INCLUDE_DIRS=%s' % spec['superlu-dist'].prefix.include
+ ])
+ if spec.satisfies('^superlu-dist@4.0:'):
+ options.extend([
+ '-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON'
+ ])
+ else:
+ options.extend([
+ '-DTPL_ENABLE_SuperLUDist:BOOL=OFF',
+ ])
+
+
+ # python
+ if '+python' in spec:
+ options.extend([
+ '-DTrilinos_ENABLE_PyTrilinos:BOOL=ON'
+ ])
+ else:
+ options.extend([
+ '-DTrilinos_ENABLE_PyTrilinos:BOOL=OFF'
+ ])
+
+ # collect CXX flags:
+ options.extend([
+ '-DCMAKE_CXX_FLAGS:STRING=%s' % (' '.join(cxx_flags)),
+ ])
+
+ # disable due to compiler / config errors:
+ options.extend([
+ '-DTrilinos_ENABLE_SEACAS=OFF',
+ '-DTrilinos_ENABLE_Pike=OFF',
+ '-DTrilinos_ENABLE_STK=OFF'
+ ])
+ if sys.platform == 'darwin':
+ options.extend([
+ '-DTrilinos_ENABLE_FEI=OFF'
+ ])
+
+
with working_dir('spack-build', create=True):
cmake('..', *options)
make()
make('install')
+
+ # When trilinos is built with Python, libpytrilinos is included through
+ # cmake configure files. Namely, Trilinos_LIBRARIES in TrilinosConfig.cmake
+ # contains pytrilinos. This leads to a run-time error:
+ # Symbol not found: _PyBool_Type
+ # and prevents Trilinos to be used in any C++ code, which links executable
+ # against the libraries listed in Trilinos_LIBRARIES.
+ # See https://github.com/Homebrew/homebrew-science/issues/2148#issuecomment-103614509
+ # A workaround it to remove PyTrilinos from the COMPONENTS_LIST :
+ if '+python' in self.spec:
+ filter_file(r'(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)', (r'\1\3'), '%s/cmake/Trilinos/TrilinosConfig.cmake' % prefix.lib)
+
+ # The shared libraries are not installed correctly on Darwin; correct this
+ if (sys.platform == 'darwin') and ('+shared' in spec):
+ fix_darwin_install_name(prefix.lib)
diff --git a/var/spack/repos/builtin/packages/trilinos/umfpack_from_suitesparse.patch b/var/spack/repos/builtin/packages/trilinos/umfpack_from_suitesparse.patch
new file mode 100644
index 0000000000..9defc55527
--- /dev/null
+++ b/var/spack/repos/builtin/packages/trilinos/umfpack_from_suitesparse.patch
@@ -0,0 +1,12 @@
+diff --git a/cmake/TPLs/FindTPLUMFPACK.cmake b/cmake/TPLs/FindTPLUMFPACK.cmake
+index 963eb71..998cd02 100644
+--- a/cmake/TPLs/FindTPLUMFPACK.cmake
++++ b/cmake/TPLs/FindTPLUMFPACK.cmake
+@@ -55,6 +55,6 @@
+
+
+ TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES( UMFPACK
+- REQUIRED_HEADERS umfpack.h amd.h UFconfig.h
++ REQUIRED_HEADERS umfpack.h amd.h SuiteSparse_config.h
+ REQUIRED_LIBS_NAMES umfpack amd
+ )
diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py
index 4a27a8fedb..24382af406 100644
--- a/var/spack/repos/builtin/packages/vtk/package.py
+++ b/var/spack/repos/builtin/packages/vtk/package.py
@@ -7,11 +7,23 @@ class Vtk(Package):
homepage = "http://www.vtk.org"
url = "http://www.vtk.org/files/release/6.1/VTK-6.1.0.tar.gz"
+ version("7.0.0", "5fe35312db5fb2341139b8e4955c367d", url="http://www.vtk.org/files/release/7.0/VTK-7.0.0.tar.gz")
+
+ version("6.3.0", '0231ca4840408e9dd60af48b314c5b6d', url="http://www.vtk.org/files/release/6.3/VTK-6.3.0.tar.gz")
+
version('6.1.0', '25e4dfb3bad778722dcaec80cd5dab7d')
depends_on("qt")
+ # VTK7 defaults to OpenGL2 rendering backend
+ variant('opengl2', default=True, description='Build with OpenGL instead of OpenGL2 as rendering backend')
+
def install(self, spec, prefix):
+ def feature_to_bool(feature, on='ON', off='OFF'):
+ if feature in spec:
+ return on
+ return off
+
with working_dir('spack-build', create=True):
cmake_args = [
"..",
@@ -35,6 +47,12 @@ class Vtk(Package):
if spec['qt'].satisfies('@5'):
cmake_args.append("-DVTK_QT_VERSION:STRING=5")
+ if spec.satisfies("@6.1.0"):
+ cmake_args.append("-DCMAKE_C_FLAGS=-DGLX_GLXEXT_LEGACY")
+ cmake_args.append("-DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY")
+
+ cmake_args.append('-DVTK_RENDERING_BACKEND:STRING=%s' % feature_to_bool('+opengl2', 'OpenGL2', 'OpenGL'))
+
cmake(*cmake_args)
make()
make("install")