OpenMX: add v3.9 (#31466)
Co-authored-by: Marcos Mazzini - <mmazzini@serafin.ccad.unc.edu.ar>
This commit is contained in:
parent
110a35a520
commit
9087224e04
@ -17,6 +17,7 @@ class Openmx(MakefilePackage):
|
|||||||
homepage = "http://www.openmx-square.org/index.html"
|
homepage = "http://www.openmx-square.org/index.html"
|
||||||
url = "https://t-ozaki.issp.u-tokyo.ac.jp/openmx3.8.tar.gz"
|
url = "https://t-ozaki.issp.u-tokyo.ac.jp/openmx3.8.tar.gz"
|
||||||
|
|
||||||
|
version('3.9', sha256='27bb56bd4d1582d33ad32108fb239b546bdd1bdffd6f5b739b4423da1ab93ae2')
|
||||||
version('3.8', sha256='36ee10d8b1587b25a2ca1d57f110111be65c4fb4dc820e6d93e1ed2b562634a1')
|
version('3.8', sha256='36ee10d8b1587b25a2ca1d57f110111be65c4fb4dc820e6d93e1ed2b562634a1')
|
||||||
|
|
||||||
resource(name='patch',
|
resource(name='patch',
|
||||||
@ -25,10 +26,15 @@ class Openmx(MakefilePackage):
|
|||||||
placement='patch',
|
placement='patch',
|
||||||
when='@3.8')
|
when='@3.8')
|
||||||
|
|
||||||
|
resource(name='patch',
|
||||||
|
url='http://www.openmx-square.org/bugfixed/21Oct17/patch3.9.9.tar.gz',
|
||||||
|
sha256='20cccc4e3412a814a53568f400260e90f79f0bfb7e2bed84447fe071b26edd38',
|
||||||
|
placement='patch',
|
||||||
|
when='@3.9')
|
||||||
|
|
||||||
depends_on('mpi')
|
depends_on('mpi')
|
||||||
depends_on('fftw')
|
depends_on('fftw-api@3')
|
||||||
depends_on('blas')
|
depends_on('scalapack')
|
||||||
depends_on('lapack')
|
|
||||||
depends_on('sse2neon', when='target=aarch64:')
|
depends_on('sse2neon', when='target=aarch64:')
|
||||||
|
|
||||||
patch('for_aarch64.patch', when='@3.8 target=aarch64:')
|
patch('for_aarch64.patch', when='@3.8 target=aarch64:')
|
||||||
@ -41,6 +47,10 @@ def edit(self, spec, prefix):
|
|||||||
# Move contents to source/
|
# Move contents to source/
|
||||||
# http://www.openmx-square.org/bugfixed/18June12/README.txt
|
# http://www.openmx-square.org/bugfixed/18June12/README.txt
|
||||||
copy_tree('patch', 'source')
|
copy_tree('patch', 'source')
|
||||||
|
# Move extra file for 3.9 patch
|
||||||
|
# http://www.openmx-square.org/bugfixed/21Oct17/README.txt
|
||||||
|
if spec.satisfies('@3.9'):
|
||||||
|
copy(join_path('source', 'kpoint.in'), 'work')
|
||||||
makefile = FileFilter('./source/makefile')
|
makefile = FileFilter('./source/makefile')
|
||||||
makefile.filter('^DESTDIR.*$', 'DESTDIR = {0}/bin'.format(prefix))
|
makefile.filter('^DESTDIR.*$', 'DESTDIR = {0}/bin'.format(prefix))
|
||||||
mkdirp(prefix.bin)
|
mkdirp(prefix.bin)
|
||||||
@ -48,20 +58,27 @@ def edit(self, spec, prefix):
|
|||||||
@property
|
@property
|
||||||
def common_arguments(self):
|
def common_arguments(self):
|
||||||
spec, common_option = self.spec, []
|
spec, common_option = self.spec, []
|
||||||
|
lapack_blas_libs = (
|
||||||
lapack_blas_libs = spec['lapack'].libs + spec['blas'].libs
|
spec['lapack'].libs +
|
||||||
lapack_blas_headers = spec['lapack'].headers + spec['blas'].headers
|
spec['blas'].libs +
|
||||||
|
spec['scalapack'].libs
|
||||||
|
)
|
||||||
cc_option = [
|
cc_option = [
|
||||||
spec['mpi'].mpicc,
|
spec['mpi'].mpicc,
|
||||||
self.compiler.openmp_flag,
|
self.compiler.openmp_flag,
|
||||||
spec['fftw'].headers.include_flags
|
spec['fftw-api'].headers.include_flags
|
||||||
]
|
]
|
||||||
fc_option = [spec['mpi'].mpifc]
|
fc_option = [spec['mpi'].mpifc]
|
||||||
lib_option = [
|
lib_option = [
|
||||||
spec['fftw'].libs.ld_flags,
|
spec['fftw-api'].libs.ld_flags,
|
||||||
lapack_blas_libs.ld_flags,
|
lapack_blas_libs.ld_flags,
|
||||||
'-lmpi_mpifh'
|
'-lmpi_mpifh'
|
||||||
]
|
]
|
||||||
|
if spec.satisfies('@3.8'):
|
||||||
|
cc_option.append('-I$(LIBERIDIR)')
|
||||||
|
if spec.satisfies('@3.9'):
|
||||||
|
lib_option.extend(['-lmpi_usempif08'])
|
||||||
|
lib_option.extend(['-lmpi_usempi_ignore_tkr'])
|
||||||
|
|
||||||
if '%fj' in spec:
|
if '%fj' in spec:
|
||||||
common_option.append('-Dkcomp -Kfast')
|
common_option.append('-Dkcomp -Kfast')
|
||||||
@ -69,12 +86,14 @@ def common_arguments(self):
|
|||||||
fc_option.append(self.compiler.openmp_flag)
|
fc_option.append(self.compiler.openmp_flag)
|
||||||
else:
|
else:
|
||||||
common_option.append('-O3')
|
common_option.append('-O3')
|
||||||
common_option.append(lapack_blas_headers.include_flags)
|
|
||||||
if '%gcc' in spec:
|
if '%gcc' in spec:
|
||||||
lib_option.append('-lgfortran')
|
lib_option.append('-lgfortran')
|
||||||
|
if spec.satisfies('%gcc@10:'):
|
||||||
|
fc_option.append('-fallow-argument-mismatch')
|
||||||
|
cc_option.append('-fcommon')
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'CC={0} {1} -I$(LIBERIDIR)'.format(
|
'CC={0} -Dscalapack {1} '.format(
|
||||||
' '.join(cc_option), ' '.join(common_option)
|
' '.join(cc_option), ' '.join(common_option)
|
||||||
),
|
),
|
||||||
'FC={0} {1}'.format(' '.join(fc_option), ' '.join(common_option)),
|
'FC={0} {1}'.format(' '.join(fc_option), ' '.join(common_option)),
|
||||||
@ -83,10 +102,7 @@ def common_arguments(self):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def build_targets(self):
|
def build_targets(self):
|
||||||
return [
|
return ['all'] + self.common_arguments
|
||||||
'openmx', 'DosMain', 'jx', 'analysis_example', 'esp', 'polB',
|
|
||||||
'bandgnu13', 'bin2txt', 'cube2xsf', 'intensity_map', 'md2axsf'
|
|
||||||
] + self.common_arguments
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def install_targets(self):
|
def install_targets(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user