mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-21 06:25:15 -04:00
Enabling calculations with ECPs (libgrpp library)
This commit is contained in:
parent
03c4f52a6f
commit
2b286a57fc
16 changed files with 1397 additions and 473 deletions
10
INSTALL.md
10
INSTALL.md
|
|
@ -424,6 +424,15 @@ functions replacing the dgemm calls with `offload_dgemm` will eventually be offl
|
|||
The SPLA library has internal criteria to decide if it is worth to do the operation on GPU or not.
|
||||
Calls to `offload_dgemm` also accept pointers on GPU or a combination of them.
|
||||
|
||||
### 2y. libgrpp (optional, enables calculations with ECPs)
|
||||
|
||||
- libgrpp is a library for the calculation of integrals with GTOs and ECPs
|
||||
- The libgrpp library can be found under <https://github.com/aoleynichenko/libgrpp>
|
||||
- During the installation, the directories `$(LIBGRPP_DIR)/lib` and `$(LIBGRPP_DIR)/include` are
|
||||
created.
|
||||
- Add `-D__LIBGRPP` to DFLAGS, `-I$(LIBGRPP_DIR)/include` to FCFLAGS and
|
||||
`-L$(LIBGRPP_DIR)/lib -llibgrpp` to LIBS
|
||||
|
||||
<!---
|
||||
### 2y. LibMaxwell (External Maxwell Solver)
|
||||
|
||||
|
|
@ -508,6 +517,7 @@ libraries (see 2.)
|
|||
- `-D__parallel -D__SCALAPACK` parallel runs
|
||||
- `-D__LIBINT` use LIBINT (needed for HF exchange)
|
||||
- `-D__LIBXC` use LIBXC
|
||||
- `-D__LIBGRPP` use libgrpp (for calculations with ECPs)
|
||||
- `-D__ELPA` use ELPA in place of SYEVD to solve the eigenvalue problem
|
||||
- `-D__FFTW3` FFTW version 3 is recommended
|
||||
- `-D__MKL` link the MKL library for linear algebra and/or FFT
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -293,6 +293,7 @@ list(
|
|||
kpoint_methods.F
|
||||
kpoint_transitional.F
|
||||
kpoint_types.F
|
||||
libgrpp_integrals.F
|
||||
libint_2c_3c.F
|
||||
libint_wrapper.F
|
||||
library_tests.F
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ MODULE core_ppl
|
|||
sgp_potential_type
|
||||
USE kinds, ONLY: dp,&
|
||||
int_8
|
||||
USE libgrpp_integrals, ONLY: libgrpp_local_integral,&
|
||||
libgrpp_semilocal_integral
|
||||
USE lri_environment_types, ONLY: lri_kind_type
|
||||
USE orbital_pointers, ONLY: init_orbital_pointers,&
|
||||
ncoset
|
||||
|
|
@ -123,7 +125,7 @@ CONTAINS
|
|||
INTEGER, DIMENSION(:, :), POINTER :: first_sgfa, first_sgfb
|
||||
INTEGER, DIMENSION(nexp_max) :: nct_ppl
|
||||
LOGICAL :: do_dR, dokp, ecp_local, ecp_semi_local, &
|
||||
found, lpotextended
|
||||
found, lpotextended, only_gaussians
|
||||
REAL(KIND=dp) :: alpha, dab, dac, dbc, f0, ppl_radius
|
||||
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: qab, work
|
||||
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :, :) :: hab2_w, ppl_fwork, ppl_work
|
||||
|
|
@ -234,7 +236,7 @@ CONTAINS
|
|||
!$OMP set_radius_a, rpgfa, force_a, force_b, ppl_fwork, mepos, &
|
||||
!$OMP slot, f0, katom, ppl_work, cellind, img, ecp_local, ecp_semi_local, &
|
||||
!$OMP nloc, nrloc, aloc, bloc, n_local, a_local, c_local, &
|
||||
!$OMP slmax, npot, nrpot, apot, bpot, &
|
||||
!$OMP slmax, npot, nrpot, apot, bpot, only_gaussians, &
|
||||
!$OMP ldai, hash, hash1, hash2, iatom8) &
|
||||
!$OMP REDUCTION (+ : pv_thread, force_thread )
|
||||
|
||||
|
|
@ -382,6 +384,7 @@ CONTAINS
|
|||
CALL get_qs_kind(qs_kind_set(kkind), gth_potential=gth_potential, &
|
||||
sgp_potential=sgp_potential)
|
||||
ecp_semi_local = .FALSE.
|
||||
only_gaussians = .TRUE.
|
||||
IF (ASSOCIATED(gth_potential)) THEN
|
||||
CALL get_potential(potential=gth_potential, &
|
||||
alpha_ppl=alpha, cexp_ppl=cexp_ppl, &
|
||||
|
|
@ -409,9 +412,11 @@ CONTAINS
|
|||
CALL get_potential(potential=sgp_potential, nloc=nloc, nrloc=nrloc, aloc=aloc, bloc=bloc)
|
||||
nexp_ppl = nloc
|
||||
CPASSERT(nexp_ppl <= nexp_max)
|
||||
nct_ppl(1:nloc) = nrloc(1:nloc) - 1
|
||||
nct_ppl(1:nloc) = nrloc(1:nloc)
|
||||
alpha_ppl(1:nloc) = bloc(1:nloc)
|
||||
cval_ppl(1, 1:nloc) = aloc(1:nloc)
|
||||
only_gaussians = ALL(nct_ppl(1:nloc) == 2)
|
||||
IF (only_gaussians) nct_ppl(1:nloc) = nct_ppl(1:nloc) - 1
|
||||
ELSE
|
||||
CALL get_potential(potential=sgp_potential, n_local=n_local, a_local=a_local, c_local=c_local)
|
||||
nexp_ppl = n_local
|
||||
|
|
@ -509,16 +514,37 @@ CONTAINS
|
|||
CPABORT("Option not implemented")
|
||||
END IF
|
||||
ELSE
|
||||
CALL ppl_integral( &
|
||||
la_max(iset), la_min(iset), npgfa(iset), &
|
||||
rpgfa(:, iset), zeta(:, iset), &
|
||||
lb_max(jset), lb_min(jset), npgfb(jset), &
|
||||
rpgfb(:, jset), zetb(:, jset), &
|
||||
nexp_ppl, alpha_ppl, nct_ppl, cval_ppl, ppl_radius, &
|
||||
rab, dab, rac, dac, rbc, dbc, hab(:, :, iset, jset), ppl_work)
|
||||
IF (only_gaussians) THEN
|
||||
!If the local part of the pseudo-potential only has Gaussian functions
|
||||
!we can use CP2K native code, that can run without libgrpp installation
|
||||
CALL ppl_integral( &
|
||||
la_max(iset), la_min(iset), npgfa(iset), &
|
||||
rpgfa(:, iset), zeta(:, iset), &
|
||||
lb_max(jset), lb_min(jset), npgfb(jset), &
|
||||
rpgfb(:, jset), zetb(:, jset), &
|
||||
nexp_ppl, alpha_ppl, nct_ppl, cval_ppl, ppl_radius, &
|
||||
rab, dab, rac, dac, rbc, dbc, hab(:, :, iset, jset), ppl_work)
|
||||
|
||||
ELSE
|
||||
!If the local part of the potential is more complex, we need libgrpp
|
||||
CALL libgrpp_local_integral(la_max(iset), la_min(iset), npgfa(iset), &
|
||||
rpgfa(:, iset), zeta(:, iset), &
|
||||
lb_max(jset), lb_min(jset), npgfb(jset), &
|
||||
rpgfb(:, jset), zetb(:, jset), &
|
||||
nexp_ppl, alpha_ppl, cval_ppl(1, :), nct_ppl, &
|
||||
ppl_radius, rab, dab, rac, dac, dbc, &
|
||||
hab(:, :, iset, jset))
|
||||
END IF
|
||||
|
||||
IF (ecp_semi_local) THEN
|
||||
! semi local ECP part
|
||||
CPABORT("NYA")
|
||||
CALL libgrpp_semilocal_integral(la_max(iset), la_min(iset), npgfa(iset), &
|
||||
rpgfa(:, iset), zeta(:, iset), &
|
||||
lb_max(jset), lb_min(jset), npgfb(jset), &
|
||||
rpgfb(:, jset), zetb(:, jset), &
|
||||
slmax, npot, bpot, apot, nrpot, &
|
||||
ppl_radius, rab, dab, rac, dac, dbc, &
|
||||
hab(:, :, iset, jset))
|
||||
END IF
|
||||
END IF
|
||||
END DO
|
||||
|
|
@ -837,7 +863,7 @@ CONTAINS
|
|||
IF (SUM(ABS(aloc(1:nloc))) < 1.0e-12_dp) CYCLE
|
||||
nexp_ppl = nloc
|
||||
CPASSERT(nexp_ppl <= nexp_max)
|
||||
nct_ppl(1:nloc) = nrloc(1:nloc) - 1
|
||||
nct_ppl(1:nloc) = nrloc(1:nloc)
|
||||
alpha_ppl(1:nloc) = bloc(1:nloc)
|
||||
cval_ppl(1, 1:nloc) = aloc(1:nloc)
|
||||
ELSE
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@ CONTAINS
|
|||
#if defined(__LIBXC)
|
||||
flags = TRIM(flags)//" libxc"
|
||||
#endif
|
||||
#if defined(__LIBGRPP)
|
||||
flags = TRIM(flags)//" libgrpp"
|
||||
#endif
|
||||
#if defined(__LIBPEXSI)
|
||||
flags = TRIM(flags)//" pexsi"
|
||||
#endif
|
||||
|
|
|
|||
301
src/libgrpp_integrals.F
Normal file
301
src/libgrpp_integrals.F
Normal file
|
|
@ -0,0 +1,301 @@
|
|||
!--------------------------------------------------------------------------------------------------!
|
||||
! CP2K: A general program to perform molecular dynamics simulations !
|
||||
! Copyright 2000-2023 CP2K developers group <https://cp2k.org> !
|
||||
! !
|
||||
! SPDX-License-Identifier: GPL-2.0-or-later !
|
||||
!--------------------------------------------------------------------------------------------------!
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Local and semi-local ECP integrals using the libgrpp library
|
||||
! **************************************************************************************************
|
||||
|
||||
MODULE libgrpp_integrals
|
||||
USE kinds, ONLY: dp
|
||||
USE mathconstants, ONLY: pi
|
||||
USE orbital_pointers, ONLY: nco,&
|
||||
ncoset
|
||||
#include "./base/base_uses.f90"
|
||||
|
||||
IMPLICIT NONE
|
||||
PRIVATE
|
||||
|
||||
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'libgrpp_integrals'
|
||||
|
||||
PUBLIC :: libgrpp_semilocal_integral, libgrpp_local_integral
|
||||
|
||||
CONTAINS
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Local ECP integrals using libgrpp
|
||||
!> \param la_max_set ...
|
||||
!> \param la_min_set ...
|
||||
!> \param npgfa ...
|
||||
!> \param rpgfa ...
|
||||
!> \param zeta ...
|
||||
!> \param lb_max_set ...
|
||||
!> \param lb_min_set ...
|
||||
!> \param npgfb ...
|
||||
!> \param rpgfb ...
|
||||
!> \param zetb ...
|
||||
!> \param npot_ecp ...
|
||||
!> \param alpha_ecp ...
|
||||
!> \param coeffs_ecp ...
|
||||
!> \param nrpot_ecp ...
|
||||
!> \param rpgfc ...
|
||||
!> \param rab ...
|
||||
!> \param dab ...
|
||||
!> \param rac ...
|
||||
!> \param dac ...
|
||||
!> \param dbc ...
|
||||
!> \param vab ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE libgrpp_local_integral(la_max_set, la_min_set, npgfa, rpgfa, zeta, &
|
||||
lb_max_set, lb_min_set, npgfb, rpgfb, zetb, &
|
||||
npot_ecp, alpha_ecp, coeffs_ecp, nrpot_ecp, &
|
||||
rpgfc, rab, dab, rac, dac, dbc, vab)
|
||||
|
||||
INTEGER, INTENT(IN) :: la_max_set, la_min_set, npgfa
|
||||
REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: rpgfa, zeta
|
||||
INTEGER, INTENT(IN) :: lb_max_set, lb_min_set, npgfb
|
||||
REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: rpgfb, zetb
|
||||
INTEGER, INTENT(IN) :: npot_ecp
|
||||
REAL(KIND=dp), DIMENSION(1:npot_ecp), INTENT(IN) :: alpha_ecp, coeffs_ecp
|
||||
INTEGER, DIMENSION(1:npot_ecp), INTENT(IN) :: nrpot_ecp
|
||||
REAL(KIND=dp), INTENT(IN) :: rpgfc
|
||||
REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: rab
|
||||
REAL(KIND=dp), INTENT(IN) :: dab
|
||||
REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: rac
|
||||
REAL(KIND=dp), INTENT(IN) :: dac
|
||||
REAL(KIND=dp), INTENT(IN) :: dbc
|
||||
REAL(KIND=dp), DIMENSION(:, :), INTENT(INOUT) :: vab
|
||||
|
||||
#if defined(__LIBGRPP)
|
||||
INTEGER :: a_offset, a_start, b_offset, b_start, i, &
|
||||
ipgf, j, jpgf, li, lj, ncoa, ncob
|
||||
REAL(dp) :: expi, expj, normi, normj, prefi, prefj, &
|
||||
zeti, zetj
|
||||
REAL(dp), ALLOCATABLE, DIMENSION(:) :: tmp
|
||||
REAL(dp), DIMENSION(3) :: ra, rb, rc
|
||||
|
||||
!libgrpp requires absolute positions, not relative ones
|
||||
ra(:) = 0.0_dp
|
||||
rb(:) = rab(:)
|
||||
rc(:) = rac(:)
|
||||
|
||||
DO ipgf = 1, npgfa
|
||||
IF (rpgfa(ipgf) + rpgfc < dac) CYCLE
|
||||
zeti = zeta(ipgf)
|
||||
a_start = (ipgf - 1)*ncoset(la_max_set)
|
||||
|
||||
DO jpgf = 1, npgfb
|
||||
IF (rpgfb(jpgf) + rpgfc < dbc) CYCLE
|
||||
IF (rpgfa(ipgf) + rpgfb(jpgf) < dab) CYCLE
|
||||
zetj = zetb(jpgf)
|
||||
b_start = (jpgf - 1)*ncoset(lb_max_set)
|
||||
|
||||
DO li = la_min_set, la_max_set
|
||||
a_offset = a_start + ncoset(li - 1)
|
||||
ncoa = nco(li)
|
||||
prefi = 2.0_dp**li*(2.0_dp/pi)**0.75_dp
|
||||
expi = 0.25_dp*REAL(2*li + 3, dp)
|
||||
normi = 1.0_dp/(prefi*zeti**expi)
|
||||
|
||||
DO lj = lb_min_set, lb_max_set
|
||||
b_offset = b_start + ncoset(lj - 1)
|
||||
ncob = nco(lj)
|
||||
prefj = 2.0_dp**lj*(2.0_dp/pi)**0.75_dp
|
||||
expj = 0.25_dp*REAL(2*lj + 3, dp)
|
||||
normj = 1.0_dp/(prefj*zetj**expj)
|
||||
|
||||
ALLOCATE (tmp(ncoa*ncob))
|
||||
tmp = 0.0_dp
|
||||
!libgrpp implicitely normalizes cartesian Gaussian. In CP2K, we do not, hence
|
||||
!the 1/norm coefficients for PGFi and PGFj
|
||||
CALL libgrpp_type1_integrals(ra, li, 1, [normi], [zeti], &
|
||||
rb, lj, 1, [normj], [zetj], &
|
||||
rc, npot_ecp, nrpot_ecp, &
|
||||
coeffs_ecp, alpha_ecp, tmp)
|
||||
|
||||
!note: tmp array is in C row-major ordering
|
||||
DO j = 1, ncob
|
||||
DO i = 1, ncoa
|
||||
vab(a_offset + i, b_offset + j) = vab(a_offset + i, b_offset + j) + tmp((i - 1)*ncob + j)
|
||||
END DO
|
||||
END DO
|
||||
DEALLOCATE (tmp)
|
||||
|
||||
END DO !lj
|
||||
END DO !li
|
||||
|
||||
END DO !jpgf
|
||||
END DO !ipgf
|
||||
#else
|
||||
|
||||
MARK_USED(la_max_set)
|
||||
MARK_USED(la_min_set)
|
||||
MARK_USED(npgfa)
|
||||
MARK_USED(rpgfa)
|
||||
MARK_USED(zeta)
|
||||
MARK_USED(lb_max_set)
|
||||
MARK_USED(lb_min_set)
|
||||
MARK_USED(npgfb)
|
||||
MARK_USED(rpgfb)
|
||||
MARK_USED(zetb)
|
||||
MARK_USED(npot_ecp)
|
||||
MARK_USED(alpha_ecp)
|
||||
MARK_USED(coeffs_ecp)
|
||||
MARK_USED(nrpot_ecp)
|
||||
MARK_USED(rpgfc)
|
||||
MARK_USED(rab)
|
||||
MARK_USED(dab)
|
||||
MARK_USED(rac)
|
||||
MARK_USED(dac)
|
||||
MARK_USED(dbc)
|
||||
MARK_USED(vab)
|
||||
|
||||
CPABORT("Please compile CP2K with libgrpp support for calculations with ECPs")
|
||||
#endif
|
||||
|
||||
END SUBROUTINE libgrpp_local_integral
|
||||
|
||||
! **************************************************************************************************
|
||||
!> \brief Semi-local ECP integrals using libgrpp.
|
||||
!> \param la_max_set ...
|
||||
!> \param la_min_set ...
|
||||
!> \param npgfa ...
|
||||
!> \param rpgfa ...
|
||||
!> \param zeta ...
|
||||
!> \param lb_max_set ...
|
||||
!> \param lb_min_set ...
|
||||
!> \param npgfb ...
|
||||
!> \param rpgfb ...
|
||||
!> \param zetb ...
|
||||
!> \param lmax_ecp ...
|
||||
!> \param npot_ecp ...
|
||||
!> \param alpha_ecp ...
|
||||
!> \param coeffs_ecp ...
|
||||
!> \param nrpot_ecp ...
|
||||
!> \param rpgfc ...
|
||||
!> \param rab ...
|
||||
!> \param dab ...
|
||||
!> \param rac ...
|
||||
!> \param dac ...
|
||||
!> \param dbc ...
|
||||
!> \param vab ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE libgrpp_semilocal_integral(la_max_set, la_min_set, npgfa, rpgfa, zeta, &
|
||||
lb_max_set, lb_min_set, npgfb, rpgfb, zetb, &
|
||||
lmax_ecp, npot_ecp, alpha_ecp, coeffs_ecp, nrpot_ecp, &
|
||||
rpgfc, rab, dab, rac, dac, dbc, vab)
|
||||
|
||||
INTEGER, INTENT(IN) :: la_max_set, la_min_set, npgfa
|
||||
REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: rpgfa, zeta
|
||||
INTEGER, INTENT(IN) :: lb_max_set, lb_min_set, npgfb
|
||||
REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: rpgfb, zetb
|
||||
INTEGER, INTENT(IN) :: lmax_ecp
|
||||
INTEGER, DIMENSION(0:10), INTENT(IN) :: npot_ecp
|
||||
REAL(KIND=dp), DIMENSION(1:15, 0:10), INTENT(IN) :: alpha_ecp, coeffs_ecp
|
||||
INTEGER, DIMENSION(1:15, 0:10), INTENT(IN) :: nrpot_ecp
|
||||
REAL(KIND=dp), INTENT(IN) :: rpgfc
|
||||
REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: rab
|
||||
REAL(KIND=dp), INTENT(IN) :: dab
|
||||
REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: rac
|
||||
REAL(KIND=dp), INTENT(IN) :: dac
|
||||
REAL(KIND=dp), INTENT(IN) :: dbc
|
||||
REAL(KIND=dp), DIMENSION(:, :), INTENT(INOUT) :: vab
|
||||
|
||||
#if defined(__LIBGRPP)
|
||||
INTEGER :: a_offset, a_start, b_offset, b_start, i, &
|
||||
ipgf, j, jpgf, li, lj, lk, ncoa, ncob
|
||||
REAL(dp) :: expi, expj, normi, normj, prefi, prefj, &
|
||||
zeti, zetj
|
||||
REAL(dp), ALLOCATABLE, DIMENSION(:) :: tmp
|
||||
REAL(dp), DIMENSION(3) :: ra, rb, rc
|
||||
|
||||
!libgrpp requires absolute positions, not relative ones
|
||||
ra(:) = 0.0_dp
|
||||
rb(:) = rab(:)
|
||||
rc(:) = rac(:)
|
||||
|
||||
DO ipgf = 1, npgfa
|
||||
IF (rpgfa(ipgf) + rpgfc < dac) CYCLE
|
||||
zeti = zeta(ipgf)
|
||||
a_start = (ipgf - 1)*ncoset(la_max_set)
|
||||
|
||||
DO jpgf = 1, npgfb
|
||||
IF (rpgfb(jpgf) + rpgfc < dbc) CYCLE
|
||||
IF (rpgfa(ipgf) + rpgfb(jpgf) < dab) CYCLE
|
||||
zetj = zetb(jpgf)
|
||||
b_start = (jpgf - 1)*ncoset(lb_max_set)
|
||||
|
||||
DO li = la_min_set, la_max_set
|
||||
a_offset = a_start + ncoset(li - 1)
|
||||
ncoa = nco(li)
|
||||
prefi = 2.0_dp**li*(2.0_dp/pi)**0.75_dp
|
||||
expi = 0.25_dp*REAL(2*li + 3, dp)
|
||||
normi = 1.0_dp/(prefi*zeti**expi)
|
||||
|
||||
DO lj = lb_min_set, lb_max_set
|
||||
b_offset = b_start + ncoset(lj - 1)
|
||||
ncob = nco(lj)
|
||||
prefj = 2.0_dp**lj*(2.0_dp/pi)**0.75_dp
|
||||
expj = 0.25_dp*REAL(2*lj + 3, dp)
|
||||
normj = 1.0_dp/(prefj*zetj**expj)
|
||||
|
||||
ALLOCATE (tmp(ncoa*ncob))
|
||||
!Loop over ECP angular momentum
|
||||
DO lk = 0, lmax_ecp
|
||||
tmp = 0.0_dp
|
||||
!libgrpp implicitely normalizes cartesian Gaussian. In CP2K, we do not, hence
|
||||
!the 1/norm coefficients for PGFi and PGFj
|
||||
CALL libgrpp_type2_integrals(ra, li, 1, [normi], [zeti], &
|
||||
rb, lj, 1, [normj], [zetj], &
|
||||
rc, lk, npot_ecp(lk), nrpot_ecp(:, lk), &
|
||||
coeffs_ecp(:, lk), alpha_ecp(:, lk), tmp)
|
||||
|
||||
!note: tmp array is in C row-major ordering
|
||||
DO j = 1, ncob
|
||||
DO i = 1, ncoa
|
||||
vab(a_offset + i, b_offset + j) = vab(a_offset + i, b_offset + j) + tmp((i - 1)*ncob + j)
|
||||
END DO
|
||||
END DO
|
||||
END DO !lk
|
||||
DEALLOCATE (tmp)
|
||||
|
||||
END DO !lj
|
||||
END DO !li
|
||||
|
||||
END DO !jpgf
|
||||
END DO !ipgf
|
||||
|
||||
#else
|
||||
|
||||
MARK_USED(la_max_set)
|
||||
MARK_USED(la_min_set)
|
||||
MARK_USED(npgfa)
|
||||
MARK_USED(rpgfa)
|
||||
MARK_USED(zeta)
|
||||
MARK_USED(lb_max_set)
|
||||
MARK_USED(lb_min_set)
|
||||
MARK_USED(npgfb)
|
||||
MARK_USED(rpgfb)
|
||||
MARK_USED(zetb)
|
||||
MARK_USED(lmax_ecp)
|
||||
MARK_USED(npot_ecp)
|
||||
MARK_USED(alpha_ecp)
|
||||
MARK_USED(coeffs_ecp)
|
||||
MARK_USED(nrpot_ecp)
|
||||
MARK_USED(rpgfc)
|
||||
MARK_USED(rab)
|
||||
MARK_USED(dab)
|
||||
MARK_USED(rac)
|
||||
MARK_USED(dac)
|
||||
MARK_USED(dbc)
|
||||
MARK_USED(vab)
|
||||
|
||||
CPABORT("Please compile CP2K with libgrpp support for calculations with ECPs")
|
||||
#endif
|
||||
|
||||
END SUBROUTINE libgrpp_semilocal_integral
|
||||
|
||||
END MODULE libgrpp_integrals
|
||||
|
|
@ -2362,6 +2362,7 @@ CONTAINS
|
|||
npot=ecppot%npot, nrpot=ecppot%nrpot, apot=ecppot%apot, bpot=ecppot%bpot)
|
||||
! convert PP
|
||||
IF (.NOT. ecp_semi_local) THEN
|
||||
CPABORT("ECPs are only well tested in their semi-local form")
|
||||
CALL get_qs_kind(qs_kind, basis_set=orb_basis_set)
|
||||
CALL sgp_construction(sgp_pot=sgppot, ecp_pot=ecppot, orb_basis=orb_basis_set, error=error)
|
||||
IF (iounit > 0) THEN
|
||||
|
|
|
|||
203
tests/QS/regtest-ecp/ECP_BASIS_POT
Normal file
203
tests/QS/regtest-ecp/ECP_BASIS_POT
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
#----------------------------------------------------------------------
|
||||
# Basis Set Exchange
|
||||
# Version v0.9.1
|
||||
# https://www.basissetexchange.org
|
||||
#----------------------------------------------------------------------
|
||||
# Basis set: CRENBL
|
||||
# Description: CRENBL designed for use with small core potentials
|
||||
# Role: orbital
|
||||
# Version: 0 (Data from the Original Basis Set Exchange)
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
# Radon Stuttgart RLC (4s,4p,1d) -> [2s,2p,1d]
|
||||
Rn Stuttgart-RLC
|
||||
5
|
||||
1 0 0 3 1
|
||||
1.9783250 0.6789880
|
||||
1.5140330 -1.1841590
|
||||
0.3246540 0.9210860
|
||||
1 0 0 1 1
|
||||
0.1273660 1.0000000
|
||||
1 1 1 3 1
|
||||
2.0310950 0.2320400
|
||||
1.6561220 -0.3545180
|
||||
0.2983650 0.6651200
|
||||
1 1 1 1 1
|
||||
0.1032220 1.0000000
|
||||
1 2 2 1 1
|
||||
0.2600000 1.0000000
|
||||
|
||||
## Effective core potentials
|
||||
Stuttgart_RLC_ECP
|
||||
Rn nelec 78
|
||||
Rn ul
|
||||
2 1.000000000 0.000000000
|
||||
Rn S
|
||||
2 0.922386000 -5.019005000
|
||||
2 1.781915000 37.036790000
|
||||
2 10.804601000 195.103308000
|
||||
Rn P
|
||||
2 0.724291000 -1.966481000
|
||||
2 1.363860000 23.464059000
|
||||
Rn D
|
||||
2 0.769400000 7.483457000
|
||||
2 1.538800000 9.361900000
|
||||
Rn F
|
||||
2 1.213897000 -6.763150000
|
||||
Rn G
|
||||
2 1.576469000 -9.915662000
|
||||
END Stuttgart_RLC_ECP
|
||||
|
||||
# Hydrogen def2-SVP (4s,1p) -> [2s,1p]
|
||||
H def2-SVP
|
||||
3
|
||||
1 0 0 3 1
|
||||
13.0107010 0.19682158E-01
|
||||
1.9622572 0.13796524
|
||||
0.44453796 0.47831935
|
||||
1 0 0 1 1
|
||||
0.12194962 1.0000000
|
||||
1 1 1 1 1
|
||||
0.8000000 1.0000000
|
||||
|
||||
# Antimony def2-SVP (10s,7p,6d) -> [4s,4p,2d]
|
||||
Sb def2-SVP
|
||||
10
|
||||
1 0 0 2 1
|
||||
10.584496987 -0.14845336778E-01
|
||||
1.4680242769 0.35289492025
|
||||
1 0 0 6 1
|
||||
372.76139166 0.15878057239E-02
|
||||
22.689478596 -0.15027605583
|
||||
18.391547037 0.35915813039
|
||||
7.6406271414 -0.74805091065
|
||||
1.9052000235 0.92017581656
|
||||
0.93007107773 0.46754079597
|
||||
1 0 0 1 1
|
||||
0.21621190032 1.0000000
|
||||
1 0 0 1 1
|
||||
0.83546307041E-01 1.0000000
|
||||
1 1 1 1 1
|
||||
2.6190751238 1.0000000
|
||||
1 1 1 4 1
|
||||
15.926550950 0.13206950012
|
||||
10.052739237 -0.41511149340
|
||||
1.2682183726 0.74197972626
|
||||
0.57196620929 0.15580772750
|
||||
1 1 1 1 1
|
||||
0.25183282652 1.0000000
|
||||
1 1 1 1 1
|
||||
0.83389127684E-01 1.0000000
|
||||
1 2 2 5 1
|
||||
45.485063360 0.32556415807E-02
|
||||
18.504059617 -0.54952972010E-02
|
||||
3.9156032308 0.27988806353
|
||||
1.7142196009 0.51273377761
|
||||
0.69675478242 0.33288802736
|
||||
1 2 2 1 1
|
||||
0.23060000000 1.0000000
|
||||
|
||||
## Effective core potentials
|
||||
def2-SVP_ECP
|
||||
Sb nelec 28
|
||||
Sb ul
|
||||
2 14.44497800 -15.36680100
|
||||
2 14.44929500 -20.29613800
|
||||
Sb S
|
||||
2 16.33086500 281.07158100
|
||||
2 8.55654200 61.71660400
|
||||
2 14.44497800 15.36680100
|
||||
2 14.44929500 20.29613800
|
||||
Sb P
|
||||
2 14.47033700 67.45738000
|
||||
2 13.81619400 134.93350300
|
||||
2 8.42492400 14.71634400
|
||||
2 8.09272800 29.51851200
|
||||
2 14.44497800 15.36680100
|
||||
2 14.44929500 20.29613800
|
||||
Sb D
|
||||
2 14.88633100 35.44781500
|
||||
2 15.14631900 53.14346600
|
||||
2 5.90826700 9.17922300
|
||||
2 5.59432200 13.24025300
|
||||
2 14.44497800 15.36680100
|
||||
2 14.44929500 20.29613800
|
||||
END def2-SVP_ECP
|
||||
|
||||
## All-electron potential
|
||||
H ALLELECTRON ALL
|
||||
1 0 0
|
||||
0.20000000 0
|
||||
|
||||
# Chlorine LANL2DZ (3s,3p) -> [2s,2p]
|
||||
Cl LANL2DZ
|
||||
2
|
||||
1 0 0 3 2
|
||||
2.2310000 -0.4900589 0.0000000
|
||||
0.4720000 1.2542684 0.0000000
|
||||
0.1631000 0.0000000 1.0000000
|
||||
1 1 1 3 2
|
||||
6.2960000 -0.0635641 0.0000000
|
||||
0.6333000 1.0141355 0.0000000
|
||||
0.1819000 0.0000000 1.0000000
|
||||
|
||||
# Iodine LANL2DZ (3s,3p) -> [2s,2p]
|
||||
I LANL2DZ
|
||||
2
|
||||
1 0 0 3 2
|
||||
0.7242000 -2.9731048 0.0000000
|
||||
0.4653000 3.4827643 0.0000000
|
||||
0.1336000 0.0000000 1.0000000
|
||||
1 1 1 3 2
|
||||
1.2900000 -0.2092377 0.0000000
|
||||
0.3180000 1.1035347 0.0000000
|
||||
0.1053000 0.0000000 1.0000000
|
||||
|
||||
## Effective core potentials
|
||||
LANL2DZ_ECP
|
||||
Cl nelec 10
|
||||
Cl ul
|
||||
1 94.8130000 -10.0000000
|
||||
2 165.6440000 66.2729170
|
||||
2 30.8317000 -28.9685950
|
||||
2 10.5841000 -12.8663370
|
||||
2 3.7704000 -1.7102170
|
||||
Cl S
|
||||
0 128.8391000 3.0000000
|
||||
1 120.3786000 12.8528510
|
||||
2 63.5622000 275.6723980
|
||||
2 18.0695000 115.6777120
|
||||
2 3.8142000 35.0606090
|
||||
Cl P
|
||||
0 216.5263000 5.0000000
|
||||
1 46.5723000 7.4794860
|
||||
2 147.4685000 613.0320000
|
||||
2 48.9869000 280.8006850
|
||||
2 13.2096000 107.8788240
|
||||
2 3.1831000 15.3439560
|
||||
I nelec 46
|
||||
I ul
|
||||
0 1.0715702 -0.0747621
|
||||
1 44.1936028 -30.0811224
|
||||
2 12.9367609 -75.3722721
|
||||
2 3.1956412 -22.0563758
|
||||
2 0.8589806 -1.6979585
|
||||
I S
|
||||
0 127.9202670 2.9380036
|
||||
1 78.6211465 41.2471267
|
||||
2 36.5146237 287.8680095
|
||||
2 9.9065681 114.3758506
|
||||
2 1.9420086 37.6547714
|
||||
I P
|
||||
0 13.0035304 2.2222630
|
||||
1 76.0331404 39.4090831
|
||||
2 24.1961684 177.4075002
|
||||
2 6.4053433 77.9889462
|
||||
2 1.5851786 25.7547641
|
||||
I D
|
||||
0 40.4278108 7.0524360
|
||||
1 28.9084375 33.3041635
|
||||
2 15.6268936 186.9453875
|
||||
2 4.1442856 71.9688361
|
||||
2 0.9377235 9.3630657
|
||||
END LANL2DZ_ECP
|
||||
58
tests/QS/regtest-ecp/ICl_lanl2dz_gpw.inp
Normal file
58
tests/QS/regtest-ecp/ICl_lanl2dz_gpw.inp
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
&GLOBAL
|
||||
PROJECT ICl_lanl2dz_gpw
|
||||
RUN_TYPE ENERGY
|
||||
&END GLOBAL
|
||||
&FORCE_EVAL
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME ./ECP_BASIS_POT
|
||||
POTENTIAL_FILE_NAME ./ECP_BASIS_POT
|
||||
|
||||
&QS
|
||||
METHOD GPW
|
||||
EPS_DEFAULT 1.0E-12
|
||||
&END QS
|
||||
|
||||
&SCF
|
||||
SCF_GUESS ATOMIC
|
||||
MAX_SCF 5
|
||||
&END
|
||||
|
||||
&MGRID
|
||||
CUTOFF 400
|
||||
REL_CUTOFF 40
|
||||
NGRIDS 5
|
||||
&END
|
||||
|
||||
&POISSON
|
||||
PERIODIC NONE
|
||||
PSOLVER WAVELET
|
||||
&END
|
||||
|
||||
&XC
|
||||
&XC_FUNCTIONAL LDA
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 10.0 10.0 10.0
|
||||
PERIODIC NONE
|
||||
&END CELL
|
||||
&COORD
|
||||
Cl 0.00000 0.00000 0.00000
|
||||
I 0.00000 0.00000 2.49000
|
||||
&END COORD
|
||||
&TOPOLOGY
|
||||
&CENTER_COORDINATES
|
||||
&END
|
||||
&END
|
||||
&KIND I
|
||||
BASIS_SET LANL2DZ
|
||||
POTENTIAL ECP LANL2DZ_ECP
|
||||
&END KIND
|
||||
&KIND Cl
|
||||
BASIS_SET LANL2DZ
|
||||
POTENTIAL ECP LANL2DZ_ECP
|
||||
&END KIND
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
44
tests/QS/regtest-ecp/Rn_stuttgart_gapw.inp
Normal file
44
tests/QS/regtest-ecp/Rn_stuttgart_gapw.inp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
&GLOBAL
|
||||
PROJECT Rn_stuttgart_gapw
|
||||
RUN_TYPE ENERGY
|
||||
&END GLOBAL
|
||||
&FORCE_EVAL
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME ./ECP_BASIS_POT
|
||||
POTENTIAL_FILE_NAME ./ECP_BASIS_POT
|
||||
|
||||
&QS
|
||||
METHOD GAPW
|
||||
EPS_DEFAULT 1.0E-12
|
||||
&END QS
|
||||
|
||||
&SCF
|
||||
SCF_GUESS ATOMIC
|
||||
MAX_SCF 5
|
||||
&END
|
||||
|
||||
&MGRID
|
||||
CUTOFF 400
|
||||
REL_CUTOFF 40
|
||||
NGRIDS 5
|
||||
&END
|
||||
|
||||
&XC
|
||||
&XC_FUNCTIONAL LDA
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 5.0 5.0 10.0
|
||||
&END CELL
|
||||
&COORD
|
||||
Rn 0.00000 0.00000 0.00000
|
||||
Rn 0.00000 0.00000 5.00000
|
||||
&END COORD
|
||||
&KIND Rn
|
||||
BASIS_SET Stuttgart-RLC
|
||||
POTENTIAL ECP Stuttgart_RLC_ECP
|
||||
&END KIND
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
60
tests/QS/regtest-ecp/SbH3_def2_gapw.inp
Normal file
60
tests/QS/regtest-ecp/SbH3_def2_gapw.inp
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
&GLOBAL
|
||||
PROJECT SbH3_def2_gapw
|
||||
RUN_TYPE ENERGY
|
||||
&END GLOBAL
|
||||
&FORCE_EVAL
|
||||
&DFT
|
||||
BASIS_SET_FILE_NAME ./ECP_BASIS_POT
|
||||
POTENTIAL_FILE_NAME ./ECP_BASIS_POT
|
||||
|
||||
&QS
|
||||
METHOD GAPW
|
||||
EPS_DEFAULT 1.0E-12
|
||||
&END QS
|
||||
|
||||
&SCF
|
||||
SCF_GUESS ATOMIC
|
||||
MAX_SCF 5
|
||||
&END
|
||||
|
||||
&MGRID
|
||||
CUTOFF 400
|
||||
REL_CUTOFF 40
|
||||
NGRIDS 5
|
||||
&END
|
||||
|
||||
&POISSON
|
||||
PERIODIC NONE
|
||||
PSOLVER WAVELET
|
||||
&END
|
||||
|
||||
&XC
|
||||
&XC_FUNCTIONAL LDA
|
||||
&END XC_FUNCTIONAL
|
||||
&END XC
|
||||
&END DFT
|
||||
&SUBSYS
|
||||
&CELL
|
||||
ABC 10.0 10.0 10.0
|
||||
PERIODIC NONE
|
||||
&END CELL
|
||||
&COORD
|
||||
Sb 0.0000000000 -0.2357770000 -0.6270200000
|
||||
H 0.0000000000 1.1518460000 0.3391280000
|
||||
H -1.2017170000 -0.9295890000 0.3391280000
|
||||
H 0.2017170000 -0.9295890000 0.3391280000
|
||||
&END COORD
|
||||
&TOPOLOGY
|
||||
&CENTER_COORDINATES
|
||||
&END
|
||||
&END
|
||||
&KIND Sb
|
||||
BASIS_SET def2-SVP
|
||||
POTENTIAL ECP def2-SVP_ECP
|
||||
&END KIND
|
||||
&KIND H
|
||||
BASIS_SET def2-SVP
|
||||
POTENTIAL ALL
|
||||
&END KIND
|
||||
&END SUBSYS
|
||||
&END FORCE_EVAL
|
||||
3
tests/QS/regtest-ecp/TEST_FILES
Normal file
3
tests/QS/regtest-ecp/TEST_FILES
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
ICl_lanl2dz_gpw.inp 11 1.0E-11 -23.515911094537550
|
||||
Rn_stuttgart_gapw.inp 11 1.0E-11 -25.632304810373267
|
||||
SbH3_def2_gapw.inp 11 1.0E-11 -212.357670903187426
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
# Directories have been reordered according the execution time needed for a gfortran pdbg run using 2 MPI tasks
|
||||
# in case a new directory is added just add it at the top of the list..
|
||||
# the order will be regularly checked and modified...
|
||||
QS/regtest-ecp libgrpp
|
||||
QS/regtest-as-3 libint mpiranks%2==0
|
||||
QS/regtest-as-2 libint
|
||||
QS/regtest-wfn-restart
|
||||
|
|
|
|||
|
|
@ -170,6 +170,9 @@ The --with-PKG options follow the rules:
|
|||
--with-libint libint, library for evaluation of two-body molecular
|
||||
integrals, needed for hybrid functional calculations
|
||||
Default = install
|
||||
--with-libgrpp libgrpp, library for the evaluation of ECP integrals, needed
|
||||
for any calculations with semi-local ECP pseudopotentials
|
||||
Default = install
|
||||
--with-fftw FFTW3, library for fast fourier transform
|
||||
Default = install
|
||||
--with-acml AMD core maths library, which provides LAPACK and BLAS
|
||||
|
|
@ -259,7 +262,7 @@ EOF
|
|||
tool_list="gcc intel cmake"
|
||||
mpi_list="mpich openmpi intelmpi"
|
||||
math_list="mkl acml openblas"
|
||||
lib_list="fftw libint libxc libxsmm cosma scalapack elpa cusolvermp plumed \
|
||||
lib_list="fftw libint libxc libgrpp libxsmm cosma scalapack elpa cusolvermp plumed \
|
||||
spfft spla ptscotch superlu pexsi quip gsl spglib hdf5 libvdwxc sirius
|
||||
libvori libtorch"
|
||||
package_list="${tool_list} ${mpi_list} ${math_list} ${lib_list}"
|
||||
|
|
@ -280,6 +283,7 @@ with_gcc="__SYSTEM__"
|
|||
# libs to turn on by default, the math and mpi libraries are chosen by there respective modes:
|
||||
with_fftw="__INSTALL__"
|
||||
with_libint="__INSTALL__"
|
||||
with_libgrpp="__INSTALL__"
|
||||
with_libxsmm="__INSTALL__"
|
||||
with_libxc="__INSTALL__"
|
||||
with_scalapack="__INSTALL__"
|
||||
|
|
@ -560,6 +564,9 @@ while [ $# -ge 1 ]; do
|
|||
--with-libxc*)
|
||||
with_libxc=$(read_with "${1}")
|
||||
;;
|
||||
--with-libgrpp*)
|
||||
with_libgrpp=$(read_with "${1}")
|
||||
;;
|
||||
--with-fftw*)
|
||||
with_fftw=$(read_with "${1}")
|
||||
;;
|
||||
|
|
|
|||
108
tools/toolchain/scripts/stage3/install_libgrpp.sh
Executable file
108
tools/toolchain/scripts/stage3/install_libgrpp.sh
Executable file
|
|
@ -0,0 +1,108 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# TODO: Review and if possible fix shellcheck errors.
|
||||
# shellcheck disable=all
|
||||
|
||||
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
|
||||
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"
|
||||
|
||||
libgrpp_ver="20231206"
|
||||
libgrpp_sha="85c8caeca62589ca4e23709f467fd65e49079c0720f4db78f4382ce91cc3cebc"
|
||||
source "${SCRIPT_DIR}"/common_vars.sh
|
||||
source "${SCRIPT_DIR}"/tool_kit.sh
|
||||
source "${SCRIPT_DIR}"/signal_trap.sh
|
||||
source "${INSTALLDIR}"/toolchain.conf
|
||||
source "${INSTALLDIR}"/toolchain.env
|
||||
|
||||
[ -f "${BUILDDIR}/setup_libgrpp" ] && rm "${BUILDDIR}/setup_libgrpp"
|
||||
|
||||
LIBGRPP_CFLAGS=""
|
||||
LIBGRPP_LDFLAGS=""
|
||||
LIBGRPP_LIBS=""
|
||||
! [ -d "${BUILDDIR}" ] && mkdir -p "${BUILDDIR}"
|
||||
cd "${BUILDDIR}"
|
||||
|
||||
case "$with_libgrpp" in
|
||||
__INSTALL__)
|
||||
echo "==================== Installing libgrpp ===================="
|
||||
pkg_install_dir="${INSTALLDIR}/libgrpp-main-${libgrpp_ver}"
|
||||
echo "pkg_install_dir:"
|
||||
echo ${pkg_install_dir}
|
||||
install_lock_file="$pkg_install_dir/install_successful"
|
||||
if verify_checksums "${install_lock_file}"; then
|
||||
echo "libgrpp-main-${libgrpp_ver} is already installed, skipping it."
|
||||
else
|
||||
if [ -f libgrpp-${libgrpp_ver}.zip ]; then
|
||||
echo "libgrpp-main-${libgrpp_ver}.zip is found"
|
||||
else
|
||||
download_pkg_from_cp2k_org "${libgrpp_sha}" "libgrpp-main-${libgrpp_ver}.zip"
|
||||
fi
|
||||
echo "Installing from scratch into ${pkg_install_dir}"
|
||||
[ -d libgrpp-main-${libgrpp_ver} ] && rm -rf libgrpp-main-${libgrpp_ver}
|
||||
unzip -qq libgrpp-main-${libgrpp_ver}.zip
|
||||
cd libgrpp-main
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
CC=${CC} FC=${FC} cmake .. > cmake.log 2>&1 || tail -n ${LOG_LINES} cmake.log
|
||||
make > make.log 2>&1 || tail -n ${LOG_LINES} make.log
|
||||
cd ..
|
||||
|
||||
install -d "${pkg_install_dir}/lib" >> install.log 2>&1
|
||||
install -d "${pkg_install_dir}/include" >> install.log 2>&1
|
||||
install -m 644 build/libgrpp/liblibgrpp.a "${pkg_install_dir}/lib" >> install.log 2>&1
|
||||
install -m 644 libgrpp/* "${pkg_install_dir}/include" >> install.log 2>&1
|
||||
|
||||
cd ..
|
||||
write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage3/$(basename ${SCRIPT_NAME})"
|
||||
fi
|
||||
|
||||
LIBGRPP_CFLAGS="-I'${pkg_install_dir}/include'"
|
||||
LIBGRPP_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
|
||||
;;
|
||||
__SYSTEM__)
|
||||
echo "==================== Finding libgrpp from system paths ===================="
|
||||
check_lib -llibgrpp "libgrpp"
|
||||
add_include_from_paths -p LIBGRPP_CFLAGS "libgrpp" $INCLUDE_PATHS
|
||||
add_lib_from_paths LIBGRPP_LDFLAGS "liblibgrpp.*" $LIB_PATHS
|
||||
;;
|
||||
__DONTUSE__) ;;
|
||||
|
||||
*)
|
||||
echo "==================== Linking libgrpp to user paths ===================="
|
||||
pkg_install_dir="$with_libgrpp"
|
||||
check_dir "${pkg_install_dir}/include"
|
||||
check_dir "${pkg_install_dir}/lib"
|
||||
LIBGRPP_CFLAGS="-I'${pkg_install_dir}/include'"
|
||||
LIBGRPP_LDFLAGS="-L'${pkg_install_dir}/lib'"
|
||||
;;
|
||||
esac
|
||||
if [ "$with_libgrpp" != "__DONTUSE__" ]; then
|
||||
LIBGRPP_LIBS="-llibgrpp"
|
||||
if [ "$with_libgrpp" != "__SYSTEM__" ]; then
|
||||
cat << EOF > "${BUILDDIR}/setup_libgrpp"
|
||||
prepend_path LD_LIBRARY_PATH "$pkg_install_dir/lib"
|
||||
prepend_path LD_RUN_PATH "$pkg_install_dir/lib"
|
||||
prepend_path LIBRARY_PATH "$pkg_install_dir/lib"
|
||||
prepend_path PKG_CONFIG_PATH "$pkg_install_dir/lib/pkgconfig"
|
||||
prepend_path CMAKE_PREFIX_PATH "$pkg_install_dir"
|
||||
export LIBGRPP_ROOT="${pkg_install_dir}"
|
||||
EOF
|
||||
cat "${BUILDDIR}/setup_libgrpp" >> $SETUPFILE
|
||||
fi
|
||||
cat << EOF >> "${BUILDDIR}/setup_libgrpp"
|
||||
export LIBGRPP_CFLAGS="${LIBGRPP_CFLAGS}"
|
||||
export LIBGRPP_LDFLAGS="${LIBGRPP_LDFLAGS}"
|
||||
export LIBGRPP_LIBS="${LIBGRPP_LIBS}"
|
||||
export CP_DFLAGS="\${CP_DFLAGS} -D__LIBGRPP"
|
||||
export CP_CFLAGS="\${CP_CFLAGS} ${LIBGRPP_CFLAGS}"
|
||||
export CP_LDFLAGS="\${CP_LDFLAGS} ${LIBGRPP_LDFLAGS}"
|
||||
export CP_LIBS="${LIBGRPP_LIBS} \${CP_LIBS}"
|
||||
EOF
|
||||
fi
|
||||
|
||||
load "${BUILDDIR}/setup_libgrpp"
|
||||
write_toolchain_env "${INSTALLDIR}"
|
||||
|
||||
cd "${ROOTDIR}"
|
||||
report_timing "libgrpp"
|
||||
|
|
@ -6,5 +6,6 @@
|
|||
./scripts/stage3/install_fftw.sh
|
||||
./scripts/stage3/install_libint.sh
|
||||
./scripts/stage3/install_libxc.sh
|
||||
./scripts/stage3/install_libgrpp.sh
|
||||
|
||||
#EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue