Skip to content

Commit

Permalink
Update sp package (spack#38208)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderRichert-NOAA authored Jun 12, 2023
1 parent d2e0ac4 commit 94e9e18
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions var/spack/repos/builtin/packages/sp/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,28 @@ class Sp(CMakePackage):

maintainers("t-brown", "AlexanderRichert-NOAA", "edwardhartnett", "Hang-Lei-NOAA")

version("2.4.0", sha256="dbb4280e622d2683b68a28f8e3837744adf9bbbb1e7940856e8f4597f481c708")
version("2.3.3", sha256="c0d465209e599de3c0193e65671e290e9f422f659f1da928505489a3edeab99f")

variant("shared", default=False, description="Build shared library", when="@2.4:")
variant("pic", default=False, description="Enable position-independent code (PIC)")

def setup_run_environment(self, env):
for suffix in ("4", "8", "d"):
lib = find_libraries("libsp_" + suffix, root=self.prefix, shared=False, recursive=True)
suffixes = ["4", "d"]
if self.spec.satisfies("@:2.3"):
suffixes += ["8"]
for suffix in suffixes:
lib = find_libraries(
"libsp_" + suffix,
root=self.prefix,
shared=self.spec.satisfies("+shared"),
recursive=True,
)
env.set("SP_LIB" + suffix, lib[0])
env.set("SP_INC" + suffix, "include_" + suffix)

def cmake_args(self):
args = []
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
args.append(self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"))
return args

0 comments on commit 94e9e18

Please sign in to comment.