name = 'QuantumESPRESSO'
version = '5.4.0'
versionsuffix = '-hybrid'

homepage = 'http://www.pwscf.org/'
description = """Quantum ESPRESSO  is an integrated suite of computer codes
 for electronic-structure calculations and materials modeling at the nanoscale.
 It is based on density-functional theory, plane waves, and pseudopotentials
  (both norm-conserving and ultrasoft)."""

toolchain = {'name': 'foss', 'version': '2016b'}
toolchainopts = {'usempi': True, 'openmp': True}

#  this list was determined from QE 5.4.0 version release 
sources = [
    # Common source
    'espresso-%(version)s.tar.gz',
    'tddfpt-%(version)s.tar.gz',
    # Other sources
    'atomic-%(version)s.tar.gz',
    'neb-%(version)s.tar.gz',
    'PHonon-%(version)s.tar.gz',
    'pwcond-%(version)s.tar.gz',
    'xspectra-%(version)s.tar.gz' ,
    'PWgui-%(version)s.tar.gz' ,
    'EPW-%(version)s.tar.gz' ,
    'test-suite-%(version)s.tar.gz' ,
    'GWW-%(version)s.tar.gz' ,
]
source_urls = [
    'http://files.qe-forge.org/index.php?file=',  # Almost all
    'http://www.qe-forge.org/gf/download/frsrelease/211/968/', # espresso-5.4.0.tar.gz
    # These will not be used because of the 404 signal not found from the previous link.
    'http://www.qe-forge.org/gf/download/frsrelease/211/961/', # PWgui-5.4.0.tar.gz
    'http://www.qe-forge.org/gf/download/frsrelease/211/956/', # tddfpt-5.4.0.tar.gz        
    'http://www.qe-forge.org/gf/download/frsrelease/211/954/', # atomic-5.4.0.tar.gz
    'http://www.qe-forge.org/gf/download/frsrelease/211/959/', # neb-5.4.0.tar.gz
    'http://www.qe-forge.org/gf/download/frsrelease/211/962/', # PHonon-5.4.0.tar.gz
    'http://www.qe-forge.org/gf/download/frsrelease/211/960/', # pwcond-5.4.0.tar.gz
    'http://www.qe-forge.org/gf/download/frsrelease/211/958/', # xspectra-5.4.0.tar.gz
    'http://www.qe-forge.org/gf/download/frsrelease/211/969/', # EPW-5.4.0.tar.gz
    'http://www.qe-forge.org/gf/download/frsrelease/211/963/', # test-suite-5.4.0.tar.gz
    'http://www.qe-forge.org/gf/download/frsrelease/211/957/', # GWW-5.4.0.tar.gz
]

# Hybrid option exists only for backward compatibility, use toolchain option openmp instead.
hybrid = True
# Patch file to avoid the CPP problem generated by different OSes
patches = ['QuantumESPRESSO-5.4.0_fix-f90rule-gfortran.patch']               
  
# packages included in 5.4.0 version of QE. We met errors when try to include gipaw, yambo and someother packages.
buildopts = 'all tddfpt neb xspectra ph '

# parallel build tends to fail
parallel = 1

moduleclass = 'chem'

