From 6810f1fb9d9d450455999b3ef62d487eea6517a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=96hman?= Date: Fri, 24 Apr 2020 20:12:43 +0200 Subject: [PATCH 1/4] Adjust nwchem block for 7 release. Add support for external GA --- easybuild/easyblocks/n/nwchem.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/easybuild/easyblocks/n/nwchem.py b/easybuild/easyblocks/n/nwchem.py index 9d4d136155..d937d80b8e 100644 --- a/easybuild/easyblocks/n/nwchem.py +++ b/easybuild/easyblocks/n/nwchem.py @@ -26,6 +26,7 @@ EasyBuild support for building and installing NWChem, implemented as an easyblock @author: Kenneth Hoste (Ghent University) +@author: Mikael Öhman (Chalmers University of Technology) """ import os import re @@ -142,12 +143,17 @@ def configure_step(self): self.setvar_env_makeopt('NWCHEM_LONG_PATHS', 'Y') env.setvar('NWCHEM_TARGET', self.cfg['target']) - env.setvar('MSG_COMMS', self.cfg['msg_comms']) - env.setvar('ARMCI_NETWORK', self.cfg['armci_network']) - if self.cfg['armci_network'] in ["OPENIB"]: - env.setvar('IB_INCLUDE', "/usr/include") - env.setvar('IB_LIB', "/usr/lib64") - env.setvar('IB_LIB_NAME', "-libumad -libverbs -lpthread") + + garoot = get_software_root('GlobalArrays') + if garoot: + self.setvar_env_makeopt('EXTERNAL_GA_PATH', garoot) + else: + env.setvar('MSG_COMMS', self.cfg['msg_comms']) + env.setvar('ARMCI_NETWORK', self.cfg['armci_network']) + if self.cfg['armci_network'] in ["OPENIB"]: + env.setvar('IB_INCLUDE', "/usr/include") + env.setvar('IB_LIB', "/usr/lib64") + env.setvar('IB_LIB_NAME', "-libumad -libverbs -lpthread") if 'python' in self.cfg['modules']: python_root = get_software_root('Python') @@ -222,8 +228,9 @@ def configure_step(self): raise EasyBuildError("Don't know how to set LIBMPI for %s", mpi_family) env.setvar('LIBMPI', libmpi) - if self.cfg['armci_network'] in ["OPENIB"]: - libmpi += " -libumad -libverbs -lpthread" + if not garoot: + if self.cfg['armci_network'] in ["OPENIB"]: + libmpi += " -libumad -libverbs -lpthread" # compiler optimization flags: set environment variables _and_ add them to list of make options self.setvar_env_makeopt('COPTIMIZE', os.getenv('CFLAGS')) @@ -233,6 +240,9 @@ def configure_step(self): self.setvar_env_makeopt('BLASOPT', '%s -L%s %s %s' % (os.getenv('LDFLAGS'), os.getenv('MPI_LIB_DIR'), os.getenv('LIBSCALAPACK_MT'), libmpi)) + # Setting LAPACK_LIB is required from 7.0.0 onwards. + self.setvar_env_makeopt('LAPACK_LIB', os.getenv('LIBLAPACK')) + self.setvar_env_makeopt('SCALAPACK', '%s %s' % (os.getenv('LDFLAGS'), os.getenv('LIBSCALAPACK_MT'))) if self.toolchain.options['i8']: size = 8 From 63d993c572067324b35ce0fde5fcd09ca4f2a74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=96hman?= Date: Sat, 25 Apr 2020 20:49:17 +0200 Subject: [PATCH 2/4] MPI_LIB_DIR can can contain multiple directories nowdays. Fix broken -L flag for nwchem --- easybuild/easyblocks/n/nwchem.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/easybuild/easyblocks/n/nwchem.py b/easybuild/easyblocks/n/nwchem.py index d937d80b8e..f3c7f656f6 100644 --- a/easybuild/easyblocks/n/nwchem.py +++ b/easybuild/easyblocks/n/nwchem.py @@ -26,7 +26,6 @@ EasyBuild support for building and installing NWChem, implemented as an easyblock @author: Kenneth Hoste (Ghent University) -@author: Mikael Öhman (Chalmers University of Technology) """ import os import re @@ -237,8 +236,8 @@ def configure_step(self): self.setvar_env_makeopt('FOPTIMIZE', os.getenv('FFLAGS')) # BLAS and ScaLAPACK - self.setvar_env_makeopt('BLASOPT', '%s -L%s %s %s' % (os.getenv('LDFLAGS'), os.getenv('MPI_LIB_DIR'), - os.getenv('LIBSCALAPACK_MT'), libmpi)) + MPI_LIB_DIRS = ' '.join('-L' + d for d in os.getenv('MPI_LIB_DIR').split()) + self.setvar_env_makeopt('BLASOPT', ' '.join([os.getenv('LDFLAGS'), MPI_LIB_DIRS, os.getenv('LIBSCALAPACK_MT'), libmpi])) # Setting LAPACK_LIB is required from 7.0.0 onwards. self.setvar_env_makeopt('LAPACK_LIB', os.getenv('LIBLAPACK')) From 29c30c50d81e4bc6c1946087811fe73c1427299b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=96hman?= Date: Sat, 25 Apr 2020 20:51:12 +0200 Subject: [PATCH 3/4] Shorten too long line --- easybuild/easyblocks/n/nwchem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/easybuild/easyblocks/n/nwchem.py b/easybuild/easyblocks/n/nwchem.py index f3c7f656f6..f8e4e8e2c3 100644 --- a/easybuild/easyblocks/n/nwchem.py +++ b/easybuild/easyblocks/n/nwchem.py @@ -237,7 +237,8 @@ def configure_step(self): # BLAS and ScaLAPACK MPI_LIB_DIRS = ' '.join('-L' + d for d in os.getenv('MPI_LIB_DIR').split()) - self.setvar_env_makeopt('BLASOPT', ' '.join([os.getenv('LDFLAGS'), MPI_LIB_DIRS, os.getenv('LIBSCALAPACK_MT'), libmpi])) + self.setvar_env_makeopt('BLASOPT', ' '.join([os.getenv('LDFLAGS'), MPI_LIB_DIRS, + os.getenv('LIBSCALAPACK_MT'), libmpi])) # Setting LAPACK_LIB is required from 7.0.0 onwards. self.setvar_env_makeopt('LAPACK_LIB', os.getenv('LIBLAPACK')) From 0316d6f0e77c83ddf856fcbc27c43b558373995d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=96hman?= Date: Sun, 26 Apr 2020 12:42:20 +0200 Subject: [PATCH 4/4] Fix case for variable --- easybuild/easyblocks/n/nwchem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/n/nwchem.py b/easybuild/easyblocks/n/nwchem.py index f8e4e8e2c3..02e07157c4 100644 --- a/easybuild/easyblocks/n/nwchem.py +++ b/easybuild/easyblocks/n/nwchem.py @@ -236,8 +236,8 @@ def configure_step(self): self.setvar_env_makeopt('FOPTIMIZE', os.getenv('FFLAGS')) # BLAS and ScaLAPACK - MPI_LIB_DIRS = ' '.join('-L' + d for d in os.getenv('MPI_LIB_DIR').split()) - self.setvar_env_makeopt('BLASOPT', ' '.join([os.getenv('LDFLAGS'), MPI_LIB_DIRS, + mpi_lib_dirs = ' '.join('-L' + d for d in os.getenv('MPI_LIB_DIR').split()) + self.setvar_env_makeopt('BLASOPT', ' '.join([os.getenv('LDFLAGS'), mpi_lib_dirs, os.getenv('LIBSCALAPACK_MT'), libmpi])) # Setting LAPACK_LIB is required from 7.0.0 onwards.