From f86dcd8b4cff3b49ba5395c9f64e91f066c0a8be Mon Sep 17 00:00:00 2001 From: Pramod Kumbhar Date: Wed, 22 Feb 2017 20:04:14 +0100 Subject: Fix scotch build on bg-q (#3196) * Fix build issue #3190 on bg-q : - disable parallel build as it produces weired linker errors in cross compiling environment - update ldflags for bg-q as per Makefile provided Makefile.inc.ppca2_ibm_bgq * Added note about -lpthread vs -pthread --- var/spack/repos/builtin/packages/scotch/package.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py index ca8e3e3fa0..f164037efa 100644 --- a/var/spack/repos/builtin/packages/scotch/package.py +++ b/var/spack/repos/builtin/packages/scotch/package.py @@ -56,6 +56,10 @@ class Scotch(Package): depends_on('mpi', when='+mpi') depends_on('zlib', when='+compression') + # NOTE: In cross-compiling environment parallel build + # produces weird linker errors. + parallel = False + # NOTE: Versions of Scotch up to version 6.0.0 don't include support for # building with 'esmumps' in their default packages. In order to enable # support for this feature, we must grab the 'esmumps' enabled archives @@ -140,9 +144,14 @@ class Scotch(Package): ldflags.append('-L%s -lz' % (self.spec['zlib'].prefix.lib)) cflags.append('-DCOMMON_PTHREAD') + + # NOTE: bg-q platform needs -lpthread (and not -pthread) + # otherwise we get illegal instruction error during runtime if self.spec.satisfies('platform=darwin'): cflags.append('-DCOMMON_PTHREAD_BARRIER') ldflags.append('-lm -pthread') + elif self.spec.satisfies('platform=bgq'): + ldflags.append('-lm -lrt -lpthread') else: ldflags.append('-lm -lrt -pthread') -- cgit v1.2.3-60-g2f50