Remove JSON-Fortran

This commit is contained in:
Ole Schütt 2019-08-16 15:03:01 +02:00 committed by Ole Schütt
parent 5955911909
commit ff7806a1bb
7 changed files with 4 additions and 157 deletions

View file

@ -171,19 +171,13 @@ A library for finding and handling crystal symmetries
* The spglib can be downloaded from https://github.com/atztogo/spglib
* For building CP2K with the spglib add `-D__SPGLIB` to DFLAGS
### 2q. JSON-Fortran (optional, required for SIRIUS)
JSON-Fortran is a Fortran 2008 JSON API.
* The code is available at https://github.com/jacobwilliams/json-fortran
* For building CP2K with JSON-Fortran add `-D__JSON` to DFLAGS.
### 2r. SIRIUS (optional, plane wave calculations)
### 2q. SIRIUS (optional, plane wave calculations)
SIRIUS is a domain specific library for electronic structure calculations.
* The code is available at https://github.com/electronic-structure/SIRIUS
* For building CP2K with SIRIUS add `-D__SIRIUS` to DFLAGS.
* Furthermore, SIRIUS depends on JSON-Fortran.
* See https://electronic-structure.github.io/SIRIUS/ for more information.
### 2s. FPGA (optional, plane wave FFT calculations)
### 2r. FPGA (optional, plane wave FFT calculations)
* Use `-D__PW_FPGA` to enable FPGA support for PW (fft) calculations. Currently tested only for Intel Stratix 10 and Arria 10 GX1150 FPGAs.
* Supports single precision and double precision fft calculations with the use of dedicated APIs.
* Double precision is the default API chosen when set using the `-D__PW_FPGA` flag.

View file

@ -271,9 +271,6 @@ CONTAINS
#if defined __MKL
flags = TRIM(flags)//" mkl"
#endif
#if defined __JSON
flags = TRIM(flags)//" json"
#endif
#if defined __SIRIUS
flags = TRIM(flags)//" sirius"
#endif

View file

@ -207,13 +207,6 @@ dnl check for libvdwxc
ACX_LIBVDWXC([options="$options libvdwxc"; LIBVDWXC_DFLAGS="-D__LIBVDWXC"], [])
AC_SUBST(LIBVDWXC_DFLAGS)
SECTION_TITLE([json fortran (SIRIUS dependency)])
dnl check for libvdwxc
ACX_JSON_FORTRAN([options="$options json-fortran"; JSON_FORTRAN_DFLAGS="-D__JSON"], [])
AC_SUBST(JSON_FORTRAN_DFLAGS)
SECTION_TITLE([ParMETIS, PTSCOTCH and SuperLU])
dnl check for parmetis
ACX_PARMETIS([options="$options ParMETIS"; PARMETIS_DFLAGS="-D__PARMETIS"], [])

View file

@ -1,25 +0,0 @@
# -*- Autoconf -*-
AU_ALIAS([ACX_JSON_FORTRAN], [AX_JSON_FORTRAN])
AC_DEFUN([ACX_JSON_FORTRAN],
[
_ac_have_json_fortran=no
AC_ARG_WITH(json-fortran,
[AC_HELP_STRING([--with-json-fortran=yes/no/prefix],
["use the json fortran library (SIRIUS dependency)"])],
[json_fortran_prefix="$withval"],
[json_fortran_prefix="/usr/local"])
pkg_config_path_save=$PKG_CONFIG_PATH
PKG_CONFIG_PATH=${json_fortran_prefix}/lib/pkgconfig:$PKG_CONFIG_PATH
AS_IF([test "$with_json_fortran" != "no"],
[PKG_CHECK_EXISTS([json-fortran],
[PKG_CHECK_MODULES([JSON_FORTRAN], [json-fortran], [_ac_have_json_fortran=yes], [AC_MSG_WARN([json-fortran not found])])],
[])
])
PKG_CONFIG_PATH=$pkg_config_path_save
AC_SUBST(JSON_FORTRAN_CFLAGS)
AC_SUBST(JSON_FORTRAN_LIBS)
AC_SUBST(JSON_FORTRAN_LDFLAGS)
AS_IF([test "_ac_have_json_fortran" == "yes"], [$1], [$2])
])
#

View file

@ -126,9 +126,6 @@ RUN ./scripts/install_libvdwxc.sh && rm -rf ./build
COPY ./scripts/install_sirius.sh ./scripts/
RUN ./scripts/install_sirius.sh && rm -rf ./build
COPY ./scripts/install_json_fortran.sh ./scripts/
RUN ./scripts/install_json_fortran.sh && rm -rf ./build
COPY ./scripts/arch_base.tmpl \
./scripts/generate_arch_files.sh ./scripts/
RUN ./scripts/generate_arch_files.sh && rm -rf ./build

View file

@ -212,7 +212,7 @@ The --with-PKG options follow the rules:
--with-quip Enable interface to QUIP library
Default = no
--with-sirius Enable interface to the plane wave SIRIUS library.
This package requires: gsl, libspg, elpa, scalapack, json-fortran, hdf5 and libxc.
This package requires: gsl, libspg, elpa, scalapack, hdf5 and libxc.
Default = install
--with-gsl Enable the gnu scientific library
Default = install
@ -223,10 +223,6 @@ The --with-PKG options follow the rules:
Default = install
--with-hdf5 Enable the hdf5 library (used by the sirius library)
Default = install
--with-json-fortran Enable the json fortran library (used by cp2k when sirius is activated)
This package depends on cmake.
Default = install
FURTHER INSTRUCTIONS
@ -263,7 +259,7 @@ tool_list="valgrind cmake gcc"
mpi_list="mpich openmpi"
math_list="mkl acml openblas reflapack"
lib_list="fftw libint libxc libsmm libxsmm scalapack elpa \
ptscotch parmetis metis superlu pexsi quip gsl spglib hdf5 libvdwxc sirius json_fortran"
ptscotch parmetis metis superlu pexsi quip gsl spglib hdf5 libvdwxc sirius"
package_list="$tool_list $mpi_list $math_list $lib_list"
# ------------------------------------------------------------------------
@ -304,7 +300,6 @@ with_sirius="__INSTALL__"
with_gsl="__INSTALL__"
with_spglib="__INSTALL__"
with_hdf5="__INSTALL__"
with_json_fortran="__INSTALL__"
with_elpa="__INSTALL__"
with_libvdwxc="__INSTALL__"
@ -600,9 +595,6 @@ while [ $# -ge 1 ] ; do
--with-hdf5*)
with_hdf5=$(read_with $1)
;;
--with-json*)
with_json_fortran=$(read_with $1)
;;
--with-libvdwxc*)
with_libvdwxc=$(read_with $1)
;;
@ -741,11 +733,6 @@ if [ "$with_spglib" = "__INSTALL__" ] ; then
[ "$with_cmake" = "__DONTUSE__" ] && with_cmake="__INSTALL__"
fi
# json-fortran requires cmake.
if [ "$with_json_fortran" = "__INSTALL__" ] ; then
[ "$with_cmake" = "__DONTUSE__" ] && with_cmake="__INSTALL__"
fi
# SIRIUS dependencies. Remove the gsl library from the dependencies if SIRIUS is not activated
if [ "$with_sirius" = "__INSTALL__" ] ; then
if [ "$with_gsl" = "__DONTUSE__" ] ; then
@ -768,10 +755,6 @@ if [ "$with_sirius" = "__INSTALL__" ] ; then
report_error "For SIRIUS to work you need a working hdf5 library use --with-hdf5 option to specify if you wish to install the library or specify its location."
exit 1
fi
if [ "$with_json_fortran" = "__DONTUSE__" ] ; then
report_error "For SIRIUS to work you need a working json-fortran library use --with-json option to specify if you wish to install it or specify its location."
exit 1
fi
fi
@ -945,7 +928,6 @@ else
./scripts/install_hdf5.sh
./scripts/install_libvdwxc.sh
./scripts/install_sirius.sh
./scripts/install_json_fortran.sh
./scripts/generate_arch_files.sh
fi

