summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-06-20 20:46:11 +0200
committeralalazo <massimiliano.culpo@googlemail.com>2016-06-20 20:46:11 +0200
commitb86e3047f34ab24ef8ff4586c433fcf79580aeca (patch)
treebbc14088cf5565fdb020ec07eee20e91b4f0c326 /var
parentf74d4b0660d460d3b95eb840bedc9f7aa10a31f9 (diff)
downloadspack-b86e3047f34ab24ef8ff4586c433fcf79580aeca.tar.gz
spack-b86e3047f34ab24ef8ff4586c433fcf79580aeca.tar.bz2
spack-b86e3047f34ab24ef8ff4586c433fcf79580aeca.tar.xz
spack-b86e3047f34ab24ef8ff4586c433fcf79580aeca.zip
openmpi : revert part of #1079 (OpenMPI can be built without fortran)
Building OpenMPI without fortran is possible, and was already handled. Raising an install error we effectively renounce at clang+OpenMPI. build_environment : sets 'CC', 'CXX', and similar variables only if a compiler is found
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/openmpi/package.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py
index 695fb82f62..588d862d96 100644
--- a/var/spack/repos/builtin/packages/openmpi/package.py
+++ b/var/spack/repos/builtin/packages/openmpi/package.py
@@ -24,6 +24,8 @@
##############################################################################
import os
+import llnl.util.tty as tty
+
from spack import *
@@ -118,6 +120,21 @@ class Openmpi(Package):
self.spec.mpifc = join_path(self.prefix.bin, 'mpif90')
self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77')
+ def setup_environment(self, spack_env, run_env):
+ # As of 06/2016 there is no mechanism to specify that packages which
+ # depends on MPI need C or/and Fortran implementation. For now
+ # require both.
+ if (self.compiler.f77 is None) or (self.compiler.fc is None):
+ tty.warn('OpenMPI : FORTRAN compiler not found')
+ tty.warn('OpenMPI : FORTRAN bindings will be disabled')
+ spack_env.unset('FC')
+ spack_env.unset('F77')
+ # Setting an attribute here and using it in the 'install'
+ # method is needed to ensure tty.warn is actually displayed
+ # to user and not redirected to spack-build.out
+ self.config_extra = ['--enable-mpi-fortran=none',
+ '--disable-oshmem-fortran']
+
@property
def verbs(self):
# Up through version 1.6, this option was previously named
@@ -129,17 +146,14 @@ class Openmpi(Package):
return 'verbs'
def install(self, spec, prefix):
- # As of 06/2016 there is no mechanism to specify that packages which
- # depends on MPI need C or/and Fortran implementation. For now
- # require both.
- if (self.compiler.f77 is None) or (self.compiler.fc is None):
- raise InstallError('OpenMPI requires both C and Fortran ',
- 'compilers!')
-
config_args = ["--prefix=%s" % prefix,
"--with-hwloc=%s" % spec['hwloc'].prefix,
"--enable-shared",
"--enable-static"]
+
+ if getattr(self, 'config_extra', None) is not None:
+ config_args.extend(self.config_extra)
+
# Variant based arguments
config_args.extend([
# Schedulers
@@ -170,9 +184,6 @@ class Openmpi(Package):
if self.version == ver("1.6.5") and '+lanl' in spec:
config_args.append("--with-platform=contrib/platform/lanl/tlcc2/optimized-nopanasas") # NOQA: ignore=E501
- if not self.compiler.f77 and not self.compiler.fc:
- config_args.append("--enable-mpi-fortran=no")
-
configure(*config_args)
make()
make("install")