diff options
author | snehring <7978778+snehring@users.noreply.github.com> | 2024-07-22 13:55:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-22 20:55:34 +0200 |
commit | 54f1af5a294b5883ece3cf8efc58d15ded357aa9 (patch) | |
tree | 813cc53e8dce1be085432fc73b1f66ba1d370bd5 | |
parent | 350661f0276f84bcafc97d84fe0961a0389069f7 (diff) | |
download | spack-54f1af5a294b5883ece3cf8efc58d15ded357aa9.tar.gz spack-54f1af5a294b5883ece3cf8efc58d15ded357aa9.tar.bz2 spack-54f1af5a294b5883ece3cf8efc58d15ded357aa9.tar.xz spack-54f1af5a294b5883ece3cf8efc58d15ded357aa9.zip |
libint: Fix build for 2.6.0, add libs property (#45034)
Signed-off-by: Shane Nehring <snehring@iastate.edu>
-rw-r--r-- | var/spack/repos/builtin/packages/libint/package.py | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/var/spack/repos/builtin/packages/libint/package.py b/var/spack/repos/builtin/packages/libint/package.py index 151d997690..cb5798b543 100644 --- a/var/spack/repos/builtin/packages/libint/package.py +++ b/var/spack/repos/builtin/packages/libint/package.py @@ -227,34 +227,47 @@ class Libint(AutotoolsPackage): # now build the library with working_dir(os.path.join(self.build_directory, "generated")): if spec.satisfies("@2.6.0"): - # see https://github.com/evaleev/libint/issues/144 - force_remove( - join_path("include", "libint2", "basis.h"), - join_path("include", "libint2", "config.h"), - ) - 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) + config_args = [ + f"--prefix={prefix}", + "--enable-shared", + 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 = [ + "..", + 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:") 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") @when("@2.6.0:") 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") @when("@:2.6.0") @@ -269,3 +282,7 @@ class Libint(AutotoolsPackage): "export/fortran/Makefile", string=True, ) + + @property + def libs(self): + return find_libraries("libint2", self.spec.prefix, shared=True, recursive=True) |