summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Payerle <payerle@umd.edu>2023-09-06 19:18:07 -0400
committerGitHub <noreply@github.com>2023-09-06 16:18:07 -0700
commit743a93902d76095620110dadcfd5e6d7e4208916 (patch)
treece11f6315bc3cb769c04d773d646256776fa78ab
parent5bc5139552c2291e44949852cef4016003e2531f (diff)
downloadspack-743a93902d76095620110dadcfd5e6d7e4208916.tar.gz
spack-743a93902d76095620110dadcfd5e6d7e4208916.tar.bz2
spack-743a93902d76095620110dadcfd5e6d7e4208916.tar.xz
spack-743a93902d76095620110dadcfd5e6d7e4208916.zip
cgns: Add -fPIC to Fortan/C compilation flags (#39700)
* cgns: Add -fPIC to Fortan/C compilation flags This should fix #39699 * cgns: Add -fPIC compilation flags when +fortran Incorporating suggestions of @aumuell with addition of making +pic required when +fortran
-rw-r--r--var/spack/repos/builtin/packages/cgns/package.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cgns/package.py b/var/spack/repos/builtin/packages/cgns/package.py
index 8c43a2fe09..795af5b568 100644
--- a/var/spack/repos/builtin/packages/cgns/package.py
+++ b/var/spack/repos/builtin/packages/cgns/package.py
@@ -46,6 +46,7 @@ class Cgns(CMakePackage):
variant("legacy", default=False, description="Enable legacy options")
variant("mem_debug", default=False, description="Enable memory debugging option")
variant("tools", default=False, description="Enable CGNS tools")
+ variant("pic", default=False, description="Produce position-independent code")
depends_on("cmake@3.12:", when="@4.3:", type="build")
depends_on("cmake@3.8:", when="@4.2:", type="build")
@@ -62,6 +63,8 @@ class Cgns(CMakePackage):
depends_on("libxmu", when="+tools")
depends_on("libsm", when="+tools")
+ conflicts("~pic", when="+fortran", msg="+pic required when +fortran")
+
# patch for error undefined reference to `matherr, see
# https://bugs.gentoo.org/662210
patch("no-matherr.patch", when="@:3.3.1 +tools")
@@ -83,6 +86,7 @@ class Cgns(CMakePackage):
self.define_from_variant("CGNS_ENABLE_BASE_SCOPE", "base_scope"),
self.define_from_variant("CGNS_ENABLE_LEGACY", "legacy"),
self.define_from_variant("CGNS_ENABLE_MEM_DEBUG", "mem_debug"),
+ self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
]
)