summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsnehring <7978778+snehring@users.noreply.github.com>2023-07-17 15:33:37 -0500
committerGitHub <noreply@github.com>2023-07-17 13:33:37 -0700
commit1730bcaa31932a7359caa31853557c7a5039186d (patch)
tree12c74e6c884d4517f47aa5b2d156348caad475ec
parente6235a8ff97b38aa169c8883bfd122c781609343 (diff)
downloadspack-1730bcaa31932a7359caa31853557c7a5039186d.tar.gz
spack-1730bcaa31932a7359caa31853557c7a5039186d.tar.bz2
spack-1730bcaa31932a7359caa31853557c7a5039186d.tar.xz
spack-1730bcaa31932a7359caa31853557c7a5039186d.zip
soapdenovo2: strip optimization flags from injected flags (#38846)
* soapdenovo2: strip optimization flags from injected flags * soapdenovo2: add maintainer * soapdenovo2: only append on cflags * soapdenovo2: clean up some wording and implementation
-rw-r--r--var/spack/repos/builtin/packages/soapdenovo2/package.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/soapdenovo2/package.py b/var/spack/repos/builtin/packages/soapdenovo2/package.py
index 4f5708bd89..57f84d00c7 100644
--- a/var/spack/repos/builtin/packages/soapdenovo2/package.py
+++ b/var/spack/repos/builtin/packages/soapdenovo2/package.py
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import re
+
from spack.package import *
@@ -15,16 +17,19 @@ class Soapdenovo2(MakefilePackage):
homepage = "https://github.com/aquaskyline/SOAPdenovo2"
url = "https://github.com/aquaskyline/SOAPdenovo2/archive/r240.tar.gz"
+ maintainers("snehring")
version("242", sha256="a0043ceb41bc17a1c3fd2b8abe4f9029a60ad3edceb2b15af3c2cfabd36aa11b")
version("240", sha256="cc9e9f216072c0bbcace5efdead947e1c3f41f09baec5508c7b90f933a090909")
def flag_handler(self, name, flags):
- if self.spec.satisfies("%gcc@10:"):
- if name == "cflags" or name == "CFLAGS":
- flags.append("-fcommon")
- if name == "cxxflags" or name == "CXXFLAGS":
- flags.append("-fcommon")
+ if name.lower() == "cflags" and self.spec.satisfies("%gcc@10:"):
+ flags.append("-fcommon")
+ if name.lower() in ["cflags", "cxxflags", "cppflags"]:
+ opt_flag = re.compile("-O.*")
+ # This package cannot compile with any optimization flag other
+ # than the -O3 specified in the makefile
+ flags = [f for f in flags if not opt_flag.match(f)]
return (flags, None, None)
def install(self, spec, prefix):