From f128e7de54a29ca422e43e0f24145f95638724c5 Mon Sep 17 00:00:00 2001
From: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Date: Tue, 28 Jul 2020 10:56:59 +0200
Subject: [PATCH] Removed references to BlueGene/Q in Spack builtin packages

---
 .../packages/apple-libunwind/package.py       |  1 -
 .../repos/builtin/packages/charmpp/package.py |  3 ---
 .../repos/builtin/packages/elpa/package.py    |  2 +-
 .../repos/builtin/packages/elsi/package.py    |  2 +-
 .../builtin/packages/hpctoolkit/package.py    | 16 +--------------
 .../repos/builtin/packages/lcals/package.py   | 19 +-----------------
 .../builtin/packages/libglvnd/package.py      |  1 -
 .../builtin/packages/libmonitor/package.py    | 20 -------------------
 .../repos/builtin/packages/llvm/package.py    |  1 -
 .../repos/builtin/packages/neuron/package.py  | 13 ------------
 .../builtin/packages/py-matplotlib/package.py |  1 -
 .../builtin/packages/py-tensorflow/package.py |  4 ----
 .../builtin/packages/scorec-core/package.py   |  8 --------
 .../repos/builtin/packages/scotch/package.py  |  2 --
 .../repos/builtin/packages/scr/package.py     |  2 --
 .../repos/builtin/packages/tau/package.py     |  4 ----
 16 files changed, 4 insertions(+), 95 deletions(-)

diff --git a/var/spack/repos/builtin/packages/apple-libunwind/package.py b/var/spack/repos/builtin/packages/apple-libunwind/package.py
index 9d1db5cca8..680560a99d 100644
--- a/var/spack/repos/builtin/packages/apple-libunwind/package.py
+++ b/var/spack/repos/builtin/packages/apple-libunwind/package.py
@@ -19,7 +19,6 @@ class AppleLibunwind(Package):
     # Darwin must be expressed by listing a conflict with every
     # platform that isn't Darwin/macOS
     conflicts('platform=linux')
-    conflicts('platform=bgq')
     conflicts('platform=cray')
 
     # Override the fetcher method to throw a useful error message;
diff --git a/var/spack/repos/builtin/packages/charmpp/package.py b/var/spack/repos/builtin/packages/charmpp/package.py
index ed1b6ee7b7..3afeb6cadb 100644
--- a/var/spack/repos/builtin/packages/charmpp/package.py
+++ b/var/spack/repos/builtin/packages/charmpp/package.py
@@ -169,9 +169,6 @@ def charmarch(self):
             ("win",     "x86_64",   "netlrts"):     "netlrts-win-x86_64",
             ("cnl",     "x86_64",   "gni"):         "gni-crayxc",
             ("cnl",     "x86_64",   "mpi"):         "mpi-crayxc",
-            ("cnk",     "x86_64",   "mpi"):         "mpi-bluegeneq",
-            ("cnk",     "x86_64",   "pami"):        "pami-bluegeneq",
-            ("cnk",     "x86_64",   "pamilrts"):    "pamilrts-bluegeneq",
         }
         if (plat, mach, comm) not in versions:
             raise InstallError(
diff --git a/var/spack/repos/builtin/packages/elpa/package.py b/var/spack/repos/builtin/packages/elpa/package.py
index 58c088393f..182432d12b 100644
--- a/var/spack/repos/builtin/packages/elpa/package.py
+++ b/var/spack/repos/builtin/packages/elpa/package.py
@@ -69,7 +69,7 @@ def configure_args(self):
 
         # TODO: add --enable-gpu, --disable-sse-assembly, --enable-sparc64
         # and --enable-neon-arch64
-        simd_features = ['vsx', 'sse', 'avx', 'avx2', 'avx512', 'bgp', 'bgq']
+        simd_features = ['vsx', 'sse', 'avx', 'avx2', 'avx512']
 
         for feature in simd_features:
             msg = '--enable-{0}' if feature in spec.target else '--disable-{0}'
diff --git a/var/spack/repos/builtin/packages/elsi/package.py b/var/spack/repos/builtin/packages/elsi/package.py
index db5d4714f6..578bc73c91 100644
--- a/var/spack/repos/builtin/packages/elsi/package.py
+++ b/var/spack/repos/builtin/packages/elsi/package.py
@@ -25,7 +25,7 @@ class Elsi(CMakePackage):
     )
     variant(
         'elpa2_kernel', default="none", description="ELPA2 Kernel",
-        values=('BGQ', 'AVX', 'AVX2', 'AVX512'), multi=False
+        values=('AVX', 'AVX2', 'AVX512'), multi=False
     )
     variant(
         'enable_pexsi', default=False, description='Enable PEXSI support'
diff --git a/var/spack/repos/builtin/packages/hpctoolkit/package.py b/var/spack/repos/builtin/packages/hpctoolkit/package.py
index 0224e9a985..89a7a4b641 100644
--- a/var/spack/repos/builtin/packages/hpctoolkit/package.py
+++ b/var/spack/repos/builtin/packages/hpctoolkit/package.py
@@ -38,10 +38,6 @@ class Hpctoolkit(AutotoolsPackage):
             description='Build for Cray compute nodes, including '
             'hpcprof-mpi.')
 
-    variant('bgq', default=False,
-            description='Build for Blue Gene compute nodes, including '
-            'hpcprof-mpi (up to 2019.12.28 only).')
-
     variant('mpi', default=False,
             description='Build hpcprof-mpi, the MPI version of hpcprof.')
 
@@ -73,8 +69,7 @@ class Hpctoolkit(AutotoolsPackage):
     depends_on('gotcha@1.0.3:')
     depends_on('intel-tbb+shared')
     depends_on('libdwarf')
-    depends_on('libmonitor+hpctoolkit+bgq', when='+bgq')
-    depends_on('libmonitor+hpctoolkit~bgq', when='~bgq')
+    depends_on('libmonitor+hpctoolkit')
     depends_on('libunwind@1.4: +xz')
     depends_on('mbedtls+pic')
     depends_on('xerces-c transcoder=iconv')
@@ -96,9 +91,6 @@ class Hpctoolkit(AutotoolsPackage):
     conflicts('+cuda', when='@2018.0.0:2019.99.99',
               msg='cuda requires 2020.03.01 or later')
 
-    conflicts('+bgq', when='@2020.03.01:',
-              msg='blue gene requires 2019.12.28 or earlier')
-
     flag_handler = AutotoolsPackage.build_system_flags
 
     def configure_args(self):
@@ -138,12 +130,6 @@ def configure_args(self):
                 '--enable-mpi-search=cray',
                 '--enable-all-static',
             ])
-        elif '+bgq' in spec:
-            args.extend([
-                '--enable-mpi-search=bgq',
-                '--enable-all-static',
-                '--enable-bgq',
-            ])
         elif '+mpi' in spec:
             args.append('MPICXX=%s' % spec['mpi'].mpicxx)
 
diff --git a/var/spack/repos/builtin/packages/lcals/package.py b/var/spack/repos/builtin/packages/lcals/package.py
index ebf5411d00..9305c3dcb3 100644
--- a/var/spack/repos/builtin/packages/lcals/package.py
+++ b/var/spack/repos/builtin/packages/lcals/package.py
@@ -46,7 +46,7 @@ def build_targets(self):
             arch = 'MIC'
         elif arch == 'x86_64' or arch == 'x86_32':
             arch = 'x86'
-        elif arch != 'bgq':
+        else:
             raise InstallError('unknown architecture.')
 
         if self.compiler.name == 'intel':
@@ -72,24 +72,7 @@ def build_targets(self):
                 cxxflags += '-DLCALS_PLATFORM_X86_AVX -DLCALS_COMPILER_GNU '
                 cxx_compile += '-Ofast -mavx -finline-functions'
                 ' -finline-limit=10000 -std=c++11'
-            elif arch == 'bgq':
-                cxxflags += '-DLCALS_PLATFORM_BGQ -DLCALS_COMPILER_GNU '
-                cxx_compile += '-O3 -finline-functions -finline-limit=10000'
-                ' -std=c++0x'
             cxxflags += self.compiler.openmp_flag
-        elif self.compiler.name == 'xl' and arch == 'bgp':
-            if self.compiler.version == Version('9') and arch == 'bgp':
-                cxxflags += '-DLCALS_PLATFORM_BGP -DLCALS_COMPILER_XLC9 '
-                cxx_compile += 'O3 -qarch=450d -qtune=450 -qalias=allp -qhot'
-                ' -qsmp=omp '
-            elif self.compiler.version == Version('12') and arch == 'bgq':
-                cxxflags += '-DLCALS_PLATFORM_BGQ -DLCALS_COMPILER_XLC12 '
-                cxx_compile += '-O3 -qarch=qp -qhot=novector -qsimd=auto'
-                ' -qlanglvl=extended0x -qnostrict -qinline=10000 -qsmp=omp '
-        elif self.compiler.name == 'clang':
-            if arch == 'bgq':
-                cxxflags += '-DLCALS_PLATFORM_BGQ -DLCALS_COMPILER_CLANG '
-                cxx_compile += '-O3 -finline-functions  -ffast-math -std=c++0x'
 
         targets.append('LCALS_ARCH=')
         cxx_compile += ' ' + cxxflags
diff --git a/var/spack/repos/builtin/packages/libglvnd/package.py b/var/spack/repos/builtin/packages/libglvnd/package.py
index 84f5440f27..5834c7b9b6 100644
--- a/var/spack/repos/builtin/packages/libglvnd/package.py
+++ b/var/spack/repos/builtin/packages/libglvnd/package.py
@@ -26,7 +26,6 @@ class Libglvnd(AutotoolsPackage):
     version('1.1.1', sha256='71918ed1261e4eece18c0b74b50dc62c0237b8d526e83277ef078554544720b9')
 
     conflicts('platform=darwin', msg='libglvnd is linux specific')
-    conflicts('platform=bgq', msg='libglvnd is linux specific')
 
     depends_on('libxext')
     depends_on('libx11')
diff --git a/var/spack/repos/builtin/packages/libmonitor/package.py b/var/spack/repos/builtin/packages/libmonitor/package.py
index 5a199ee333..e396d0c80b 100644
--- a/var/spack/repos/builtin/packages/libmonitor/package.py
+++ b/var/spack/repos/builtin/packages/libmonitor/package.py
@@ -24,9 +24,6 @@ class Libmonitor(AutotoolsPackage):
     variant('hpctoolkit', default=False,
             description='Configure for HPCToolkit')
 
-    variant('bgq', default=False,
-            description='Configure for Blue Gene/Q')
-
     # Configure for Krell and OpenSpeedshop.
     variant('krellpatch', default=False,
             description="Build with openspeedshop based patch.")
@@ -58,21 +55,4 @@ def configure_args(self):
         if '+hpctoolkit' in self.spec:
             args.append('--enable-client-signals=%s' % self.signals)
 
-        # TODO: Spack has trouble finding cross-compilers; the +bgq variant
-        # manually specifies the appropriate compiler to build for BGQ (by
-        # setting that here, Spack's choice of CC is overridden).
-        # If the user manually defines an entry in compilers.yaml, the bgq
-        # variant should not be required if the user specifies the bgq
-        # architecture for the libmonitor package. See #8860
-        # TODO: users want to build this for the backend and dependents for the
-        # frontend. Spack ought to make that easy by finding the appropriate
-        # compiler for each if the root and libmonitor are designated to build
-        # on the frontend and backend, respectively. As of now though, there
-        # is an issue with compiler concretization such that spack will attempt
-        # to assign the compiler chosen for libmonitor to the root (unless the
-        # user specifies the compiler for each in addition to the arch).
-        # See #8859
-        if '+bgq' in self.spec:
-            args.append('CC=powerpc64-bgq-linux-gcc')
-
         return args
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index 8520f966ac..9573c5d715 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -177,7 +177,6 @@ class Llvm(CMakePackage, CudaPackage):
 
     # code signing is only necessary on macOS",
     conflicts('+code_signing', when='platform=linux')
-    conflicts('+code_signing', when='platform=bgq')
     conflicts('+code_signing', when='platform=cray')
 
     conflicts(
diff --git a/var/spack/repos/builtin/packages/neuron/package.py b/var/spack/repos/builtin/packages/neuron/package.py
index 8f3371a159..a3c6cbec05 100644
--- a/var/spack/repos/builtin/packages/neuron/package.py
+++ b/var/spack/repos/builtin/packages/neuron/package.py
@@ -81,11 +81,6 @@ def get_arch_options(self, spec):
                             '--without-memacs',
                             '--without-nmodl'])
 
-        # need to enable bg-q arch
-        if 'bgq' in self.spec.architecture:
-            options.extend(['--enable-bluegeneQ',
-                            '--host=powerpc64'])
-
         # on os-x disable building carbon 'click' utility
         if 'darwin' in self.spec.architecture:
             options.append('macdarwin=no')
@@ -119,9 +114,6 @@ def get_python_options(self, spec):
     def get_compiler_options(self, spec):
         flags = '-O2 -g'
 
-        if 'bgq' in self.spec.architecture:
-            flags = '-O3 -qtune=qp -qarch=qp -q64 -qstrict -qnohot -g'
-
         if self.spec.satisfies('%pgi'):
             flags += ' ' + self.compiler.cc_pic_flag
 
@@ -134,11 +126,6 @@ def build_nmodl(self, spec, prefix):
                    '--with-nmodl-only',
                    '--without-x']
 
