atompaw: use autotoolsPackage and support Fujitsu compiler. (#28471)
* atompaw: use autotoolsPackage and support Fujitsu compiler.
This commit is contained in:
parent
73077f3a67
commit
cccd1ce376
@ -0,0 +1,40 @@
|
|||||||
|
--- spack-src/src/io_tools.F90 2021-10-08 13:30:58.000000000 +0900
|
||||||
|
+++ spack-src/src/io_tools.F90.new 2021-10-08 13:30:30.000000000 +0900
|
||||||
|
@@ -12,6 +12,9 @@
|
||||||
|
#if defined (__INTEL_COMPILER)
|
||||||
|
USE IFPORT
|
||||||
|
#endif
|
||||||
|
+#if defined(__FUJITSU)
|
||||||
|
+use service_routines
|
||||||
|
+#endif
|
||||||
|
IMPLICIT NONE
|
||||||
|
|
||||||
|
PRIVATE
|
||||||
|
--- spack-src/src/excor.F90 2021-10-08 16:04:49.000000000 +0900
|
||||||
|
+++ spack-src/src/excor.F90.new 2021-10-08 16:12:28.000000000 +0900
|
||||||
|
@@ -11,6 +11,9 @@
|
||||||
|
|
||||||
|
MODULE excor
|
||||||
|
|
||||||
|
+#if defined(__FUJITSU)
|
||||||
|
+ USE, intrinsic :: ieee_arithmetic
|
||||||
|
+#endif
|
||||||
|
USE io_tools
|
||||||
|
USE Tools
|
||||||
|
USE globalmath
|
||||||
|
@@ -589,8 +592,15 @@
|
||||||
|
deallocate(grad,gradmag,gxc,dgxcdr,dfxcdgbg)
|
||||||
|
! not sure why/if this is needed
|
||||||
|
do i=1,n
|
||||||
|
+#if defined(__FUJITSU)
|
||||||
|
+ if (ieee_support_nan(tmpv(i))) then
|
||||||
|
+ if (ieee_is_nan(tmpv(i))) tmpv(i)=0.d0
|
||||||
|
+ if (ieee_is_nan(exci(i))) exci(i)=0.d0
|
||||||
|
+ endif
|
||||||
|
+#else
|
||||||
|
if (isnan(tmpv(i))) tmpv(i)=0.d0
|
||||||
|
if (isnan(exci(i))) exci(i)=0.d0
|
||||||
|
+#endif
|
||||||
|
enddo
|
||||||
|
elseif (libxc_ismgga()) then
|
||||||
|
write(std_out,*) ' atompaw not yet available for mgga -- stop '
|
@ -7,7 +7,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Atompaw(Package):
|
class Atompaw(AutotoolsPackage):
|
||||||
"""A Projector Augmented Wave (PAW) code for generating
|
"""A Projector Augmented Wave (PAW) code for generating
|
||||||
atom-centered functions.
|
atom-centered functions.
|
||||||
|
|
||||||
@ -30,19 +30,23 @@ class Atompaw(Package):
|
|||||||
depends_on('libxc@:2', when='@:4.0')
|
depends_on('libxc@:2', when='@:4.0')
|
||||||
|
|
||||||
patch('atompaw-4.1.1.0-fix-ifort.patch', when='@4.1.1.0:')
|
patch('atompaw-4.1.1.0-fix-ifort.patch', when='@4.1.1.0:')
|
||||||
|
patch('atompaw-4.1.1.0-fix-fujitsu.patch', when='@4.1.1.0 %fj')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
parallel = False
|
||||||
options = ['--prefix=%s' % prefix]
|
|
||||||
|
|
||||||
|
def flag_handler(self, name, flags):
|
||||||
|
if self.spec.satisfies('%fj') and name == 'fflags':
|
||||||
|
opt_flag_found = any(f in self.compiler.opt_flags for f in flags)
|
||||||
|
if not opt_flag_found:
|
||||||
|
flags.append('-Kfast')
|
||||||
|
return (flags, None, None)
|
||||||
|
|
||||||
|
def configure_args(self):
|
||||||
|
spec = self.spec
|
||||||
linalg = spec['lapack'].libs + spec['blas'].libs
|
linalg = spec['lapack'].libs + spec['blas'].libs
|
||||||
options.extend([
|
return [
|
||||||
"--with-linalg-libs=%s" % linalg.ld_flags,
|
"--with-linalg-libs=%s" % linalg.ld_flags,
|
||||||
"--enable-libxc",
|
"--enable-libxc",
|
||||||
"--with-libxc-incs=-I%s" % spec["libxc"].prefix.include,
|
"--with-libxc-incs=-I%s" % spec["libxc"].prefix.include,
|
||||||
"--with-libxc-libs=-L%s -lxcf90 -lxc" % spec["libxc"].prefix.lib,
|
"--with-libxc-libs=-L%s -lxcf90 -lxc" % spec["libxc"].prefix.lib,
|
||||||
])
|
]
|
||||||
|
|
||||||
configure(*options)
|
|
||||||
make(parallel=False) # parallel build fails
|
|
||||||
make("check")
|
|
||||||
make("install")
|
|
||||||
|
Loading…
Reference in New Issue
Block a user