Skip to content

Commit

Permalink
Merge pull request #2043 from Micket/nwchem_7
Browse files Browse the repository at this point in the history
add support for building NWChem on top of external GlobalArrays + also define $LAPACK_LIB (required for NWChem 7.x)
  • Loading branch information
boegel authored Apr 26, 2020
2 parents 3f5eb1d + 0316d6f commit 4d3ea06
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions easybuild/easyblocks/n/nwchem.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,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')
Expand Down Expand Up @@ -222,16 +227,21 @@ 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'))
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'))

self.setvar_env_makeopt('SCALAPACK', '%s %s' % (os.getenv('LDFLAGS'), os.getenv('LIBSCALAPACK_MT')))
if self.toolchain.options['i8']:
Expand Down

0 comments on commit 4d3ea06

Please sign in to comment.