pgplot: Correct building shared libraries (#34846)

This commit is contained in:
Erik Schnetter 2023-01-10 05:20:30 -05:00 committed by GitHub
parent ae3a1618a2
commit 954e241174
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,10 +64,10 @@ def edit(self, spec, prefix):
"@CCOMPL@": spack_cc,
"@CFLAGC@": "-Wall -fPIC -DPG_PPU -O -std=c89 "
+ "-Wno-error=implicit-function-declaration",
"@CFLAGD@": "-O2",
"@CFLAGD@": "-O2 -fPIC",
"@FCOMPL@": spack_fc,
"@FFLAGC@": "-Wall -fPIC -O -ffixed-line-length-none" + fib,
"@FFLAGD@": libs + " -fno-backslash",
"@FFLAGD@": "-fPIC " + libs + " -fno-backslash",
"@LIBS@": libs + " -lgfortran",
"@SHARED_LD@": spack_cc + " -shared -o $SHARED_LIB",
"@SHARED_LIB_LIBS@": libs + " -lgfortran",
@ -167,7 +167,11 @@ def install(self, spec, prefix):
@property
def libs(self):
shared = "+shared" in self.spec
return find_libraries("lib*pgplot", root=self.prefix, shared=shared, recursive=True)
if shared:
libnames = ["libpgplot"]
else:
libnames = ["libcpgplot", "libpgplot"]
return find_libraries(libnames, root=self.prefix, shared=shared, recursive=True)
def setup_run_environment(self, env):
env.set("PGPLOT_FONT", self.prefix.include + "/grfont.dat")