From 515f1466c8e45aa3903084e283808ab75a3f374a Mon Sep 17 00:00:00 2001 From: t-karatsu <49965247+t-karatsu@users.noreply.github.com> Date: Thu, 28 Nov 2019 01:15:22 +0900 Subject: [PATCH] accfft: fix narrowing error. (#13909) --- .../builtin/packages/accfft/fix_narrowing_error.patch | 11 +++++++++++ var/spack/repos/builtin/packages/accfft/package.py | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 var/spack/repos/builtin/packages/accfft/fix_narrowing_error.patch diff --git a/var/spack/repos/builtin/packages/accfft/fix_narrowing_error.patch b/var/spack/repos/builtin/packages/accfft/fix_narrowing_error.patch new file mode 100644 index 0000000000..bdd48cbc1c --- /dev/null +++ b/var/spack/repos/builtin/packages/accfft/fix_narrowing_error.patch @@ -0,0 +1,11 @@ +--- spack-src/include/parUtils.txx.org 2019-11-27 16:41:07.438799437 +0900 ++++ spack-src/include/parUtils.txx 2019-11-27 16:54:51.654921619 +0900 +@@ -70,7 +70,7 @@ + } + omp_par::scan(&s_cnt[0],&s_dsp[0],np+1); + +- size_t range[2]={0,np}; ++ size_t range[2]={0,(unsigned long)np}; + for(size_t np_new=np; np_new>1; np_new/=kway){ + double tt=omp_get_wtime(); + if(kway>np_new) kway=np_new; diff --git a/var/spack/repos/builtin/packages/accfft/package.py b/var/spack/repos/builtin/packages/accfft/package.py index 8c200b76f9..cd2c5b8c9d 100644 --- a/var/spack/repos/builtin/packages/accfft/package.py +++ b/var/spack/repos/builtin/packages/accfft/package.py @@ -24,6 +24,9 @@ class Accfft(CMakePackage, CudaPackage): depends_on('parallel-netcdf', when='+pnetcdf') + # fix error [-Wc++11-narrowing] + patch('fix_narrowing_error.patch') + parallel = False def cmake_args(self):