libint: add v2.9.0 (#44776)
Signed-off-by: Shane Nehring <snehring@iastate.edu>
This commit is contained in:
		| @@ -33,6 +33,7 @@ class Libint(AutotoolsPackage): | ||||
| 
 | ||||
|     license("LGPL-3.0-only") | ||||
| 
 | ||||
|     version("2.9.0", sha256="4929b2f2d3e53479270be052e366e8c70fa154a7f309e5c2c23b7d394159687d") | ||||
|     version("2.6.0", sha256="4ae47e8f0b5632c3d2a956469a7920896708e9f0e396ec10071b8181e4c8d9fa") | ||||
|     version("2.4.2", sha256="86dff38065e69a3a51d15cfdc638f766044cb87e5c6682d960c14f9847e2eac3") | ||||
|     version("2.4.1", sha256="0513be124563fdbbc7cd3c7043e221df1bda236a037027ba9343429a27db8ce4") | ||||
| @@ -64,11 +65,16 @@ class Libint(AutotoolsPackage): | ||||
|     depends_on("automake", type="build") | ||||
|     depends_on("libtool", type="build") | ||||
|     depends_on("python", type="build") | ||||
|     depends_on("cmake@3.19:", when="@2.6.0:", type="build") | ||||
| 
 | ||||
|     # Libint 2 dependencies | ||||
|     # Fixme: Can maintainers please confirm that this is a required dependency | ||||
|     depends_on(Boost.with_default_variants, when="@2:") | ||||
|     depends_on("gmp+cxx", when="@2:") | ||||
|     depends_on("eigen", when="@2.7.0:") | ||||
|     # unicode variable names in @2.9.0: | ||||
|     # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67224 | ||||
|     conflicts("%gcc@:9", when="@2.9.0:", msg="libint@2.9.0: requires at least gcc 10") | ||||
| 
 | ||||
|     for tvariant in TUNE_VARIANTS[1:]: | ||||
|         conflicts( | ||||
| @@ -98,10 +104,6 @@ def autoreconf(self, spec, prefix): | ||||
|             aclocal("-I", "lib/autoconf") | ||||
|             autoconf() | ||||
| 
 | ||||
|         if "@2.6.0:" in spec: | ||||
|             # skip tarball creation and removal of dir with generated code | ||||
|             filter_file(r"^(export::.*)\s+tgz$", r"\1", "export/Makefile") | ||||
| 
 | ||||
|     @property | ||||
|     def optflags(self): | ||||
|         flags = "-O2" | ||||
| @@ -212,39 +214,46 @@ def build(self, spec, prefix): | ||||
|         """ | ||||
| 
 | ||||
|         # upstream says that using configure/make for the generated code | ||||
|         # is deprecated and one should use CMake, but with the currently | ||||
|         # recent 2.7.0.b1 it still doesn't work | ||||
|         # first generate the libint compiler | ||||
|         # is deprecated and one should use CMake | ||||
| 
 | ||||
|         # skip tarball creation and removal of dir with generated code | ||||
|         filter_file("&& rm -rf $(EXPORTDIR)", "", "export/Makefile", string=True) | ||||
| 
 | ||||
|         make("export") | ||||
|         # now build the library | ||||
|         with working_dir(os.path.join(self.build_directory, "generated")): | ||||
|             # straight from the AutotoolsPackage class: | ||||
|             config_args = [ | ||||
|                 "--prefix={0}".format(prefix), | ||||
|                 "--enable-shared", | ||||
|                 "--with-boost={0}".format(self.spec["boost"].prefix), | ||||
|                 "--with-cxx-optflags={0}".format(self.optflags), | ||||
|             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", | ||||
|             ] | ||||
|             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() | ||||
|             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")): | ||||
|         with working_dir(os.path.join(self.build_directory, "generated", "build")): | ||||
|             make("check") | ||||
| 
 | ||||
|     @when("@2.6.0:") | ||||
|     def install(self, spec, prefix): | ||||
|         with working_dir(os.path.join(self.build_directory, "generated")): | ||||
|         with working_dir(os.path.join(self.build_directory, "generated", "build")): | ||||
|             make("install") | ||||
|             if "+fortran" in self.spec: | ||||
|                 mkdirp(prefix.include) | ||||
|                 install(join_path("fortran", "*.mod"), prefix.include) | ||||
| 
 | ||||
|     @when("@:2.6.0") | ||||
|     def patch(self): | ||||
|         # Use Fortran compiler to link the Fortran example, not the C++ | ||||
|         # compiler | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 snehring
					snehring