From 49fe67572e2d3f632ed686957fb9187ebb275b1e Mon Sep 17 00:00:00 2001 From: Daniel Ahlin <50445206+danielahlin@users.noreply.github.com> Date: Thu, 13 Apr 2023 03:19:42 +0200 Subject: gromacs: Intel oneapi 2023 fixes (#36555) * gromacs: oneapi@2023 - g++-dependency and MKL path Fixes to build with oneapi@2023 and MKL 2023. * Depend on gcc and add GMX_GPLUSPLUS_PATH to it * MKL seems to be picked up without explicit directives and the old directives fails (at least for my tests) with MKL 2023. * gromacs: oneapi@2023 fix - address style errors * gromacs: add danielahlin as maintainer Adding danielahlin as maintainer as discussed in https://github.com/spack/spack/pull/36555#issuecomment-1496224128 and https://github.com/spack/spack/pull/36555#issuecomment-1504682712 * Update package.py --------- Co-authored-by: Christoph Junghans Co-authored-by: Christoph Junghans Co-authored-by: Massimiliano Culpo --- var/spack/repos/builtin/packages/gromacs/package.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index 68fcd7c693..70b7f5e023 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -26,7 +26,7 @@ class Gromacs(CMakePackage, CudaPackage): url = "https://ftp.gromacs.org/gromacs/gromacs-2022.2.tar.gz" list_url = "https://ftp.gromacs.org/gromacs" git = "https://gitlab.com/gromacs/gromacs.git" - maintainers("junghans", "marvinbernhardt") + maintainers("danielahlin", "eirrgang", "junghans") version("main", branch="main") version("master", branch="main", deprecated=True) @@ -243,6 +243,7 @@ class Gromacs(CMakePackage, CudaPackage): depends_on("sycl", when="+sycl") depends_on("lapack", when="+lapack") depends_on("blas", when="+blas") + depends_on("gcc", when="%oneapi") depends_on("hwloc@1.0:1", when="+hwloc@2016:2018") depends_on("hwloc", when="+hwloc@2019:") @@ -426,6 +427,9 @@ class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): if self.spec.satisfies("@2020:"): options.append("-DGMX_INSTALL_LEGACY_API=ON") + if self.spec.satisfies("%oneapi"): + options.append("-DGMX_GPLUSPLUS_PATH=%s/g++" % self.spec["gcc"].prefix.bin) + if "+double" in self.spec: options.append("-DGMX_DOUBLE:BOOL=ON") @@ -570,10 +574,13 @@ class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): # fftw-api@3 is provided by intel-mkl or intel-parllel-studio # we use the mkl interface of gromacs options.append("-DGMX_FFT_LIBRARY=mkl") - options.append("-DMKL_INCLUDE_DIR={0}".format(self.spec["mkl"].headers.directories[0])) - # The 'blas' property provides a minimal set of libraries - # that is sufficient for fft. Using full mkl fails the cmake test - options.append("-DMKL_LIBRARIES={0}".format(self.spec["blas"].libs.joined(";"))) + if not self.spec["mkl"].satisfies("@2023:"): + options.append( + "-DMKL_INCLUDE_DIR={0}".format(self.spec["mkl"].headers.directories[0]) + ) + # The 'blas' property provides a minimal set of libraries + # that is sufficient for fft. Using full mkl fails the cmake test + options.append("-DMKL_LIBRARIES={0}".format(self.spec["blas"].libs.joined(";"))) else: # we rely on the fftw-api@3 options.append("-DGMX_FFT_LIBRARY=fftw3") -- cgit v1.2.3-60-g2f50