Skip to content

Commit

Permalink
Merge pull request spack#311 from AlexanderRichert-NOAA/bufr_inc_fix
Browse files Browse the repository at this point in the history
Fix BUFR_INC variables for bufr recipe & add MADIS 4.5
  • Loading branch information
AlexanderRichert-NOAA committed Aug 28, 2023
2 parents 015c839 + 0dc2b9e commit 6291ec9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion var/spack/repos/builtin/packages/bufr/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _setup_bufr_environment(self, env, suffix):
lib = find_libraries(libname + append, root=self.prefix, shared=shared, recursive=True)
lib_envname = "BUFR_LIB{0}".format(suffix) + append
inc_envname = "BUFR_INC{0}".format(suffix) + append
include_dir = "include_{0}".format(suffix)
include_dir = "{0}_{1}".format(self.prefix.include.bufr, suffix)

env.set(lib_envname, lib[0])
env.set(inc_envname, include_dir)
Expand Down
9 changes: 5 additions & 4 deletions var/spack/repos/builtin/packages/madis/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Madis(MakefilePackage):

maintainers("AlexanderRichert-NOAA")

version("4.5", sha256="66376c72ade6b06a5392ad8b4b7a338efbf4d82ff6f7f33648ca316738808e6f")
version("4.3", sha256="5d1ee9800c84e623dcf4271653aa66d17a744143e58354e70f8a0646cd6b246c")

variant("pic", default=True, description="Build with position-independent code (PIC)")
Expand All @@ -32,28 +33,28 @@ class Madis(MakefilePackage):
def setup_build_environment(self, env):
fflags = []
if self.spec.satisfies("%gcc@10:"):
fflags += ["-fallow-argument-mismatch"]
fflags.append("-fallow-argument-mismatch")

if self.spec.satisfies("+pic"):
fflags += ["-fPIC"]
fflags.append("-fPIC")

env.set("FFLAGS", " ".join(fflags))

ldflags = []
libs = []

if self.spec.satisfies("+pnetcdf"):
libs = []
pnetcdf = self.spec["parallel-netcdf"]
ldflags.append(pnetcdf.libs.ld_flags)
libs.append(pnetcdf.libs.link_flags)
env.set("LIBS", " ".join(libs))

nfconfig = which(os.path.join(self.spec["netcdf-fortran"].prefix.bin, "nf-config"))
ldflags.append(nfconfig("--flibs", output=str).strip())
netcdf_f = self.spec["netcdf-fortran"]
env.set("NETCDF_INC", netcdf_f.prefix.include)

env.set("NETCDF_LIB", " ".join(ldflags))
env.set("LIBS", " ".join(libs))

def build(self, spec, prefix):
with working_dir("src"):
Expand Down

0 comments on commit 6291ec9

Please sign in to comment.