libint: Fix build for 2.6.0, add libs property (#45034)
Signed-off-by: Shane Nehring <snehring@iastate.edu>
This commit is contained in:
parent
350661f027
commit
54f1af5a29
@ -227,34 +227,47 @@ 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}",
|
||||||
cmake_args = [
|
]
|
||||||
"..",
|
config_args += self.enable_or_disable("debug", activation_value=lambda x: "opt")
|
||||||
f"-DCMAKE_INSTALL_PREFIX={prefix}",
|
config_args += self.enable_or_disable("fortran")
|
||||||
"-DLIBINT2_BUILD_SHARED_AND_STATIC_LIBS=ON",
|
configure = Executable("./configure")
|
||||||
]
|
configure(*config_args)
|
||||||
if "+fortran" in spec:
|
|
||||||
cmake_args.append("-DENABLE_FORTRAN=ON")
|
|
||||||
if "+debug" in spec:
|
|
||||||
cmake_args.append("CMAKE_BUILD_TYPE=Debug")
|
|
||||||
cmake = Executable("cmake")
|
|
||||||
mkdirp("build")
|
|
||||||
with working_dir("build"):
|
|
||||||
cmake(*cmake_args)
|
|
||||||
make()
|
make()
|
||||||
|
else:
|
||||||
|
cmake_args = [
|
||||||
|
"..",
|
||||||
|
f"-DCMAKE_INSTALL_PREFIX={prefix}",
|
||||||
|
"-DLIBINT2_BUILD_SHARED_AND_STATIC_LIBS=ON",
|
||||||
|
]
|
||||||
|
if "+fortran" in spec:
|
||||||
|
cmake_args.append("-DENABLE_FORTRAN=ON")
|
||||||
|
if "+debug" in spec:
|
||||||
|
cmake_args.append("CMAKE_BUILD_TYPE=Debug")
|
||||||
|
cmake = Executable("cmake")
|
||||||
|
mkdirp("build")
|
||||||
|
with working_dir("build"):
|
||||||
|
cmake(*cmake_args)
|
||||||
|
make()
|
||||||
|
|
||||||
@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)
|
||||||
|
Loading…
Reference in New Issue
Block a user