summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/docs/basic_usage.rst92
-rwxr-xr-xlib/spack/env/cc94
-rw-r--r--lib/spack/llnl/util/filesystem.py18
-rw-r--r--lib/spack/spack/__init__.py4
-rw-r--r--lib/spack/spack/build_environment.py50
-rw-r--r--lib/spack/spack/cmd/compiler.py13
-rw-r--r--lib/spack/spack/cmd/module.py10
-rw-r--r--lib/spack/spack/cmd/pkg.py3
-rw-r--r--lib/spack/spack/cmd/stage.py5
-rw-r--r--lib/spack/spack/cmd/test-install.py300
-rw-r--r--lib/spack/spack/cmd/uninstall.py191
-rw-r--r--lib/spack/spack/fetch_strategy.py24
-rw-r--r--lib/spack/spack/modules.py17
-rw-r--r--lib/spack/spack/package.py15
-rw-r--r--lib/spack/spack/stage.py19
-rw-r--r--lib/spack/spack/test/__init__.py5
-rw-r--r--lib/spack/spack/test/cc.py24
-rw-r--r--lib/spack/spack/test/cmd/__init__.py0
-rw-r--r--lib/spack/spack/test/cmd/test_install.py190
-rw-r--r--lib/spack/spack/test/cmd/uninstall.py37
-rw-r--r--lib/spack/spack/test/database.py82
-rw-r--r--lib/spack/spack/test/install.py29
-rw-r--r--lib/spack/spack/test/mock_database.py80
-rw-r--r--lib/spack/spack/test/unit_install.py126
-rw-r--r--var/spack/repos/builtin.mock/packages/cmake-client/package.py89
-rw-r--r--var/spack/repos/builtin.mock/packages/cmake/package.py69
-rw-r--r--var/spack/repos/builtin/packages/astyle/package.py1
-rw-r--r--var/spack/repos/builtin/packages/bash/package.py20
-rw-r--r--var/spack/repos/builtin/packages/binutils/package.py4
-rw-r--r--var/spack/repos/builtin/packages/boost/package.py12
-rw-r--r--var/spack/repos/builtin/packages/cereal/package.py4
-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.py2
-rw-r--r--var/spack/repos/builtin/packages/dealii/package.py31
-rw-r--r--var/spack/repos/builtin/packages/dia/package.py35
-rw-r--r--var/spack/repos/builtin/packages/dyninst/package.py2
-rw-r--r--var/spack/repos/builtin/packages/eigen/package.py3
-rw-r--r--var/spack/repos/builtin/packages/elk/package.py122
-rw-r--r--var/spack/repos/builtin/packages/environment-modules/package.py38
-rw-r--r--var/spack/repos/builtin/packages/espresso/package.py17
-rw-r--r--var/spack/repos/builtin/packages/git/package.py34
-rw-r--r--var/spack/repos/builtin/packages/global/package.py1
-rw-r--r--var/spack/repos/builtin/packages/gmp/package.py2
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py27
-rw-r--r--var/spack/repos/builtin/packages/hoomd-blue/package.py73
-rw-r--r--var/spack/repos/builtin/packages/intltool/package.py19
-rw-r--r--var/spack/repos/builtin/packages/ior/package.py42
-rw-r--r--var/spack/repos/builtin/packages/ipopt/package.py51
-rw-r--r--var/spack/repos/builtin/packages/jemalloc/package.py4
-rw-r--r--var/spack/repos/builtin/packages/julia/openblas.patch68
-rw-r--r--var/spack/repos/builtin/packages/julia/package.py67
-rw-r--r--var/spack/repos/builtin/packages/libdrm/package.py4
-rw-r--r--var/spack/repos/builtin/packages/libpng/package.py3
-rw-r--r--var/spack/repos/builtin/packages/libxc/package.py18
-rw-r--r--var/spack/repos/builtin/packages/libxcb/package.py3
-rw-r--r--var/spack/repos/builtin/packages/metis/package.py109
-rw-r--r--var/spack/repos/builtin/packages/mfem/package.py125
-rw-r--r--var/spack/repos/builtin/packages/mpich/package.py12
-rw-r--r--var/spack/repos/builtin/packages/mrnet/krell-5.0.1.patch154
-rw-r--r--var/spack/repos/builtin/packages/mrnet/package.py12
-rw-r--r--var/spack/repos/builtin/packages/mumps/package.py9
-rw-r--r--var/spack/repos/builtin/packages/mvapich2/package.py7
-rw-r--r--var/spack/repos/builtin/packages/ncurses/package.py7
-rw-r--r--var/spack/repos/builtin/packages/ncview/package.py20
-rw-r--r--var/spack/repos/builtin/packages/netcdf-cxx/package.py6
-rw-r--r--var/spack/repos/builtin/packages/netlib-lapack/package.py39
-rw-r--r--var/spack/repos/builtin/packages/netlib-scalapack/package.py1
-rw-r--r--var/spack/repos/builtin/packages/oce/null.patch482
-rw-r--r--var/spack/repos/builtin/packages/oce/package.py22
-rw-r--r--var/spack/repos/builtin/packages/openblas/package.py125
-rw-r--r--var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c13
-rw-r--r--var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output9
-rw-r--r--var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py38
-rw-r--r--var/spack/repos/builtin/packages/p4est/package.py13
-rw-r--r--var/spack/repos/builtin/packages/papi/package.py31
-rw-r--r--var/spack/repos/builtin/packages/paradiseo/enable_eoserial.patch14
-rw-r--r--var/spack/repos/builtin/packages/paradiseo/fix_osx_detection.patch13
-rw-r--r--var/spack/repos/builtin/packages/paradiseo/fix_tests.patch13
-rw-r--r--var/spack/repos/builtin/packages/paradiseo/fix_tutorials.patch13
-rw-r--r--var/spack/repos/builtin/packages/paradiseo/package.py59
-rw-r--r--var/spack/repos/builtin/packages/parallel-netcdf/package.py1
-rw-r--r--var/spack/repos/builtin/packages/paraview/package.py21
-rw-r--r--var/spack/repos/builtin/packages/parmetis/package.py2
-rw-r--r--var/spack/repos/builtin/packages/petsc/package.py2
-rw-r--r--var/spack/repos/builtin/packages/pkg-config/package.py7
-rw-r--r--var/spack/repos/builtin/packages/py-SQLAlchemy/package.py14
-rw-r--r--var/spack/repos/builtin/packages/py-bottleneck/package.py2
-rw-r--r--var/spack/repos/builtin/packages/py-csvkit/package.py22
-rw-r--r--var/spack/repos/builtin/packages/py-dask/package.py15
-rw-r--r--var/spack/repos/builtin/packages/py-dbf/package.py15
-rw-r--r--var/spack/repos/builtin/packages/py-decorator/package.py15
-rw-r--r--var/spack/repos/builtin/packages/py-jdcal/package.py14
-rw-r--r--var/spack/repos/builtin/packages/py-matplotlib/package.py3
-rw-r--r--var/spack/repos/builtin/packages/py-mpmath/package.py13
-rw-r--r--var/spack/repos/builtin/packages/py-networkx/package.py15
-rw-r--r--var/spack/repos/builtin/packages/py-numexpr/package.py2
-rw-r--r--var/spack/repos/builtin/packages/py-openpyxl/package.py17
-rw-r--r--var/spack/repos/builtin/packages/py-pandas/package.py2
-rw-r--r--var/spack/repos/builtin/packages/py-pillow/package.py63
-rw-r--r--var/spack/repos/builtin/packages/py-scikit-image/package.py20
-rw-r--r--var/spack/repos/builtin/packages/py-scikit-learn/package.py5
-rw-r--r--var/spack/repos/builtin/packages/py-scipy/package.py12
-rw-r--r--var/spack/repos/builtin/packages/py-setuptools/package.py10
-rw-r--r--var/spack/repos/builtin/packages/py-sympy/package.py2
-rw-r--r--var/spack/repos/builtin/packages/py-xlrd/package.py15
-rw-r--r--var/spack/repos/builtin/packages/python/package.py2
-rw-r--r--var/spack/repos/builtin/packages/qt/package.py74
-rw-r--r--var/spack/repos/builtin/packages/readline/package.py4
-rw-r--r--var/spack/repos/builtin/packages/suite-sparse/package.py41
-rw-r--r--var/spack/repos/builtin/packages/superlu-dist/package.py2
-rw-r--r--var/spack/repos/builtin/packages/swig/package.py12
-rw-r--r--var/spack/repos/builtin/packages/tcl/package.py9
-rw-r--r--var/spack/repos/builtin/packages/tk/package.py6
-rw-r--r--var/spack/repos/builtin/packages/trilinos/package.py2
-rw-r--r--var/spack/repos/builtin/packages/turbomole/package.py124
-rw-r--r--var/spack/repos/builtin/packages/vtk/package.py18
-rw-r--r--var/spack/repos/builtin/packages/wget/package.py4
-rw-r--r--var/spack/repos/builtin/packages/xerces-c/package.py4
-rw-r--r--var/spack/repos/builtin/packages/zoltan/package.py81
120 files changed, 3649 insertions, 730 deletions
diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst
index accf09cc2a..29791d98c4 100644
--- a/lib/spack/docs/basic_usage.rst
+++ b/lib/spack/docs/basic_usage.rst
@@ -149,26 +149,46 @@ customize an installation in :ref:`sec-specs`.
``spack uninstall``
~~~~~~~~~~~~~~~~~~~~~
-To uninstall a package, type ``spack uninstall <package>``. This will
-completely remove the directory in which the package was installed.
+To uninstall a package, type ``spack uninstall <package>``. This will ask the user for
+confirmation, and in case will completely remove the directory in which the package was installed.
.. code-block:: sh
spack uninstall mpich
If there are still installed packages that depend on the package to be
-uninstalled, spack will refuse to uninstall it. You can override this
-behavior with ``spack uninstall -f <package>``, but you risk breaking
-other installed packages. In general, it is safer to remove dependent
-packages *before* removing their dependencies.
+uninstalled, spack will refuse to uninstall it.
-A line like ``spack uninstall mpich`` may be ambiguous, if multiple
-``mpich`` configurations are installed. For example, if both
+To uninstall a package and every package that depends on it, you may give the
+`--dependents` option.
+
+.. code-block:: sh
+
+ spack uninstall --dependents mpich
+
+will display a list of all the packages that depends on `mpich` and, upon confirmation,
+will uninstall them in the right order.
+
+A line like
+
+.. code-block:: sh
+
+ spack uninstall mpich
+
+may be ambiguous, if multiple ``mpich`` configurations are installed. For example, if both
``mpich@3.0.2`` and ``mpich@3.1`` are installed, ``mpich`` could refer
to either one. Because it cannot determine which one to uninstall,
-Spack will ask you to provide a version number to remove the
-ambiguity. As an example, ``spack uninstall mpich@3.1`` is
-unambiguous in this scenario.
+Spack will ask you either to provide a version number to remove the
+ambiguity or use the ``--all`` option to uninstall all of the matching packages.
+
+You may force uninstall a package with the `--force` option
+
+.. code-block:: sh
+
+ spack uninstall --force mpich
+
+but you risk breaking other installed packages. In general, it is safer to remove dependent
+packages *before* removing their dependencies or use the `--dependents` option.
Seeing installed packages
@@ -352,25 +372,32 @@ how this is done is in :ref:`sec-specs`.
``spack compiler add``
~~~~~~~~~~~~~~~~~~~~~~~
+An alias for ``spack compiler find``.
+
+.. _spack-compiler-find:
+
+``spack compiler find``
+~~~~~~~~~~~~~~~~~~~~~~~
+
If you do not see a compiler in this list, but you want to use it with
-Spack, you can simply run ``spack compiler add`` with the path to
+Spack, you can simply run ``spack compiler find`` with the path to
where the compiler is installed. For example::
- $ spack compiler add /usr/local/tools/ic-13.0.079
+ $ spack compiler find /usr/local/tools/ic-13.0.079
==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml
intel@13.0.079
-Or you can run ``spack compiler add`` with no arguments to force
+Or you can run ``spack compiler find`` with no arguments to force
auto-detection. This is useful if you do not know where compilers are
installed, but you know that new compilers have been added to your
``PATH``. For example, using dotkit, you might do this::
$ module load gcc-4.9.0
- $ spack compiler add
+ $ spack compiler find
==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml
gcc@4.9.0
-This loads the environment module for gcc-4.9.0 to get it into the
+This loads the environment module for gcc-4.9.0 to add it to
``PATH``, and then it adds the compiler to Spack.
.. _spack-compiler-info:
@@ -774,6 +801,39 @@ Environment modules
Spack provides some limited integration with environment module
systems to make it easier to use the packages it provides.
+
+Installing Environment Modules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In order to use Spack's generated environment modules, you must have
+installed the *Environment Modules* package. On many Linux
+distributions, this can be installed from the vendor's repository.
+For example: ```yum install environment-modules``
+(Fedora/RHEL/CentOS). If your Linux distribution does not have
+Environment Modules, you can get it with Spack:
+
+1. Install with::
+
+.. code-block:: sh
+
+ spack install environment-modules
+
+2. Activate with::
+
+Add the following two lines to your ``.bashrc`` profile (or similar):
+
+.. code-block:: sh
+
+ MODULES_HOME=`spack location -i environment-modules`
+ source ${MODULES_HOME}/Modules/init/bash
+
+In case you use a Unix shell other than bash, substitute ``bash`` by
+the appropriate file in ``${MODULES_HOME}/Modules/init/``.
+
+
+Spack and Environment Modules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
You can enable shell support by sourcing some files in the
``/share/spack`` directory.
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index 2eb6f46afe..cb07a2ffea 100755
--- a/lib/spack/env/cc
+++ b/lib/spack/env/cc
@@ -39,7 +39,7 @@
#
# This is the list of environment variables that need to be set before
-# the script runs. They are set by routines in spack.build_environment
+# the script runs. They are set by routines in spack.build_environment
# as part of spack.package.Package.do_install().
parameters="
SPACK_PREFIX
@@ -50,7 +50,7 @@ SPACK_SHORT_SPEC"
# The compiler input variables are checked for sanity later:
# SPACK_CC, SPACK_CXX, SPACK_F77, SPACK_FC
-# Debug flag is optional; set to true for debug logging:
+# Debug flag is optional; set to "TRUE" for debug logging:
# SPACK_DEBUG
# Test command is used to unit test the compiler script.
# SPACK_TEST_COMMAND
@@ -66,11 +66,10 @@ function die {
for param in $parameters; do
if [[ -z ${!param} ]]; then
- die "Spack compiler must be run from spack! Input $param was missing!"
+ die "Spack compiler must be run from Spack! Input '$param' is missing."
fi
done
-#
# Figure out the type of compiler, the language, and the mode so that
# the compiler script knows what to do.
#
@@ -78,19 +77,18 @@ done
# 'command' is set based on the input command to $SPACK_[CC|CXX|F77|F90]
#
# 'mode' is set to one of:
+# vcheck version check
# cpp preprocess
# cc compile
# as assemble
# ld link
# ccld compile & link
-# 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
+ cpp)
+ mode=cpp
+ ;;
cc|c89|c99|gcc|clang|icc|pgcc|xlc)
command="$SPACK_CC"
language="C"
@@ -107,34 +105,20 @@ case "$command" in
command="$SPACK_F77"
language="Fortran 77"
;;
- cpp)
- mode=cpp
- ;;
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 [ -z "$mode" ]; then
+# If any of the arguments below are 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
+ if [[ $arg == -v || $arg == -V || $arg == --version || $arg == -dumpversion ]]; then
mode=vcheck
break
fi
@@ -142,16 +126,16 @@ if [ -z "$mode" ]; then
fi
# Finish setting up the mode.
-if [ -z "$mode" ]; then
+if [[ -z $mode ]]; then
mode=ccld
for arg in "$@"; do
- if [ "$arg" = -E ]; then
+ if [[ $arg == -E ]]; then
mode=cpp
break
- elif [ "$arg" = -S ]; then
+ elif [[ $arg == -S ]]; then
mode=as
break
- elif [ "$arg" = -c ]; then
+ elif [[ $arg == -c ]]; then
mode=cc
break
fi
@@ -159,7 +143,7 @@ if [ -z "$mode" ]; then
fi
# Dump the version and exit if we're in testing mode.
-if [ "$SPACK_TEST_COMMAND" = "dump-mode" ]; then
+if [[ $SPACK_TEST_COMMAND == dump-mode ]]; then
echo "$mode"
exit
fi
@@ -170,10 +154,23 @@ if [[ -z $command ]]; then
die "ERROR: Compiler '$SPACK_COMPILER_SPEC' does not support compiling $language programs."
fi
-if [ "$mode" == vcheck ] ; then
+if [[ $mode == vcheck ]]; then
exec ${command} "$@"
fi
+# Darwin's linker has a -r argument that merges object files together.
+# It doesn't work with -rpath.
+# This variable controls whether they are added.
+add_rpaths=true
+if [[ $mode == ld && "$SPACK_SHORT_SPEC" =~ "darwin" ]]; then
+ for arg in "$@"; do
+ if [[ $arg == -r ]]; then
+ add_rpaths=false
+ break
+ fi
+ done
+fi
+
# Save original command for debug logging
input_command="$@"
args=("$@")
@@ -183,17 +180,17 @@ IFS=':' read -ra deps <<< "$SPACK_DEPENDENCIES"
for dep in "${deps[@]}"; do
# Prepend include directories
if [[ -d $dep/include ]]; then
- if [[ $mode = cpp || $mode = cc || $mode = as || $mode = ccld ]]; then
+ if [[ $mode == cpp || $mode == cc || $mode == as || $mode == ccld ]]; then
args=("-I$dep/include" "${args[@]}")
fi
fi
# Prepend lib and RPATH directories
if [[ -d $dep/lib ]]; then
- if [[ $mode = ccld ]]; then
+ if [[ $mode == ccld ]]; then
$add_rpaths && args=("-Wl,-rpath,$dep/lib" "${args[@]}")
args=("-L$dep/lib" "${args[@]}")
- elif [[ $mode = ld ]]; then
+ elif [[ $mode == ld ]]; then
$add_rpaths && args=("-rpath" "$dep/lib" "${args[@]}")
args=("-L$dep/lib" "${args[@]}")
fi
@@ -201,10 +198,10 @@ for dep in "${deps[@]}"; do
# Prepend lib64 and RPATH directories
if [[ -d $dep/lib64 ]]; then
- if [[ $mode = ccld ]]; then
+ if [[ $mode == ccld ]]; then
$add_rpaths && args=("-Wl,-rpath,$dep/lib64" "${args[@]}")
args=("-L$dep/lib64" "${args[@]}")
- elif [[ $mode = ld ]]; then
+ elif [[ $mode == ld ]]; then
$add_rpaths && args=("-rpath" "$dep/lib64" "${args[@]}")
args=("-L$dep/lib64" "${args[@]}")
fi
@@ -212,9 +209,9 @@ for dep in "${deps[@]}"; do
done
# Include all -L's and prefix/whatever dirs in rpath
-if [[ $mode = ccld ]]; then
+if [[ $mode == ccld ]]; then
$add_rpaths && args=("-Wl,-rpath,$SPACK_PREFIX/lib" "-Wl,-rpath,$SPACK_PREFIX/lib64" "${args[@]}")
-elif [[ $mode = ld ]]; then
+elif [[ $mode == ld ]]; then
$add_rpaths && args=("-rpath" "$SPACK_PREFIX/lib" "-rpath" "$SPACK_PREFIX/lib64" "${args[@]}")
fi
@@ -234,11 +231,14 @@ IFS=':' read -ra spack_env_dirs <<< "$SPACK_ENV_PATH"
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
+ addpath=true
+ for env_dir in "${spack_env_dirs[@]}"; do
+ if [[ $dir == $env_dir ]]; then
+ addpath=false
+ break
+ fi
done
- if [[ -z $remove ]]; then
+ if $addpath; then
PATH="${PATH:+$PATH:}$dir"
fi
done
@@ -247,7 +247,7 @@ export PATH
full_command=("$command" "${args[@]}")
# In test command mode, write out full command for Spack tests.
-if [[ $SPACK_TEST_COMMAND = dump-args ]]; then
+if [[ $SPACK_TEST_COMMAND == dump-args ]]; then
echo "${full_command[@]}"
exit
elif [[ -n $SPACK_TEST_COMMAND ]]; then
@@ -257,7 +257,7 @@ 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 "[$mode] $command $input_command" >> $input_log
diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py
index 46ca03bec4..70d46a7f77 100644
--- a/lib/spack/llnl/util/filesystem.py
+++ b/lib/spack/llnl/util/filesystem.py
@@ -27,7 +27,8 @@ __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', 'fix_darwin_install_name']
+ 'remove_dead_links', 'remove_linked_tree', 'find_library_path',
+ 'fix_darwin_install_name']
import os
import glob
@@ -395,6 +396,7 @@ def remove_linked_tree(path):
else:
shutil.rmtree(path, True)
+
def fix_darwin_install_name(path):
"""
Fix install name of dynamic libraries on Darwin to have full path.
@@ -420,3 +422,17 @@ def fix_darwin_install_name(path):
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.
+
+ Return:
+ directory where the library was found, if found. None otherwise.
+
+ """
+ for path in paths:
+ library = join_path(path, libname)
+ if os.path.exists(library):
+ return path
+ return None
diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py
index aee11f061f..9108e1d0e3 100644
--- a/lib/spack/spack/__init__.py
+++ b/lib/spack/spack/__init__.py
@@ -136,9 +136,7 @@ for path in _tmp_candidates:
# don't add a second username if it's already unique by user.
if not _tmp_user in path:
tmp_dirs.append(join_path(path, '%u', 'spack-stage'))
-
-for path in _tmp_candidates:
- if not path in tmp_dirs:
+ else:
tmp_dirs.append(join_path(path, 'spack-stage'))
# Whether spack should allow installation of unsafe versions of
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 119a255a34..eb72f2a6b4 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -59,6 +59,11 @@ SPACK_SHORT_SPEC = 'SPACK_SHORT_SPEC'
SPACK_DEBUG_LOG_DIR = 'SPACK_DEBUG_LOG_DIR'
+# Platform-specific library suffix.
+dso_suffix = 'dylib' if sys.platform == 'darwin' else 'so'
+
+
+
class MakeExecutable(Executable):
"""Special callable executable object for make so the user can
specify parallel or not on a per-invocation basis. Using
@@ -208,7 +213,7 @@ def set_module_variables_for_package(pkg, module):
# TODO: of build dependencies, as opposed to link dependencies.
# TODO: Currently, everything is a link dependency, but tools like
# TODO: this shouldn't be.
- m.cmake = which("cmake")
+ m.cmake = Executable('cmake')
# standard CMake arguments
m.std_cmake_args = ['-DCMAKE_INSTALL_PREFIX=%s' % pkg.prefix,
@@ -246,6 +251,9 @@ def set_module_variables_for_package(pkg, module):
# a Prefix object.
m.prefix = pkg.prefix
+ # Platform-specific library suffix.
+ m.dso_suffix = dso_suffix
+
def get_rpaths(pkg):
"""Get a list of all the rpaths for a package."""
@@ -270,21 +278,6 @@ def parent_class_modules(cls):
return result
-def setup_module_variables_for_dag(pkg):
- """Set module-scope variables for all packages in the DAG."""
- for spec in pkg.spec.traverse(order='post'):
- # If a user makes their own package repo, e.g.
- # spack.repos.mystuff.libelf.Libelf, and they inherit from
- # an existing class like spack.repos.original.libelf.Libelf,
- # then set the module variables for both classes so the
- # parent class can still use them if it gets called.
- spkg = spec.package
- modules = parent_class_modules(spkg.__class__)
- for mod in modules:
- set_module_variables_for_package(spkg, mod)
- set_module_variables_for_package(spkg, spkg.module)
-
-
def setup_package(pkg):
"""Execute all environment setup routines."""
spack_env = EnvironmentModifications()
@@ -308,20 +301,27 @@ def setup_package(pkg):
set_compiler_environment_variables(pkg, spack_env)
set_build_environment_variables(pkg, spack_env)
- setup_module_variables_for_dag(pkg)
- # Allow dependencies to modify the module
+ # traverse in postorder so package can use vars from its dependencies
spec = pkg.spec
- for dependency_spec in spec.traverse(root=False):
- dpkg = dependency_spec.package
- dpkg.setup_dependent_package(pkg.module, spec)
+ for dspec in pkg.spec.traverse(order='post', root=False):
+ # If a user makes their own package repo, e.g.
+ # spack.repos.mystuff.libelf.Libelf, and they inherit from
+ # an existing class like spack.repos.original.libelf.Libelf,
+ # then set the module variables for both classes so the
+ # parent class can still use them if it gets called.
+ spkg = dspec.package
+ modules = parent_class_modules(spkg.__class__)
+ for mod in modules:
+ set_module_variables_for_package(spkg, mod)
+ set_module_variables_for_package(spkg, spkg.module)
- # Allow dependencies to set up environment as well
- for dependency_spec in spec.traverse(root=False):
- dpkg = dependency_spec.package
+ # Allow dependencies to modify the module
+ dpkg = dspec.package
+ dpkg.setup_dependent_package(pkg.module, spec)
dpkg.setup_dependent_environment(spack_env, run_env, spec)
- # Allow the package to apply some settings.
+ set_module_variables_for_package(pkg, pkg.module)
pkg.setup_environment(spack_env, run_env)
# Make sure nothing's strange about the Spack environment.
diff --git a/lib/spack/spack/cmd/compiler.py b/lib/spack/spack/cmd/compiler.py
index 3e58e82184..a8e9e2a7a5 100644
--- a/lib/spack/spack/cmd/compiler.py
+++ b/lib/spack/spack/cmd/compiler.py
@@ -44,10 +44,10 @@ def setup_parser(subparser):
scopes = spack.config.config_scopes
- # Add
- add_parser = sp.add_parser('add', help='Add compilers to the Spack configuration.')
- add_parser.add_argument('add_paths', nargs=argparse.REMAINDER)
- add_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_modify_scope,
+ # Find
+ find_parser = sp.add_parser('find', aliases=['add'], help='Search the system for compilers to add to the Spack configuration.')
+ find_parser.add_argument('add_paths', nargs=argparse.REMAINDER)
+ find_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_modify_scope,
help="Configuration scope to modify.")
# Remove
@@ -70,7 +70,7 @@ def setup_parser(subparser):
help="Configuration scope to read from.")
-def compiler_add(args):
+def compiler_find(args):
"""Search either $PATH or a list of paths for compilers and add them
to Spack's configuration."""
paths = args.add_paths
@@ -136,7 +136,8 @@ def compiler_list(args):
def compiler(parser, args):
- action = { 'add' : compiler_add,
+ action = { 'add' : compiler_find,
+ 'find' : compiler_find,
'remove' : compiler_remove,
'rm' : compiler_remove,
'info' : compiler_info,
diff --git a/lib/spack/spack/cmd/module.py b/lib/spack/spack/cmd/module.py
index 315d9fc926..a67f5c0c13 100644
--- a/lib/spack/spack/cmd/module.py
+++ b/lib/spack/spack/cmd/module.py
@@ -22,21 +22,16 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
-import sys
import os
import shutil
-import argparse
+import sys
import llnl.util.tty as tty
-from llnl.util.lang import partition_list
-from llnl.util.filesystem import mkdirp
-
import spack.cmd
+from llnl.util.filesystem import mkdirp
from spack.modules import module_types
from spack.util.string import *
-from spack.spec import Spec
-
description ="Manipulate modules and dotkits."
@@ -98,7 +93,6 @@ def module_refresh():
cls(spec).write()
-
def module(parser, args):
if args.module_command == 'refresh':
module_refresh()
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/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py
index 656873a2f0..3277e15548 100644
--- a/lib/spack/spack/cmd/test-install.py
+++ b/lib/spack/spack/cmd/test-install.py
@@ -23,87 +23,106 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import argparse
-import xml.etree.ElementTree as ET
-import itertools
-import re
-import os
import codecs
+import os
+import time
+import xml.dom.minidom
+import xml.etree.ElementTree as ET
import llnl.util.tty as tty
-from llnl.util.filesystem import *
-
import spack
+import spack.cmd
+from llnl.util.filesystem import *
from spack.build_environment import InstallError
from spack.fetch_strategy import FetchError
-import spack.cmd
description = "Run package installation as a unit test, output formatted results."
-def setup_parser(subparser):
- subparser.add_argument(
- '-j', '--jobs', action='store', type=int,
- help="Explicitly set number of make jobs. Default is #cpus.")
-
- subparser.add_argument(
- '-n', '--no-checksum', action='store_true', dest='no_checksum',
- help="Do not check packages against checksum")
- subparser.add_argument(
- '-o', '--output', action='store', help="test output goes in this file")
+def setup_parser(subparser):
+ subparser.add_argument('-j',
+ '--jobs',
+ action='store',
+ type=int,
+ help="Explicitly set number of make jobs. Default is #cpus.")
- subparser.add_argument(
- 'package', nargs=argparse.REMAINDER, help="spec of package to install")
+ subparser.add_argument('-n',
+ '--no-checksum',
+ action='store_true',
+ dest='no_checksum',
+ help="Do not check packages against checksum")
+ subparser.add_argument('-o', '--output', action='store', help="test output goes in this file")
-class JunitResultFormat(object):
- def __init__(self):
- self.root = ET.Element('testsuite')
- self.tests = []
-
- def add_test(self, buildId, testResult, buildInfo=None):
- self.tests.append((buildId, testResult, buildInfo))
-
- def write_to(self, stream):
- self.root.set('tests', '{0}'.format(len(self.tests)))
- for buildId, testResult, buildInfo in self.tests:
- testcase = ET.SubElement(self.root, 'testcase')
- testcase.set('classname', buildId.name)
- testcase.set('name', buildId.stringId())
- if testResult == TestResult.FAILED:
- failure = ET.SubElement(testcase, 'failure')
- failure.set('type', "Build Error")
- failure.text = buildInfo
- elif testResult == TestResult.SKIPPED:
- skipped = ET.SubElement(testcase, 'skipped')
- skipped.set('type', "Skipped Build")
- skipped.text = buildInfo
- ET.ElementTree(self.root).write(stream)
+ subparser.add_argument('package', nargs=argparse.REMAINDER, help="spec of package to install")
class TestResult(object):
PASSED = 0
FAILED = 1
SKIPPED = 2
+ ERRORED = 3
-class BuildId(object):
- def __init__(self, spec):
- self.name = spec.name
- self.version = spec.version
- self.hashId = spec.dag_hash()
-
- def stringId(self):
- return "-".join(str(x) for x in (self.name, self.version, self.hashId))
-
- def __hash__(self):
- return hash((self.name, self.version, self.hashId))
-
- def __eq__(self, other):
- if not isinstance(other, BuildId):
- return False
+class TestSuite(object):
+ def __init__(self, filename):
+ self.filename = filename
+ self.root = ET.Element('testsuite')
+ self.tests = []
- return ((self.name, self.version, self.hashId) ==
- (other.name, other.version, other.hashId))
+ def __enter__(self):
+ return self
+
+ def append(self, item):
+ if not isinstance(item, TestCase):
+ raise TypeError('only TestCase instances may be appended to a TestSuite instance')
+ self.tests.append(item) # Append the item to the list of tests
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ # Prepare the header for the entire test suite
+ number_of_errors = sum(x.result_type == TestResult.ERRORED for x in self.tests)
+ self.root.set('errors', str(number_of_errors))
+ number_of_failures = sum(x.result_type == TestResult.FAILED for x in self.tests)
+ self.root.set('failures', str(number_of_failures))
+ self.root.set('tests', str(len(self.tests)))
+
+ for item in self.tests:
+ self.root.append(item.element)
+
+ with open(self.filename, 'wb') as file:
+ xml_string = ET.tostring(self.root)
+ xml_string = xml.dom.minidom.parseString(xml_string).toprettyxml()
+ file.write(xml_string)
+
+
+class TestCase(object):
+
+ results = {
+ TestResult.PASSED: None,
+ TestResult.SKIPPED: 'skipped',
+ TestResult.FAILED: 'failure',
+ TestResult.ERRORED: 'error',
+ }
+
+ def __init__(self, classname, name, time=None):
+ self.element = ET.Element('testcase')
+ self.element.set('classname', str(classname))
+ self.element.set('name', str(name))
+ if time is not None:
+ self.element.set('time', str(time))
+ self.result_type = None
+
+ def set_result(self, result_type, message=None, error_type=None, text=None):
+ self.result_type = result_type
+ result = TestCase.results[self.result_type]
+ if result is not None and result is not TestResult.PASSED:
+ subelement = ET.SubElement(self.element, result)
+ if error_type is not None:
+ subelement.set('type', error_type)
+ if message is not None:
+ subelement.set('message', str(message))
+ if text is not None:
+ subelement.text = text
def fetch_log(path):
@@ -114,46 +133,76 @@ def fetch_log(path):
def failed_dependencies(spec):
- return set(childSpec for childSpec in spec.dependencies.itervalues() if not
- spack.repo.get(childSpec).installed)
-
-
-def create_test_output(topSpec, newInstalls, output, getLogFunc=fetch_log):
- # Post-order traversal is not strictly required but it makes sense to output
- # tests for dependencies first.
- for spec in topSpec.traverse(order='post'):
- if spec not in newInstalls:
- continue
-
- failedDeps = failed_dependencies(spec)
- package = spack.repo.get(spec)
- if failedDeps:
- result = TestResult.SKIPPED
- dep = iter(failedDeps).next()
- depBID = BuildId(dep)
- errOutput = "Skipped due to failed dependency: {0}".format(
- depBID.stringId())
- elif (not package.installed) and (not package.stage.source_path):
- result = TestResult.FAILED
- errOutput = "Failure to fetch package resources."
- elif not package.installed:
- result = TestResult.FAILED
- lines = getLogFunc(package.build_log_path)
- errMessages = list(line for line in lines if
- re.search('error:', line, re.IGNORECASE))
- errOutput = errMessages if errMessages else lines[-10:]
- errOutput = '\n'.join(itertools.chain(
- [spec.to_yaml(), "Errors:"], errOutput,
- ["Build Log:", package.build_log_path]))
- else:
- result = TestResult.PASSED
- errOutput = None
-
- bId = BuildId(spec)
- output.add_test(bId, result, errOutput)
+ return set(item for item in spec.dependencies.itervalues() if not spack.repo.get(item).installed)
+
+
+def get_top_spec_or_die(args):
+ specs = spack.cmd.parse_specs(args.package, concretize=True)
+ if len(specs) > 1:
+ tty.die("Only 1 top-level package can be specified")
+ top_spec = iter(specs).next()
+ return top_spec
+
+
+def install_single_spec(spec, number_of_jobs):
+ package = spack.repo.get(spec)
+
+ # If it is already installed, skip the test
+ if spack.repo.get(spec).installed:
+ testcase = TestCase(package.name, package.spec.short_spec, time=0.0)
+ testcase.set_result(TestResult.SKIPPED, message='Skipped [already installed]', error_type='already_installed')
+ return testcase
+
+ # If it relies on dependencies that did not install, skip
+ if failed_dependencies(spec):
+ testcase = TestCase(package.name, package.spec.short_spec, time=0.0)
+ testcase.set_result(TestResult.SKIPPED, message='Skipped [failed dependencies]', error_type='dep_failed')
+ return testcase
+
+ # Otherwise try to install the spec
+ try:
+ start_time = time.time()
+ package.do_install(keep_prefix=False,
+ keep_stage=True,
+ ignore_deps=False,
+ make_jobs=number_of_jobs,
+ verbose=True,
+ fake=False)
+ duration = time.time() - start_time
+ testcase = TestCase(package.name, package.spec.short_spec, duration)
+ testcase.set_result(TestResult.PASSED)
+ except InstallError:
+ # An InstallError is considered a failure (the recipe didn't work correctly)
+ duration = time.time() - start_time
+ # Try to get the log
+ lines = fetch_log(package.build_log_path)
+ text = '\n'.join(lines)
+ testcase = TestCase(package.name, package.spec.short_spec, duration)
+ testcase.set_result(TestResult.FAILED, message='Installation failure', text=text)
+
+ except FetchError:
+ # A FetchError is considered an error (we didn't even start building)
+ duration = time.time() - start_time
+ testcase = TestCase(package.name, package.spec.short_spec, duration)
+ testcase.set_result(TestResult.ERRORED, message='Unable to fetch package')
+
+ return testcase
+
+
+def get_filename(args, top_spec):
+ if not args.output:
+ fname = 'test-{x.name}-{x.version}-{hash}.xml'.format(x=top_spec, hash=top_spec.dag_hash())
+ output_directory = join_path(os.getcwd(), 'test-output')
+ if not os.path.exists(output_directory):
+ os.mkdir(output_directory)
+ output_filename = join_path(output_directory, fname)
+ else:
+ output_filename = args.output
+ return output_filename
def test_install(parser, args):
+ # Check the input
if not args.package:
tty.die("install requires a package argument")
@@ -162,50 +211,15 @@ def test_install(parser, args):
tty.die("The -j option must be a positive integer!")
if args.no_checksum:
- spack.do_checksum = False # TODO: remove this global.
-
- specs = spack.cmd.parse_specs(args.package, concretize=True)
- if len(specs) > 1:
- tty.die("Only 1 top-level package can be specified")
- topSpec = iter(specs).next()
-
- newInstalls = set()
- for spec in topSpec.traverse():
- package = spack.repo.get(spec)
- if not package.installed:
- newInstalls.add(spec)
-
- if not args.output:
- bId = BuildId(topSpec)
- outputDir = join_path(os.getcwd(), "test-output")
- if not os.path.exists(outputDir):
- os.mkdir(outputDir)
- outputFpath = join_path(outputDir, "test-{0}.xml".format(bId.stringId()))
- else:
- outputFpath = args.output
-
- for spec in topSpec.traverse(order='post'):
- # Calling do_install for the top-level package would be sufficient but
- # this attempts to keep going if any package fails (other packages which
- # are not dependents may succeed)
- package = spack.repo.get(spec)
- if (not failed_dependencies(spec)) and (not package.installed):
- try:
- package.do_install(
- keep_prefix=False,
- keep_stage=True,
- ignore_deps=False,
- make_jobs=args.jobs,
- verbose=True,
- fake=False)
- except InstallError:
- pass
- except FetchError:
- pass
-
- jrf = JunitResultFormat()
- handled = {}
- create_test_output(topSpec, newInstalls, jrf)
-
- with open(outputFpath, 'wb') as F:
- jrf.write_to(F)
+ spack.do_checksum = False # TODO: remove this global.
+
+ # Get the one and only top spec
+ top_spec = get_top_spec_or_die(args)
+ # Get the filename of the test
+ output_filename = get_filename(args, top_spec)
+ # TEST SUITE
+ with TestSuite(output_filename) as test_suite:
+ # Traverse in post order : each spec is a test case
+ for spec in top_spec.traverse(order='post'):
+ test_case = install_single_spec(spec, args.jobs)
+ test_suite.append(test_case)
diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py
index 350ef372cb..1ff3d8db5f 100644
--- a/lib/spack/spack/cmd/uninstall.py
+++ b/lib/spack/spack/cmd/uninstall.py
@@ -23,19 +23,33 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from __future__ import print_function
-import sys
+
import argparse
import llnl.util.tty as tty
-from llnl.util.tty.colify import colify
-
import spack
import spack.cmd
import spack.repository
from spack.cmd.find import display_specs
-from spack.package import PackageStillNeededError
-description="Remove an installed package"
+description = "Remove an installed package"
+
+error_message = """You can either:
+ a) Use a more specific spec, or
+ b) use spack uninstall -a to uninstall ALL matching specs.
+"""
+
+
+def ask_for_confirmation(message):
+ while True:
+ tty.msg(message + '[y/n]')
+ choice = raw_input().lower()
+ if choice == 'y':
+ break
+ elif choice == 'n':
+ raise SystemExit('Operation aborted')
+ tty.warn('Please reply either "y" or "n"')
+
def setup_parser(subparser):
subparser.add_argument(
@@ -44,10 +58,101 @@ def setup_parser(subparser):
subparser.add_argument(
'-a', '--all', action='store_true', dest='all',
help="USE CAREFULLY. Remove ALL installed packages that match each " +
- "supplied spec. i.e., if you say uninstall libelf, ALL versions of " +
- "libelf are uninstalled. This is both useful and dangerous, like rm -r.")
+ "supplied spec. i.e., if you say uninstall libelf, ALL versions of " +
+ "libelf are uninstalled. This is both useful and dangerous, like rm -r.")
subparser.add_argument(
- 'packages', nargs=argparse.REMAINDER, help="specs of packages to uninstall")
+ '-d', '--dependents', action='store_true', dest='dependents',
+ help='Also uninstall any packages that depend on the ones given via command line.'
+ )
+ subparser.add_argument(
+ '-y', '--yes-to-all', action='store_true', dest='yes_to_all',
+ help='Assume "yes" is the answer to every confirmation asked to the user.'
+
+ )
+ subparser.add_argument('packages', nargs=argparse.REMAINDER, help="specs of packages to uninstall")
+
+
+def concretize_specs(specs, allow_multiple_matches=False, force=False):
+ """
+ Returns a list of specs matching the non necessarily concretized specs given from cli
+
+ Args:
+ specs: list of specs to be matched against installed packages
+ allow_multiple_matches : boolean (if True multiple matches for each item in specs are admitted)
+
+ Return:
+ list of specs
+ """
+ specs_from_cli = [] # List of specs that match expressions given via command line
+ has_errors = False
+ for spec in specs:
+ matching = spack.installed_db.query(spec)
+ # For each spec provided, make sure it refers to only one package.
+ # Fail and ask user to be unambiguous if it doesn't
+ if not allow_multiple_matches and len(matching) > 1:
+ tty.error("%s matches multiple packages:" % spec)
+ print()
+ display_specs(matching, long=True)
+ print()
+ has_errors = True
+
+ # No installed package matches the query
+ if len(matching) == 0 and not force:
+ tty.error("%s does not match any installed packages." % spec)
+ has_errors = True
+
+ specs_from_cli.extend(matching)
+ if has_errors:
+ tty.die(error_message)
+
+ return specs_from_cli
+
+
+def installed_dependents(specs):
+ """
+ Returns a dictionary that maps a spec with a list of its installed dependents
+
+ Args:
+ specs: list of specs to be checked for dependents
+
+ Returns:
+ dictionary of installed dependents
+ """
+ dependents = {}
+ for item in specs:
+ lst = [x for x in item.package.installed_dependents if x not in specs]
+ if lst:
+ lst = list(set(lst))
+ dependents[item] = lst
+ return dependents
+
+
+def do_uninstall(specs, force):
+ """
+ Uninstalls all the specs in a list.
+
+ Args:
+ specs: list of specs to be uninstalled
+ force: force uninstallation (boolean)
+ """
+ packages = []
+ for item in specs:
+ try:
+ # should work if package is known to spack
+ packages.append(item.package)
+ except spack.repository.UnknownPackageError as e:
+ # The package.py file has gone away -- but still
+ # want to uninstall.
+ spack.Package(item).do_uninstall(force=True)
+
+ # Sort packages to be uninstalled by the number of installed dependents
+ # This ensures we do things in the right order
+ def num_installed_deps(pkg):
+ return len(pkg.installed_dependents)
+
+ packages.sort(key=num_installed_deps)
+ for item in packages:
+ item.do_uninstall(force=force)
def uninstall(parser, args):
@@ -56,50 +161,34 @@ def uninstall(parser, args):
with spack.installed_db.write_transaction():
specs = spack.cmd.parse_specs(args.packages)
+ # Gets the list of installed specs that match the ones give via cli
+ uninstall_list = concretize_specs(specs, args.all, args.force) # takes care of '-a' is given in the cli
+ dependent_list = installed_dependents(uninstall_list) # takes care of '-d'
- # For each spec provided, make sure it refers to only one package.
- # Fail and ask user to be unambiguous if it doesn't
- pkgs = []
- for spec in specs:
- matching_specs = spack.installed_db.query(spec)
- if not args.all and len(matching_specs) > 1:
- tty.error("%s matches multiple packages:" % spec)
- print()
- display_specs(matching_specs, long=True)
- print()
- print("You can either:")
- print(" a) Use a more specific spec, or")
- print(" b) use spack uninstall -a to uninstall ALL matching specs.")
- sys.exit(1)
-
- if len(matching_specs) == 0:
- if args.force: continue
- tty.die("%s does not match any installed packages." % spec)
-
- for s in matching_specs:
- try:
- # should work if package is known to spack
- pkgs.append(s.package)
- except spack.repository.UnknownPackageError as e:
- # The package.py file has gone away -- but still
- # want to uninstall.
- spack.Package(s).do_uninstall(force=True)
-
- # Sort packages to be uninstalled by the number of installed dependents
- # This ensures we do things in the right order
- def num_installed_deps(pkg):
- return len(pkg.installed_dependents)
- pkgs.sort(key=num_installed_deps)
-
- # Uninstall packages in order now.
- for pkg in pkgs:
- try:
- pkg.do_uninstall(force=args.force)
- except PackageStillNeededError as e:
- tty.error("Will not uninstall %s" % e.spec.format("$_$@$%@$#", color=True))
+ # Process dependent_list and update uninstall_list
+ has_error = False
+ if dependent_list and not args.dependents and not args.force:
+ for spec, lst in dependent_list.items():
+ tty.error("Will not uninstall %s" % spec.format("$_$@$%@$#", color=True))
print('')
print("The following packages depend on it:")
- display_specs(e.dependents, long=True)
+ display_specs(lst, long=True)
print('')
- print("You can use spack uninstall -f to force this action.")
- sys.exit(1)
+ has_error = True
+ elif args.dependents:
+ for key, lst in dependent_list.items():
+ uninstall_list.extend(lst)
+ uninstall_list = list(set(uninstall_list))
+
+ if has_error:
+ tty.die('You can use spack uninstall --dependents to uninstall these dependencies as well')
+
+ if not args.yes_to_all:
+ tty.msg("The following packages will be uninstalled : ")
+ print('')
+ display_specs(uninstall_list, long=True)
+ print('')
+ ask_for_confirmation('Do you want to proceed ? ')
+
+ # Uninstall everything on the list
+ do_uninstall(uninstall_list, args.force)
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index 4ea87bea7e..ce2c4e30c7 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -157,12 +157,26 @@ class URLFetchStrategy(FetchStrategy):
tty.msg("Already downloaded %s" % self.archive_file)
return
+ possible_files = self.stage.expected_archive_files
+ save_file = None
+ partial_file = None
+ if possible_files:
+ save_file = self.stage.expected_archive_files[0]
+ partial_file = self.stage.expected_archive_files[0] + '.part'
+
tty.msg("Trying to fetch from %s" % self.url)
- curl_args = ['-O', # save file to disk
+ if partial_file:
+ save_args = ['-C', '-', # continue partial downloads
+ '-o', partial_file] # use a .part file
+ else:
+ save_args = ['-O']
+
+ curl_args = save_args + [
'-f', # fail on >400 errors
'-D', '-', # print out HTML headers
- '-L', self.url, ]
+ '-L', # resolve 3xx redirects
+ self.url, ]
if sys.stdout.isatty():
curl_args.append('-#') # status bar when using a tty
@@ -178,6 +192,9 @@ class URLFetchStrategy(FetchStrategy):
if self.archive_file:
os.remove(self.archive_file)
+ if partial_file and os.path.exists(partial_file):
+ os.remove(partial_file)
+
if spack.curl.returncode == 22:
# This is a 404. Curl will print the error.
raise FailedDownloadError(
@@ -209,6 +226,9 @@ class URLFetchStrategy(FetchStrategy):
"'spack clean <package>' to remove the bad archive, then fix",
"your internet gateway issue and install again.")
+ if save_file:
+ os.rename(partial_file, save_file)
+
if not self.archive_file:
raise FailedDownloadError(self.url)
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py
index f6a11c92e3..61624fbd70 100644
--- a/lib/spack/spack/modules.py
+++ b/lib/spack/spack/modules.py
@@ -163,9 +163,14 @@ class EnvModule(object):
# package-specific modifications
spack_env = EnvironmentModifications()
for item in self.pkg.extendees:
- package = self.spec[item].package
- package.setup_dependent_package(self.pkg.module, self.spec)
- package.setup_dependent_environment(spack_env, env, self.spec)
+ try:
+ package = self.spec[item].package
+ package.setup_dependent_package(self.pkg.module, self.spec)
+ package.setup_dependent_environment(spack_env, env, self.spec)
+ except:
+ # The extends was conditional, so it doesn't count here
+ # eg: extends('python', when='+python')
+ pass
# Package-specific environment modifications
self.spec.package.setup_environment(spack_env, env)
@@ -206,7 +211,11 @@ class EnvModule(object):
def remove(self):
mod_file = self.file_name
if os.path.exists(mod_file):
- shutil.rmtree(mod_file, ignore_errors=True)
+ try:
+ os.remove(mod_file) # Remove the module file
+ os.removedirs(os.path.dirname(mod_file)) # Remove all the empty directories from the leaf up
+ except OSError:
+ pass # removedirs throws OSError on first non-empty directory found
class Dotkit(EnvModule):
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 9af3221837..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."""
@@ -926,6 +929,9 @@ class Package(object):
install(env_path, env_install_path)
dump_packages(self.spec, packages_dir)
+ # Run post install hooks before build stage is removed.
+ spack.hooks.post_install(self)
+
# Stop timer.
self._total_time = time.time() - start_time
build_time = self._total_time - self._fetch_time
@@ -954,9 +960,6 @@ class Package(object):
# the database, so that we don't need to re-read from file.
spack.installed_db.add(self.spec, self.prefix)
- # Once everything else is done, run post install hooks
- spack.hooks.post_install(self)
-
def sanity_check_prefix(self):
"""This function checks whether install succeeded."""
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index f88f82fc2d..84c47ee660 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
@@ -208,6 +211,18 @@ class Stage(object):
return False
@property
+ def expected_archive_files(self):
+ """Possible archive file paths."""
+ paths = []
+ if isinstance(self.fetcher, fs.URLFetchStrategy):
+ paths.append(os.path.join(self.path, os.path.basename(self.fetcher.url)))
+
+ if self.mirror_path:
+ paths.append(os.path.join(self.path, os.path.basename(self.mirror_path)))
+
+ return paths
+
+ @property
def archive_file(self):
"""Path to the source archive within this stage directory."""
paths = []
diff --git a/lib/spack/spack/test/__init__.py b/lib/spack/spack/test/__init__.py
index cd842561e6..3c5edde66b 100644
--- a/lib/spack/spack/test/__init__.py
+++ b/lib/spack/spack/test/__init__.py
@@ -61,13 +61,14 @@ test_names = ['versions',
'optional_deps',
'make_executable',
'configure_guess',
- 'unit_install',
'lock',
'database',
'namespace_trie',
'yaml',
'sbang',
- 'environment']
+ 'environment',
+ 'cmd.uninstall',
+ 'cmd.test_install']
def list_tests():
diff --git a/lib/spack/spack/test/cc.py b/lib/spack/spack/test/cc.py
index 0b1aeb2a8f..594cd6efe9 100644
--- a/lib/spack/spack/test/cc.py
+++ b/lib/spack/spack/test/cc.py
@@ -219,3 +219,27 @@ class CompilerTest(unittest.TestCase):
' '.join(test_command))
+ def test_ld_deps_reentrant(self):
+ """Make sure ld -r is handled correctly on OS's where it doesn't
+ support rpaths."""
+ os.environ['SPACK_DEPENDENCIES'] = ':'.join([self.dep1])
+
+ os.environ['SPACK_SHORT_SPEC'] = "foo@1.2=linux-x86_64"
+ reentrant_test_command = ['-r'] + test_command
+ self.check_ld('dump-args', reentrant_test_command,
+ 'ld ' +
+ '-rpath ' + self.prefix + '/lib ' +
+ '-rpath ' + self.prefix + '/lib64 ' +
+
+ '-L' + self.dep1 + '/lib ' +
+ '-rpath ' + self.dep1 + '/lib ' +
+
+ '-r ' +
+ ' '.join(test_command))
+
+ os.environ['SPACK_SHORT_SPEC'] = "foo@1.2=darwin-x86_64"
+ self.check_ld('dump-args', reentrant_test_command,
+ 'ld ' +
+ '-L' + self.dep1 + '/lib ' +
+ '-r ' +
+ ' '.join(test_command))
diff --git a/lib/spack/spack/test/cmd/__init__.py b/lib/spack/spack/test/cmd/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/lib/spack/spack/test/cmd/__init__.py
diff --git a/lib/spack/spack/test/cmd/test_install.py b/lib/spack/spack/test/cmd/test_install.py
new file mode 100644
index 0000000000..2206c7bea1
--- /dev/null
+++ b/lib/spack/spack/test/cmd/test_install.py
@@ -0,0 +1,190 @@
+##############################################################################
+# 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
+##############################################################################
+import collections
+from contextlib import contextmanager
+
+import StringIO
+
+FILE_REGISTRY = collections.defaultdict(StringIO.StringIO)
+
+# Monkey-patch open to write module files to a StringIO instance
+@contextmanager
+def mock_open(filename, mode):
+ if not mode == 'wb':
+ raise RuntimeError('test.test_install : unexpected opening mode for monkey-patched open')
+
+ FILE_REGISTRY[filename] = StringIO.StringIO()
+
+ try:
+ yield FILE_REGISTRY[filename]
+ finally:
+ handle = FILE_REGISTRY[filename]
+ FILE_REGISTRY[filename] = handle.getvalue()
+ handle.close()
+
+import os
+import itertools
+import unittest
+
+import spack
+import spack.cmd
+
+
+# The use of __import__ is necessary to maintain a name with hyphen (which cannot be an identifier in python)
+test_install = __import__("spack.cmd.test-install", fromlist=['test_install'])
+
+
+class MockSpec(object):
+ def __init__(self, name, version, hashStr=None):
+ self.dependencies = {}
+ self.name = name
+ self.version = version
+ self.hash = hashStr if hashStr else hash((name, version))
+
+ def traverse(self, order=None):
+ for _, spec in self.dependencies.items():
+ yield spec
+ yield self
+ #allDeps = itertools.chain.from_iterable(i.traverse() for i in self.dependencies.itervalues())
+ #return set(itertools.chain([self], allDeps))
+
+ def dag_hash(self):
+ return self.hash
+
+ @property
+ def short_spec(self):
+ return '-'.join([self.name, str(self.version), str(self.hash)])
+
+
+class MockPackage(object):
+ def __init__(self, spec, buildLogPath):
+ self.name = spec.name
+ self.spec = spec
+ self.installed = False
+ self.build_log_path = buildLogPath
+
+ def do_install(self, *args, **kwargs):
+ self.installed = True
+
+
+class MockPackageDb(object):
+ def __init__(self, init=None):
+ self.specToPkg = {}
+ if init:
+ self.specToPkg.update(init)
+
+ def get(self, spec):
+ return self.specToPkg[spec]
+
+
+def mock_fetch_log(path):
+ return []
+
+specX = MockSpec('X', "1.2.0")
+specY = MockSpec('Y', "2.3.8")
+specX.dependencies['Y'] = specY
+pkgX = MockPackage(specX, 'logX')
+pkgY = MockPackage(specY, 'logY')
+
+
+class MockArgs(object):
+ def __init__(self, package):
+ self.package = package
+ self.jobs = None
+ self.no_checksum = False
+ self.output = None
+
+
+# TODO: add test(s) where Y fails to install
+class TestInstallTest(unittest.TestCase):
+ """
+ Tests test-install where X->Y
+ """
+
+ def setUp(self):
+ super(TestInstallTest, self).setUp()
+
+ # Monkey patch parse specs
+ def monkey_parse_specs(x, concretize):
+ if x == 'X':
+ return [specX]
+ elif x == 'Y':
+ return [specY]
+ return []
+
+ self.parse_specs = spack.cmd.parse_specs
+ spack.cmd.parse_specs = monkey_parse_specs
+
+ # Monkey patch os.mkdirp
+ self.os_mkdir = os.mkdir
+ os.mkdir = lambda x: True
+
+ # Monkey patch open
+ test_install.open = mock_open
+
+ # Clean FILE_REGISTRY
+ FILE_REGISTRY = collections.defaultdict(StringIO.StringIO)
+
+ pkgX.installed = False
+ pkgY.installed = False
+
+ # Monkey patch pkgDb
+ self.saved_db = spack.repo
+ pkgDb = MockPackageDb({specX: pkgX, specY: pkgY})
+ spack.repo = pkgDb
+
+ def tearDown(self):
+ # Remove the monkey patched test_install.open
+ test_install.open = open
+
+ # Remove the monkey patched os.mkdir
+ os.mkdir = self.os_mkdir
+ del self.os_mkdir
+
+ # Remove the monkey patched parse_specs
+ spack.cmd.parse_specs = self.parse_specs
+ del self.parse_specs
+ super(TestInstallTest, self).tearDown()
+
+ spack.repo = self.saved_db
+
+ def test_installing_both(self):
+ test_install.test_install(None, MockArgs('X') )
+ self.assertEqual(len(FILE_REGISTRY), 1)
+ for _, content in FILE_REGISTRY.items():
+ self.assertTrue('tests="2"' in content)
+ self.assertTrue('failures="0"' in content)
+ self.assertTrue('errors="0"' in content)
+
+ def test_dependency_already_installed(self):
+ pkgX.installed = True
+ pkgY.installed = True
+ test_install.test_install(None, MockArgs('X'))
+ self.assertEqual(len(FILE_REGISTRY), 1)
+ for _, content in FILE_REGISTRY.items():
+ self.assertTrue('tests="2"' in content)
+ self.assertTrue('failures="0"' in content)
+ self.assertTrue('errors="0"' in content)
+ self.assertEqual(sum('skipped' in line for line in content.split('\n')), 2)
diff --git a/lib/spack/spack/test/cmd/uninstall.py b/lib/spack/spack/test/cmd/uninstall.py
new file mode 100644
index 0000000000..80efe06d36
--- /dev/null
+++ b/lib/spack/spack/test/cmd/uninstall.py
@@ -0,0 +1,37 @@
+import spack.test.mock_database
+
+from spack.cmd.uninstall import uninstall
+
+
+class MockArgs(object):
+ def __init__(self, packages, all=False, force=False, dependents=False):
+ self.packages = packages
+ self.all = all
+ self.force = force
+ self.dependents = dependents
+ self.yes_to_all = True
+
+
+class TestUninstall(spack.test.mock_database.MockDatabase):
+ def test_uninstall(self):
+ parser = None
+ # Multiple matches
+ args = MockArgs(['mpileaks'])
+ self.assertRaises(SystemExit, uninstall, parser, args)
+ # Installed dependents
+ args = MockArgs(['libelf'])
+ self.assertRaises(SystemExit, uninstall, parser, args)
+ # Recursive uninstall
+ args = MockArgs(['callpath'], all=True, dependents=True)
+ uninstall(parser, args)
+
+ all_specs = spack.install_layout.all_specs()
+ self.assertEqual(len(all_specs), 7)
+ # query specs with multiple configurations
+ mpileaks_specs = [s for s in all_specs if s.satisfies('mpileaks')]
+ callpath_specs = [s for s in all_specs if s.satisfies('callpath')]
+ mpi_specs = [s for s in all_specs if s.satisfies('mpi')]
+
+ self.assertEqual(len(mpileaks_specs), 0)
+ self.assertEqual(len(callpath_specs), 0)
+ self.assertEqual(len(mpi_specs), 3)
diff --git a/lib/spack/spack/test/database.py b/lib/spack/spack/test/database.py
index ce6e8a0552..465263d057 100644
--- a/lib/spack/spack/test/database.py
+++ b/lib/spack/spack/test/database.py
@@ -28,16 +28,12 @@ both in memory and in its file
"""
import os.path
import multiprocessing
-import shutil
-import tempfile
import spack
from llnl.util.filesystem import join_path
from llnl.util.lock import *
from llnl.util.tty.colify import colify
-from spack.database import Database
-from spack.directory_layout import YamlDirectoryLayout
-from spack.test.mock_packages_test import *
+from spack.test.mock_database import MockDatabase
def _print_ref_counts():
@@ -75,80 +71,7 @@ def _print_ref_counts():
colify(recs, cols=3)
-class DatabaseTest(MockPackagesTest):
-
- def _mock_install(self, spec):
- s = Spec(spec)
- s.concretize()
- pkg = spack.repo.get(s)
- pkg.do_install(fake=True)
-
-
- def _mock_remove(self, spec):
- specs = spack.installed_db.query(spec)
- assert(len(specs) == 1)
- spec = specs[0]
- spec.package.do_uninstall(spec)
-
-
- def setUp(self):
- super(DatabaseTest, self).setUp()
- #
- # TODO: make the mockup below easier.
- #
-
- # Make a fake install directory
- self.install_path = tempfile.mkdtemp()
- self.spack_install_path = spack.install_path
- spack.install_path = self.install_path
-
- self.install_layout = YamlDirectoryLayout(self.install_path)
- self.spack_install_layout = spack.install_layout
- spack.install_layout = self.install_layout
-
- # Make fake database and fake install directory.
- self.installed_db = Database(self.install_path)
- self.spack_installed_db = spack.installed_db
- spack.installed_db = self.installed_db
-
- # make a mock database with some packages installed note that
- # the ref count for dyninst here will be 3, as it's recycled
- # across each install.
- #
- # Here is what the mock DB looks like:
- #
- # o mpileaks o mpileaks' o mpileaks''
- # |\ |\ |\
- # | o callpath | o callpath' | o callpath''
- # |/| |/| |/|
- # o | mpich o | mpich2 o | zmpi
- # | | o | fake
- # | | |
- # | |______________/
- # | .____________/
- # |/
- # o dyninst
- # |\
- # | o libdwarf
- # |/
- # o libelf
- #
-
- # Transaction used to avoid repeated writes.
- with spack.installed_db.write_transaction():
- self._mock_install('mpileaks ^mpich')
- self._mock_install('mpileaks ^mpich2')
- self._mock_install('mpileaks ^zmpi')
-
-
- def tearDown(self):
- super(DatabaseTest, self).tearDown()
- shutil.rmtree(self.install_path)
- spack.install_path = self.spack_install_path
- spack.install_layout = self.spack_install_layout
- spack.installed_db = self.spack_installed_db
-
-
+class DatabaseTest(MockDatabase):
def test_005_db_exists(self):
"""Make sure db cache file exists after creating."""
index_file = join_path(self.install_path, '.spack-db', 'index.yaml')
@@ -157,7 +80,6 @@ class DatabaseTest(MockPackagesTest):
self.assertTrue(os.path.exists(index_file))
self.assertTrue(os.path.exists(lock_file))
-
def test_010_all_install_sanity(self):
"""Ensure that the install layout reflects what we think it does."""
all_specs = spack.install_layout.all_specs()
diff --git a/lib/spack/spack/test/install.py b/lib/spack/spack/test/install.py
index 8297893f01..fc5b7e67df 100644
--- a/lib/spack/spack/test/install.py
+++ b/lib/spack/spack/test/install.py
@@ -64,7 +64,14 @@ class InstallTest(MockPackagesTest):
shutil.rmtree(self.tmpdir, ignore_errors=True)
- def test_install_and_uninstall(self):
+ def fake_fetchify(self, pkg):
+ """Fake the URL for a package so it downloads from a file."""
+ fetcher = FetchStrategyComposite()
+ fetcher.append(URLFetchStrategy(self.repo.url))
+ pkg.fetcher = fetcher
+
+
+ def ztest_install_and_uninstall(self):
# Get a basic concrete spec for the trivial install package.
spec = Spec('trivial_install_test_package')
spec.concretize()
@@ -73,11 +80,7 @@ class InstallTest(MockPackagesTest):
# Get the package
pkg = spack.repo.get(spec)
- # Fake the URL for the package so it downloads from a file.
-
- fetcher = FetchStrategyComposite()
- fetcher.append(URLFetchStrategy(self.repo.url))
- pkg.fetcher = fetcher
+ self.fake_fetchify(pkg)
try:
pkg.do_install()
@@ -85,3 +88,17 @@ class InstallTest(MockPackagesTest):
except Exception, e:
pkg.remove_prefix()
raise
+
+
+ def test_install_environment(self):
+ spec = Spec('cmake-client').concretized()
+
+ for s in spec.traverse():
+ self.fake_fetchify(s.package)
+
+ pkg = spec.package
+ try:
+ pkg.do_install()
+ except Exception, e:
+ pkg.remove_prefix()
+ raise
diff --git a/lib/spack/spack/test/mock_database.py b/lib/spack/spack/test/mock_database.py
new file mode 100644
index 0000000000..82ba59fc48
--- /dev/null
+++ b/lib/spack/spack/test/mock_database.py
@@ -0,0 +1,80 @@
+import shutil
+import tempfile
+
+import spack
+from spack.spec import Spec
+from spack.database import Database
+from spack.directory_layout import YamlDirectoryLayout
+from spack.test.mock_packages_test import MockPackagesTest
+
+
+class MockDatabase(MockPackagesTest):
+ def _mock_install(self, spec):
+ s = Spec(spec)
+ s.concretize()
+ pkg = spack.repo.get(s)
+ pkg.do_install(fake=True)
+
+ def _mock_remove(self, spec):
+ specs = spack.installed_db.query(spec)
+ assert len(specs) == 1
+ spec = specs[0]
+ spec.package.do_uninstall(spec)
+
+ def setUp(self):
+ super(MockDatabase, self).setUp()
+ #
+ # TODO: make the mockup below easier.
+ #
+
+ # Make a fake install directory
+ self.install_path = tempfile.mkdtemp()
+ self.spack_install_path = spack.install_path
+ spack.install_path = self.install_path
+
+ self.install_layout = YamlDirectoryLayout(self.install_path)
+ self.spack_install_layout = spack.install_layout
+ spack.install_layout = self.install_layout
+
+ # Make fake database and fake install directory.
+ self.installed_db = Database(self.install_path)
+ self.spack_installed_db = spack.installed_db
+ spack.installed_db = self.installed_db
+
+ # make a mock database with some packages installed note that
+ # the ref count for dyninst here will be 3, as it's recycled
+ # across each install.
+ #
+ # Here is what the mock DB looks like:
+ #
+ # o mpileaks o mpileaks' o mpileaks''
+ # |\ |\ |\
+ # | o callpath | o callpath' | o callpath''
+ # |/| |/| |/|
+ # o | mpich o | mpich2 o | zmpi
+ # | | o | fake
+ # | | |
+ # | |______________/
+ # | .____________/
+ # |/
+ # o dyninst
+ # |\
+ # | o libdwarf
+ # |/
+ # o libelf
+ #
+
+ # Transaction used to avoid repeated writes.
+ with spack.installed_db.write_transaction():
+ self._mock_install('mpileaks ^mpich')
+ self._mock_install('mpileaks ^mpich2')
+ self._mock_install('mpileaks ^zmpi')
+
+ def tearDown(self):
+ for spec in spack.installed_db.query():
+ spec.package.do_uninstall(spec)
+ super(MockDatabase, self).tearDown()
+ shutil.rmtree(self.install_path)
+ spack.install_path = self.spack_install_path
+ spack.install_layout = self.spack_install_layout
+ spack.installed_db = self.spack_installed_db
diff --git a/lib/spack/spack/test/unit_install.py b/lib/spack/spack/test/unit_install.py
deleted file mode 100644
index 18615b7efe..0000000000
--- a/lib/spack/spack/test/unit_install.py
+++ /dev/null
@@ -1,126 +0,0 @@
-##############################################################################
-# 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
-##############################################################################
-import itertools
-import unittest
-
-import spack
-
-test_install = __import__("spack.cmd.test-install",
- fromlist=["BuildId", "create_test_output", "TestResult"])
-
-class MockOutput(object):
- def __init__(self):
- self.results = {}
-
- def add_test(self, buildId, passed=True, buildInfo=None):
- self.results[buildId] = passed
-
- def write_to(self, stream):
- pass
-
-class MockSpec(object):
- def __init__(self, name, version, hashStr=None):
- self.dependencies = {}
- self.name = name
- self.version = version
- self.hash = hashStr if hashStr else hash((name, version))
-
- def traverse(self, order=None):
- allDeps = itertools.chain.from_iterable(i.traverse() for i in
- self.dependencies.itervalues())
- return set(itertools.chain([self], allDeps))
-
- def dag_hash(self):
- return self.hash
-
- def to_yaml(self):
- return "<<<MOCK YAML {0}>>>".format(test_install.BuildId(self).stringId())
-
-class MockPackage(object):
- def __init__(self, buildLogPath):
- self.installed = False
- self.build_log_path = buildLogPath
-
-specX = MockSpec("X", "1.2.0")
-specY = MockSpec("Y", "2.3.8")
-specX.dependencies['Y'] = specY
-pkgX = MockPackage('logX')
-pkgY = MockPackage('logY')
-bIdX = test_install.BuildId(specX)
-bIdY = test_install.BuildId(specY)
-
-class UnitInstallTest(unittest.TestCase):
- """Tests test-install where X->Y"""
-
- def setUp(self):
- super(UnitInstallTest, self).setUp()
-
- pkgX.installed = False
- pkgY.installed = False
-
- self.saved_db = spack.repo
- pkgDb = MockPackageDb({specX:pkgX, specY:pkgY})
- spack.repo = pkgDb
-
-
- def tearDown(self):
- super(UnitInstallTest, self).tearDown()
-
- spack.repo = self.saved_db
-
- def test_installing_both(self):
- mo = MockOutput()
-
- pkgX.installed = True
- pkgY.installed = True
- test_install.create_test_output(specX, [specX, specY], mo, getLogFunc=mock_fetch_log)
-
- self.assertEqual(mo.results,
- {bIdX:test_install.TestResult.PASSED,
- bIdY:test_install.TestResult.PASSED})
-
-
- def test_dependency_already_installed(self):
- mo = MockOutput()
-
- pkgX.installed = True
- pkgY.installed = True
- test_install.create_test_output(specX, [specX], mo, getLogFunc=mock_fetch_log)
- self.assertEqual(mo.results, {bIdX:test_install.TestResult.PASSED})
-
- #TODO: add test(s) where Y fails to install
-
-
-class MockPackageDb(object):
- def __init__(self, init=None):
- self.specToPkg = {}
- if init:
- self.specToPkg.update(init)
-
- def get(self, spec):
- return self.specToPkg[spec]
-
-def mock_fetch_log(path):
- return []
diff --git a/var/spack/repos/builtin.mock/packages/cmake-client/package.py b/var/spack/repos/builtin.mock/packages/cmake-client/package.py
new file mode 100644
index 0000000000..a5d3ef156a
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/cmake-client/package.py
@@ -0,0 +1,89 @@
+##############################################################################
+# 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
+
+def check(condition, msg):
+ """Raise an install error if condition is False."""
+ if not condition:
+ raise InstallError(msg)
+
+
+class CmakeClient(Package):
+ """A dumy package that uses cmake."""
+ homepage = 'https://www.example.com'
+ url = 'https://www.example.com/cmake-client-1.0.tar.gz'
+
+ version('1.0', '4cb3ff35b2472aae70f542116d616e63')
+
+ depends_on('cmake')
+
+
+ def setup_environment(self, spack_env, run_env):
+ spack_cc # Ensure spack module-scope variable is avaiabl
+ check(from_cmake == "from_cmake",
+ "setup_environment couldn't read global set by cmake.")
+
+ check(self.spec['cmake'].link_arg == "test link arg",
+ "link arg on dependency spec not readable from setup_environment.")
+
+
+ def setup_dependent_environment(self, spack_env, run_env, dspec):
+ spack_cc # Ensure spack module-scope variable is avaiable
+ check(from_cmake == "from_cmake",
+ "setup_dependent_environment couldn't read global set by cmake.")
+
+ check(self.spec['cmake'].link_arg == "test link arg",
+ "link arg on dependency spec not readable from setup_dependent_environment.")
+
+
+ def setup_dependent_package(self, module, dspec):
+ spack_cc # Ensure spack module-scope variable is avaiable
+ check(from_cmake == "from_cmake",
+ "setup_dependent_package couldn't read global set by cmake.")
+
+ check(self.spec['cmake'].link_arg == "test link arg",
+ "link arg on dependency spec not readable from setup_dependent_package.")
+
+
+
+ def install(self, spec, prefix):
+ # check that cmake is in the global scope.
+ global cmake
+ check(cmake is not None, "No cmake was in environment!")
+
+ # check that which('cmake') returns the right one.
+ cmake = which('cmake')
+ check(cmake.exe[0].startswith(spec['cmake'].prefix.bin),
+ "Wrong cmake was in environment: %s" % cmake)
+
+ check(from_cmake == "from_cmake",
+ "Couldn't read global set by cmake.")
+
+ check(os.environ['from_cmake'] == 'from_cmake',
+ "Couldn't read env var set in envieonmnt by dependency")
+
+ mkdirp(prefix.bin)
+ touch(join_path(prefix.bin, 'dummy'))
diff --git a/var/spack/repos/builtin.mock/packages/cmake/package.py b/var/spack/repos/builtin.mock/packages/cmake/package.py
new file mode 100644
index 0000000000..deb44c2bf7
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/cmake/package.py
@@ -0,0 +1,69 @@
+##############################################################################
+# 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
+
+def check(condition, msg):
+ """Raise an install error if condition is False."""
+ if not condition:
+ raise InstallError(msg)
+
+
+class Cmake(Package):
+ """A dumy package for the cmake build system."""
+ homepage = 'https://www.cmake.org'
+ url = 'https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz'
+
+ version('3.4.3', '4cb3ff35b2472aae70f542116d616e63',
+ url='https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz')
+
+
+ def setup_environment(self, spack_env, run_env):
+ spack_cc # Ensure spack module-scope variable is avaiable
+ spack_env.set('for_install', 'for_install')
+
+ def setup_dependent_environment(self, spack_env, run_env, dspec):
+ spack_cc # Ensure spack module-scope variable is avaiable
+ spack_env.set('from_cmake', 'from_cmake')
+
+
+ def setup_dependent_package(self, module, dspec):
+ spack_cc # Ensure spack module-scope variable is avaiable
+
+ self.spec.from_cmake = "from_cmake"
+ module.from_cmake = "from_cmake"
+
+ self.spec.link_arg = "test link arg"
+
+
+ def install(self, spec, prefix):
+ mkdirp(prefix.bin)
+
+ check(os.environ['for_install'] == 'for_install',
+ "Couldn't read env var set in compile envieonmnt")
+
+ cmake_exe = join_path(prefix.bin, 'cmake')
+ touch(cmake_exe)
+ set_executable(cmake_exe)
diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py
index 7260fd74a1..5274fc018f 100644
--- a/var/spack/repos/builtin/packages/astyle/package.py
+++ b/var/spack/repos/builtin/packages/astyle/package.py
@@ -14,4 +14,5 @@ class Astyle(Package):
make('-f',
join_path(self.stage.source_path,'build','clang','Makefile'),
parallel=False)
+ mkdirp(self.prefix.bin)
install(join_path(self.stage.source_path, 'src','bin','astyle'), self.prefix.bin)
diff --git a/var/spack/repos/builtin/packages/bash/package.py b/var/spack/repos/builtin/packages/bash/package.py
new file mode 100644
index 0000000000..9c9fbeedcf
--- /dev/null
+++ b/var/spack/repos/builtin/packages/bash/package.py
@@ -0,0 +1,20 @@
+from spack import *
+
+class Bash(Package):
+ """The GNU Project's Bourne Again SHell."""
+
+ homepage = "https://www.gnu.org/software/bash/"
+ url = "ftp://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz"
+
+ version('4.3', '81348932d5da294953e15d4814c74dd1')
+
+ depends_on('readline')
+
+ def install(self, spec, prefix):
+ configure('--prefix=%s' % prefix,
+ '--with-curses',
+ '--with-installed-readline=%s' % spec['readline'].prefix)
+
+ make()
+ make("tests")
+ make("install")
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py
index 897539a439..b8064093d2 100644
--- a/var/spack/repos/builtin/packages/binutils/package.py
+++ b/var/spack/repos/builtin/packages/binutils/package.py
@@ -12,6 +12,10 @@ class Binutils(Package):
version('2.23.2', '4f8fa651e35ef262edc01d60fb45702e')
version('2.20.1', '2b9dc8f2b7dbd5ec5992c6e29de0b764')
+ depends_on('m4')
+ depends_on('flex')
+ depends_on('bison')
+
# Add a patch that creates binutils libiberty_pic.a which is preferred by OpenSpeedShop and cbtf-krell
variant('krellpatch', default=False, description="build with openspeedshop based patch.")
variant('gold', default=True, description="build the gold linker")
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py
index f889da21f2..12bc9508c3 100644
--- a/var/spack/repos/builtin/packages/boost/package.py
+++ b/var/spack/repos/builtin/packages/boost/package.py
@@ -199,6 +199,18 @@ class Boost(Package):
install_tree(src, dst)
return
+ # Remove libraries that the release version does not support
+ if not spec.satisfies('@1.54.0:'):
+ withLibs.remove('log')
+ if not spec.satisfies('@1.53.0:'):
+ withLibs.remove('atomic')
+ if not spec.satisfies('@1.48.0:'):
+ withLibs.remove('locale')
+ if not spec.satisfies('@1.47.0:'):
+ withLibs.remove('chrono')
+ if not spec.satisfies('@1.43.0:'):
+ withLibs.remove('random')
+
# to make Boost find the user-config.jam
env['BOOST_BUILD_PATH'] = './'
diff --git a/var/spack/repos/builtin/packages/cereal/package.py b/var/spack/repos/builtin/packages/cereal/package.py
index a83927456f..6acbf666c8 100644
--- a/var/spack/repos/builtin/packages/cereal/package.py
+++ b/var/spack/repos/builtin/packages/cereal/package.py
@@ -1,4 +1,5 @@
from spack import *
+import os
import shutil
class Cereal(Package):
@@ -30,5 +31,8 @@ class Cereal(Package):
# Install
shutil.rmtree(join_path(prefix, 'doc'), ignore_errors=True)
shutil.rmtree(join_path(prefix, 'include'), ignore_errors=True)
+ shutil.rmtree(join_path(prefix, 'lib'), ignore_errors=True)
shutil.copytree('doc', join_path(prefix, 'doc'), symlinks=True)
shutil.copytree('include', join_path(prefix, 'include'), symlinks=True)
+ # Create empty directory to avoid linker warnings later
+ os.mkdir(join_path(prefix, 'lib'))
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py
index 91a4e3b415..2493cf0a13 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.2', '701386a1b5ec95f8d1075ecf96383e02')
version('3.5.1', 'ca051f4a66375c89d1a524e726da0296')
version('3.5.0', '33c5d09d4c33d4ffcc63578a6ba8777e')
version('3.4.3', '4cb3ff35b2472aae70f542116d616e63')
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 422f5a19eb..74ce8ef502 100644
--- a/var/spack/repos/builtin/packages/dbus/package.py
+++ b/var/spack/repos/builtin/packages/dbus/package.py
@@ -20,6 +20,8 @@ class Dbus(Package):
version('1.8.4', '4717cb8ab5b80978fcadf2b4f2f72e1b')
version('1.8.2', 'd6f709bbec0a022a1847c7caec9d6068')
+ depends_on('expat')
+
def install(self, spec, prefix):
configure(
"--prefix=%s" % prefix,
diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py
index 7aaf33380e..674fe3150a 100644
--- a/var/spack/repos/builtin/packages/dealii/package.py
+++ b/var/spack/repos/builtin/packages/dealii/package.py
@@ -23,8 +23,10 @@ class Dealii(Package):
# required dependencies, light version
depends_on ("blas")
- depends_on ("boost", when='~mpi')
- depends_on ("boost+mpi", when='+mpi')
+ # Boost 1.58 is blacklisted, see https://github.com/dealii/dealii/issues/1591
+ # require at least 1.59
+ depends_on ("boost@1.59.0:", when='~mpi')
+ depends_on ("boost@1.59.0:+mpi", when='+mpi')
depends_on ("bzip2")
depends_on ("cmake")
depends_on ("lapack")
@@ -38,7 +40,7 @@ class Dealii(Package):
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 ("metis@5:", when='+metis')
depends_on ("netcdf+mpi", when="+netcdf+mpi")
depends_on ("netcdf-cxx", when='+netcdf+mpi')
depends_on ("oce", when='+oce')
@@ -48,8 +50,8 @@ class Dealii(Package):
depends_on ("trilinos", when='+trilinos+mpi')
# developer dependnecies
- #depends_on ("numdiff") #FIXME
- #depends_on ("astyle") #FIXME
+ depends_on ("numdiff", when='@dev')
+ depends_on ("astyle@2.04", when='@dev')
def install(self, spec, prefix):
options = []
@@ -174,6 +176,19 @@ class Dealii(Package):
make('release')
make('run',parallel=False)
+ # An example which uses Metis + PETSc
+ # FIXME: switch step-18 to MPI
+ with working_dir('examples/step-18'):
+ print('=====================================')
+ print('============= Step-18 ===============')
+ print('=====================================')
+ # list the number of cycles to speed up
+ filter_file(r'(end_time = 10;)', ('end_time = 3;'), 'step-18.cc')
+ if '^petsc' in spec and '^metis' in spec:
+ 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'):
@@ -235,5 +250,7 @@ class Dealii(Package):
if 'oce' in spec:
cmake('.')
make('release')
- if sys.platform != 'darwin': #FIXME
- make('run',parallel=False)
+ make('run',parallel=False)
+
+ def setup_environment(self, spack_env, env):
+ env.set('DEAL_II_DIR', self.prefix)
diff --git a/var/spack/repos/builtin/packages/dia/package.py b/var/spack/repos/builtin/packages/dia/package.py
new file mode 100644
index 0000000000..25d5f08205
--- /dev/null
+++ b/var/spack/repos/builtin/packages/dia/package.py
@@ -0,0 +1,35 @@
+from spack import *
+
+class Dia(Package):
+ """Dia is a program for drawing structured diagrams."""
+ homepage = 'https://wiki.gnome.org/Apps/Dia'
+ url = 'https://ftp.gnome.org/pub/gnome/sources/dia/0.97/dia-0.97.3.tar.xz'
+
+ version('0.97.3', '0e744a0f6a6c4cb6a089e4d955392c3c')
+
+ depends_on('intltool')
+ depends_on('gtkplus@2.6.0:')
+ depends_on('cairo')
+ #depends_on('libart') # optional dependency, not yet supported by spack.
+ depends_on('libpng')
+ depends_on('libxslt')
+ depends_on('python')
+ depends_on('swig')
+ # depends_on('py-gtk') # optional dependency, not yet supported by spack.
+
+ def url_for_version(self, version):
+ """Handle Dia's version-based custom URLs."""
+ return 'https://ftp.gnome.org/pub/gnome/source/dia/%s/dia-%s.tar.xz' % (version.up_to(2), version)
+
+ def install(self, spec, prefix):
+
+ # configure, build, install:
+ options = ['--prefix=%s' % prefix,
+ '--with-cairo',
+ '--with-xslt-prefix=%s' % spec['libxslt'].prefix,
+ '--with-python',
+ '--with-swig']
+
+ configure(*options)
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/dyninst/package.py b/var/spack/repos/builtin/packages/dyninst/package.py
index 0111dcbe08..b28e897a0f 100644
--- a/var/spack/repos/builtin/packages/dyninst/package.py
+++ b/var/spack/repos/builtin/packages/dyninst/package.py
@@ -31,6 +31,8 @@ class Dyninst(Package):
url = "http://www.dyninst.org/sites/default/files/downloads/dyninst/8.1.2/DyninstAPI-8.1.2.tgz"
list_url = "http://www.dyninst.org/downloads/dyninst-8.x"
+ version('9.1.0', '5c64b77521457199db44bec82e4988ac',
+ url="http://www.paradyn.org/release9.1.0/DyninstAPI-9.1.0.tgz")
version('8.2.1', 'abf60b7faabe7a2e4b54395757be39c7',
url="http://www.paradyn.org/release8.2/DyninstAPI-8.2.1.tgz")
version('8.1.2', 'bf03b33375afa66fe0efa46ce3f4b17a',
diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py
index 8d6e672f86..6b38ab0261 100644
--- a/var/spack/repos/builtin/packages/eigen/package.py
+++ b/var/spack/repos/builtin/packages/eigen/package.py
@@ -45,7 +45,8 @@ class Eigen(Package):
# TODO : dependency on googlehash, superlu, adolc missing
- depends_on('metis', when='+metis')
+ depends_on('cmake')
+ depends_on('metis@5:', when='+metis')
depends_on('scotch', when='+scotch')
depends_on('fftw', when='+fftw')
depends_on('suite-sparse', when='+suitesparse')
diff --git a/var/spack/repos/builtin/packages/elk/package.py b/var/spack/repos/builtin/packages/elk/package.py
new file mode 100644
index 0000000000..1d9216fd1a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/elk/package.py
@@ -0,0 +1,122 @@
+from spack import *
+import spack
+
+class Elk(Package):
+ '''An all-electron full-potential linearised augmented-plane wave
+ (FP-LAPW) code with many advanced features.'''
+
+ homepage = 'http://elk.sourceforge.net/'
+ url = 'https://sourceforge.net/projects/elk/files/elk-3.3.17.tgz'
+
+ version('3.3.17', 'f57f6230d14f3b3b558e5c71f62f0592')
+
+ # Elk provides these libraries, but allows you to specify your own
+ variant('blas', default=True, description='Build with custom BLAS library')
+ variant('lapack', default=True, description='Build with custom LAPACK library')
+ variant('fft', default=True, description='Build with custom FFT library')
+
+ # Elk does not provide these libraries, but allows you to use them
+ variant('mpi', default=True, description='Enable MPI parallelism')
+ variant('openmp', default=True, description='Enable OpenMP support')
+ variant('libxc', default=True, description='Link to Libxc functional library')
+
+ depends_on('blas', when='+blas')
+ depends_on('lapack', when='+lapack')
+ depends_on('fftw', when='+fft')
+ depends_on('mpi', when='+mpi')
+ depends_on('libxc', when='+libxc')
+
+ # Cannot be built in parallel
+ parallel = False
+
+
+ def configure(self, spec):
+ # Dictionary of configuration options
+ config = {
+ 'MAKE': 'make',
+ 'F90': join_path(spack.build_env_path, 'f90'),
+ 'F77': join_path(spack.build_env_path, 'f77'),
+ 'AR': 'ar',
+ 'LIB_FFT': 'fftlib.a',
+ 'SRC_MPI': 'mpi_stub.f90',
+ 'SRC_OMP': 'omp_stub.f90',
+ 'SRC_libxc': 'libxcifc_stub.f90',
+ 'SRC_FFT': 'zfftifc.f90'
+ }
+
+ # Compiler-specific flags
+ flags = ''
+ if self.compiler.name == 'intel':
+ flags = '-O3 -ip -unroll -no-prec-div -openmp'
+ elif self.compiler.name == 'gcc':
+ flags = '-O3 -ffast-math -funroll-loops -fopenmp'
+ elif self.compiler.name == 'pgi':
+ flags = '-O3 -mp -lpthread'
+ elif self.compiler.name == 'g95':
+ flags = '-O3 -fno-second-underscore'
+ elif self.compiler.name == 'nag':
+ flags = '-O4 -kind=byte -dusty -dcfuns'
+ elif self.compiler.name == 'xl':
+ flags = '-O3 -qsmp=omp'
+ config['F90_OPTS'] = flags
+ config['F77_OPTS'] = flags
+
+ # BLAS/LAPACK support
+ blas = 'blas.a'
+ lapack = 'lapack.a'
+ if '+blas' in spec:
+ blas = join_path(spec['blas'].prefix.lib, 'libblas.so')
+ if '+lapack' in spec:
+ lapack = join_path(spec['lapack'].prefix.lib, 'liblapack.so')
+ config['LIB_LPK'] = ' '.join([lapack, blas]) # lapack must come before blas
+
+ # FFT support
+ if '+fft' in spec:
+ config['LIB_FFT'] = join_path(spec['fftw'].prefix.lib, 'libfftw3.so')
+ config['SRC_FFT'] = 'zfftifc_fftw.f90'
+
+ # MPI support
+ if '+mpi' in spec:
+ config.pop('SRC_MPI')
+ config['F90'] = join_path(spec['mpi'].prefix.bin, 'mpif90')
+ config['F77'] = join_path(spec['mpi'].prefix.bin, 'mpif77')
+
+ # OpenMP support
+ if '+openmp' in spec:
+ config.pop('SRC_OMP')
+
+ # Libxc support
+ if '+libxc' in spec:
+ config['LIB_libxc'] = ' '.join([
+ join_path(spec['libxc'].prefix.lib, 'libxcf90.so'),
+ join_path(spec['libxc'].prefix.lib, 'libxc.so')
+ ])
+ config['SRC_libxc'] = ' '.join([
+ 'libxc_funcs.f90',
+ 'libxc.f90',
+ 'libxcifc.f90'
+ ])
+
+ # Write configuration options to include file
+ with open('make.inc', 'w') as inc:
+ for key in config:
+ inc.write('{0} = {1}\n'.format(key, config[key]))
+
+
+ def install(self, spec, prefix):
+ # Elk only provides an interactive setup script
+ self.configure(spec)
+
+ make()
+ make('test')
+
+ # The Elk Makefile does not provide an install target
+ mkdirp(prefix.bin)
+
+ install('src/elk', prefix.bin)
+ install('src/eos/eos', prefix.bin)
+ install('src/spacegroup/spacegroup', prefix.bin)
+
+ install_tree('examples', join_path(prefix, 'examples'))
+ install_tree('species', join_path(prefix, 'species'))
+
diff --git a/var/spack/repos/builtin/packages/environment-modules/package.py b/var/spack/repos/builtin/packages/environment-modules/package.py
new file mode 100644
index 0000000000..45181da41b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/environment-modules/package.py
@@ -0,0 +1,38 @@
+from spack import *
+
+
+class EnvironmentModules(Package):
+ """The Environment Modules package provides for the dynamic
+ modification of a user's environment via modulefiles."""
+
+ homepage = "https://sourceforge.net/p/modules/wiki/Home/"
+ url = "http://prdownloads.sourceforge.net/modules/modules-3.2.10.tar.gz"
+
+ version('3.2.10', '8b097fdcb90c514d7540bb55a3cb90fb')
+
+ # Dependencies:
+ depends_on('tcl')
+
+ def install(self, spec, prefix):
+ tcl_spec = spec['tcl']
+
+ # See: https://sourceforge.net/p/modules/bugs/62/
+ CPPFLAGS = ['-DUSE_INTERP_ERRORLINE']
+ config_args = [
+ "--without-tclx",
+ "--with-tclx-ver=0.0",
+ "--prefix=%s" % prefix,
+ "--with-tcl=%s" % join_path(tcl_spec.prefix, 'lib'), # It looks for tclConfig.sh
+ "--with-tcl-ver=%d.%d" % (tcl_spec.version.version[0], tcl_spec.version.version[1]),
+ '--disable-debug',
+ '--disable-dependency-tracking',
+ '--disable-silent-rules',
+ '--disable-versioning',
+ '--datarootdir=%s' % prefix.share,
+ 'CPPFLAGS=%s' % ' '.join(CPPFLAGS)
+ ]
+
+
+ configure(*config_args)
+ make()
+ make('install')
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/git/package.py b/var/spack/repos/builtin/packages/git/package.py
index 586b6ce3c3..77521fd658 100644
--- a/var/spack/repos/builtin/packages/git/package.py
+++ b/var/spack/repos/builtin/packages/git/package.py
@@ -7,7 +7,8 @@ class Git(Package):
homepage = "http://git-scm.com"
url = "https://github.com/git/git/tarball/v2.7.1"
- version('2.8.0-rc2', 'c2cf9f2cc70e35f2fafbaf9258f82e4c')
+ version('2.8.1', '1308448d95afa41a4135903f22262fc8')
+ version('2.8.0', 'eca687e46e9750121638f258cff8317b')
version('2.7.3', 'fa1c008b56618c355a32ba4a678305f6')
version('2.7.1', 'bf0706b433a8dedd27a63a72f9a66060')
@@ -23,18 +24,12 @@ class Git(Package):
#version('2.2.1', 'ff41fdb094eed1ec430aed8ee9b9849c')
- # Git compiles with curl support by default on but if your system
- # does not have it you will not be able to clone https repos
- variant("curl", default=False, description="Add the internal support of curl for https clone")
-
- # Git compiles with expat support by default on but if your system
- # does not have it you will not be able to push https repos
- variant("expat", default=False, description="Add the internal support of expat for https push")
-
depends_on("openssl")
depends_on("autoconf")
- depends_on("curl", when="+curl")
- depends_on("expat", when="+expat")
+ depends_on("curl")
+ depends_on("expat")
+
+ # Also depends_on gettext: apt-get install gettext (Ubuntu)
# Use system perl for now.
# depends_on("perl")
@@ -47,23 +42,12 @@ class Git(Package):
"--prefix=%s" % prefix,
"--without-pcre",
"--with-openssl=%s" % spec['openssl'].prefix,
- "--with-zlib=%s" % spec['zlib'].prefix
+ "--with-zlib=%s" % spec['zlib'].prefix,
+ "--with-curl=%s" % spec['curl'].prefix,
+ "--with-expat=%s" % spec['expat'].prefix,
]
- if '+curl' in spec:
- configure_args.append("--with-curl=%s" % spec['curl'].prefix)
-
- if '+expat' in spec:
- configure_args.append("--with-expat=%s" % spec['expat'].prefix)
-
which('autoreconf')('-i')
configure(*configure_args)
make()
make("install")
-
-
-
-
-
-
-
diff --git a/var/spack/repos/builtin/packages/global/package.py b/var/spack/repos/builtin/packages/global/package.py
index e8f06516d9..aac1cede30 100644
--- a/var/spack/repos/builtin/packages/global/package.py
+++ b/var/spack/repos/builtin/packages/global/package.py
@@ -11,6 +11,7 @@ class Global(Package):
version('6.5', 'dfec818b4f53d91721e247cf7b218078')
depends_on('exuberant-ctags')
+ depends_on('ncurses')
def install(self, spec, prefix):
config_args = ['--prefix={0}'.format(prefix)]
diff --git a/var/spack/repos/builtin/packages/gmp/package.py b/var/spack/repos/builtin/packages/gmp/package.py
index fe13de3b95..85e9c237d6 100644
--- a/var/spack/repos/builtin/packages/gmp/package.py
+++ b/var/spack/repos/builtin/packages/gmp/package.py
@@ -35,6 +35,8 @@ class Gmp(Package):
version('6.0.0a', 'b7ff2d88cae7f8085bd5006096eed470')
version('6.0.0' , '6ef5869ae735db9995619135bd856b84')
+ depends_on("m4")
+
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
make()
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
index 513a38ee8a..470969832f 100644
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -37,7 +37,8 @@ class Hdf5(Package):
list_url = "http://www.hdfgroup.org/ftp/HDF5/releases"
list_depth = 3
- version('1.8.16', 'b8ed9a36ae142317f88b0c7ef4b9c618')
+ version('1.10.0', 'bdc935337ee8282579cd6bc4270ad199')
+ version('1.8.16', 'b8ed9a36ae142317f88b0c7ef4b9c618', preferred=True)
version('1.8.15', '03cccb5b33dbe975fdcd8ae9dc021f24')
version('1.8.13', 'c03426e9e77d7766944654280b467289')
@@ -80,10 +81,16 @@ class Hdf5(Package):
# sanity check in configure, so this doesn't merit a variant.
extra_args.append("--enable-unsupported")
- if '+debug' in spec:
- extra_args.append('--enable-debug=all')
+ if spec.satisfies('@1.10:'):
+ if '+debug' in spec:
+ extra_args.append('--enable-build-mode=debug')
+ else:
+ extra_args.append('--enable-build-mode=production')
else:
- extra_args.append('--enable-production')
+ if '+debug' in spec:
+ extra_args.append('--enable-debug=all')
+ else:
+ extra_args.append('--enable-production')
if '+shared' in spec:
extra_args.append('--enable-shared')
@@ -94,10 +101,10 @@ class Hdf5(Package):
extra_args.append('--enable-cxx')
if '+fortran' in spec:
- extra_args.extend([
- '--enable-fortran',
- '--enable-fortran2003'
- ])
+ extra_args.append('--enable-fortran')
+ # '--enable-fortran2003' no longer exists as of version 1.10.0
+ if spec.satisfies('@:1.8.16'):
+ extra_args.append('--enable-fortran2003')
if '+mpi' in spec:
# The HDF5 configure script warns if cxx and mpi are enabled
@@ -139,5 +146,7 @@ class Hdf5(Package):
return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + v + ".tar.gz"
elif version < Version("1.7"):
return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + version.up_to(2) + "/hdf5-" + v + ".tar.gz"
- else:
+ elif version < Version("1.10"):
return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + v + "/src/hdf5-" + v + ".tar.gz"
+ else:
+ return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + version.up_to(2) + "/hdf5-" + v + "/src/hdf5-" + v + ".tar.gz"
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/intltool/package.py b/var/spack/repos/builtin/packages/intltool/package.py
new file mode 100644
index 0000000000..9b3c095378
--- /dev/null
+++ b/var/spack/repos/builtin/packages/intltool/package.py
@@ -0,0 +1,19 @@
+from spack import *
+
+class Intltool(Package):
+ """intltool is a set of tools to centralize translation of many different file formats using GNU gettext-compatible PO files."""
+ homepage = 'https://freedesktop.org/wiki/Software/intltool/'
+
+ version('0.51.0', '12e517cac2b57a0121cda351570f1e63')
+
+ def url_for_version(self, version):
+ """Handle version-based custom URLs."""
+ return 'https://launchpad.net/intltool/trunk/%s/+download/intltool-%s.tar.gz' % (version, version)
+
+ def install(self, spec, prefix):
+
+ # configure, build, install:
+ options = ['--prefix=%s' % prefix ]
+ configure(*options)
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/ior/package.py b/var/spack/repos/builtin/packages/ior/package.py
new file mode 100644
index 0000000000..c46650a674
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ior/package.py
@@ -0,0 +1,42 @@
+from spack import *
+import os
+
+class Ior(Package):
+ """The IOR software is used for benchmarking parallel file systems
+ using POSIX, MPI-IO, or HDF5 interfaces."""
+
+ homepage = "https://github.com/LLNL/ior"
+ url = "https://github.com/LLNL/ior/archive/3.0.1.tar.gz"
+
+ version('3.0.1', '71150025e0bb6ea1761150f48b553065')
+
+ variant('hdf5', default=False, description='support IO with HDF5 backend')
+ variant('ncmpi', default=False, description='support IO with NCMPI backend')
+
+ depends_on('mpi')
+ depends_on('hdf5+mpi', when='+hdf5')
+ depends_on('netcdf+mpi', when='+ncmpi')
+
+
+ def install(self, spec, prefix):
+ os.system('./bootstrap')
+
+ config_args = [
+ 'MPICC=%s' % spec['mpi'].prefix.bin + '/mpicc',
+ '--prefix=%s' % prefix,
+ ]
+
+ if '+hdf5' in spec:
+ config_args.append('--with-hdf5')
+ else:
+ config_args.append('--without-hdf5')
+
+ if '+ncmpi' in spec:
+ config_args.append('--with-ncmpi')
+ else:
+ config_args.append('--without-ncmpi')
+
+ configure(*config_args)
+
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/ipopt/package.py b/var/spack/repos/builtin/packages/ipopt/package.py
new file mode 100644
index 0000000000..13c37bf79c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ipopt/package.py
@@ -0,0 +1,51 @@
+from spack import *
+
+class Ipopt(Package):
+ """Ipopt (Interior Point OPTimizer, pronounced eye-pea-Opt) is a
+ software package for large-scale nonlinear optimization."""
+ homepage = "https://projects.coin-or.org/Ipopt"
+ url = "http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.4.tgz"
+
+ version('3.12.4', '12a8ecaff8dd90025ddea6c65b49cb03')
+ version('3.12.3', 'c560cbfa9cbf62acf8b485823c255a1b')
+ version('3.12.2', 'ec1e855257d7de09e122c446506fb00d')
+ version('3.12.1', 'ceaf895ce80c77778f2cab68ba9f17f3')
+ version('3.12.0', 'f7dfc3aa106a6711a85214de7595e827')
+
+ depends_on("blas")
+ depends_on("lapack")
+ depends_on("pkg-config")
+ depends_on("mumps+double~mpi")
+
+ def install(self, spec, prefix):
+ # Dependency directories
+ blas_dir = spec['blas'].prefix
+ lapack_dir = spec['lapack'].prefix
+ mumps_dir = spec['mumps'].prefix
+
+ # Add directory with fake MPI headers in sequential MUMPS
+ # install to header search path
+ mumps_flags = "-ldmumps -lmumps_common -lpord -lmpiseq"
+ mumps_libcmd = "-L%s " % mumps_dir.lib + mumps_flags
+
+ # By convention, spack links blas & lapack libs to libblas & liblapack
+ blas_lib = "-L%s" % blas_dir.lib + " -lblas"
+ lapack_lib = "-L%s" % lapack_dir.lib + " -llapack"
+
+ configure_args = [
+ "--prefix=%s" % prefix,
+ "--with-mumps-incdir=%s" % mumps_dir.include,
+ "--with-mumps-lib=%s" % mumps_libcmd,
+ "--enable-shared",
+ "--with-blas-incdir=%s" % blas_dir.include,
+ "--with-blas-lib=%s" % blas_lib,
+ "--with-lapack-incdir=%s" % lapack_dir.include,
+ "--with-lapack-lib=%s" % lapack_lib
+ ]
+
+ configure(*configure_args)
+
+ # IPOPT does not build correctly in parallel on OS X
+ make(parallel=False)
+ make("test", parallel=False)
+ make("install", parallel=False)
diff --git a/var/spack/repos/builtin/packages/jemalloc/package.py b/var/spack/repos/builtin/packages/jemalloc/package.py
index 8cec9ea75b..9cb0fd1f40 100644
--- a/var/spack/repos/builtin/packages/jemalloc/package.py
+++ b/var/spack/repos/builtin/packages/jemalloc/package.py
@@ -5,6 +5,7 @@ class Jemalloc(Package):
homepage = "http://www.canonware.com/jemalloc/"
url = "https://github.com/jemalloc/jemalloc/releases/download/4.0.4/jemalloc-4.0.4.tar.bz2"
+ version('4.1.0', 'c4e53c947905a533d5899e5cc3da1f94')
version('4.0.4', '687c5cc53b9a7ab711ccd680351ff988')
variant('stats', default=False, description='Enable heap statistics')
@@ -20,5 +21,8 @@ class Jemalloc(Package):
configure(*configure_args)
+ # Don't use -Werror
+ filter_file(r'-Werror=\S*', '', 'Makefile')
+
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/julia/openblas.patch b/var/spack/repos/builtin/packages/julia/openblas.patch
new file mode 100644
index 0000000000..f75d7dd04f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/julia/openblas.patch
@@ -0,0 +1,68 @@
+diff --git a/deps/Makefile b/deps/Makefile
+index 6cb73be..bcd8520 100644
+--- a/deps/Makefile
++++ b/deps/Makefile
+@@ -1049,7 +1049,7 @@ OPENBLAS_BUILD_OPTS += NO_AFFINITY=1
+
+ # Build for all architectures - required for distribution
+ ifeq ($(OPENBLAS_DYNAMIC_ARCH), 1)
+-OPENBLAS_BUILD_OPTS += DYNAMIC_ARCH=1
++OPENBLAS_BUILD_OPTS += DYNAMIC_ARCH=1 MAKE_NO_J=1
+ endif
+
+ # 64-bit BLAS interface
+@@ -1085,6 +1085,7 @@ OPENBLAS_BUILD_OPTS += NO_AVX2=1
+ endif
+
+ $(OPENBLAS_SRC_DIR)/config.status: $(OPENBLAS_SRC_DIR)/Makefile
++ cd $(dir $@) && patch -p1 < ../openblas-make.patch
+ ifeq ($(OS),WINNT)
+ cd $(dir $@) && patch -p1 < ../openblas-win64.patch
+ endif
+diff --git a/deps/openblas.version b/deps/openblas.version
+index 7c97e1b..58b9467 100644
+--- a/deps/openblas.version
++++ b/deps/openblas.version
+@@ -1,2 +1,2 @@
+-OPENBLAS_BRANCH=v0.2.15
+-OPENBLAS_SHA1=53e849f4fcae4363a64576de00e982722c7304f9
++OPENBLAS_BRANCH=v0.2.17
++OPENBLAS_SHA1=a71e8c82f6a9f73093b631e5deab1e8da716b61f
+--- a/deps/openblas-make.patch
++++ b/deps/openblas-make.patch
+@@ -0,0 +1,35 @@
++diff --git a/Makefile.system b/Makefile.system
++index b89f60e..2dbdad0 100644
++--- a/Makefile.system
+++++ b/Makefile.system
++@@ -139,6 +139,10 @@ NO_PARALLEL_MAKE=0
++ endif
++ GETARCH_FLAGS += -DNO_PARALLEL_MAKE=$(NO_PARALLEL_MAKE)
++
+++ifdef MAKE_NO_J
+++GETARCH_FLAGS += -DMAKE_NO_J=$(MAKE_NO_J)
+++endif
+++
++ ifdef MAKE_NB_JOBS
++ GETARCH_FLAGS += -DMAKE_NB_JOBS=$(MAKE_NB_JOBS)
++ endif
++diff --git a/getarch.c b/getarch.c
++index f9c49e6..dffad70 100644
++--- a/getarch.c
+++++ b/getarch.c
++@@ -1012,6 +1012,7 @@ int main(int argc, char *argv[]){
++ #endif
++ #endif
++
+++#ifndef MAKE_NO_J
++ #ifdef MAKE_NB_JOBS
++ printf("MAKE += -j %d\n", MAKE_NB_JOBS);
++ #elif NO_PARALLEL_MAKE==1
++@@ -1021,6 +1022,7 @@ int main(int argc, char *argv[]){
++ printf("MAKE += -j %d\n", get_num_cores());
++ #endif
++ #endif
+++#endif
++
++ break;
++
diff --git a/var/spack/repos/builtin/packages/julia/package.py b/var/spack/repos/builtin/packages/julia/package.py
index 6900af38e4..25d782266b 100644
--- a/var/spack/repos/builtin/packages/julia/package.py
+++ b/var/spack/repos/builtin/packages/julia/package.py
@@ -4,43 +4,56 @@ import os
class Julia(Package):
"""The Julia Language: A fresh approach to technical computing"""
homepage = "http://julialang.org"
- url = "http://github.com/JuliaLang/julia/releases/download/v0.4.2/julia-0.4.2.tar.gz"
+ url = "https://github.com/JuliaLang/julia/releases/download/v0.4.3/julia-0.4.3-full.tar.gz"
- version('0.4.3', '7b9f096798fca4bef262a64674bc2b52')
- version('0.4.2', 'ccfeb4f4090c8b31083f5e1ccb03eb06')
+ version('master',
+ git='https://github.com/JuliaLang/julia.git', branch='master')
+ version('0.4.5', '69141ff5aa6cee7c0ec8c85a34aa49a6')
+ version('0.4.3', '8a4a59fd335b05090dd1ebefbbe5aaac')
patch('gc.patch')
+ patch('openblas.patch', when='@0.4:0.4.5')
- # Build-time dependencies
- depends_on("cmake @2.8:")
+ # Build-time dependencies:
# depends_on("awk")
# depends_on("m4")
# depends_on("pkg-config")
- depends_on("python @2.6:2.9")
- # I think that Julia requires the dependencies above, but it builds find (on
- # my system) without these. We should enable them as necessary.
+ # Combined build-time and run-time dependencies:
+ depends_on("binutils")
+ depends_on("cmake @2.8:")
+ depends_on("git")
+ depends_on("openssl")
+ depends_on("python @2.7:2.999")
+
+ # I think that Julia requires the dependencies above, but it
+ # builds fine (on my system) without these. We should enable them
+ # as necessary.
- # Run-time dependencies
+ # Run-time dependencies:
# depends_on("arpack")
# depends_on("fftw +float")
# depends_on("gmp")
+ # depends_on("libgit")
# depends_on("mpfr")
+ # depends_on("openblas")
# depends_on("pcre2")
- # ARPACK: Requires BLAS and LAPACK; needs to use the same version as Julia.
+ # ARPACK: Requires BLAS and LAPACK; needs to use the same version
+ # as Julia.
- # BLAS and LAPACK: Julia prefers 64-bit versions on 64-bit systems. OpenBLAS
- # has an option for this; make it available as variant.
+ # BLAS and LAPACK: Julia prefers 64-bit versions on 64-bit
+ # systems. OpenBLAS has an option for this; make it available as
+ # variant.
- # FFTW: Something doesn't work when using a pre-installed FFTW library; need
- # to investigate.
+ # FFTW: Something doesn't work when using a pre-installed FFTW
+ # library; need to investigate.
- # GMP, MPFR: Something doesn't work when using a pre-installed FFTW library;
- # need to investigate.
+ # GMP, MPFR: Something doesn't work when using a pre-installed
+ # FFTW library; need to investigate.
- # LLVM: Julia works only with specific versions, and might require patches.
- # Thus we let Julia install its own LLVM.
+ # LLVM: Julia works only with specific versions, and might require
+ # patches. Thus we let Julia install its own LLVM.
# Other possible dependencies:
# USE_SYSTEM_OPENLIBM=0
@@ -50,11 +63,21 @@ class Julia(Package):
# USE_SYSTEM_UTF8PROC=0
# USE_SYSTEM_LIBGIT2=0
+ # Run-time dependencies for Julia packages:
+ depends_on("hdf5")
+ depends_on("mpi")
+
def install(self, spec, prefix):
- # Explicitly setting CC, CXX, or FC breaks building libuv, one of
- # Julia's dependencies. This might be a Darwin-specific problem. Given
- # how Spack sets up compilers, Julia should still use Spack's compilers,
- # even if we don't specify them explicitly.
+ if '@master' in spec:
+ # Julia needs to know the offset from a specific commit
+ git = which('git')
+ git('fetch', '--unshallow')
+
+ # Explicitly setting CC, CXX, or FC breaks building libuv, one
+ # of Julia's dependencies. This might be a Darwin-specific
+ # problem. Given how Spack sets up compilers, Julia should
+ # still use Spack's compilers, even if we don't specify them
+ # explicitly.
options = [#"CC=cc",
#"CXX=c++",
#"FC=fc",
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 73c8c62341..9d5782896e 100644
--- a/var/spack/repos/builtin/packages/libpng/package.py
+++ b/var/spack/repos/builtin/packages/libpng/package.py
@@ -8,6 +8,9 @@ class Libpng(Package):
version('1.6.16', '1a4ad377919ab15b54f6cb6a3ae2622d')
version('1.6.15', '829a256f3de9307731d4f52dc071916d')
version('1.6.14', '2101b3de1d5f348925990f9aa8405660')
+ version('1.5.26', '3ca98347a5541a2dad55cd6d07ee60a9')
+ version('1.4.19', '89bcbc4fc8b31f4a403906cf4f662330')
+ version('1.2.56', '9508fc59d10a1ffadd9aae35116c19ee')
depends_on('zlib')
diff --git a/var/spack/repos/builtin/packages/libxc/package.py b/var/spack/repos/builtin/packages/libxc/package.py
new file mode 100644
index 0000000000..010a5918c5
--- /dev/null
+++ b/var/spack/repos/builtin/packages/libxc/package.py
@@ -0,0 +1,18 @@
+from spack import *
+
+class Libxc(Package):
+ """Libxc is a library of exchange-correlation functionals for
+ density-functional theory."""
+
+ homepage = "http://www.tddft.org/programs/octopus/wiki/index.php/Libxc"
+ url = "http://www.tddft.org/programs/octopus/down.php?file=libxc/libxc-2.2.2.tar.gz"
+
+ version('2.2.2', 'd9f90a0d6e36df6c1312b6422280f2ec')
+
+
+ def install(self, spec, prefix):
+ configure('--prefix=%s' % prefix,
+ '--enable-shared')
+
+ make()
+ make("install")
diff --git a/var/spack/repos/builtin/packages/libxcb/package.py b/var/spack/repos/builtin/packages/libxcb/package.py
index 1dd5954c99..d7d94c4546 100644
--- a/var/spack/repos/builtin/packages/libxcb/package.py
+++ b/var/spack/repos/builtin/packages/libxcb/package.py
@@ -14,6 +14,9 @@ class Libxcb(Package):
depends_on("python")
depends_on("xcb-proto")
+ # depends_on('pthread') # Ubuntu: apt-get install libpthread-stubs0-dev
+ # depends_on('xau') # Ubuntu: apt-get install libxau-dev
+
def patch(self):
filter_file('typedef struct xcb_auth_info_t {', 'typedef struct {', 'src/xcb.h')
diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py
index 9301135f9f..b05f23a3dc 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,sys
+import glob, sys, os
class Metis(Package):
"""
@@ -36,7 +36,10 @@ class Metis(Package):
homepage = 'http://glaros.dtc.umn.edu/gkhome/metis/metis/overview'
url = "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz"
- version('5.1.0', '5465e67079419a69e0116de24fce58fe')
+ version('5.1.0', '5465e67079419a69e0116de24fce58fe',
+ url='http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz')
+ version('4.0.3', '5efa35de80703c1b2c4d0de080fafbcf4e0d363a21149a1ad2f96e0144841a55',
+ url='http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/OLD/metis-4.0.3.tar.gz')
variant('shared', default=True, description='Enables the build of shared libraries')
variant('debug', default=False, description='Builds the library in debug mode')
@@ -45,12 +48,85 @@ class Metis(Package):
variant('idx64', default=False, description='Use int64_t as default index type')
variant('double', default=False, description='Use double precision floating point types')
- depends_on('cmake @2.8:') # build-time dependency
-
+ depends_on('cmake @2.8:', when='@5:') # build-time dependency
depends_on('gdb', when='+gdb')
- patch('install_gklib_defs_rename.patch')
+ patch('install_gklib_defs_rename.patch', when='@5:')
+
+ @when('@4:4.0.3')
+ def install(self, spec, prefix):
+
+ if '+gdb' in spec:
+ raise InstallError('gdb support not implemented in METIS 4!')
+ if '+idx64' in spec:
+ raise InstallError('idx64 option not implemented in METIS 4!')
+ if '+double' in spec:
+ raise InstallError('double option not implemented for METIS 4!')
+
+ options = ['COPTIONS=-fPIC']
+ if '+debug' in spec:
+ options.append('OPTFLAGS=-g -O0')
+ make(*options)
+
+ mkdir(prefix.bin)
+ for x in ('pmetis', 'kmetis', 'oemetis', 'onmetis', 'partnmesh',
+ 'partdmesh', 'mesh2nodal', 'mesh2dual', 'graphchk'):
+ install(x, prefix.bin)
+
+ mkdir(prefix.lib)
+ install('libmetis.a', prefix.lib)
+
+ mkdir(prefix.include)
+ for h in glob.glob(join_path('Lib', '*.h')):
+ install(h, prefix.include)
+
+ mkdir(prefix.share)
+ for f in (join_path(*p)
+ for p in (('Programs', 'io.c'),
+ ('Test','mtest.c'),
+ ('Graphs','4elt.graph'),
+ ('Graphs', 'metis.mesh'),
+ ('Graphs', 'test.mgraph'))):
+ install(f, prefix.share)
+
+ if '+shared' in spec:
+ if sys.platform == 'darwin':
+ lib_dsuffix = 'dylib'
+ load_flag = '-Wl,-all_load'
+ no_load_flag = ''
+ else:
+ lib_dsuffix = 'so'
+ load_flag = '-Wl,-whole-archive'
+ no_load_flag = '-Wl,-no-whole-archive'
+
+ os.system(spack_cc + ' -fPIC -shared ' + load_flag +
+ ' libmetis.a ' + no_load_flag + ' -o libmetis.' +
+ lib_dsuffix)
+ install('libmetis.' + lib_dsuffix, prefix.lib)
+
+ # Set up and run tests on installation
+ symlink(join_path(prefix.share, 'io.c'), 'io.c')
+ symlink(join_path(prefix.share, 'mtest.c'), 'mtest.c')
+ os.system(spack_cc + ' -I%s' % prefix.include + ' -c io.c')
+ os.system(spack_cc + ' -I%s' % prefix.include +
+ ' -L%s' % prefix.lib + ' -lmetis mtest.c io.o -o mtest')
+ _4eltgraph = join_path(prefix.share, '4elt.graph')
+ test_mgraph = join_path(prefix.share, 'test.mgraph')
+ metis_mesh = join_path(prefix.share, 'metis.mesh')
+ kmetis = join_path(prefix.bin, 'kmetis')
+ os.system('./mtest ' + _4eltgraph)
+ os.system(kmetis + ' ' + _4eltgraph + ' 40')
+ os.system(join_path(prefix.bin, 'onmetis') + ' ' + _4eltgraph)
+ os.system(join_path(prefix.bin, 'pmetis') + ' ' + test_mgraph + ' 2')
+ os.system(kmetis + ' ' + test_mgraph + ' 2')
+ os.system(kmetis + ' ' + test_mgraph + ' 5')
+ os.system(join_path(prefix.bin, 'partnmesh') + metis_mesh + ' 10')
+ os.system(join_path(prefix.bin, 'partdmesh') + metis_mesh + ' 10')
+ os.system(join_path(prefix.bin, 'mesh2dual') + metis_mesh)
+
+
+ @when('@5:')
def install(self, spec, prefix):
options = []
@@ -60,6 +136,7 @@ class Metis(Package):
source_directory = self.stage.source_path
options.append('-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=source_directory))
+ options.append('-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % prefix)
if '+shared' in spec:
options.append('-DSHARED:BOOL=ON')
@@ -79,10 +156,28 @@ class Metis(Package):
if '+double' in spec:
filter_file('REALTYPEWIDTH 32', 'REALTYPEWIDTH 64', metis_header)
+ # Make clang 7.3 happy.
+ # Prevents "ld: section __DATA/__thread_bss extends beyond end of file"
+ # See upstream LLVM issue https://llvm.org/bugs/show_bug.cgi?id=27059
+ # Adopted from https://github.com/Homebrew/homebrew-science/blob/master/metis.rb
+ if spec.satisfies('%clang@7.3.0'):
+ filter_file('#define MAX_JBUFS 128', '#define MAX_JBUFS 24', join_path(source_directory, 'GKlib', 'error.c'))
+
with working_dir(build_directory, create=True):
cmake(source_directory, *options)
make()
make("install")
+ # now run some tests:
+ for f in ["4elt", "copter2", "mdual"]:
+ graph = join_path(source_directory,'graphs','%s.graph' % f)
+ Executable(join_path(prefix.bin,'graphchk'))(graph)
+ Executable(join_path(prefix.bin,'gpmetis'))(graph,'2')
+ Executable(join_path(prefix.bin,'ndmetis'))(graph)
+
+ graph = join_path(source_directory,'graphs','test.mgraph')
+ Executable(join_path(prefix.bin,'gpmetis'))(graph,'2')
+ graph = join_path(source_directory,'graphs','metis.mesh')
+ Executable(join_path(prefix.bin,'mpmetis'))(graph,'2')
# install GKlib headers, which will be needed for ParMETIS
GKlib_dist = join_path(prefix.include,'GKlib')
@@ -90,7 +185,3 @@ 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/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py
new file mode 100644
index 0000000000..510e09c4e1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/mfem/package.py
@@ -0,0 +1,125 @@
+from spack import *
+import glob, string
+
+class Mfem(Package):
+ """Free, lightweight, scalable C++ library for finite element methods."""
+
+ homepage = 'http://www.mfem.org'
+ url = 'https://github.com/mfem/mfem'
+
+# version('3.1', git='https://github.com/mfem/mfem.git',
+# commit='dbae60fe32e071989b52efaaf59d7d0eb2a3b574')
+
+ version('3.1', '841ea5cf58de6fae4de0f553b0e01ebaab9cd9c67fa821e8a715666ecf18fc57',
+ url='http://goo.gl/xrScXn', expand=False)
+
+ variant('metis', default=False, description='Activate support for metis')
+ variant('hypre', default=False, description='Activate support for hypre')
+ variant('suite-sparse', default=False,
+ description='Activate support for SuiteSparse')
+ variant('mpi', default=False, description='Activate support for MPI')
+ variant('lapack', default=False, description='Activate support for LAPACK')
+ variant('debug', default=False, description='Build debug version')
+
+ depends_on('blas', when='+lapack')
+ depends_on('lapack', when='+lapack')
+
+ depends_on('mpi', when='+mpi')
+ depends_on('metis', when='+mpi')
+ depends_on('hypre', when='+mpi')
+
+ depends_on('hypre', when='+hypre')
+
+ depends_on('metis@4:', when='+metis')
+
+ depends_on('suite-sparse', when='+suite-sparse')
+ depends_on('blas', when='+suite-sparse')
+ depends_on('lapack', when='+suite-sparse')
+ depends_on('metis@5:', when='+suite-sparse ^suite-sparse@4.5:')
+ depends_on('cmake', when='^metis@5:')
+
+ def check_variants(self, spec):
+ if '+mpi' in spec and ('+hypre' not in spec or '+metis' not in spec):
+ raise InstallError('mfem+mpi must be built with +hypre ' +
+ 'and +metis!')
+ if '+suite-sparse' in spec and ('+metis' not in spec or
+ '+lapack' not in spec):
+ raise InstallError('mfem+suite-sparse must be built with ' +
+ '+metis and +lapack!')
+ if 'metis@5:' in spec and '%clang' in spec and ('^cmake %gcc' not in spec):
+ raise InstallError('To work around CMake bug with clang, must ' +
+ 'build mfem with mfem[+variants] %clang ' +
+ '^cmake %gcc to force CMake to build with gcc')
+ return
+
+ def install(self, spec, prefix):
+ self.check_variants(spec)
+
+ options = ['PREFIX=%s' % prefix]
+
+ if '+lapack' in spec:
+ lapack_lib = '-L{0} -llapack -L{1} -lblas'.format(
+ spec['lapack'].prefix.lib, spec['blas'].prefix.lib)
+ options.extend(['MFEM_USE_LAPACK=YES',
+ 'LAPACK_OPT=-I%s' % spec['lapack'].prefix.include,
+ 'LAPACK_LIB=%s' % lapack_lib])
+
+ if '+hypre' in spec:
+ options.extend(['HYPRE_DIR=%s' % spec['hypre'].prefix,
+ 'HYPRE_OPT=-I%s' % spec['hypre'].prefix.include,
+ 'HYPRE_LIB=-L%s' % spec['hypre'].prefix.lib +
+ ' -lHYPRE'])
+
+ if '+metis' in spec:
+ metis_lib = '-L%s -lmetis' % spec['metis'].prefix.lib
+ if spec['metis'].satisfies('@5:'):
+ metis_str = 'MFEM_USE_METIS_5=YES'
+ else:
+ metis_str = 'MFEM_USE_METIS_5=NO'
+ options.extend([metis_str,
+ 'METIS_DIR=%s' % spec['metis'].prefix,
+ 'METIS_OPT=-I%s' % spec['metis'].prefix.include,
+ 'METIS_LIB=%s' % metis_lib])
+
+ if '+mpi' in spec: options.extend(['MFEM_USE_MPI=YES'])
+
+ if '+suite-sparse' in spec:
+ ssp = spec['suite-sparse'].prefix
+ ss_lib = '-L%s' % ssp.lib
+ ss_lib += (' -lumfpack -lcholmod -lcolamd -lamd -lcamd' +
+ ' -lccolamd -lsuitesparseconfig')
+
+ no_librt_archs = ['darwin-i686', 'darwin-x86_64']
+ no_rt = any(map(lambda a: spec.satisfies('='+a), no_librt_archs))
+ if not no_rt: ss_lib += ' -lrt'
+ ss_lib += (' ' + metis_lib + ' ' + lapack_lib)
+
+ options.extend(['MFEM_USE_SUITESPARSE=YES',
+ 'SUITESPARSE_DIR=%s' % ssp,
+ 'SUITESPARSE_OPT=-I%s' % ssp.include,
+ 'SUITESPARSE_LIB=%s' % ss_lib])
+
+ if '+debug' in spec: options.extend(['MFEM_DEBUG=YES'])
+
+ # Dirty hack to cope with URL redirect
+ tgz_file = string.split(self.url,'/')[-1]
+ tar = which('tar')
+ tar('xzvf', tgz_file)
+ cd(glob.glob('mfem*')[0])
+ # End dirty hack to cope with URL redirect
+
+ make('config', *options)
+ make('all')
+
+ # Run a small test before installation
+ args = ['-m', join_path('data','star.mesh'), '--no-visualization']
+ if '+mpi' in spec:
+ Executable(join_path(spec['mpi'].prefix.bin,
+ 'mpirun'))('-np',
+ '4',
+ join_path('examples','ex1p'),
+ *args)
+ else:
+ Executable(join_path('examples', 'ex1'))(*args)
+
+ make('install')
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py
index 2d7955e08d..b317ec6651 100644
--- a/var/spack/repos/builtin/packages/mpich/package.py
+++ b/var/spack/repos/builtin/packages/mpich/package.py
@@ -47,12 +47,12 @@ class Mpich(Package):
provides('mpi@:3.0', when='@3:')
provides('mpi@:1.3', when='@1:')
- def setup_dependent_environment(self, env, dependent_spec):
- env.set('MPICH_CC', spack_cc)
- env.set('MPICH_CXX', spack_cxx)
- env.set('MPICH_F77', spack_f77)
- env.set('MPICH_F90', spack_f90)
- env.set('MPICH_FC', spack_fc)
+ def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
+ spack_env.set('MPICH_CC', spack_cc)
+ spack_env.set('MPICH_CXX', spack_cxx)
+ spack_env.set('MPICH_F77', spack_f77)
+ spack_env.set('MPICH_F90', spack_fc)
+ spack_env.set('MPICH_FC', spack_fc)
def setup_dependent_package(self, module, dep_spec):
"""For dependencies, make mpicc's use spack wrapper."""
diff --git a/var/spack/repos/builtin/packages/mrnet/krell-5.0.1.patch b/var/spack/repos/builtin/packages/mrnet/krell-5.0.1.patch
new file mode 100644
index 0000000000..53294fbbc6
--- /dev/null
+++ b/var/spack/repos/builtin/packages/mrnet/krell-5.0.1.patch
@@ -0,0 +1,154 @@
+--- mrnet-3093918/include/mrnet/Types.h 2015-12-10 09:32:24.000000000 -0800
++++ mrnet_top_of_tree/include/mrnet/Types.h 2016-03-16 12:29:33.986132302 -0700
+@@ -23,7 +23,7 @@
+ #ifndef MRNET_VERSION_MAJOR
+ # define MRNET_VERSION_MAJOR 5
+ # define MRNET_VERSION_MINOR 0
+-# define MRNET_VERSION_REV 0
++# define MRNET_VERSION_REV 1
+ #endif
+
+ namespace MRN
+--- mrnet-3093918/include/mrnet_lightweight/Types.h 2015-12-10 09:32:24.000000000 -0800
++++ mrnet_top_of_tree/include/mrnet_lightweight/Types.h 2016-03-16 12:29:33.987132302 -0700
+@@ -30,7 +30,7 @@
+ #ifndef MRNET_VERSION_MAJOR
+ #define MRNET_VERSION_MAJOR 5
+ #define MRNET_VERSION_MINOR 0
+-#define MRNET_VERSION_REV 0
++#define MRNET_VERSION_REV 1
+ #endif
+ void get_Version(int* major,
+ int* minor,
+--- mrnet-3093918/src/lightweight/SerialGraph.c 2015-12-10 09:32:24.000000000 -0800
++++ mrnet_top_of_tree/src/lightweight/SerialGraph.c 2016-03-16 12:29:33.995132302 -0700
+@@ -59,7 +59,7 @@
+
+ mrn_dbg_func_begin();
+
+- sprintf(hoststr, "[%s:%hu:%u:", ihostname, iport, irank);
++ sprintf(hoststr, "[%s:%05hu:%u:", ihostname, iport, irank);
+ mrn_dbg(5, mrn_printf(FLF, stderr, "looking for SubTreeRoot: '%s'\n", hoststr));
+
+ byte_array = sg->byte_array;
+@@ -110,7 +110,7 @@
+
+ mrn_dbg_func_begin();
+
+- len = (size_t) sprintf(hoststr, "[%s:%hu:%u:0]", ihostname, iport, irank);
++ len = (size_t) sprintf(hoststr, "[%s:%05hu:%u:0]", ihostname, iport, irank);
+ mrn_dbg(5, mrn_printf(FLF, stderr, "adding sub tree leaf: %s\n", hoststr));
+
+ len += strlen(sg->byte_array) + 1;
+@@ -139,7 +139,7 @@
+
+ mrn_dbg_func_begin();
+
+- len = (size_t) sprintf(hoststr, "[%s:%hu:%u:1", ihostname, iport, irank);
++ len = (size_t) sprintf(hoststr, "[%s:%05hu:%u:1", ihostname, iport, irank);
+ mrn_dbg(5, mrn_printf(FLF, stderr, "adding sub tree root: %s\n", hoststr));
+
+ len += strlen(sg->byte_array) + 1;
+@@ -360,8 +360,8 @@
+ char old_hoststr[256];
+ char new_hoststr[256];
+
+- sprintf(old_hoststr, "[%s:%hu:%u:", hostname, UnknownPort, irank);
+- sprintf(new_hoststr, "[%s:%hu:%u:", hostname, port, irank);
++ sprintf(old_hoststr, "[%s:%05hu:%u:", hostname, UnknownPort, irank);
++ sprintf(new_hoststr, "[%s:%05hu:%u:", hostname, port, irank);
+
+ old_byte_array = sg->byte_array;
+ new_byte_array = (char*) malloc( strlen(old_byte_array) + 10 );
+--- mrnet-3093918/xplat/src/lightweight/SocketUtils.c 2015-12-10 09:32:24.000000000 -0800
++++ mrnet_top_of_tree/xplat/src/lightweight/SocketUtils.c 2016-03-16 12:29:34.006132303 -0700
+@@ -15,7 +15,7 @@
+ #else
+ const XPlat_Socket InvalidSocket = INVALID_SOCKET;
+ #endif
+-const XPlat_Port InvalidPort = (XPlat_Port)-1;
++const XPlat_Port InvalidPort = (XPlat_Port)0;
+
+ static bool_t SetTcpNoDelay( XPlat_Socket sock )
+ {
+--- mrnet-3093918/conf/configure.in 2015-12-10 09:32:24.000000000 -0800
++++ mrnet_top_of_tree/conf/configure.in 2016-03-16 12:45:54.573196781 -0700
+@@ -107,6 +107,18 @@
+ AC_SUBST(PURIFY)
+
+
++AC_ARG_WITH(expat,
++ [AS_HELP_STRING([--with-expat=PATH],
++ [Absolute path to installation of EXPAT libraries (note: specify the path to the directory containing "include" and "lib" sub-directories)])],
++ [EXPAT_DIR="${withval}"],
++ [EXPAT_DIR=""])
++
++if test "x$EXPAT_DIR" = "x" ; then
++ EXPAT_LIB=""
++else
++ EXPAT_LIB="-L$EXPAT_DIR/lib"
++fi
++
+ dnl === Checks for header files.
+ AC_CHECK_HEADERS([assert.h errno.h fcntl.h limits.h netdb.h signal.h stddef.h stdlib.h stdio.h string.h unistd.h arpa/inet.h netinet/in.h sys/ioctl.h sys/socket.h sys/sockio.h sys/time.h])
+ AC_HEADER_STDBOOL
+@@ -432,7 +444,7 @@
+ CRAYXT_ATH_LIBS_SO="$CRAYXT_ATH_LIBS -lalps"
+ CRAYXT_ATH_LIBS="$CRAYXT_ATH_LIBS -Wl,-Bstatic -lalps -lxmlrpc -Wl,-Bdynamic"
+ CRAYXE_ATH_LIBS_SO="$CRAYXE_ATH_LIBS -lalps"
+- CRAYXE_ATH_LIBS="$CRAYXE_ATH_LIBS -Wl,-Bstatic -lalps -lxmlrpc-epi -lexpat -Wl,-Bdynamic"
++ CRAYXE_ATH_LIBS="$CRAYXE_ATH_LIBS -Wl,-Bstatic -lalps -lxmlrpc-epi $EXPAT_LIB -lexpat -Wl,-Bdynamic"
+
+ AC_CHECK_LIB( [alps], [alps_launch_tool_helper],
+ [HAVE_ATH_LIBS="yes"; EXTRA_LIBS="$CRAYXT_ATH_LIBS $EXTRA_LIBS"; EXTRA_LIBS_SO="$CRAYXT_ATH_LIBS_SO $EXTRA_LIBS_SO"],
+--- mrnet-3093918/configure 2015-12-10 09:32:24.000000000 -0800
++++ mrnet_top_of_tree/configure 2016-03-16 13:47:20.386439143 -0700
+@@ -742,6 +742,7 @@
+ enable_debug
+ enable_ltwt_threadsafe
+ with_purify
++with_expat
+ '
+ ac_precious_vars='build_alias
+ host_alias
+@@ -1399,6 +1400,9 @@
+ containing "include" and "lib" sub-directories)
+ --with-launchmon=PATH Absolute path to installation of LaunchMON
+ --with-purify Use purify for memory debugging
++ --with-expat=PATH Absolute path to installation of EXPAT libraries
++ (note: specify the path to the directory containing
++ "include" and "lib" sub-directories)
+
+ Some influential environment variables:
+ CC C compiler command
+@@ -3541,6 +3545,21 @@
+
+
+
++# Check whether --with-expat was given.
++if test "${with_expat+set}" = set; then :
++ withval=$with_expat; EXPAT_DIR="${withval}"
++else
++ EXPAT_DIR=""
++fi
++
++
++if test "x$EXPAT_DIR" = "x" ; then
++ EXPAT_LIB=""
++else
++ EXPAT_LIB="-L$EXPAT_DIR/lib"
++fi
++
++
+ ac_ext=cpp
+ ac_cpp='$CXXCPP $CPPFLAGS'
+ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+@@ -5473,7 +5492,7 @@
+ CRAYXT_ATH_LIBS_SO="$CRAYXT_ATH_LIBS -lalps"
+ CRAYXT_ATH_LIBS="$CRAYXT_ATH_LIBS -Wl,-Bstatic -lalps -lxmlrpc -Wl,-Bdynamic"
+ CRAYXE_ATH_LIBS_SO="$CRAYXE_ATH_LIBS -lalps"
+- CRAYXE_ATH_LIBS="$CRAYXE_ATH_LIBS -Wl,-Bstatic -lalps -lxmlrpc-epi -lexpat -Wl,-Bdynamic"
++ CRAYXE_ATH_LIBS="$CRAYXE_ATH_LIBS -Wl,-Bstatic -lalps -lxmlrpc-epi $EXPAT_LIB -lexpat -Wl,-Bdynamic"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alps_launch_tool_helper in -lalps" >&5
+ $as_echo_n "checking for alps_launch_tool_helper in -lalps... " >&6; }
diff --git a/var/spack/repos/builtin/packages/mrnet/package.py b/var/spack/repos/builtin/packages/mrnet/package.py
index fed944e45f..a3abb71285 100644
--- a/var/spack/repos/builtin/packages/mrnet/package.py
+++ b/var/spack/repos/builtin/packages/mrnet/package.py
@@ -3,11 +3,17 @@ from spack import *
class Mrnet(Package):
"""The MRNet Multi-Cast Reduction Network."""
homepage = "http://paradyn.org/mrnet"
- url = "ftp://ftp.cs.wisc.edu/paradyn/mrnet/mrnet_4.0.0.tar.gz"
+ url = "ftp://ftp.cs.wisc.edu/paradyn/mrnet/mrnet_5.0.1.tar.gz"
+ list_url = "http://ftp.cs.wisc.edu/paradyn/mrnet"
- version('4.0.0', 'd00301c078cba57ef68613be32ceea2f')
- version('4.1.0', '5a248298b395b329e2371bf25366115c')
version('5.0.1', '17f65738cf1b9f9b95647ff85f69ecdd')
+ version('4.1.0', '5a248298b395b329e2371bf25366115c')
+ version('4.0.0', 'd00301c078cba57ef68613be32ceea2f')
+
+ # Add a patch that brings mrnet-5.0.1 up to date with the current development tree
+ # The development tree contains fixes needed for the krell based tools
+ variant('krellpatch', default=False, description="Build MRNet with krell openspeedshop based patch.")
+ patch('krell-5.0.1.patch', when='@5.0.1+krellpatch')
variant('lwthreads', default=False, description="Also build the MRNet LW threadsafe libraries")
parallel = False
diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py
index 26440ab7c8..58f790ec32 100644
--- a/var/spack/repos/builtin/packages/mumps/package.py
+++ b/var/spack/repos/builtin/packages/mumps/package.py
@@ -1,5 +1,5 @@
from spack import *
-import os, sys
+import os, sys, glob
class Mumps(Package):
"""MUMPS: a MUltifrontal Massively Parallel sparse direct Solver"""
@@ -23,7 +23,7 @@ class Mumps(Package):
depends_on('scotch + esmumps', when='~ptscotch+scotch')
depends_on('scotch + esmumps + mpi', when='+ptscotch')
- depends_on('metis', when='+metis')
+ depends_on('metis@5:', when='+metis')
depends_on('parmetis', when="+parmetis")
depends_on('blas')
depends_on('lapack')
@@ -164,10 +164,13 @@ class Mumps(Package):
install_tree('lib', prefix.lib)
install_tree('include', prefix.include)
- if '~mpi' in spec:
+
+ if '~mpi' in spec:
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)
+ for f in glob.glob(join_path('libseq','*.h')):
+ install(f, prefix.include)
# 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
diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py
index e4e95f92af..3e60b517db 100644
--- a/var/spack/repos/builtin/packages/mvapich2/package.py
+++ b/var/spack/repos/builtin/packages/mvapich2/package.py
@@ -140,6 +140,13 @@ class Mvapich2(Package):
configure_args.extend(network_options)
+ def setup_dependent_environment(self, spack_env, run_env, extension_spec):
+ spack_env.set('MPICH_CC', spack_cc)
+ spack_env.set('MPICH_CXX', spack_cxx)
+ spack_env.set('MPICH_F77', spack_f77)
+ spack_env.set('MPICH_F90', spack_fc)
+ spack_env.set('MPICH_FC', spack_fc)
+
def install(self, spec, prefix):
# we'll set different configure flags depending on our environment
configure_args = [
diff --git a/var/spack/repos/builtin/packages/ncurses/package.py b/var/spack/repos/builtin/packages/ncurses/package.py
index 8dc808caac..219fbce226 100644
--- a/var/spack/repos/builtin/packages/ncurses/package.py
+++ b/var/spack/repos/builtin/packages/ncurses/package.py
@@ -8,11 +8,10 @@ class Ncurses(Package):
"""
homepage = "http://invisible-island.net/ncurses/ncurses.html"
+ url = "http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz"
- version('5.9', '8cb9c412e5f2d96bc6f459aa8c6282a1',
- url='http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz')
- version('6.0', 'ee13d052e1ead260d7c28071f46eefb1',
- url='http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz')
+ version('6.0', 'ee13d052e1ead260d7c28071f46eefb1')
+ version('5.9', '8cb9c412e5f2d96bc6f459aa8c6282a1')
patch('patch_gcc_5.txt', when='%gcc@5.0:')
diff --git a/var/spack/repos/builtin/packages/ncview/package.py b/var/spack/repos/builtin/packages/ncview/package.py
new file mode 100644
index 0000000000..1aa13e3f03
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ncview/package.py
@@ -0,0 +1,20 @@
+from spack import *
+
+class Ncview(Package):
+ """Simple viewer for NetCDF files."""
+ homepage = "http://meteora.ucsd.edu/~pierce/ncview_home_page.html"
+ url = "ftp://cirrus.ucsd.edu/pub/ncview/ncview-2.1.7.tar.gz"
+
+ version('2.1.7', 'debd6ca61410aac3514e53122ab2ba07')
+
+ depends_on("netcdf")
+ depends_on("udunits2")
+
+ # OS Dependencies
+ # Ubuntu: apt-get install libxaw7-dev
+ # CentOS 7: yum install libXaw-devel
+
+ def install(self, spec, prefix):
+ configure('--prefix=%s' % prefix)
+ make()
+ make("install")
diff --git a/var/spack/repos/builtin/packages/netcdf-cxx/package.py b/var/spack/repos/builtin/packages/netcdf-cxx/package.py
index 5334dfb853..8aa1d8b236 100644
--- a/var/spack/repos/builtin/packages/netcdf-cxx/package.py
+++ b/var/spack/repos/builtin/packages/netcdf-cxx/package.py
@@ -1,7 +1,11 @@
from spack import *
class NetcdfCxx(Package):
- """C++ compatibility bindings for NetCDF"""
+ """Deprecated C++ compatibility bindings for NetCDF.
+ These do NOT read or write NetCDF-4 files, and are no longer
+ maintained by Unidata. Developers should migrate to current
+ NetCDF C++ bindings, in Spack package netcdf-cxx4."""
+
homepage = "http://www.unidata.ucar.edu/software/netcdf"
url = "http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx-4.2.tar.gz"
diff --git a/var/spack/repos/builtin/packages/netlib-lapack/package.py b/var/spack/repos/builtin/packages/netlib-lapack/package.py
index c4b7ce3b04..f70e634347 100644
--- a/var/spack/repos/builtin/packages/netlib-lapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-lapack/package.py
@@ -31,10 +31,20 @@ class NetlibLapack(Package):
depends_on('cmake')
depends_on('blas', when='+external-blas')
- def install(self, spec, prefix):
- cmake_args = ['-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'),
+
+ def patch(self):
+ # Fix cblas CMakeLists.txt -- has wrong case for subdirectory name.
+ if self.spec.satisfies('@3.6.0:'):
+ filter_file('${CMAKE_CURRENT_SOURCE_DIR}/CMAKE/',
+ '${CMAKE_CURRENT_SOURCE_DIR}/cmake/', 'CBLAS/CMakeLists.txt', string=True)
+
+ def install_one(self, spec, prefix, shared):
+ cmake_args = ['-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if shared else 'OFF'),
'-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'),
'-DLAPACKE:BOOL=%s' % ('ON' if '+lapacke' in spec else 'OFF')]
+ if spec.satisfies('@3.6.0:'):
+ cmake_args.extend(['-DCBLAS=ON']) # always build CBLAS
+
if '+external-blas' in spec:
# TODO : the mechanism to specify the library should be more general,
# TODO : but this allows to have an hook to an external blas
@@ -45,7 +55,30 @@ class NetlibLapack(Package):
cmake_args.extend(std_cmake_args)
- with working_dir('spack-build', create=True):
+ build_dir = 'spack-build' + ('-shared' if shared else '-static')
+ with working_dir(build_dir, create=True):
cmake('..', *cmake_args)
make()
make("install")
+
+
+ def install(self, spec, prefix):
+ # Always build static libraries.
+ self.install_one(spec, prefix, False)
+
+ # Build shared libraries if requested.
+ if '+shared' in spec:
+ self.install_one(spec, prefix, True)
+
+
+ def setup_dependent_package(self, module, dspec):
+ # This is WIP for a prototype interface for virtual packages.
+ # We can update this as more builds start depending on BLAS/LAPACK.
+ libdir = find_library_path('libblas.a', self.prefix.lib64, self.prefix.lib)
+
+ self.spec.blas_static_lib = join_path(libdir, 'libblas.a')
+ self.spec.lapack_static_lib = join_path(libdir, 'liblapack.a')
+
+ if '+shared' in self.spec:
+ self.spec.blas_shared_lib = join_path(libdir, 'libblas.%s' % dso_suffix)
+ self.spec.lapack_shared_lib = join_path(libdir, 'liblapack.%s' % dso_suffix)
diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
index d59f8e41fe..276876d197 100644
--- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py
@@ -18,6 +18,7 @@ class NetlibScalapack(Package):
provides('scalapack')
+ depends_on('cmake')
depends_on('mpi')
depends_on('lapack')
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 4d5081ac9d..3fe6638e66 100644
--- a/var/spack/repos/builtin/packages/oce/package.py
+++ b/var/spack/repos/builtin/packages/oce/package.py
@@ -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',
@@ -46,6 +57,11 @@ class Oce(Package):
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/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py
index 1d10f217c4..f5d656f659 100644
--- a/var/spack/repos/builtin/packages/openblas/package.py
+++ b/var/spack/repos/builtin/packages/openblas/package.py
@@ -1,5 +1,7 @@
from spack import *
import sys
+import os
+import shutil
class Openblas(Package):
"""OpenBLAS: An optimized BLAS library"""
@@ -10,29 +12,132 @@ class Openblas(Package):
version('0.2.16', 'fef46ab92463bdbb1479dcec594ef6dc')
version('0.2.15', 'b1190f3d3471685f17cfd1ec1d252ac9')
+ variant('shared', default=True, description="Build shared libraries as well as static libs.")
+ variant('openmp', default=True, description="Enable OpenMP support.")
+ variant('fpic', default=True, description="Build position independent code")
+
# virtual dependency
provides('blas')
provides('lapack')
+
def install(self, spec, prefix):
- extra=[]
+ # Openblas is picky about compilers. Configure fails with
+ # FC=/abs/path/to/f77, whereas FC=f77 works fine.
+ # To circumvent this, provide basename only:
+ make_defs = ['CC=%s' % os.path.basename(spack_cc),
+ 'FC=%s' % os.path.basename(spack_f77)]
+
+ make_targets = ['libs', 'netlib']
+
+ # Build shared if variant is set.
+ if '+shared' in spec:
+ make_targets += ['shared']
+ else:
+ if '+fpic' in spec:
+ make_defs.extend(['CFLAGS=-fPIC', 'FFLAGS=-fPIC'])
+ make_defs += ['NO_SHARED=1']
+
+ # fix missing _dggsvd_ and _sggsvd_
if spec.satisfies('@0.2.16'):
- extra.extend([
- 'BUILD_LAPACK_DEPRECATED=1' # fix missing _dggsvd_ and _sggsvd_
- ])
+ make_defs += ['BUILD_LAPACK_DEPRECATED=1']
+
+ # Add support for OpenMP
+ # Note: Make sure your compiler supports OpenMP
+ if '+openmp' in spec:
+ make_defs += ['USE_OPENMP=1']
+
+ make_args = make_defs + make_targets
+ make(*make_args)
- make('libs', 'netlib', 'shared', 'CC=cc', 'FC=f77',*extra)
- make("tests")
- make('install', "PREFIX='%s'" % prefix)
+ make("tests", *make_defs)
+
+ # no quotes around prefix (spack doesn't use a shell)
+ make('install', "PREFIX=%s" % prefix, *make_defs)
- lib_dsuffix = 'dylib' if sys.platform == 'darwin' else 'so'
# Blas virtual package should provide blas.a and libblas.a
with working_dir(prefix.lib):
symlink('libopenblas.a', 'blas.a')
symlink('libopenblas.a', 'libblas.a')
- symlink('libopenblas.%s' % lib_dsuffix, 'libblas.%s' % lib_dsuffix)
+ if '+shared' in spec:
+ symlink('libopenblas.%s' % dso_suffix, 'libblas.%s' % dso_suffix)
# Lapack virtual package should provide liblapack.a
with working_dir(prefix.lib):
symlink('libopenblas.a', 'liblapack.a')
- symlink('libopenblas.%s' % lib_dsuffix, 'liblapack.%s' % lib_dsuffix)
+ if '+shared' in spec:
+ symlink('libopenblas.%s' % dso_suffix, 'liblapack.%s' % dso_suffix)
+
+ # Openblas may pass its own test but still fail to compile Lapack
+ # symbols. To make sure we get working Blas and Lapack, do a small test.
+ self.check_install(spec)
+
+
+ def setup_dependent_package(self, module, dspec):
+ # This is WIP for a prototype interface for virtual packages.
+ # We can update this as more builds start depending on BLAS/LAPACK.
+ libdir = find_library_path('libopenblas.a', self.prefix.lib64, self.prefix.lib)
+
+ self.spec.blas_static_lib = join_path(libdir, 'libopenblas.a')
+ self.spec.lapack_static_lib = self.spec.blas_static_lib
+
+ if '+shared' in self.spec:
+ self.spec.blas_shared_lib = join_path(libdir, 'libopenblas.%s' % dso_suffix)
+ self.spec.lapack_shared_lib = self.spec.blas_shared_lib
+
+ def check_install(self, spec):
+ "Build and run a small program to test that we have Lapack symbols"
+ print "Checking Openblas installation..."
+ checkdir = "spack-check"
+ with working_dir(checkdir, create=True):
+ source = r"""
+#include <cblas.h>
+#include <stdio.h>
+int main(void) {
+int i=0;
+double A[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0};
+double B[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0};
+double C[9] = {.5, .5, .5, .5, .5, .5, .5, .5, .5};
+cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans,
+ 3, 3, 2, 1, A, 3, B, 3, 2, C, 3);
+for (i = 0; i < 9; i++)
+ printf("%f\n", C[i]);
+return 0;
+}
+"""
+ expected = """\
+11.000000
+-9.000000
+5.000000
+-9.000000
+21.000000
+-1.000000
+5.000000
+-1.000000
+3.000000
+"""
+ with open("check.c", 'w') as f:
+ f.write(source)
+ cc = which('cc')
+ # TODO: Automate these path and library settings
+ cc('-c', "-I%s" % join_path(spec.prefix, "include"), "check.c")
+ cc('-o', "check", "check.o",
+ "-L%s" % join_path(spec.prefix, "lib"), "-llapack", "-lblas", "-lpthread")
+ try:
+ check = Executable('./check')
+ output = check(return_output=True)
+ except:
+ output = ""
+ success = output == expected
+ if not success:
+ print "Produced output does not match expected output."
+ print "Expected output:"
+ print '-'*80
+ print expected
+ print '-'*80
+ print "Produced output:"
+ print '-'*80
+ print output
+ print '-'*80
+ raise RuntimeError("Openblas install check failed")
+ shutil.rmtree(checkdir)
diff --git a/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c
new file mode 100644
index 0000000000..634e99d20b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c
@@ -0,0 +1,13 @@
+#include <cblas.h>
+#include <stdio.h>
+int main(void) {
+int i=0;
+double A[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0};
+double B[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0};
+double C[9] = {.5, .5, .5, .5, .5, .5, .5, .5, .5};
+cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans,
+ 3, 3, 2, 1, A, 3, B, 3, 2, C, 3);
+for (i = 0; i < 9; i++)
+ printf("%f\n", C[i]);
+return 0;
+}
diff --git a/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output
new file mode 100644
index 0000000000..b8316d7477
--- /dev/null
+++ b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output
@@ -0,0 +1,9 @@
+11.000000
+-9.000000
+5.000000
+-9.000000
+21.000000
+-1.000000
+5.000000
+-1.000000
+3.000000
diff --git a/var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py b/var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py
new file mode 100644
index 0000000000..01054471a3
--- /dev/null
+++ b/var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py
@@ -0,0 +1,38 @@
+from spack import *
+
+class OsuMicroBenchmarks(Package):
+ """The Ohio MicroBenchmark suite is a collection of independent MPI
+ message passing performance microbenchmarks developed and written at
+ The Ohio State University. It includes traditional benchmarks and
+ performance measures such as latency, bandwidth and host overhead
+ and can be used for both traditional and GPU-enhanced nodes."""
+
+ homepage = "http://mvapich.cse.ohio-state.edu/benchmarks/"
+ url = "http://mvapich.cse.ohio-state.edu/download/mvapich/osu-micro-benchmarks-5.3.tar.gz"
+
+ version('5.3', '42e22b931d451e8bec31a7424e4adfc2')
+
+ variant('cuda', default=False, description="Enable CUDA support")
+
+ depends_on('mpi')
+ depends_on('cuda', when='+cuda')
+
+
+ def install(self, spec, prefix):
+ config_args = [
+ 'CC=%s' % spec['mpi'].prefix.bin + '/mpicc',
+ 'CXX=%s' % spec['mpi'].prefix.bin + '/mpicxx',
+ 'LDFLAGS=-lrt',
+ '--prefix=%s' % prefix
+ ]
+
+ if '+cuda' in spec:
+ config_args.extend([
+ '--enable-cuda',
+ '--with-cuda=%s' % spec['cuda'].prefix,
+ ])
+
+ configure(*config_args)
+
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/p4est/package.py b/var/spack/repos/builtin/packages/p4est/package.py
index 1e2969fe64..017c4e3fbf 100644
--- a/var/spack/repos/builtin/packages/p4est/package.py
+++ b/var/spack/repos/builtin/packages/p4est/package.py
@@ -7,10 +7,15 @@ class P4est(Package):
version('1.1', '37ba7f4410958cfb38a2140339dbf64f')
- # disable by default to make it work on frontend of clusters
- variant('tests', default=False, description='Run small tests')
+ # build dependencies
+ depends_on('automake')
+ depends_on('autoconf')
+ depends_on('libtool@2.4.2:')
+ # other dependencies
+ depends_on('lua') # Needed for the submodule sc
depends_on('mpi')
+ depends_on('zlib')
def install(self, spec, prefix):
options = ['--enable-mpi',
@@ -28,7 +33,5 @@ class P4est(Package):
configure('--prefix=%s' % prefix, *options)
make()
- if '+tests' in self.spec:
- make("check")
-
+ make("check")
make("install")
diff --git a/var/spack/repos/builtin/packages/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py
index 53d69e28d9..74b3ea9ef9 100644
--- a/var/spack/repos/builtin/packages/papi/package.py
+++ b/var/spack/repos/builtin/packages/papi/package.py
@@ -1,5 +1,8 @@
from spack import *
+import glob
import os
+import sys
+from llnl.util.filesystem import fix_darwin_install_name
class Papi(Package):
"""PAPI provides the tool designer and application engineer with a
@@ -18,17 +21,27 @@ class Papi(Package):
version('5.3.0', '367961dd0ab426e5ae367c2713924ffb')
def install(self, spec, prefix):
- os.chdir("src/")
+ with working_dir("src"):
- configure_args=["--prefix=%s" % prefix]
+ configure_args=["--prefix=%s" % prefix]
- # PAPI uses MPI if MPI is present; since we don't require an
- # MPI package, we ensure that all attempts to use MPI fail, so
- # that PAPI does not get confused
- configure_args.append('MPICC=:')
+ # PAPI uses MPI if MPI is present; since we don't require
+ # an MPI package, we ensure that all attempts to use MPI
+ # fail, so that PAPI does not get confused
+ configure_args.append('MPICC=:')
- configure(*configure_args)
+ configure(*configure_args)
- make()
- make("install")
+ # Don't use <malloc.h>
+ for level in [".", "*", "*/*"]:
+ files = glob.iglob(join_path(level, "*.[ch]"))
+ filter_file(r"\<malloc\.h\>", "<stdlib.h>", *files)
+ make()
+ make("install")
+
+ # The shared library is not installed correctly on Darwin
+ if sys.platform == 'darwin':
+ os.rename(join_path(prefix.lib, 'libpapi.so'),
+ join_path(prefix.lib, 'libpapi.dylib'))
+ fix_darwin_install_name(prefix.lib)
diff --git a/var/spack/repos/builtin/packages/paradiseo/enable_eoserial.patch b/var/spack/repos/builtin/packages/paradiseo/enable_eoserial.patch
new file mode 100644
index 0000000000..8b3ccfeb84
--- /dev/null
+++ b/var/spack/repos/builtin/packages/paradiseo/enable_eoserial.patch
@@ -0,0 +1,14 @@
+diff --git a/eo/src/CMakeLists.txt b/eo/src/CMakeLists.txt
+index b2b445a..d45ddc7 100644
+--- a/eo/src/CMakeLists.txt
++++ b/eo/src/CMakeLists.txt
+@@ -47,7 +47,7 @@ install(DIRECTORY do es ga gp other utils
+ add_subdirectory(es)
+ add_subdirectory(ga)
+ add_subdirectory(utils)
+-#add_subdirectory(serial)
++add_subdirectory(serial) # Required when including <paradiseo/eo/utils/eoTimer.h> , which is need by <paradiseo/eo/mpi/eoMpi.h>
+
+ if(ENABLE_PYEO)
+ add_subdirectory(pyeo)
+ \ No newline at end of file
diff --git a/var/spack/repos/builtin/packages/paradiseo/fix_osx_detection.patch b/var/spack/repos/builtin/packages/paradiseo/fix_osx_detection.patch
new file mode 100644
index 0000000000..27b240f673
--- /dev/null
+++ b/var/spack/repos/builtin/packages/paradiseo/fix_osx_detection.patch
@@ -0,0 +1,13 @@
+diff --git a/cmake/Config.cmake b/cmake/Config.cmake
+index 02593ba..d198ca9 100644
+--- a/cmake/Config.cmake
++++ b/cmake/Config.cmake
+@@ -6,7 +6,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+
+ # detect OS X version. (use '/usr/bin/sw_vers -productVersion' to extract V from '10.V.x'.)
+ execute_process (COMMAND /usr/bin/sw_vers -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW)
+- string(REGEX REPLACE "10\\.([0-9]).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}")
++ string(REGEX REPLACE "10\\.([0-9]+).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}")
+ if(${MACOSX_VERSION} LESS 5)
+ message(FATAL_ERROR "Unsupported version of OS X : ${MACOSX_VERSION_RAW}")
+ return()
diff --git a/var/spack/repos/builtin/packages/paradiseo/fix_tests.patch b/var/spack/repos/builtin/packages/paradiseo/fix_tests.patch
new file mode 100644
index 0000000000..607c5d5262
--- /dev/null
+++ b/var/spack/repos/builtin/packages/paradiseo/fix_tests.patch
@@ -0,0 +1,13 @@
+diff --git a/moeo/test/t-moeo2DMinHypervolumeArchive.cpp b/moeo/test/t-moeo2DMinHypervolumeArchive.cpp
+index 994a9a4..c4ba77b 100644
+--- a/moeo/test/t-moeo2DMinHypervolumeArchive.cpp
++++ b/moeo/test/t-moeo2DMinHypervolumeArchive.cpp
+@@ -41,7 +41,7 @@
+ #include <moeo>
+ #include <cassert>
+
+-#include<archive/moeo2DMinHyperVolumeArchive.h>
++#include<archive/moeo2DMinHypervolumeArchive.h>
+
+ //-----------------------------------------------------------------------------
+
diff --git a/var/spack/repos/builtin/packages/paradiseo/fix_tutorials.patch b/var/spack/repos/builtin/packages/paradiseo/fix_tutorials.patch
new file mode 100644
index 0000000000..14cb5fed74
--- /dev/null
+++ b/var/spack/repos/builtin/packages/paradiseo/fix_tutorials.patch
@@ -0,0 +1,13 @@
+diff --git a/eo/tutorial/Lesson3/exercise3.1.cpp b/eo/tutorial/Lesson3/exercise3.1.cpp
+index dc37479..d178941 100644
+--- a/eo/tutorial/Lesson3/exercise3.1.cpp
++++ b/eo/tutorial/Lesson3/exercise3.1.cpp
+@@ -289,7 +289,7 @@ void main_function(int argc, char **argv)
+ checkpoint.add(fdcStat);
+
+ // The Stdout monitor will print parameters to the screen ...
+- eoStdoutMonitor monitor(false);
++ eoStdoutMonitor monitor;
+
+ // when called by the checkpoint (i.e. at every generation)
+ checkpoint.add(monitor);
diff --git a/var/spack/repos/builtin/packages/paradiseo/package.py b/var/spack/repos/builtin/packages/paradiseo/package.py
new file mode 100644
index 0000000000..c254234b32
--- /dev/null
+++ b/var/spack/repos/builtin/packages/paradiseo/package.py
@@ -0,0 +1,59 @@
+from spack import *
+import sys
+
+class Paradiseo(Package):
+ """A C++ white-box object-oriented framework dedicated to the reusable design of metaheuristics."""
+ homepage = "http://paradiseo.gforge.inria.fr/"
+
+ # Installing from the development version is a better option at this
+ # point than using the very old supplied packages
+ version('head', git='https://gforge.inria.fr/git/paradiseo/paradiseo.git')
+ # This is a version that the package formula author has tested successfully.
+ # However, the clone is very large (~1Gb git history). The history in the
+ # head version has been trimmed significantly.
+ version('dev-safe', git='https://gforge.inria.fr/git/paradiseo/paradiseo.git',
+ commit='dbb8fbe9a786efd4d1c26408ac1883442e7643a6')
+
+ variant('mpi', default=True, description='Compile with parallel and distributed metaheuristics module')
+ variant('smp', default=True, description='Compile with symmetric multi-processing module ')
+ variant('edo', default=True, description='Compile with (Experimental) EDO module')
+ #variant('tests', default=False, description='Compile with build tests')
+ #variant('doc', default=False, description='Compile with documentation')
+ variant('debug', default=False, description='Builds a debug version of the libraries')
+
+ # Required dependencies
+ depends_on ("cmake")
+ depends_on ("eigen")
+
+ # Optional dependencies
+ depends_on ("mpi", when="+mpi")
+ depends_on ("doxygen", when='+doc')
+
+ # Patches
+ patch('enable_eoserial.patch')
+ patch('fix_osx_detection.patch')
+ patch('fix_tests.patch')
+ patch('fix_tutorials.patch')
+
+ def install(self, spec, prefix):
+ options = []
+ options.extend(std_cmake_args)
+
+ options.extend([
+ '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'),
+ '-DINSTALL_TYPE:STRING=MIN',
+ '-DMPI:BOOL=%s' % ('TRUE' if '+mpi' in spec else 'FALSE'),
+ '-DSMP:BOOL=%s' % ('TRUE' if '+smp' in spec else 'FALSE'), # Note: This requires a C++11 compatible compiler
+ '-DEDO:BOOL=%s' % ('TRUE' if '+edo' in spec else 'FALSE'),
+ '-DENABLE_CMAKE_TESTING:BOOL=%s' % ('TRUE' if '+tests' in spec else 'FALSE')
+ ])
+
+ with working_dir('spack-build', create=True):
+ # Configure
+ cmake('..', *options)
+
+ # Build, test and install
+ make("VERBOSE=1")
+ if '+tests' in spec:
+ make("test")
+ make("install")
diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/package.py b/var/spack/repos/builtin/packages/parallel-netcdf/package.py
index 62a8f7ca0b..e6f8cf026b 100644
--- a/var/spack/repos/builtin/packages/parallel-netcdf/package.py
+++ b/var/spack/repos/builtin/packages/parallel-netcdf/package.py
@@ -8,6 +8,7 @@ class ParallelNetcdf(Package):
homepage = "https://trac.mcs.anl.gov/projects/parallel-netcdf"
url = "http://cucis.ece.northwestern.edu/projects/PnetCDF/Release/parallel-netcdf-1.6.1.tar.gz"
+ version('1.7.0', '267eab7b6f9dc78c4d0e6def2def3aea4bc7c9f0')
version('1.6.1', '62a094eb952f9d1e15f07d56e535052604f1ac34')
depends_on("m4")
diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py
index c16054816c..60f8d3c243 100644
--- a/var/spack/repos/builtin/packages/paraview/package.py
+++ b/var/spack/repos/builtin/packages/paraview/package.py
@@ -27,13 +27,14 @@ class Paraview(Package):
depends_on('bzip2')
depends_on('freetype')
- depends_on('hdf5+mpi', when='+mpi')
- depends_on('hdf5~mpi', when='~mpi')
+ #depends_on('hdf5+mpi', when='+mpi')
+ #depends_on('hdf5~mpi', when='~mpi')
depends_on('jpeg')
depends_on('libpng')
depends_on('libtiff')
depends_on('libxml2')
- depends_on('netcdf')
+ #depends_on('netcdf')
+ #depends_on('netcdf-cxx')
#depends_on('protobuf') # version mismatches?
#depends_on('sqlite') # external version not supported
depends_on('zlib')
@@ -75,13 +76,13 @@ class Paraview(Package):
cmake('..',
'-DCMAKE_INSTALL_PREFIX:PATH=%s' % prefix,
'-DBUILD_TESTING:BOOL=OFF',
- '-DVTK_USER_SYSTEM_FREETYPE:BOOL=ON',
- '-DVTK_USER_SYSTEM_HDF5:BOOL=ON',
- '-DVTK_USER_SYSTEM_JPEG:BOOL=ON',
- '-DVTK_USER_SYSTEM_LIBXML2:BOOL=ON',
- '-DVTK_USER_SYSTEM_NETCDF:BOOL=ON',
- '-DVTK_USER_SYSTEM_TIFF:BOOL=ON',
- '-DVTK_USER_SYSTEM_ZLIB:BOOL=ON',
+ '-DVTK_USE_SYSTEM_FREETYPE:BOOL=ON',
+ '-DVTK_USE_SYSTEM_HDF5:BOOL=OFF',
+ '-DVTK_USE_SYSTEM_JPEG:BOOL=ON',
+ '-DVTK_USE_SYSTEM_LIBXML2:BOOL=ON',
+ '-DVTK_USE_SYSTEM_NETCDF:BOOL=OFF',
+ '-DVTK_USE_SYSTEM_TIFF:BOOL=ON',
+ '-DVTK_USE_SYSTEM_ZLIB:BOOL=ON',
*feature_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 ff4370aa4b..b49f8dae00 100644
--- a/var/spack/repos/builtin/packages/parmetis/package.py
+++ b/var/spack/repos/builtin/packages/parmetis/package.py
@@ -44,7 +44,7 @@ class Parmetis(Package):
depends_on('mpi')
patch('enable_external_metis.patch')
- depends_on('metis')
+ depends_on('metis@5:')
# bug fixes from PETSc developers
# https://bitbucket.org/petsc/pkg-parmetis/commits/1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b/raw/
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py
index 5c1fc6cc92..1161dd7d67 100644
--- a/var/spack/repos/builtin/packages/petsc/package.py
+++ b/var/spack/repos/builtin/packages/petsc/package.py
@@ -40,7 +40,7 @@ class Petsc(Package):
# Other dependencies
depends_on('boost', when='+boost')
- depends_on('metis', when='+metis')
+ depends_on('metis@5:', when='+metis')
depends_on('hdf5+mpi', when='+hdf5+mpi')
depends_on('parmetis', when='+metis+mpi')
diff --git a/var/spack/repos/builtin/packages/pkg-config/package.py b/var/spack/repos/builtin/packages/pkg-config/package.py
index 9964c6ce34..a803bc3f9b 100644
--- a/var/spack/repos/builtin/packages/pkg-config/package.py
+++ b/var/spack/repos/builtin/packages/pkg-config/package.py
@@ -10,7 +10,12 @@ class PkgConfig(Package):
parallel = False
def install(self, spec, prefix):
- configure("--prefix=%s" %prefix, "--enable-shared")
+ configure("--prefix=%s" %prefix,
+ "--enable-shared",
+ "--with-internal-glib") # There's a bootstrapping problem here;
+ # glib uses pkg-config as well, so
+ # break the cycle by using the internal
+ # glib.
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py b/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py
new file mode 100644
index 0000000000..9aecc95c63
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py
@@ -0,0 +1,14 @@
+from spack import *
+
+class PySqlalchemy(Package):
+ """The Python SQL Toolkit and Object Relational Mapper"""
+
+ homepage = 'http://www.sqlalchemy.org/'
+ url = "https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-1.0.12.tar.gz"
+
+ version('1.0.12', '6d19ef29883bbebdcac6613cf391cac4')
+
+ extends('python')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-bottleneck/package.py b/var/spack/repos/builtin/packages/py-bottleneck/package.py
index 0aa4208b4d..d43308543b 100644
--- a/var/spack/repos/builtin/packages/py-bottleneck/package.py
+++ b/var/spack/repos/builtin/packages/py-bottleneck/package.py
@@ -7,7 +7,7 @@ class PyBottleneck(Package):
version('1.0.0', '380fa6f275bd24f27e7cf0e0d752f5d2')
- extends('python', ignore=r'bin/f2py$')
+ extends('python')
depends_on('py-numpy')
def install(self, spec, prefix):
diff --git a/var/spack/repos/builtin/packages/py-csvkit/package.py b/var/spack/repos/builtin/packages/py-csvkit/package.py
new file mode 100644
index 0000000000..def30457be
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-csvkit/package.py
@@ -0,0 +1,22 @@
+from spack import *
+
+class PyCsvkit(Package):
+ """A library of utilities for working with CSV, the king of tabular file
+ formats"""
+
+ homepage = 'http://csvkit.rtfd.org/'
+ url = "https://pypi.python.org/packages/source/c/csvkit/csvkit-0.9.1.tar.gz"
+
+ version('0.9.1', '48d78920019d18846933ee969502fff6')
+
+ extends('python')
+
+ depends_on('py-dateutil')
+ depends_on('py-dbf')
+ depends_on('py-xlrd')
+ depends_on('py-SQLAlchemy')
+ depends_on('py-six')
+ depends_on('py-openpyxl')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-dask/package.py b/var/spack/repos/builtin/packages/py-dask/package.py
new file mode 100644
index 0000000000..cf0a16f21e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-dask/package.py
@@ -0,0 +1,15 @@
+from spack import *
+
+class PyDask(Package):
+ """Minimal task scheduling abstraction"""
+ homepage = "https://github.com/dask/dask/"
+ url = "https://pypi.python.org/packages/source/d/dask/dask-0.8.1.tar.gz"
+
+ version('0.8.1', '5dd8e3a3823b3bc62c9a6d192e2cb5b4')
+
+ extends('python')
+
+ depends_on('py-setuptools')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-dbf/package.py b/var/spack/repos/builtin/packages/py-dbf/package.py
new file mode 100644
index 0000000000..698b221903
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-dbf/package.py
@@ -0,0 +1,15 @@
+from spack import *
+
+class PyDbf(Package):
+ """Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro
+ .dbf files (including memos)"""
+
+ homepage = 'https://pypi.python.org/pypi/dbf'
+ url = "https://pypi.python.org/packages/source/d/dbf/dbf-0.96.005.tar.gz"
+
+ version('0.96.005', 'bce1a1ed8b454a30606e7e18dd2f8277')
+
+ extends('python')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-decorator/package.py b/var/spack/repos/builtin/packages/py-decorator/package.py
new file mode 100644
index 0000000000..abbd9f43d1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-decorator/package.py
@@ -0,0 +1,15 @@
+from spack import *
+
+class PyDecorator(Package):
+ """The aim of the decorator module it to simplify the usage of decorators for the average programmer, and to popularize decorators by showing various non-trivial examples."""
+ homepage = "https://github.com/micheles/decorator"
+ url = "https://pypi.python.org/packages/source/d/decorator/decorator-4.0.9.tar.gz"
+
+ version('4.0.9', 'f12c5651ccd707e12a0abaa4f76cd69a')
+
+ extends('python')
+
+ depends_on('py-setuptools')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-jdcal/package.py b/var/spack/repos/builtin/packages/py-jdcal/package.py
new file mode 100644
index 0000000000..54169b2c21
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-jdcal/package.py
@@ -0,0 +1,14 @@
+from spack import *
+
+class PyJdcal(Package):
+ """Julian dates from proleptic Gregorian and Julian calendars"""
+
+ homepage = 'http://github.com/phn/jdcal'
+ url = "https://pypi.python.org/packages/source/j/jdcal/jdcal-1.2.tar.gz"
+
+ version('1.2', 'ab8d5ba300fd1eb01514f363d19b1eb9')
+
+ extends('python')
+
+ 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 45e77dd631..1a190cc5f3 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$|bin/f2py$')
+ extends('python', ignore=r'bin/nosetests.*$|bin/pbr$')
depends_on('py-pyside', when='+gui')
depends_on('py-ipython', when='+ipython')
@@ -26,6 +26,7 @@ class PyMatplotlib(Package):
depends_on('py-pbr')
depends_on('py-funcsigs')
+ depends_on('pkg-config')
depends_on('freetype')
depends_on('qt', when='+gui')
depends_on('bzip2')
diff --git a/var/spack/repos/builtin/packages/py-mpmath/package.py b/var/spack/repos/builtin/packages/py-mpmath/package.py
new file mode 100644
index 0000000000..4d3261ae8f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-mpmath/package.py
@@ -0,0 +1,13 @@
+from spack import *
+
+class PyMpmath(Package):
+ """A Python library for arbitrary-precision floating-point arithmetic."""
+ homepage = "http://mpmath.org"
+ url = "https://pypi.python.org/packages/source/m/mpmath/mpmath-all-0.19.tar.gz"
+
+ version('0.19', 'd1b7e19dd6830d0d7b5e1bc93d46c02c')
+
+ extends('python')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-networkx/package.py b/var/spack/repos/builtin/packages/py-networkx/package.py
new file mode 100644
index 0000000000..893146ec3e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-networkx/package.py
@@ -0,0 +1,15 @@
+from spack import *
+
+class PyNetworkx(Package):
+ """NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks."""
+ homepage = "http://networkx.github.io/"
+ url = "https://pypi.python.org/packages/source/n/networkx/networkx-1.11.tar.gz"
+
+ version('1.11', '6ef584a879e9163013e9a762e1cf7cd1')
+
+ extends('python')
+
+ depends_on('py-decorator')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-numexpr/package.py b/var/spack/repos/builtin/packages/py-numexpr/package.py
index 081a79dec6..0076aa456b 100644
--- a/var/spack/repos/builtin/packages/py-numexpr/package.py
+++ b/var/spack/repos/builtin/packages/py-numexpr/package.py
@@ -9,7 +9,7 @@ class PyNumexpr(Package):
version('2.4.6', '17ac6fafc9ea1ce3eb970b9abccb4fbd')
version('2.5', '84f66cced45ba3e30dcf77a937763aaa')
- extends('python', ignore=r'bin/f2py$')
+ extends('python')
depends_on('py-numpy')
def install(self, spec, prefix):
diff --git a/var/spack/repos/builtin/packages/py-openpyxl/package.py b/var/spack/repos/builtin/packages/py-openpyxl/package.py
new file mode 100644
index 0000000000..87ff9f3521
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-openpyxl/package.py
@@ -0,0 +1,17 @@
+from spack import *
+
+class PyOpenpyxl(Package):
+ """A Python library to read/write Excel 2007 xlsx/xlsm files"""
+
+ homepage = 'http://openpyxl.readthedocs.org/'
+ url = "https://pypi.python.org/packages/source/o/openpyxl/openpyxl-2.4.0-a1.tar.gz"
+
+ version('2.4.0-a1', 'e5ca6d23ceccb15115d45cdf26e736fc')
+
+ extends('python')
+
+ depends_on('py-jdcal')
+ depends_on('py-setuptools')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-pandas/package.py b/var/spack/repos/builtin/packages/py-pandas/package.py
index 2320b1f92f..59d515eb5e 100644
--- a/var/spack/repos/builtin/packages/py-pandas/package.py
+++ b/var/spack/repos/builtin/packages/py-pandas/package.py
@@ -10,7 +10,7 @@ class PyPandas(Package):
version('0.16.1', 'fac4f25748f9610a3e00e765474bdea8')
version('0.18.0', 'f143762cd7a59815e348adf4308d2cf6')
- extends('python', ignore=r'bin/f2py$')
+ extends('python')
depends_on('py-dateutil')
depends_on('py-numpy')
depends_on('py-setuptools')
diff --git a/var/spack/repos/builtin/packages/py-pillow/package.py b/var/spack/repos/builtin/packages/py-pillow/package.py
index adc8507bd5..66d9bb4382 100644
--- a/var/spack/repos/builtin/packages/py-pillow/package.py
+++ b/var/spack/repos/builtin/packages/py-pillow/package.py
@@ -1,4 +1,5 @@
from spack import *
+import os
class PyPillow(Package):
"""Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors. The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities."""
@@ -7,8 +8,68 @@ class PyPillow(Package):
url = "https://pypi.python.org/packages/source/P/Pillow/Pillow-3.0.0.tar.gz"
version('3.0.0', 'fc8ac44e93da09678eac7e30c9b7377d')
+ provides('PIL')
+
+ # These defaults correspond to Pillow defaults
+ variant('jpeg', default=True, description='Provide JPEG functionality')
+ variant('zlib', default=True, description='Access to compressed PNGs')
+ variant('tiff', default=False, description='Access to TIFF files')
+ variant('freetype', default=False, description='Font related services')
+ variant('tk', default=False, description='Support for tkinter bitmap and photo images')
+ variant('lcms', default=False, description='Color management')
+
+ # Spack does not (yet) support these modes of building
+ # variant('webp', default=False, description='')
+ # variant('webpmux', default=False, description='')
+ # variant('jpeg2000', default=False, description='')
+
extends('python')
+ depends_on('binutils')
depends_on('py-setuptools')
+ depends_on('jpeg', when='+jpeg') # BUG: It will use the system libjpeg anyway
+ depends_on('zlib', when='+zlib')
+ depends_on('tiff', when='+tiff')
+ depends_on('freetype', when='+freetype')
+ depends_on('lcms', when='+lcms')
+ depends_on('tcl', when='+tk')
+ depends_on('tk', when='+tk')
+
def install(self, spec, prefix):
- python('setup.py', 'install', '--prefix=%s' % prefix)
+ libpath=[]
+
+ if '+jpeg' in spec:
+ libpath.append(join_path(spec['jpeg'].prefix, 'lib'))
+ if '+zlib' in spec:
+ libpath.append(join_path(spec['zlib'].prefix, 'lib'))
+ if '+tiff' in spec:
+ libpath.append(join_path(spec['tiff'].prefix, 'lib'))
+ if '+freetype' in spec:
+ libpath.append(join_path(spec['freetype'].prefix, 'lib'))
+ if '+lcms' in spec:
+ libpath.append(join_path(spec['lcms'].prefix, 'lib'))
+
+ # This has not been tested, and likely needs some other treatment.
+ #if '+tk' in spec:
+ # libpath.append(join_path(spec['tcl'].prefix, 'lib'))
+ # libpath.append(join_path(spec['tk'].prefix, 'lib'))
+
+ # -------- Building
+ cmd = ['build_ext',
+ '--%s-jpeg' % ('enable' if '+jpeg' in spec else 'disable'),
+ '--%s-zlib' % ('enable' if '+zlib' in spec else 'disable'),
+ '--%s-tiff' % ('enable' if '+tiff' in spec else 'disable'),
+ '--%s-freetype' % ('enable' if '+freetype' in spec else 'disable'),
+ '--%s-lcms' % ('enable' if '+lcms' in spec else 'disable'),
+ '-L'+':'.join(libpath) # NOTE: This does not make it find libjpeg
+ ]
+
+ #if '+tk' in spec:
+ # cmd.extend(['--enable-tcl', '--enable-tk'])
+ #else:
+ # cmd.extend(['--disable-tcl', '--disable-tk'])
+
+ # --------- Installation
+ cmd.extend(['install', '--prefix=%s' % prefix])
+
+ python('setup.py', *cmd)
diff --git a/var/spack/repos/builtin/packages/py-scikit-image/package.py b/var/spack/repos/builtin/packages/py-scikit-image/package.py
new file mode 100644
index 0000000000..d13339060e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-scikit-image/package.py
@@ -0,0 +1,20 @@
+from spack import *
+
+class PyScikitImage(Package):
+ """Image processing algorithms for SciPy, including IO, morphology, filtering, warping, color manipulation, object detection, etc."""
+ homepage = "http://scikit-image.org/"
+ url = "https://pypi.python.org/packages/source/s/scikit-image/scikit-image-0.12.3.tar.gz"
+
+ version('0.12.3', '04ea833383e0b6ad5f65da21292c25e1')
+
+ extends('python', ignore=r'bin/.*\.py$')
+
+ depends_on('py-dask')
+ depends_on('py-pillow')
+ depends_on('py-networkx')
+ depends_on('py-six')
+ depends_on('py-scipy')
+ depends_on('py-matplotlib')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-scikit-learn/package.py b/var/spack/repos/builtin/packages/py-scikit-learn/package.py
index 5b078ce901..2d7985b98c 100644
--- a/var/spack/repos/builtin/packages/py-scikit-learn/package.py
+++ b/var/spack/repos/builtin/packages/py-scikit-learn/package.py
@@ -7,8 +7,13 @@ class PyScikitLearn(Package):
version('0.15.2', 'd9822ad0238e17b382a3c756ea94fe0d')
version('0.16.1', '363ddda501e3b6b61726aa40b8dbdb7e')
+ version('0.17.1', 'a2f8b877e6d99b1ed737144f5a478dfc')
extends('python')
+ depends_on('py-setuptools')
+ depends_on('py-numpy')
+ depends_on('py-scipy')
+
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-scipy/package.py b/var/spack/repos/builtin/packages/py-scipy/package.py
index c2161c90c4..4d47c641ee 100644
--- a/var/spack/repos/builtin/packages/py-scipy/package.py
+++ b/var/spack/repos/builtin/packages/py-scipy/package.py
@@ -11,9 +11,15 @@ class PyScipy(Package):
extends('python')
depends_on('py-nose')
- depends_on('py-numpy')
- depends_on('blas')
- depends_on('lapack')
+ depends_on('py-numpy+blas+lapack')
def install(self, spec, prefix):
+ if 'atlas' in spec:
+ # libatlas.so actually isn't always installed, but this
+ # seems to make the build autodetect things correctly.
+ env['ATLAS'] = join_path(spec['atlas'].prefix.lib, 'libatlas.' + dso_suffix)
+ else:
+ env['BLAS'] = spec['blas'].blas_shared_lib
+ env['LAPACK'] = spec['lapack'].lapack_shared_lib
+
python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-setuptools/package.py b/var/spack/repos/builtin/packages/py-setuptools/package.py
index c6d9be1add..1368711978 100644
--- a/var/spack/repos/builtin/packages/py-setuptools/package.py
+++ b/var/spack/repos/builtin/packages/py-setuptools/package.py
@@ -5,11 +5,13 @@ class PySetuptools(Package):
homepage = "https://pypi.python.org/pypi/setuptools"
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.tar.gz"
- version('11.3.1', '01f69212e019a2420c1693fb43593930')
- version('16.0', '0ace0b96233516fc5f7c857d086aa3ad')
- version('18.1', 'f72e87f34fbf07f299f6cb46256a0b06')
- version('19.2', '78353b1f80375ca5e088f4b4627ffe03')
+ version('20.7.0', '5d12b39bf3e75e80fdce54e44b255615')
+ version('20.6.7', '45d6110f3ec14924e44c33411db64fe6')
version('20.5', 'fadc1e1123ddbe31006e5e43e927362b')
+ version('19.2', '78353b1f80375ca5e088f4b4627ffe03')
+ version('18.1', 'f72e87f34fbf07f299f6cb46256a0b06')
+ version('16.0', '0ace0b96233516fc5f7c857d086aa3ad')
+ version('11.3.1', '01f69212e019a2420c1693fb43593930')
extends('python')
diff --git a/var/spack/repos/builtin/packages/py-sympy/package.py b/var/spack/repos/builtin/packages/py-sympy/package.py
index c17e35b95f..bbce8c74e3 100644
--- a/var/spack/repos/builtin/packages/py-sympy/package.py
+++ b/var/spack/repos/builtin/packages/py-sympy/package.py
@@ -6,8 +6,10 @@ class PySympy(Package):
url = "https://pypi.python.org/packages/source/s/sympy/sympy-0.7.6.tar.gz"
version('0.7.6', '3d04753974306d8a13830008e17babca')
+ version('1.0', '43e797de799f00f9e8fd2307dba9fab1')
extends('python')
+ depends_on('py-mpmath', when='@1.0:')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/py-xlrd/package.py b/var/spack/repos/builtin/packages/py-xlrd/package.py
new file mode 100644
index 0000000000..8f25c06aad
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-xlrd/package.py
@@ -0,0 +1,15 @@
+from spack import *
+
+class PyXlrd(Package):
+ """Library for developers to extract data from Microsoft Excel (tm)
+ spreadsheet files"""
+
+ homepage = 'http://www.python-excel.org/'
+ url = "https://pypi.python.org/packages/source/x/xlrd/xlrd-0.9.4.tar.gz"
+
+ version('0.9.4', '911839f534d29fe04525ef8cd88fe865')
+
+ extends('python')
+
+ def install(self, spec, prefix):
+ python('setup.py', 'install', '--prefix=%s' % prefix)
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
index f5237c3b57..f7e1d94567 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -151,6 +151,8 @@ class Python(Package):
patterns.append(r'setuptools\.pth')
patterns.append(r'bin/easy_install[^/]*$')
patterns.append(r'setuptools.*egg$')
+ if ext_pkg.name != 'py-numpy':
+ patterns.append(r'bin/f2py$')
return match_predicate(ignore_arg, patterns)
diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py
index d08e8e81e1..93688fb777 100644
--- a/var/spack/repos/builtin/packages/qt/package.py
+++ b/var/spack/repos/builtin/packages/qt/package.py
@@ -1,46 +1,36 @@
-import os
from spack import *
import os
class Qt(Package):
"""Qt is a comprehensive cross-platform C++ application framework."""
- homepage = "http://qt.io"
- list_url = 'http://download.qt-project.org/official_releases/qt/'
- list_depth = 2
-
- version('5.4.2', 'fa1c4d819b401b267eb246a543a63ea5',
- url='http://download.qt-project.org/official_releases/qt/5.4/5.4.2/single/qt-everywhere-opensource-src-5.4.2.tar.gz')
-
- version('5.4.0', 'e8654e4b37dd98039ba20da7a53877e6',
- url='http://download.qt-project.org/official_releases/qt/5.4/5.4.0/single/qt-everywhere-opensource-src-5.4.0.tar.gz')
-
- version('5.3.2', 'febb001129927a70174467ecb508a682',
- url='http://download.qt.io/archive/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz')
-
- version('5.2.1', 'a78408c887c04c34ce615da690e0b4c8',
- url='http://download.qt.io/archive/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.tar.gz')
-
- version('4.8.6', '2edbe4d6c2eff33ef91732602f3518eb',
- url="http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz")
+ homepage = 'http://qt.io'
- version('3.3.8b', '9f05b4125cfe477cc52c9742c3c09009',
- url="http://download.qt.io/archive/qt/3/qt-x11-free-3.3.8b.tar.gz")
+ version('5.5.1', '59f0216819152b77536cf660b015d784')
+ version('5.4.2', 'fa1c4d819b401b267eb246a543a63ea5')
+ version('5.4.0', 'e8654e4b37dd98039ba20da7a53877e6')
+ version('5.3.2', 'febb001129927a70174467ecb508a682')
+ version('5.2.1', 'a78408c887c04c34ce615da690e0b4c8')
+ version('4.8.6', '2edbe4d6c2eff33ef91732602f3518eb')
+ version('3.3.8b', '9f05b4125cfe477cc52c9742c3c09009')
- variant('mesa', default=False, description='depend on mesa')
# Add patch for compile issues with qt3 found with use in the OpenSpeedShop project
- variant('krellpatch', default=False, description="build with openspeedshop based patch.")
+ variant('krellpatch', default=False, description="Build with openspeedshop based patch.")
+ variant('mesa', default=False, description="Depend on mesa.")
+ variant('gtk', default=False, description="Build with gtkplus.")
+
patch('qt3krell.patch', when='@3.3.8b+krellpatch')
# Use system openssl for security.
#depends_on("openssl")
depends_on("glib")
- depends_on("gtkplus")
+ depends_on("gtkplus", when='+gtk')
depends_on("libxml2")
depends_on("zlib")
depends_on("dbus", when='@4:')
depends_on("libtiff")
- depends_on("libpng")
+ depends_on("libpng@1.2.56", when='@3')
+ depends_on("libpng", when='@4:')
depends_on("libmng")
depends_on("jpeg")
@@ -56,6 +46,34 @@ class Qt(Package):
depends_on("libxcb")
+ def url_for_version(self, version):
+ url = "http://download.qt.io/archive/qt/"
+
+ if version >= Version('5'):
+ url += "%s/%s/single/qt-everywhere-opensource-src-%s.tar.gz" % \
+ (version.up_to(2), version, version)
+ elif version >= Version('4.8'):
+ url += "%s/%s/qt-everywhere-opensource-src-%s.tar.gz" % \
+ (version.up_to(2), version, version)
+ elif version >= Version('4.6'):
+ url += "%s/qt-everywhere-opensource-src-%s.tar.gz" % \
+ (version.up_to(2), version)
+ elif version >= Version('4.0'):
+ url += "%s/qt-x11-opensource-src-%s.tar.gz" % \
+ (version.up_to(2), version)
+ elif version >= Version('3'):
+ url += "%s/qt-x11-free-%s.tar.gz" % \
+ (version.up_to(1), version)
+ elif version >= Version('2.1'):
+ url += "%s/qt-x11-%s.tar.gz" % \
+ (version.up_to(1), version)
+ else:
+ url += "%s/qt-%s.tar.gz" % \
+ (version.up_to(1), version)
+
+ return url
+
+
def setup_environment(self, spack_env, env):
env.set('QTDIR', self.prefix)
@@ -88,7 +106,7 @@ class Qt(Package):
'-v',
'-opensource',
'-opengl',
- "-release",
+ '-release',
'-shared',
'-confirm-license',
'-openssl-linked',
@@ -97,12 +115,14 @@ class Qt(Package):
'-no-openvg',
'-no-pch',
# NIS is deprecated in more recent glibc
- "-no-nis"]
+ '-no-nis']
# Don't disable all the database drivers, but should
# really get them into spack at some point.
@when('@3')
def configure(self):
+ # An user report that this was necessary to link Qt3 on ubuntu
+ os.environ['LD_LIBRARY_PATH'] = os.getcwd()+'/lib'
configure('-prefix', self.prefix,
'-v',
'-thread',
diff --git a/var/spack/repos/builtin/packages/readline/package.py b/var/spack/repos/builtin/packages/readline/package.py
index 1b870e0e7f..0c429ea756 100644
--- a/var/spack/repos/builtin/packages/readline/package.py
+++ b/var/spack/repos/builtin/packages/readline/package.py
@@ -2,12 +2,12 @@ from spack import *
class Readline(Package):
"""The GNU Readline library provides a set of functions for use by
- applications that allow users to edit command li nes as they
+ applications that allow users to edit command lines as they
are typed in. Both Emacs and vi editing modes are
available. The Readline library includes additional functions
to maintain a list of previously-entered command lines, to
recall and perhaps reedit those lines, and perform csh-like
- history expansion on previous commands. """
+ history expansion on previous commands."""
homepage = "http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
url = "ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz"
diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py
index c2196dcec4..a4b3979a15 100644
--- a/var/spack/repos/builtin/packages/suite-sparse/package.py
+++ b/var/spack/repos/builtin/packages/suite-sparse/package.py
@@ -10,10 +10,18 @@ class SuiteSparse(Package):
version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319')
+ # FIXME: (see below)
+ # variant('tbb', default=True, description='Build with Intel TBB')
+
depends_on('blas')
depends_on('lapack')
depends_on('metis@5.1.0', when='@4.5.1')
+ # FIXME:
+ # in @4.5.1. TBB support in SPQR seems to be broken as TBB-related linkng flags
+ # does not seem to be used, which leads to linking errors on Linux.
+ # Try re-enabling in future versions.
+ # depends_on('tbb', when='+tbb')
def install(self, spec, prefix):
# The build system of SuiteSparse is quite old-fashioned
@@ -21,16 +29,35 @@ class SuiteSparse(Package):
# with a lot of convoluted logic in it.
# Any kind of customization will need to go through filtering of that file
- # FIXME : this actually uses the current workaround
- # FIXME : (blas / lapack always provide libblas and liblapack as aliases)
- make('install', 'INSTALL=%s' % prefix,
+ make_args = ['INSTALL=%s' % prefix]
- # inject Spack compiler wrappers
+ # inject Spack compiler wrappers
+ make_args.extend([
'AUTOCC=no',
'CC=cc',
'CXX=c++',
'F77=f77',
+ ])
+
+ # use Spack's metis in CHOLMOD/Partition module,
+ # otherwise internal Metis will be compiled
+ make_args.extend([
+ 'MY_METIS_LIB=-L%s -lmetis' % spec['metis'].prefix.lib,
+ 'MY_METIS_INC=%s' % spec['metis'].prefix.include,
+ ])
+
+ # Intel TBB in SuiteSparseQR
+ if '+tbb' in spec:
+ make_args.extend([
+ 'SPQR_CONFIG=-DHAVE_TBB',
+ 'TBB=-L%s -ltbb' % spec['tbb'].prefix.lib,
+ ])
+
+ # BLAS arguments require path to libraries
+ # FIXME : (blas / lapack always provide libblas and liblapack as aliases)
+ make_args.extend([
+ 'BLAS=-lblas',
+ 'LAPACK=-llapack'
+ ])
- # BLAS arguments require path to libraries
- 'BLAS=-lblas',
- 'LAPACK=-llapack')
+ make('install', *make_args)
diff --git a/var/spack/repos/builtin/packages/superlu-dist/package.py b/var/spack/repos/builtin/packages/superlu-dist/package.py
index ddcb7f9225..5cf5e129b4 100644
--- a/var/spack/repos/builtin/packages/superlu-dist/package.py
+++ b/var/spack/repos/builtin/packages/superlu-dist/package.py
@@ -15,7 +15,7 @@ class SuperluDist(Package):
depends_on ('blas')
depends_on ('lapack')
depends_on ('parmetis')
- depends_on ('metis')
+ depends_on ('metis@5:')
def install(self, spec, prefix):
makefile_inc = []
diff --git a/var/spack/repos/builtin/packages/swig/package.py b/var/spack/repos/builtin/packages/swig/package.py
index 8d46c4fe46..78a6c6bbae 100644
--- a/var/spack/repos/builtin/packages/swig/package.py
+++ b/var/spack/repos/builtin/packages/swig/package.py
@@ -22,6 +22,7 @@
# 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 Swig(Package):
@@ -33,14 +34,19 @@ class Swig(Package):
code. In addition, SWIG provides a variety of customization
features that let you tailor the wrapping process to suit your
application."""
+
homepage = "http://www.swig.org"
- url = "http://prdownloads.sourceforge.net/swig/swig-3.0.2.tar.gz"
+ url = "http://prdownloads.sourceforge.net/swig/swig-3.0.8.tar.gz"
+ version('3.0.8', 'c96a1d5ecb13d38604d7e92148c73c97')
version('3.0.2', '62f9b0d010cef36a13a010dc530d0d41')
+ version('2.0.12', 'c3fb0b2d710cc82ed0154b91e43085a4')
+ version('2.0.2', 'eaf619a4169886923e5f828349504a29')
+ version('1.3.40', '2df766c9e03e02811b1ab4bba1c7b9cc')
depends_on('pcre')
def install(self, spec, prefix):
- configure("--prefix=%s" % prefix)
+ configure('--prefix=%s' % prefix)
make()
- make("install")
+ make('install')
diff --git a/var/spack/repos/builtin/packages/tcl/package.py b/var/spack/repos/builtin/packages/tcl/package.py
index 529adf7788..db8bee88d0 100644
--- a/var/spack/repos/builtin/packages/tcl/package.py
+++ b/var/spack/repos/builtin/packages/tcl/package.py
@@ -10,8 +10,13 @@ class Tcl(Package):
extensible."""
homepage = "http://www.tcl.tk"
- version('8.6.3', 'db382feca91754b7f93da16dc4cdad1f',
- url="http://prdownloads.sourceforge.net/tcl/tcl8.6.3-src.tar.gz")
+ def url_for_version(self, version):
+ return 'http://prdownloads.sourceforge.net/tcl/tcl%s-src.tar.gz' % version
+
+ version('8.6.5', '0e6426a4ca9401825fbc6ecf3d89a326')
+ version('8.6.4', 'd7cbb91f1ded1919370a30edd1534304')
+ version('8.6.3', 'db382feca91754b7f93da16dc4cdad1f')
+ version('8.5.19', '0e6426a4ca9401825fbc6ecf3d89a326')
depends_on('zlib')
diff --git a/var/spack/repos/builtin/packages/tk/package.py b/var/spack/repos/builtin/packages/tk/package.py
index 96736f6f95..839d217f34 100644
--- a/var/spack/repos/builtin/packages/tk/package.py
+++ b/var/spack/repos/builtin/packages/tk/package.py
@@ -8,9 +8,11 @@ class Tk(Package):
applications that run unchanged across Windows, Mac OS X, Linux
and more."""
homepage = "http://www.tcl.tk"
- url = "http://prdownloads.sourceforge.net/tcl/tk8.6.3-src.tar.gz"
- version('src', '85ca4dbf4dcc19777fd456f6ee5d0221')
+ def url_for_version(self, version):
+ return "http://prdownloads.sourceforge.net/tcl/tk%s-src.tar.gz" % version
+
+ version('8.6.3', '85ca4dbf4dcc19777fd456f6ee5d0221')
depends_on("tcl")
diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py
index 6223848c68..0f72055fa7 100644
--- a/var/spack/repos/builtin/packages/trilinos/package.py
+++ b/var/spack/repos/builtin/packages/trilinos/package.py
@@ -42,7 +42,7 @@ class Trilinos(Package):
depends_on('matio')
depends_on('glm')
depends_on('swig')
- depends_on('metis',when='+metis')
+ depends_on('metis@5:',when='+metis')
depends_on('suite-sparse',when='+suite-sparse')
# MPI related dependencies
diff --git a/var/spack/repos/builtin/packages/turbomole/package.py b/var/spack/repos/builtin/packages/turbomole/package.py
new file mode 100644
index 0000000000..acc95e3b10
--- /dev/null
+++ b/var/spack/repos/builtin/packages/turbomole/package.py
@@ -0,0 +1,124 @@
+from spack import *
+import os
+import subprocess
+
+class Turbomole(Package):
+ """TURBOMOLE: Program Package for ab initio Electronic Structure
+ Calculations. NB: Requires a license to download."""
+
+ # NOTE: Turbomole requires purchase of a license to download. Go to the
+ # NOTE: Turbomole home page, http://www.turbomole-gmbh.com, for details.
+ # NOTE: Spack will search the current directory for this file. It is
+ # NOTE: probably best to add this file to a Spack mirror so that it can be
+ # NOTE: found from anywhere. For information on setting up a Spack mirror
+ # NOTE: see http://software.llnl.gov/spack/mirrors.html
+
+ homepage = "http://www.turbomole-gmbh.com/"
+
+ version('7.0.2', '92b97e1e52e8dcf02a4d9ac0147c09d6',
+ url="file://%s/turbolinux702.tar.gz" % os.getcwd())
+
+ variant('mpi', default=False, description='Set up MPI environment')
+ variant('smp', default=False, description='Set up SMP environment')
+
+ # Turbomole's install is odd. There are three variants
+ # - serial
+ # - parallel, MPI
+ # - parallel, SMP
+ #
+ # Only one of these can be active at a time. MPI and SMP are set as
+ # variants so there could be up to 3 installs per version. Switching
+ # between them would be accomplished with `module swap` commands.
+
+ def do_fetch(self, mirror_only=True):
+ if '+mpi' in self.spec and '+smp' in self.spec:
+ raise InstallError('Can not have both SMP and MPI enabled in the same build.')
+ super(Turbomole, self).do_fetch(mirror_only)
+
+ def get_tm_arch(self):
+ # For python-2.7 we could use `tm_arch = subprocess.check_output()`
+ # Use the following for compatibility with python 2.6
+ if 'TURBOMOLE' in os.getcwd():
+ tm_arch = subprocess.Popen(['sh', 'scripts/sysname'],
+ stdout=subprocess.PIPE).communicate()[0]
+ return tm_arch.rstrip('\n')
+ else:
+ return
+
+ def install(self, spec, prefix):
+ if spec.satisfies('@:7.0.2'):
+ calculate_version = 'calculate_2.4_linux64'
+ molecontrol_version = 'MoleControl_2.5'
+
+ tm_arch=self.get_tm_arch()
+
+ tar = which('tar')
+ dst = join_path(prefix, 'TURBOMOLE')
+
+ tar('-x', '-z', '-f', 'thermocalc.tar.gz')
+ with working_dir('thermocalc'):
+ cmd = 'sh install <<<y'
+ subprocess.call(cmd, shell=True)
+
+ install_tree('basen', join_path(dst, 'basen'))
+ install_tree('cabasen', join_path(dst, 'cabasen'))
+ install_tree(calculate_version, join_path(dst, calculate_version))
+ install_tree('cbasen', join_path(dst, 'cbasen'))
+ install_tree('DOC', join_path(dst, 'DOC'))
+ install_tree('jbasen', join_path(dst, 'jbasen'))
+ install_tree('jkbasen', join_path(dst, 'jkbasen'))
+ install_tree(molecontrol_version, join_path(dst, molecontrol_version))
+ install_tree('parameter', join_path(dst, 'parameter'))
+ install_tree('perlmodules', join_path(dst, 'perlmodules'))
+ install_tree('scripts', join_path(dst, 'scripts'))
+ install_tree('smprun_scripts', join_path(dst, 'smprun_scripts'))
+ install_tree('structures', join_path(dst, 'structures'))
+ install_tree('thermocalc', join_path(dst, 'thermocalc'))
+ install_tree('TURBOTEST', join_path(dst, 'TURBOTEST'))
+ install_tree('xbasen', join_path(dst, 'xbasen'))
+
+ install('Config_turbo_env', dst)
+ install('Config_turbo_env.tcsh', dst)
+ install('README', dst)
+ install('README_LICENSES', dst)
+ install('TURBOMOLE_702_LinuxPC', dst)
+
+ if '+mpi' in spec:
+ install_tree('bin/%s_mpi' % tm_arch, join_path(dst, 'bin', '%s_mpi' % tm_arch))
+ install_tree('libso/%s_mpi' % tm_arch, join_path(dst, 'libso', '%s_mpi' % tm_arch))
+ install_tree('mpirun_scripts/%s_mpi' % tm_arch, join_path(dst, 'mpirun_scripts', '%s_mpi' % tm_arch))
+ elif '+smp' in spec:
+ install_tree('bin/%s_smp' % tm_arch, join_path(dst, 'bin', '%s_smp' % tm_arch))
+ install_tree('libso/%s_smp' % tm_arch, join_path(dst, 'libso', '%s_smp' % tm_arch))
+ install_tree('mpirun_scripts/%s_smp' % tm_arch, join_path(dst, 'mpirun_scripts', '%s_smp' % tm_arch))
+ else:
+ install_tree('bin/%s' % tm_arch, join_path(dst, 'bin', tm_arch))
+ if '+mpi' in spec or '+smp' in spec:
+ install('mpirun_scripts/ccsdf12', join_path(dst, 'mpirun_scripts'))
+ install('mpirun_scripts/dscf', join_path(dst, 'mpirun_scripts'))
+ install('mpirun_scripts/grad', join_path(dst, 'mpirun_scripts'))
+ install('mpirun_scripts/mpgrad', join_path(dst, 'mpirun_scripts'))
+ install('mpirun_scripts/pnoccsd', join_path(dst, 'mpirun_scripts'))
+ install('mpirun_scripts/rdgrad', join_path(dst, 'mpirun_scripts'))
+ install('mpirun_scripts/ricc2', join_path(dst, 'mpirun_scripts'))
+ install('mpirun_scripts/ridft', join_path(dst, 'mpirun_scripts'))
+
+ def setup_environment(self, spack_env, run_env):
+ if self.spec.satisfies('@:7.0.2'):
+ molecontrol_version = 'MoleControl_2.5'
+
+ tm_arch=self.get_tm_arch()
+
+ run_env.set('TURBODIR', join_path(self.prefix, 'TURBOMOLE'))
+ run_env.set('MOLE_CONTROL', join_path(self.prefix, 'TURBOMOLE', molecontrol_version))
+
+ run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'thermocalc'))
+ run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'scripts'))
+ if '+mpi' in self.spec:
+ run_env.set('PARA_ARCH', 'MPI')
+ run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'bin', '%s_mpi' % tm_arch))
+ elif '+smp' in self.spec:
+ run_env.set('PARA_ARCH', 'SMP')
+ run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'bin', '%s_smp' % tm_arch))
+ else:
+ run_env.prepend_path('PATH', join_path(self.prefix, 'TURBOMOLE', 'bin', tm_arch))
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")
diff --git a/var/spack/repos/builtin/packages/wget/package.py b/var/spack/repos/builtin/packages/wget/package.py
index 55728b0515..4b92659478 100644
--- a/var/spack/repos/builtin/packages/wget/package.py
+++ b/var/spack/repos/builtin/packages/wget/package.py
@@ -17,6 +17,8 @@ class Wget(Package):
def install(self, spec, prefix):
configure("--prefix=%s" % prefix,
- "--with-ssl=openssl")
+ "--with-ssl=openssl",
+ "OPENSSL_CFLAGS=-I%s" % spec['openssl'].prefix.include,
+ "OPENSSL_LIBS=-L%s -lssl -lcrypto -lz" % spec['openssl'].prefix.lib)
make()
make("install")
diff --git a/var/spack/repos/builtin/packages/xerces-c/package.py b/var/spack/repos/builtin/packages/xerces-c/package.py
index b59ab178ae..e36fb936e0 100644
--- a/var/spack/repos/builtin/packages/xerces-c/package.py
+++ b/var/spack/repos/builtin/packages/xerces-c/package.py
@@ -24,8 +24,8 @@ class XercesC(Package):
"""
homepage = "https://xerces.apache.org/xerces-c"
- url = "https://www.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.2.tar.gz"
- version('3.1.2', '9eb1048939e88d6a7232c67569b23985')
+ url = "https://www.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.3.tar.bz2"
+ version('3.1.3', '5e333b55cb43e6b025ddf0e5d0f0fb0d')
def install(self, spec, prefix):
configure("--prefix=%s" % prefix,
diff --git a/var/spack/repos/builtin/packages/zoltan/package.py b/var/spack/repos/builtin/packages/zoltan/package.py
new file mode 100644
index 0000000000..738dfb508b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/zoltan/package.py
@@ -0,0 +1,81 @@
+import re, os, glob
+from spack import *
+
+class Zoltan(Package):
+ """The Zoltan library is a toolkit of parallel combinatorial algorithms for
+ parallel, unstructured, and/or adaptive scientific applications. Zoltan's
+ largest component is a suite of dynamic load-balancing and paritioning
+ algorithms that increase applications' parallel performance by reducing
+ idle time. Zoltan also has graph coloring and graph ordering algorithms,
+ which are useful in task schedulers and parallel preconditioners."""
+
+ homepage = "http://www.cs.sandia.gov/zoltan"
+ base_url = "http://www.cs.sandia.gov/~kddevin/Zoltan_Distributions"
+
+ version('3.83', '1ff1bc93f91e12f2c533ddb01f2c095f')
+ version('3.8', '9d8fba8a990896881b85351d4327c4a9')
+ version('3.6', '9cce794f7241ecd8dbea36c3d7a880f9')
+ version('3.3', '5eb8f00bda634b25ceefa0122bd18d65')
+
+ variant('debug', default=False, description='Builds a debug version of the library')
+ variant('shared', default=True, description='Builds a shared version of the library')
+
+ variant('fortran', default=True, description='Enable Fortran support')
+ variant('mpi', default=False, description='Enable MPI support')
+
+ depends_on('mpi', when='+mpi')
+
+ def install(self, spec, prefix):
+ config_args = [
+ '--enable-f90interface' if '+fortan' in spec else '--disable-f90interface',
+ '--enable-mpi' if '+mpi' in spec else '--disable-mpi',
+ ]
+ config_cflags = [
+ '-O0' if '+debug' in spec else '-O3',
+ '-g' if '+debug' in spec else '-g0',
+ ]
+
+ if '+shared' in spec:
+ config_args.append('--with-ar=$(CXX) -shared $(LDFLAGS) -o')
+ config_args.append('RANLIB=echo')
+ config_cflags.append('-fPIC')
+
+ if '+mpi' in spec:
+ config_args.append('CC=%s/mpicc' % spec['mpi'].prefix.bin)
+ config_args.append('CXX=%s/mpicxx' % spec['mpi'].prefix.bin)
+ config_args.append('--with-mpi=%s' % spec['mpi'].prefix)
+ config_args.append('--with-mpi-compilers=%s' % spec['mpi'].prefix.bin)
+
+ # NOTE: Early versions of Zoltan come packaged with a few embedded
+ # library packages (e.g. ParMETIS, Scotch), which messes with Spack's
+ # ability to descend directly into the package's source directory.
+ if spec.satisfies('@:3.6'):
+ cd('Zoltan_v%s' % self.version)
+
+ mkdirp('build')
+ cd('build')
+
+ config_zoltan = Executable('../configure')
+ config_zoltan(
+ '--prefix=%s' % pwd(),
+ '--with-cflags=%s' % ' '.join(config_cflags),
+ '--with-cxxflags=%s' % ' '.join(config_cflags),
+ *config_args)
+
+ make()
+ make('install')
+
+ # NOTE: Unfortunately, Zoltan doesn't provide any configuration options for
+ # the extension of the output library files, so this script must change these
+ # extensions as a post-processing step.
+ if '+shared' in spec:
+ for libpath in glob.glob('lib/*.a'):
+ libdir, libname = (os.path.dirname(libpath), os.path.basename(libpath))
+ move(libpath, os.path.join(libdir, re.sub(r'\.a$', '.so', libname)))
+
+ mkdirp(prefix)
+ move('include', prefix)
+ move('lib', prefix)
+
+ def url_for_version(self, version):
+ return '%s/zoltan_distrib_v%s.tar.gz' % (Zoltan.base_url, version)