View file

@ -1,91 +0,0 @@
#!/bin/bash -e
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)"
json_fortran_ver="7.0.0"
json_fortran_sha256="9b5b6235489b27d572bbc7620ed8e039fa9d4d14d41b1581b279be9db499f32c"
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_json_fortran" ] && rm -f "${BUILDDIR}/setup_json_fortran"
! [ -d "${BUILDDIR}" ] && mkdir -p "${BUILDDIR}"
cd "${BUILDDIR}"
case "$with_json_fortran" in
__INSTALL__)
echo "==================== Installing json_fortran ===================="
pkg_install_dir="${INSTALLDIR}/json_fortran-${json_fortran_ver}"
install_lock_file="$pkg_install_dir/install_successful"
if verify_checksums "${install_lock_file}" ; then
echo "json-fortran-${json_fortran_ver} is already installed, skipping it."
else
if [ -f json-fortran-${json_fortran_ver}.tar.gz ] ; then
echo "json-fortran-${json_fortran_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${json_fortran_sha256} \
https://github.com/jacobwilliams/json-fortran/archive/${json_fortran_ver}.tar.gz \
-o json-fortran-${json_fortran_ver}.tar.gz
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d json-fortran-${json_fortran_ver} ] && rm -rf json-fortran-${json_fortran_ver}
tar -xzf json-fortran-${json_fortran_ver}.tar.gz
cd json-fortran-${json_fortran_ver}
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="${pkg_install_dir}" -DUSE_GNU_INSTALL_CONVENTION=on -DSKIP_DOC_GEN=true -DCMAKE_INSTALL_LIBDIR=lib .. > make.log 2>&1
make -j $NPROCS >> make.log 2>&1
make -j $NPROCS install > install.log 2>&1
cd ../..
write_checksums "${install_lock_file}" "${SCRIPT_DIR}/$(basename ${SCRIPT_NAME})"
fi
JSON_CFLAGS="-I'${pkg_install_dir}/include'"
JSON_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath='${pkg_install_dir}/lib'"
;;
__SYSTEM__)
echo "==================== Finding json-fortran from system paths ===================="
add_include_from_paths JSON_CFLAGS "json_file_module.mod" $INCLUDE_PATHS
add_lib_from_paths JSON_LDFLAGS "libjsonfortran.*" $LIB_PATHS
;;
__DONTUSE__)
;;
*)
echo "==================== Linking json-fortran to user paths ===================="
pkg_install_dir="$with_json"
check_dir "$pkg_install_dir/lib"
check_dir "$pkg_install_dir/lib64"
check_dir "$pkg_install_dir/include"
JSON_CFLAGS="-I'${pkg_install_dir}/include'"
JSON_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath='${pkg_install_dir}/lib'"
;;
esac
if [ "$with_json_fortran" != "__DONTUSE__" ] ; then
JSON_LIBS="-ljsonfortran"
if [ "$with_json_fortran" != "__SYSTEM__" ] ; then
cat << EOF > "${BUILDDIR}/setup_json_fortran"
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 CPATH "$pkg_install_dir/include"
export JSON_CFLAGS="${JSON_CFLAGS}"
export JSON_LDFLAGS="${JSON_LDFLAGS}"
export CP_DFLAGS="\${CP_DFLAGS} -D__JSON"
export CP_CFLAGS="\${CP_CFLAGS} ${JSON_CFLAGS}"
export CP_LDFLAGS="\${CP_LDFLAGS} ${JSON_LDFLAGS}"
export CP_LIBS="${JSON_LIBS} \${CP_LIBS}"
EOF
cat "${BUILDDIR}/setup_json_fortran" >> $SETUPFILE
fi
fi
# update toolchain environment
load "${BUILDDIR}/setup_json_fortran"
export -p > "${INSTALLDIR}/toolchain.env"
cd "${ROOTDIR}"
report_timing "json-fortran"