# IT4Innovations 2022
# JK

easyblock = 'MakeCp'

name = 'PSPFFT'
version = '1.0'

homepage = 'http://eagle.phys.utk.edu/pspfft/trac/'
description = """PSPFFT is a library to solve Poisson's equation for an isolated system on a three-dimensional unigrid mesh using FFTs. The solver is parallelized using MPI. An arbitrary number of processors may be used (subject to some constraints). The program has been tested on from 1 up to 13,000 MPI processes."""

toolchain = {'name': 'intel', 'version': '2021b'}
toolchainopts = {'usempi': True, 'openmp': False} 

source_urls = ['http://eagle.phys.utk.edu/pspfft/trac/raw-attachment/wiki/Download/']
sources = ['%(namelower)s-%(version)s.tar.gz']
patches = ['pspfft-1.0-intel-2021b-makefile-setup.patch']
checksums = [
    '8cd62f350271af54cf7d3119201cbdff3e26cd6447558f79e3711b8f8a9e0207',  # pspfft-1.0.tar.gz
    '849abfb25aee9c85926e30f4e92d2f53b83f8f389572d7369aacb627e16253a1',  # pspfft-1.0-intel-2021b-makefile-setup.patch
]

build_cmd = 'cd Build && make '
postinstallcmds = [
    ' cd Build && make install && cd ../ ',
    ' mkdir -p %(installdir)s/lib ',
    ' mkdir -p %(installdir)s/include ',
    ' cp %(builddir)s/%(namelower)s-%(version)s/install/include/* %(installdir)s/include ',
    ' cp %(builddir)s/%(namelower)s-%(version)s/install/lib/libpspfft.a %(installdir)s/lib '
]

files_to_copy = ''

sanity_check_paths = {
    'files': ['lib/libpspfft.a'],
    'dirs': ['lib', 'include']
}

moduleclass = 'phys'
