diff options
author | a.kudelin | 2020-08-24 09:34:33 +0300 |
---|---|---|
committer | a.kudelin | 2020-08-24 09:34:33 +0300 |
commit | 686b060913877f06f0909dcd9d52cd7ee6cb04c3 (patch) | |
tree | bec0a1bc8633cef9eacf298beb0d9748ca43b839 | |
parent | fb5e7e5023399cc482df708a2006f453bb267bc5 (diff) | |
download | aur-686b060913877f06f0909dcd9d52cd7ee6cb04c3.tar.gz |
Update for GCC 10
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | PKGBUILD | 68 | ||||
-rw-r--r-- | basic.psmp | 20 | ||||
-rw-r--r-- | cuda.psmp | 25 | ||||
-rw-r--r-- | cuda_plumed.psmp | 27 | ||||
-rw-r--r-- | lapack.patch | 35 | ||||
-rw-r--r-- | plumed.psmp | 22 |
7 files changed, 137 insertions, 74 deletions
@@ -1,7 +1,7 @@ pkgbase = cp2k pkgdesc = A quantum chemistry and solid state physics software package pkgver = 7.1.0 - pkgrel = 2 + pkgrel = 3 url = https://www.cp2k.org arch = x86_64 license = GPL2 @@ -11,7 +11,7 @@ pkgbase = cp2k makedepends = sed depends = fftw depends = elpa - depends = libxc + depends = libxc<5.0 depends = libint2 depends = libxsmm depends = spglib @@ -27,12 +27,14 @@ pkgbase = cp2k source = cuda_plumed.psmp source = cuda.psmp source = plumed.psmp + source = lapack.patch sha256sums = e244f76d7e1e98da7e4e4b2e6cefb723fa1205cfae4f94739413be74952e8b4e sha256sums = 1e283a3b9ce90bda321d77f4fa611b09a7eaad167d7bc579b2e9311f7b97b5ec - sha256sums = ecbb19d6f40bf28abd7b4771e6ad0df899634f31d11ac2da89e58becb01f3ec3 - sha256sums = db6654c5d62f09a1ab166e5f82969f5cbf304cba633a286afd262eb048f5c5f0 - sha256sums = e9c97e220257d0ecf9bec4bd9aaa64c348416286fffc82d2d6f6ceda333196e8 - sha256sums = 514d6ea683bb7b904df804e258f9de18274088fc0184a56c2fd4827aa0ae63fe + sha256sums = f1e92ff252a3ee814b63111928dfdda9f9d1fd2e18a3de7a0a3e8d3629628a44 + sha256sums = 8e130a0cd75a66efc9bd8765cf3b8e081611e8f45d1f0851d3d8e8a76d93f78c + sha256sums = ac1ffe638743453234e447c6996e9c0786d67efbd4c9e3ee95142eacb45d2ad1 + sha256sums = 70af5b75ef78a27ff996867dddcedd8d265ac2609cb2a0304ff45100f854af2b + sha256sums = f566a9941f27c9d55c528acf0aacbb8ed686067777ce48f1e206432d259ee8a1 pkgname = cp2k @@ -4,12 +4,16 @@ pkgname=cp2k pkgver=7.1.0 _dbcsrver=2.0.1 -pkgrel=2 +pkgrel=3 +# NVIDIA GPU Generation: Kepler, Pascal, or Volta; +# please specify one closest to yours or leave unchanged +# if CUDA isn't supposed to be used +_GPU=Kepler pkgdesc="A quantum chemistry and solid state physics software package" arch=("x86_64") url="https://www.cp2k.org" license=("GPL2") -depends=('fftw' 'elpa' 'libxc' 'libint2' 'libxsmm' 'spglib') +depends=('fftw' 'elpa' 'libxc<5.0' 'libint2' 'libxsmm' 'spglib') makedepends=('gcc-fortran' 'python' 'sed') checkdepends=('numactl') optdepends=('cuda: GPU calculations support' @@ -21,40 +25,43 @@ source=("https://github.com/cp2k/cp2k/archive/v$pkgver.tar.gz" "basic.psmp" "cuda_plumed.psmp" "cuda.psmp" - "plumed.psmp") + "plumed.psmp" + "lapack.patch") sha256sums=('e244f76d7e1e98da7e4e4b2e6cefb723fa1205cfae4f94739413be74952e8b4e' '1e283a3b9ce90bda321d77f4fa611b09a7eaad167d7bc579b2e9311f7b97b5ec' - 'ecbb19d6f40bf28abd7b4771e6ad0df899634f31d11ac2da89e58becb01f3ec3' - 'db6654c5d62f09a1ab166e5f82969f5cbf304cba633a286afd262eb048f5c5f0' - 'e9c97e220257d0ecf9bec4bd9aaa64c348416286fffc82d2d6f6ceda333196e8' - '514d6ea683bb7b904df804e258f9de18274088fc0184a56c2fd4827aa0ae63fe') + 'f1e92ff252a3ee814b63111928dfdda9f9d1fd2e18a3de7a0a3e8d3629628a44' + '8e130a0cd75a66efc9bd8765cf3b8e081611e8f45d1f0851d3d8e8a76d93f78c' + 'ac1ffe638743453234e447c6996e9c0786d67efbd4c9e3ee95142eacb45d2ad1' + '70af5b75ef78a27ff996867dddcedd8d265ac2609cb2a0304ff45100f854af2b' + 'f566a9941f27c9d55c528acf0aacbb8ed686067777ce48f1e206432d259ee8a1') prepare() { - cd $srcdir/$pkgname-$pkgver - + cd "$srcdir/$pkgname-$pkgver" + # Prepare DBCSR - cp -r $srcdir/dbcsr-$_dbcsrver/* exts/dbcsr - + cp -r ../dbcsr-$_dbcsrver/* exts/dbcsr + patch -p1 < ../lapack.patch + # Set up the default build environment export _buildmode=0 export _arch="basic" export _corenumber=$( grep -c ^processor /proc/cpuinfo ) export _elpaver=$( ls /usr/include | grep elpa | sed 's/elpa_openmp-//g' ) export _plumed=$( find /usr/lib -maxdepth 1 -type d -name "plumed*" | awk -F'/' '{print $4}' ) - + # Enable additional features if [ $( echo -n $( which nvcc) | tail -c 4 ) == nvcc ] then echo "Adding CUDA support" _buildmode=$((_buildmode | 1)) fi - + if [[ $_plumed ]] then echo "Adding PLUMED support" _buildmode=$((_buildmode | 2)) fi - + case $_buildmode in 0) _arch="basic" @@ -70,33 +77,46 @@ prepare() { ;; esac + case $_GPU in + Kepler) + export _gpuver=K20X + ;; + Pascal) + export _gpuver=P100 + ;; + Volta) + export _gpuver=V100 + ;; + esac + # Move arch-file into a proper directory mv ../$_arch.psmp arch - + # Changing the location of the data directory sed -i 's@$(CP2KHOME)/data@/usr/share/cp2k/data@g' Makefile } build() { - cd $srcdir/$pkgname-$pkgver + cd "$srcdir/$pkgname-$pkgver" make ARCH=$_arch VERSION=psmp } check() { export DATA_DIR=$srcdir/$pkgname-$pkgver/data cd $srcdir/$pkgname-$pkgver/tools/regtesting - + # In the case of a test failure you must examine it carefully # because it can lead to an unpredictable error during a production run. ./do_regtest -cp2kdir ../.. -version psmp -arch $_arch -nobuild -maxtasks $_corenumber } package() { - cd $srcdir/$pkgname-$pkgver/exe/$_arch - install -dm755 $pkgdir/usr/{bin,share/$pkgname} - install -Dm755 cp2k.psmp $pkgdir/usr/bin/cp2k - install -Dm755 cp2k_shell.psmp $pkgdir/usr/bin/cp2k-shell - install -Dm755 graph.psmp $pkgdir/usr/bin/cp2k-graph - cp -r ../../data $pkgdir/usr/share/$pkgname - chmod -R 755 $pkgdir/usr/share/$pkgname + cd "$pkgdir" + install -dm755 usr/{bin,share/$pkgname} + cd "$srcdir/$pkgname-$pkgver/exe/$_arch" + install -Dm755 cp2k.psmp "$pkgdir/usr/bin/cp2k" + install -Dm755 cp2k_shell.psmp "$pkgdir/usr/bin/cp2k-shell" + install -Dm755 graph.psmp "$pkgdir/usr/bin/cp2k-graph" + cp -r ../../data "$pkgdir/usr/share/$pkgname" + chmod -R 755 "$pkgdir/usr/share/$pkgname" } diff --git a/basic.psmp b/basic.psmp index 84fe96a38002..c9cf595bce4f 100644 --- a/basic.psmp +++ b/basic.psmp @@ -3,9 +3,9 @@ CXX = g++ CPP = FC = mpifort LD = mpifort -# + AR = ar -r -# + DFLAGS = -D__FFTW3 \ -D__LIBINT \ -D__parallel -D__SCALAPACK \ @@ -13,21 +13,23 @@ DFLAGS = -D__FFTW3 \ -D__LIBXSMM \ -D__LIBXC \ -D__SPGLIB -# + INCS = -I/usr/include \ -I/usr/include/elpa_openmp-$(_elpaver)/elpa \ -I/usr/include/elpa_openmp-$(_elpaver)/modules -# -OPTFLAGS = -O3 -march=native -fopenmp -ftree-vectorize -# + +OPTFLAGS = -O2 -march=native -fopenmp + CFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) CXXFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) -std=c++11 CPPFLAGS = FCFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) \ - -ffree-form -ffree-line-length-none -# + -ffree-form -ffree-line-length-none \ + -fallow-argument-mismatch \ + -fno-tree-loop-vectorize + LDFLAGS = $(FCFLAGS) -# + LIBS = -lxsmmf -lxsmm \ -lelpa_openmp -lscalapack -lblas -llapack \ -lfftw3 -lfftw3_threads \ diff --git a/cuda.psmp b/cuda.psmp index a68ce090532f..6e9754e124b5 100644 --- a/cuda.psmp +++ b/cuda.psmp @@ -3,12 +3,12 @@ CXX = g++ CPP = FC = mpifort LD = mpifort -# + NVCC = nvcc -GPUVER = K20X -# +GPUVER = $(_gpuver) + AR = ar -r -# + DFLAGS = -D__FFTW3 \ -D__LIBINT \ -D__parallel -D__SCALAPACK \ @@ -17,21 +17,22 @@ DFLAGS = -D__FFTW3 \ -D__LIBXC \ -D__SPGLIB \ -D__ACC -D__DBCSR_ACC -D__PW_CUDA -# + INCS = -I/usr/include \ -I/usr/include/elpa_openmp-$(_elpaver)/elpa \ -I/usr/include/elpa_openmp-$(_elpaver)/modules \ -I/opt/cuda/include -# -OPTFLAGS = -O3 -march=native -fopenmp -ftree-vectorize -# + +OPTFLAGS = -O3 -march=native -fopenmp + CFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) CXXFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) -std=c++11 CPPFLAGS = FCFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) \ - -ffree-form -ffree-line-length-none + -ffree-form -ffree-line-length-none \ + -fallow-argument-mismatch \ + -fno-tree-loop-vectorize NVFLAGS = $(DFLAGS) -O3 -Xcompiler="-fopenmp" \ - -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_35,code=sm_35 \ -gencode arch=compute_37,code=sm_37 \ -gencode arch=compute_50,code=sm_50 \ @@ -39,9 +40,9 @@ NVFLAGS = $(DFLAGS) -O3 -Xcompiler="-fopenmp" \ -gencode arch=compute_61,code=sm_61 \ -gencode arch=compute_70,code=sm_70 \ -gencode arch=compute_75,code=sm_75 -# + LDFLAGS = $(FCFLAGS) -# + LIBS = -L/opt/cuda/lib64 -lcudart -lcuda \ -lcublas -lcufft -lrt -lnvrtc \ -lxsmmf -lxsmm \ diff --git a/cuda_plumed.psmp b/cuda_plumed.psmp index 96b3174d250c..31a036ec791e 100644 --- a/cuda_plumed.psmp +++ b/cuda_plumed.psmp @@ -3,12 +3,12 @@ CXX = g++ CPP = FC = mpifort LD = mpifort -# + NVCC = nvcc -GPUVER = K20X -# +GPUVER = $(_gpuver) + AR = ar -r -# + DFLAGS = -D__FFTW3 \ -D__LIBINT \ -D__parallel -D__SCALAPACK \ @@ -18,21 +18,22 @@ DFLAGS = -D__FFTW3 \ -D__SPGLIB \ -D__ACC -D__DBCSR_ACC -D__PW_CUDA \ -D__PLUMED2 -# + INCS = -I/usr/include \ -I/usr/include/elpa_openmp-$(_elpaver)/elpa \ -I/usr/include/elpa_openmp-$(_elpaver)/modules \ -I/opt/cuda/include -# -OPTFLAGS = -O3 -march=native -fopenmp -ftree-vectorize -# + +OPTFLAGS = -O2 -march=native -fopenmp + CFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) CXXFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) -std=c++11 CPPFLAGS = FCFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) \ - -ffree-form -ffree-line-length-none + -ffree-form -ffree-line-length-none \ + -fallow-argument-mismatch \ + -fno-tree-loop-vectorize NVFLAGS = $(DFLAGS) -O3 -Xcompiler="-fopenmp" \ - -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_35,code=sm_35 \ -gencode arch=compute_37,code=sm_37 \ -gencode arch=compute_50,code=sm_50 \ @@ -40,9 +41,9 @@ NVFLAGS = $(DFLAGS) -O3 -Xcompiler="-fopenmp" \ -gencode arch=compute_61,code=sm_61 \ -gencode arch=compute_70,code=sm_70 \ -gencode arch=compute_75,code=sm_75 -# + LDFLAGS = $(FCFLAGS) -# + LIBS = -L/opt/cuda/lib64 -lcudart -lcuda \ -lcublas -lcufft -lrt -lnvrtc \ -lxsmmf -lxsmm \ @@ -53,5 +54,5 @@ LIBS = -L/opt/cuda/lib64 -lcudart -lcuda \ -lsymspg \ -l$(_plumed) \ -lstdc++ -lpthread -lm -ldl -lz -# + include /usr/lib/$(_plumed)/src/lib/Plumed.inc diff --git a/lapack.patch b/lapack.patch new file mode 100644 index 000000000000..42c30c31c45d --- /dev/null +++ b/lapack.patch @@ -0,0 +1,35 @@ +diff --color -Naur cp2k-7.1.0/exts/dbcsr/src/block/dbcsr_block_access.f90 cp2k-7.1.0/exts/dbcsr/src/block/dbcsr_block_access.f90 +--- cp2k-7.1.0/exts/dbcsr/src/block/dbcsr_block_access.f90 2020-08-23 20:35:29.901247410 +0300 ++++ cp2k-7.1.0/exts/dbcsr/src/block/dbcsr_block_access.f90 2020-08-23 20:50:07.031730990 +0300 +@@ -432,8 +432,8 @@ + data_block, found, data_block2, replace=.FALSE.) + IF (found) THEN + IF (nze > 0) & +- CALL ${nametype1}$axpy(nze, ${one1[n]}$, block(1), 1, & +- data_block2%p(1, 1), 1) ++ CALL ${nametype1}$axpy(nze, ${one1[n]}$, block, 1, & ++ data_block2%p, 1) + IF (.NOT. ASSOCIATED(data_block%p)) & + DBCSR_WARN("Data was not present in block") + IF (ASSOCIATED(data_block%p)) DEALLOCATE (data_block%p) +diff --color -Naur cp2k-7.1.0/exts/dbcsr_old/src/tas/dbcsr_tas_test.F cp2k-7.1.0/exts/dbcsr/src/tas/dbcsr_tas_test.F +--- cp2k-7.1.0/exts/dbcsr_old/src/tas/dbcsr_tas_test.F 2020-08-23 20:35:29.931248791 +0300 ++++ cp2k-7.1.0/exts/dbcsr/src/tas/dbcsr_tas_test.F 2020-08-23 20:51:02.614321285 +0300 +@@ -79,7 +79,7 @@ + INTEGER(KIND=int_8) :: col, col_s, row, row_s + INTEGER, DIMENSION(2) :: pcoord, pdims + LOGICAL :: reuse_comm_prv, tr +- REAL(KIND=real_8) :: rn ++ REAL(KIND=real_8), DIMENSION(1) :: rn + REAL(KIND=real_8), ALLOCATABLE, DIMENSION(:, :) :: values + TYPE(dbcsr_tas_blk_size_arb) :: cbsize_obj, rbsize_obj + TYPE(dbcsr_tas_dist_cyclic) :: col_dist_obj, row_dist_obj +@@ -125,7 +125,7 @@ + DO row = 1, dbcsr_tas_nblkrows_total(matrix) + DO col = 1, dbcsr_tas_nblkcols_total(matrix) + CALL RANDOM_NUMBER(rn) +- IF (rn .LT. sparsity) THEN ++ IF (rn(1) .LT. sparsity) THEN + tr = .FALSE. + row_s = row; col_s = col + CALL dbcsr_tas_get_stored_coordinates(matrix, row_s, col_s, node_holds_blk) diff --git a/plumed.psmp b/plumed.psmp index 230f30f1bf32..9e8a1ea4bc96 100644 --- a/plumed.psmp +++ b/plumed.psmp @@ -3,9 +3,9 @@ CXX = g++ CPP = FC = mpifort LD = mpifort -# + AR = ar -r -# + DFLAGS = -D__FFTW3 \ -D__LIBINT \ -D__parallel -D__SCALAPACK \ @@ -14,21 +14,23 @@ DFLAGS = -D__FFTW3 \ -D__LIBXC \ -D__SPGLIB \ -D__PLUMED2 -# + INCS = -I/usr/include \ -I/usr/include/elpa_openmp-$(_elpaver)/elpa \ -I/usr/include/elpa_openmp-$(_elpaver)/modules -# -OPTFLAGS = -O3 -march=native -fopenmp -ftree-vectorize -# + +OPTFLAGS = -O2 -march=native -fopenmp + CFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) CXXFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) -std=c++11 CPPFLAGS = FCFLAGS = $(DFLAGS) $(INCS) $(OPTFLAGS) \ - -ffree-form -ffree-line-length-none -# + -ffree-form -ffree-line-length-none \ + -fallow-argument-mismatch \ + -fno-tree-loop-vectorize + LDFLAGS = $(FCFLAGS) -# + LIBS = -lxsmmf -lxsmm \ -lelpa_openmp -lscalapack -lblas -llapack \ -lfftw3 -lfftw3_threads \ @@ -37,5 +39,5 @@ LIBS = -lxsmmf -lxsmm \ -lsymspg \ -l$(_plumed) \ -lstdc++ -lpthread -lm -ldl -lz -# + include /usr/lib/$(_plumed)/src/lib/Plumed.inc |