diff options
author | Toyohisa Kameyama <fj5358cc@fujitsu.com> | 2022-02-05 04:50:55 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 11:50:55 -0800 |
commit | cccd1ce376345d5bcd187dcb637895ccb92ae5d6 (patch) | |
tree | 91403c886716f9ccc21889b9f142a9acbd2f55e4 /var | |
parent | 73077f3a67011818ef503b660af8cd251839f92f (diff) | |
download | spack-cccd1ce376345d5bcd187dcb637895ccb92ae5d6.tar.gz spack-cccd1ce376345d5bcd187dcb637895ccb92ae5d6.tar.bz2 spack-cccd1ce376345d5bcd187dcb637895ccb92ae5d6.tar.xz spack-cccd1ce376345d5bcd187dcb637895ccb92ae5d6.zip |
atompaw: use autotoolsPackage and support Fujitsu compiler. (#28471)
* atompaw: use autotoolsPackage and support Fujitsu compiler.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/atompaw/atompaw-4.1.1.0-fix-fujitsu.patch | 40 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/atompaw/package.py | 24 |
2 files changed, 54 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/atompaw/atompaw-4.1.1.0-fix-fujitsu.patch b/var/spack/repos/builtin/packages/atompaw/atompaw-4.1.1.0-fix-fujitsu.patch new file mode 100644 index 0000000000..e2a8d19198 --- /dev/null +++ b/var/spack/repos/builtin/packages/atompaw/atompaw-4.1.1.0-fix-fujitsu.patch @@ -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 '
diff --git a/var/spack/repos/builtin/packages/atompaw/package.py b/var/spack/repos/builtin/packages/atompaw/package.py index 784551cb02..9fcc2bb56d 100644 --- a/var/spack/repos/builtin/packages/atompaw/package.py +++ b/var/spack/repos/builtin/packages/atompaw/package.py @@ -7,7 +7,7 @@ from spack import * -class Atompaw(Package): +class Atompaw(AutotoolsPackage): """A Projector Augmented Wave (PAW) code for generating atom-centered functions. @@ -30,19 +30,23 @@ class Atompaw(Package): 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-fujitsu.patch', when='@4.1.1.0 %fj') - def install(self, spec, prefix): - options = ['--prefix=%s' % prefix] + parallel = False + 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 - options.extend([ + return [ "--with-linalg-libs=%s" % linalg.ld_flags, "--enable-libxc", "--with-libxc-incs=-I%s" % spec["libxc"].prefix.include, "--with-libxc-libs=-L%s -lxcf90 -lxc" % spec["libxc"].prefix.lib, - ]) - - configure(*options) - make(parallel=False) # parallel build fails - make("check") - make("install") + ] |