Skip to content

Commit 629e6bf

Browse files
committed
add orderings in pkg_config
1 parent 441c607 commit 629e6bf

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

repos/spack_repo/builtin/packages/mumps/package.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ def write_makefile_inc(self):
176176
)
177177

178178
orderings.append("-Dmetis")
179-
179+
if "+pkgconfig" in self.spec:
180+
# Keeping orderings in case we have to create pkg_config files
181+
self.orderings = orderings
180182
makefile_conf.append("ORDERINGSF = %s" % (" ".join(orderings)))
181183

182184
# Determine which compiler suite we are using
@@ -439,7 +441,6 @@ def install(self, spec, prefix):
439441
def create_pkgconfig(self):
440442
"""Create unofficial pkgconfig files for mumps libraries"""
441443
libdir = join_path(self.prefix, "lib")
442-
includedir = join_path(self.prefix, "include")
443444
pkg_path = join_path(libdir, "pkgconfig")
444445
mkdirp(pkg_path)
445446
precision_desc = {
@@ -448,6 +449,7 @@ def create_pkgconfig(self):
448449
"c": "complex single",
449450
"z": "complex double",
450451
}
452+
orderings = ", ".join([ordering[2:] for ordering in self.orderings])
451453
if "+mpi" in self.spec:
452454
parallel_desc = "parallel"
453455
else:
@@ -456,23 +458,21 @@ def create_pkgconfig(self):
456458
if (
457459
("+float" in self.spec and char == "s")
458460
or ("+double" in self.spec and char == "d")
459-
or ("+complex+float" in self.spec and char == "c")
460-
or ("+complex+double" in self.spec and char == "z")
461+
or ("+complex" in self.spec and "+float" in self.spec and char == "c")
462+
or ("+complex" in self.spec and "+double" in self.spec and char == "z")
461463
):
462464
with open(join_path(pkg_path, f"{char}mumps.pc"), "w") as f:
463-
f.write(
464-
f"""prefix={self.prefix}
465+
f.write(f"""prefix={self.prefix}
465466
exec_prefix=${{prefix}}
466-
libdir={libdir}
467-
includedir={includedir}
467+
includedir=${{prefix}}/include
468+
libdir=${{exec_prefix}}/lib
468469
469470
Name: {char}mumps
470-
Description: The {parallel_desc} {precision_desc[char]} MUMPS library
471+
Description: The {parallel_desc} {precision_desc[char]} MUMPS library with the following ordering(s) available: {orderings}
471472
Version: {self.version}
472473
Cflags: -I${{includedir}}
473474
Libs: -L${{libdir}} -l{char}mumps
474-
"""
475-
)
475+
""")
476476

477477
@property
478478
def libs(self):

0 commit comments

Comments
 (0)