-        if 'bgq' in self.spec.architecture:
-            flags = '-qarch=ppc64'
-            options.extend(['CFLAGS=%s' % flags,
-                            'CXXFLAGS=%s' % flags])
-
         if 'cray' in self.spec.architecture:
             flags = '-target-cpu=x86_64 -target-network=none'
             options.extend(['CFLAGS=%s' % flags,
diff --git a/var/spack/repos/builtin/packages/py-matplotlib/package.py b/var/spack/repos/builtin/packages/py-matplotlib/package.py
index f67eaeb1e0..62c1a8dac3 100644
--- a/var/spack/repos/builtin/packages/py-matplotlib/package.py
+++ b/var/spack/repos/builtin/packages/py-matplotlib/package.py
@@ -138,7 +138,6 @@ class PyMatplotlib(PythonPackage):
 
     msg = 'MacOSX backend requires the Cocoa headers included with XCode'
     conflicts('platform=linux', when='backend=macosx', msg=msg)
-    conflicts('platform=bgq',   when='backend=macosx', msg=msg)
     conflicts('platform=cray',  when='backend=macosx', msg=msg)
 
     # Patch to pick up correct freetype headers
diff --git a/var/spack/repos/builtin/packages/py-tensorflow/package.py b/var/spack/repos/builtin/packages/py-tensorflow/package.py
index 7c4a0849c5..367a3511d6 100644
--- a/var/spack/repos/builtin/packages/py-tensorflow/package.py
+++ b/var/spack/repos/builtin/packages/py-tensorflow/package.py
@@ -203,7 +203,6 @@ class PyTensorflow(Package, CudaPackage):
     conflicts('+jemalloc', when='@:0')
     conflicts('+jemalloc', when='platform=darwin', msg='Currently jemalloc is only support on Linux platform')
     conflicts('+jemalloc', when='platform=cray',   msg='Currently jemalloc is only support on Linux platform')
-    conflicts('+jemalloc', when='platform=bgq',    msg='Currently jemalloc is only support on Linux platform')
     conflicts('+gcp', when='@:0.8')
     conflicts('+hdfs', when='@:0.10')
     conflicts('+aws', when='@:1.3')
@@ -227,18 +226,15 @@ class PyTensorflow(Package, CudaPackage):
     conflicts('+tensorrt', when='~cuda')
     conflicts('+tensorrt', when='platform=darwin', msg='Currently TensorRT is only supported on Linux platform')
     conflicts('+tensorrt', when='platform=cray',   msg='Currently TensorRT is only supported on Linux platform')
-    conflicts('+tensorrt', when='platform=bgq',    msg='Currently TensorRT is only supported on Linux platform')
     conflicts('+nccl', when='@:1.7')
     conflicts('+nccl', when='~cuda')
     conflicts('+nccl', when='platform=darwin', msg='Currently NCCL is only supported on Linux platform')
     conflicts('+nccl', when='platform=cray',   msg='Currently NCCL is only supported on Linux platform')
-    conflicts('+nccl', when='platform=bgq',    msg='Currently NCCL is only supported on Linux platform')
     conflicts('+mpi', when='@:1.2')
     conflicts('+android', when='@:1.4')
     conflicts('+ios', when='@:1.12.0,1.12.2:1.13')
     conflicts('+ios', when='platform=linux', msg='iOS support only available on macOS')
     conflicts('+ios', when='platform=cray',  msg='iOS support only available on macOS')
-    conflicts('+ios', when='platform=bgq',   msg='iOS support only available on macOS')
     conflicts('+monolithic', when='@:1.3')
     conflicts('+numa', when='@:1.12.0,1.12.2:1.13')
     conflicts('+dynamic_kernels', when='@:1.12.0,1.12.2:1.12.3')
diff --git a/var/spack/repos/builtin/packages/scorec-core/package.py b/var/spack/repos/builtin/packages/scorec-core/package.py
index adb88f2aae..4ff96cae85 100644
--- a/var/spack/repos/builtin/packages/scorec-core/package.py
+++ b/var/spack/repos/builtin/packages/scorec-core/package.py
@@ -20,14 +20,6 @@ class ScorecCore(CMakePackage):
     depends_on('zoltan')
     depends_on('cmake@3.0:', type='build')
 
-    @property
-    def std_cmake_args(self):
-        # Default cmake RPATH options causes build failure on bg-q
-        if self.spec.satisfies('platform=bgq'):
-            return ['-DCMAKE_INSTALL_PREFIX:PATH={0}'.format(self.prefix)]
-        else:
-            return self._std_args(self)
-
     def cmake_args(self):
         options = []
         options.append('-DCMAKE_C_COMPILER=%s' % self.spec['mpi'].mpicc)
diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py
index fb8dc08b92..1fa9fbb3aa 100644
--- a/var/spack/repos/builtin/packages/scotch/package.py
+++ b/var/spack/repos/builtin/packages/scotch/package.py
@@ -170,8 +170,6 @@ def configure(self):
         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')
 
diff --git a/var/spack/repos/builtin/packages/scr/package.py b/var/spack/repos/builtin/packages/scr/package.py
index 3e0e1456cd..ab5907c375 100644
--- a/var/spack/repos/builtin/packages/scr/package.py
+++ b/var/spack/repos/builtin/packages/scr/package.py
@@ -80,8 +80,6 @@ class Scr(CMakePackage):
     variant('cntl_base', default='/tmp',
             description='Compile time default location for control directory.')
 
-    conflicts('platform=bgq')
-
     def get_abs_path_rel_prefix(self, path):
         # Return path if absolute, otherwise prepend prefix
         if os.path.isabs(path):
diff --git a/var/spack/repos/builtin/packages/tau/package.py b/var/spack/repos/builtin/packages/tau/package.py
index 1d2dea580b..7f7b1f9f3e 100644
--- a/var/spack/repos/builtin/packages/tau/package.py
+++ b/var/spack/repos/builtin/packages/tau/package.py
@@ -76,7 +76,6 @@ class Tau(Package):
     # This is a _reasonable_ subset of the full set of TAU
     # architectures supported:
     variant('craycnl', default=False, description='Build for Cray compute nodes')
-    variant('bgq', default=False, description='Build for IBM BlueGene/Q compute nodes')
     variant('ppc64le', default=False, description='Build for IBM Power LE nodes')
     variant('x86_64', default=False, description='Force build for x86 Linux instead of auto-detect')
 
@@ -162,9 +161,6 @@ def install(self, spec, prefix):
         if '+craycnl' in spec:
             options.append('-arch=craycnl')
 
-        if '+bgq' in spec:
-            options.append('-arch=bgq')
-
         if '+ppc64le' in spec:
             options.append('-arch=ibm64linux')
 
-- 
GitLab