From 3089207ced6b7a8efdb36c4f6d92272dbda3e984 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Wed, 28 Feb 2018 10:37:01 -0700 Subject: [PATCH] minighost: fix build on Ubuntu (#7354) * minighost: fix build on Ubuntu * minighost: append -lgfortran only for gcc --- var/spack/repos/builtin/packages/minighost/package.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/minighost/package.py b/var/spack/repos/builtin/packages/minighost/package.py index 57e590af30..5142508332 100644 --- a/var/spack/repos/builtin/packages/minighost/package.py +++ b/var/spack/repos/builtin/packages/minighost/package.py @@ -55,16 +55,17 @@ def build_targets(self): targets.append('PROTOCOL=-D_MG_MPI') targets.append('FC={0}'.format(self.spec['mpi'].mpif77)) targets.append('CC={0}'.format(self.spec['mpi'].mpicc)) - targets.append( - 'LIBS=-lm -lmpi_cxx') else: targets.append('PROTOCOL=-D_MG_SERIAL') targets.append('FC=f77') targets.append('CC=cc') - targets.append('LIBS=-lm -lgfortran') if '%gcc' in self.spec: targets.append('COMPILER_SUITE=gnu') + if '+mpi' in self.spec: + targets.append('LIBS=-lm -lmpi_cxx -lgfortran') + else: + targets.append('LIBS=-lm -lgfortran') elif '%cce' in self.spec: targets.append('COMPILER_SUITE=cray') elif '%intel' in self.spec: