summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Jesus <rj.bcjesus@gmail.com>2021-10-05 10:55:12 +0100
committerGitHub <noreply@github.com>2021-10-05 05:55:12 -0400
commit4ee74c01e3aa781f983557d3956628e3576ca17a (patch)
tree43640ccfde42dcd8c215923fe4533f81fe3bace4
parent7f2fd50d209be3d54673e45b148c63d5929b11bc (diff)
downloadspack-4ee74c01e3aa781f983557d3956628e3576ca17a.tar.gz
spack-4ee74c01e3aa781f983557d3956628e3576ca17a.tar.bz2
spack-4ee74c01e3aa781f983557d3956628e3576ca17a.tar.xz
spack-4ee74c01e3aa781f983557d3956628e3576ca17a.zip
meme: Fix compilation with `arm` and `nvhpc` compilers (#24883)
* Fix compilation with `arm` and `nvhpc` compilers * Update package.py
-rw-r--r--var/spack/repos/builtin/packages/meme/arm.patch36
-rw-r--r--var/spack/repos/builtin/packages/meme/package.py13
2 files changed, 47 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/meme/arm.patch b/var/spack/repos/builtin/packages/meme/arm.patch
new file mode 100644
index 0000000000..4bcb0c51ca
--- /dev/null
+++ b/var/spack/repos/builtin/packages/meme/arm.patch
@@ -0,0 +1,36 @@
+--- a/src/mtwist.h 2021-07-14 12:18:25.848290454 +0000
++++ b/src/mtwist.h 2021-07-14 12:37:35.581368981 +0000
+@@ -285,6 +285,7 @@
+ prototypes using the ifdef.
+ */
+ #ifndef __APPLE__
++#ifndef __ARM_LINUX_COMPILER__
+ extern uint32_t mts_lrand(mt_state* state);
+ /* Generate 32-bit value, any gen. */
+ #ifdef UINT64_MAX
+@@ -310,6 +311,7 @@
+ /* Generate floating value */
+ /* Slower, with 64-bit precision */
+ #endif
++#endif
+
+ /*
+ * Tempering parameters. These are perhaps the most magic of all the magic
+@@ -381,10 +383,14 @@
+ #ifdef __cplusplus
+ #define MT_EXTERN /* C++ doesn't need static */
+ #else /* __cplusplus */
+-#ifndef __APPLE__
+-#define MT_EXTERN extern /* C (at least gcc) needs extern */
+-#else
++#ifdef __APPLE__
+ #define MT_EXTERN static /* The apple compiler freaks out if the definitions are not static */
++#else /* __APPLE__ */
++#ifdef __ARM_LINUX_COMPILER__
++#define MT_EXTERN static /* The Arm compiler complains if the definitions are not static */
++#else /* __ARM_LINUX_COMPILER__ */
++#define MT_EXTERN extern /* C (at least gcc) needs extern */
++#endif /* __ARM_LINUX_COMPILER__ */
+ #endif /* __APPLE__ */
+ #endif /* __cplusplus */
+ #endif /* MT_EXTERN */
diff --git a/var/spack/repos/builtin/packages/meme/package.py b/var/spack/repos/builtin/packages/meme/package.py
index bf6b463e52..b26e926464 100644
--- a/var/spack/repos/builtin/packages/meme/package.py
+++ b/var/spack/repos/builtin/packages/meme/package.py
@@ -31,6 +31,10 @@ class Meme(AutotoolsPackage):
depends_on('mpi', when='+mpi')
depends_on('imagemagick', type=('build', 'run'), when='+image-magick')
depends_on('perl-xml-parser', type=('build', 'run'))
+ depends_on('libxml2', type=('build', 'run'))
+ depends_on('libxslt', type=('build', 'run'))
+
+ patch('arm.patch', when='%arm')
def url_for_version(self, version):
url = 'http://meme-suite.org/meme-software/{0}/meme{1}{2}.tar.gz'
@@ -39,8 +43,13 @@ class Meme(AutotoolsPackage):
def configure_args(self):
spec = self.spec
- # have meme build its own versions of libxml2/libxslt, see #6736
- args = ['--enable-build-libxml2', '--enable-build-libxslt']
+ args = []
if '~mpi' in spec:
args += ['--enable-serial']
return args
+
+ def patch(self):
+ # Remove flags not recognized by the NVIDIA compiler
+ if self.spec.satisfies('%nvhpc'):
+ filter_file('-fno-common', '', 'configure')
+ filter_file('-Wno-unused', '', 'configure')