Skip to content

Commit

Permalink
toolchain/libxc: fix undefined symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-zero committed Feb 1, 2019
1 parent 6cf6e4d commit c47c308
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
69 changes: 69 additions & 0 deletions tools/toolchain/scripts/files/libxc-4.3.0-fix-fortran-iface.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
diff --git a/src/libxc_master.F03 b/src/libxc_master.F03
index b6a9c5b..2769f2a 100644
--- a/src/libxc_master.F03
+++ b/src/libxc_master.F03
@@ -131,8 +131,7 @@ module xc_f03_lib_m
xc_f03_mgga_fxc, &
xc_f03_mgga_x_tpss_set_params, &
xc_f03_mgga_c_tpss_set_params, &
- xc_f03_mgga_c_bc95_set_params, &
- xc_f03_mgga_c_pkzb_set_params
+ xc_f03_mgga_c_bc95_set_params


integer(c_int), parameter, public :: &
@@ -692,11 +691,6 @@ module xc_f03_lib_m
real(RTYPE), value :: css, copp
end subroutine xc_mgga_c_bc95_set_params

- subroutine xc_mgga_c_pkzb_set_params(p, beta, d, c0_0, c0_1, c0_2, c0_3) bind(c)
- import
- type(c_ptr), value :: p
- real(RTYPE), value :: beta, d, c0_0, c0_1, c0_2, c0_3
- end subroutine xc_mgga_c_pkzb_set_params
end interface


@@ -1326,15 +1320,6 @@ module xc_f03_lib_m

end subroutine xc_f03_mgga_c_bc95_set_params

- subroutine xc_f03_mgga_c_pkzb_set_params(p, beta, d, c0_0, c0_1, c0_2, c0_3)
- type(xc_f03_func_t), intent(inout) :: p
- real(RTYPE), intent(in) :: beta, d, c0_0, c0_1, c0_2, c0_3
-
- call xc_mgga_c_pkzb_set_params(p%ptr, beta, d, c0_0, c0_1, c0_2, c0_3)
-
- end subroutine xc_f03_mgga_c_pkzb_set_params
-
-
! Helper functions to convert between C and Fortran strings
! Based on the routines by Joseph M. Krahn
function f_to_c_string(f_string) result(c_string)
diff --git a/src/xc.h b/src/xc.h
index cfdef48..6c9f3d4 100644
--- a/src/xc.h
+++ b/src/xc.h
@@ -272,7 +272,6 @@ void xc_gga_c_pbe_set_params(xc_func_type *p, double beta);

void xc_mgga_x_tpss_set_params(xc_func_type *p, double b, double c, double e, double kappa, double mu, double BLOC_a, double BLOC_b);
void xc_mgga_c_tpss_set_params(xc_func_type *p, double beta, double d, double C0_0, double C0_1, double C0_2, double C0_3);
-void xc_mgga_c_pkzb_set_params(xc_func_type *p, double beta, double d, double C0_0, double C0_1, double C0_2, double C0_3);
void xc_mgga_c_bc95_set_params(xc_func_type *p, double css, double copp);


diff --git a/src/xc_f.c b/src/xc_f.c
index 5f6adec..4609a6e 100644
--- a/src/xc_f.c
+++ b/src/xc_f.c
@@ -508,10 +508,4 @@ void FC_FUNC(f90_mgga_c_bc95_set_par, F90_MGGA_C_BC95_SET_PAR)
xc_mgga_c_bc95_set_params((xc_func_type *)(*p), *css, *copp);
}

-void FC_FUNC(f90_mgga_c_pkzb_set_par, F90_MGGA_C_PKZB_SET_PAR)
- (void **p, double *beta, double *d, double *C0_0, double *C0_1, double *C0_2, double *C0_3)
-{
- xc_mgga_c_pkzb_set_params((xc_func_type *)(*p), *beta, *d, *C0_0, *C0_1, *C0_2, *C0_3);
-}
-
#endif
4 changes: 4 additions & 0 deletions tools/toolchain/scripts/install_libxc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ case "$with_libxc" in
configure
# patch for libxc 3.0.0 + gcc 6.4.0 (undefined behavior in lda_x.c)
CFLAGS=`echo ${CFLAGS} |sed 's|-fno-omit-frame-pointer ||g'`

# patch for libxc 4.3.0 (undefined symbols due to function removal)
patch -p1 < "${SCRIPT_DIR}/files/libxc-4.3.0-fix-fortran-iface.patch"

./configure --prefix="${pkg_install_dir}" --libdir="${pkg_install_dir}/lib" > configure.log 2>&1
make -j $NPROCS > make.log 2>&1
make install > install.log 2>&1
Expand Down

0 comments on commit c47c308

Please sign in to comment.