Skip to content
Snippets Groups Projects
Commit 46433b9e authored by Denis Davydov's avatar Denis Davydov Committed by Todd Gamblin
Browse files

require fortran for MPI providers to avoid delayed compiler errors (#1937)

* openmpi: require fortran for now

* mpich: requre fortran for now

* mvapich2: require fortran for now

* openmpi: flake8 fixes
parent 92f17eeb
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,13 @@ def setup_dependent_package(self, module, dep_spec):
]
def install(self, spec, prefix):
# Until we can pass variants such as +fortran through virtual
# dependencies depends_on('mpi'), require Fortran compiler to
# avoid delayed build errors in dependents.
if (self.compiler.f77 is None) or (self.compiler.fc is None):
raise InstallError('Mpich requires both C and Fortran ',
'compilers!')
config_args = [
'--prefix={0}'.format(prefix),
'--enable-shared',
......
......@@ -232,6 +232,13 @@ def setup_dependent_package(self, module, dep_spec):
]
def install(self, spec, prefix):
# Until we can pass variants such as +fortran through virtual
# dependencies depends_on('mpi'), require Fortran compiler to
# avoid delayed build errors in dependents.
if (self.compiler.f77 is None) or (self.compiler.fc is None):
raise InstallError('Mvapich2 requires both C and Fortran ',
'compilers!')
# we'll set different configure flags depending on our
# environment
configure_args = [
......
......@@ -23,9 +23,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
import llnl.util.tty as tty
from spack import *
......@@ -135,21 +132,6 @@ def setup_dependent_package(self, module, dep_spec):
join_path(self.prefix.lib, 'libmpi.{0}'.format(dso_suffix))
]
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
......@@ -161,6 +143,13 @@ def verbs(self):
return 'verbs'
def install(self, spec, prefix):
# Until we can pass variants such as +fortran through virtual
# dependencies depends_on('mpi'), require Fortran compiler to
# avoid delayed build errors in dependents.
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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment