libint: Fix build for 2.6.0, add libs property (#45034)

Signed-off-by: Shane Nehring <snehring@iastate.edu>
This commit is contained in:
snehring 2024-07-22 13:55:34 -05:00 committed by GitHub
parent 350661f027
commit 54f1af5a29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -227,11 +227,18 @@ def build(self, spec, prefix):
# now build the library # now build the library
with working_dir(os.path.join(self.build_directory, "generated")): with working_dir(os.path.join(self.build_directory, "generated")):
if spec.satisfies("@2.6.0"): if spec.satisfies("@2.6.0"):
# see https://github.com/evaleev/libint/issues/144 config_args = [
force_remove( f"--prefix={prefix}",
join_path("include", "libint2", "basis.h"), "--enable-shared",
join_path("include", "libint2", "config.h"), f"--with-boost={spec['boost'].prefix}",
) f"--with-cxx-optflags={self.optflags}",
]
config_args += self.enable_or_disable("debug", activation_value=lambda x: "opt")
config_args += self.enable_or_disable("fortran")
configure = Executable("./configure")
configure(*config_args)
make()
else:
cmake_args = [ cmake_args = [
"..", "..",
f"-DCMAKE_INSTALL_PREFIX={prefix}", f"-DCMAKE_INSTALL_PREFIX={prefix}",
@ -249,12 +256,18 @@ def build(self, spec, prefix):
@when("@2.6.0:") @when("@2.6.0:")
def check(self): def check(self):
with working_dir(os.path.join(self.build_directory, "generated", "build")): path = join_path(self.build_directory, "generated")
if self.spec.satisfies("@2.9.0:"):
path = join_path(path, "build")
with working_dir(path):
make("check") make("check")
@when("@2.6.0:") @when("@2.6.0:")
def install(self, spec, prefix): def install(self, spec, prefix):
with working_dir(os.path.join(self.build_directory, "generated", "build")): path = join_path(self.build_directory, "generated")
if self.spec.satisfies("@2.9.0:"):
path = join_path(path, "build")
with working_dir(path):
make("install") make("install")
@when("@:2.6.0") @when("@:2.6.0")
@ -269,3 +282,7 @@ def patch(self):
"export/fortran/Makefile", "export/fortran/Makefile",
string=True, string=True,
) )
@property
def libs(self):
return find_libraries("libint2", self.spec.prefix, shared=True, recursive=True)