intel-oneapi-mkl: change logic for gfortran compatibility (#44242)
* [intel-oneapi-mkl]: change logic for gfortran compatibility * review comments Co-authored-by: Rocco Meli <r.meli@bluemail.ch> * warn if fortran-rt and gcc are used without gfortran * remove warning --------- Co-authored-by: Rocco Meli <r.meli@bluemail.ch>
This commit is contained in:
		| @@ -111,6 +111,8 @@ class IntelOneapiMkl(IntelOneApiLibraryPackage): | |||||||
|         expand=False, |         expand=False, | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|  |     variant("gfortran", default=False, description="Compatibility with GNU Fortran") | ||||||
|  | 
 | ||||||
|     variant("shared", default=True, description="Builds shared library") |     variant("shared", default=True, description="Builds shared library") | ||||||
|     variant("ilp64", default=False, description="Build with ILP64 support") |     variant("ilp64", default=False, description="Build with ILP64 support") | ||||||
|     variant( |     variant( | ||||||
| @@ -200,10 +202,16 @@ def _find_mkl_libs(self, shared): | |||||||
|         if self.spec.satisfies("+cluster"): |         if self.spec.satisfies("+cluster"): | ||||||
|             libs.extend([self._xlp64_lib("libmkl_scalapack"), "libmkl_cdft_core"]) |             libs.extend([self._xlp64_lib("libmkl_scalapack"), "libmkl_cdft_core"]) | ||||||
| 
 | 
 | ||||||
|         if self.spec.satisfies("%oneapi") or self.spec.satisfies("%intel"): |         # Explicit variant for compatibility with gfortran, otherwise | ||||||
|             libs.append(self._xlp64_lib("libmkl_intel")) |         # support intel fortran. Be aware that some dependencies may | ||||||
|         else: |         # be using this logic and other dependencies might be using | ||||||
|  |         # cmake for the library list and they have to be consistent. | ||||||
|  |         # https://github.com/spack/spack/pull/43673 for discussion | ||||||
|  |         if self.spec.satisfies("+gfortran"): | ||||||
|  |             depends_on("fortran", type="build") | ||||||
|             libs.append(self._xlp64_lib("libmkl_gf")) |             libs.append(self._xlp64_lib("libmkl_gf")) | ||||||
|  |         else: | ||||||
|  |             libs.append(self._xlp64_lib("libmkl_intel")) | ||||||
| 
 | 
 | ||||||
|         if self.spec.satisfies("threads=tbb"): |         if self.spec.satisfies("threads=tbb"): | ||||||
|             libs.append("libmkl_tbb_thread") |             libs.append("libmkl_tbb_thread") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Robert Cohn
					Robert Cohn