diff --git a/apps/alamode/README.md b/apps/alamode/README.md new file mode 100644 index 0000000..7160d7a --- /dev/null +++ b/apps/alamode/README.md @@ -0,0 +1,17 @@ +# ALAMODE + +## SUMMARY + + A program package for constructing interatomic force fields which explicitly consider lattice anharmonicity. In combination with a molecular dynamics simulator LAMMPS and an external first-principles package such as VASP and Quantum ESPRESSO, ALAMODE extracts harmonic/anharmonic force constants of solids and calculates phonon dispersion, phonon DOS, Gruneisen parameter, phonon-phonon scattering probability, lattice thermal-conductivity, anharmonic phonons at finite temperature, phonon free energy and so on. + +## LICENSE + + MIT License + +## OFFICIAL PAGE + + https://alamode.readthedocs.io/en/latest/ + +## MateriApps URL + + https://ma.issp.u-tokyo.ac.jp/en/app/155 diff --git a/apps/alamode/README_ja.md b/apps/alamode/README_ja.md new file mode 100644 index 0000000..3775d61 --- /dev/null +++ b/apps/alamode/README_ja.md @@ -0,0 +1,17 @@ +# ALAMODE + +## SUMMARY + + 格子振動の非調和性を露わに考慮した原子間ポテンシャルを構築するプログラムパッケージ。VASPやQuantum ESPRESSOなどの第一原理計算プログラムやLAMMPSの計算結果から調和・非調和force constantを推定し、それらをもとにフォノン分散、フォノン状態密度、グリューナイゼン定数、フォノン‐フォノン散乱強度、格子熱伝導率、有限温度における非調和フォノン、フォノン由来の自由エネルギーなどを計算することが可能。 + +## LICENSE + + MIT LICENSE + +## OFFICIAL PAGE + + https://alamode.readthedocs.io/en/latest/ + +## MateriApps URL + + https://ma.issp.u-tokyo.ac.jp/app/151 diff --git a/apps/alamode/config/default/build.sh b/apps/alamode/config/default/build.sh new file mode 100644 index 0000000..bc0d080 --- /dev/null +++ b/apps/alamode/config/default/build.sh @@ -0,0 +1,2 @@ +cd build +make ${MAKE_J} diff --git a/apps/alamode/config/default/install.sh b/apps/alamode/config/default/install.sh new file mode 100644 index 0000000..091754d --- /dev/null +++ b/apps/alamode/config/default/install.sh @@ -0,0 +1,15 @@ +mkdir -p $PREFIX/bin + +cp build/alm/alm $PREFIX/bin +cp build/anphon/anphon $PREFIX/bin + +mkdir -p $PREFIX/tools +for name in analyze_phonons dfc2 fc_virtual parse_fcsxml qe2alm; do + cp build/tools/$name $PREFIX/tools +done + +cp tools/*.py $PREFIX/tools +cp -r tools/interface $PREFIX/tools + +cp -r example $PREFIX + diff --git a/apps/alamode/config/default/preprocess.sh b/apps/alamode/config/default/preprocess.sh new file mode 100644 index 0000000..d05f17a --- /dev/null +++ b/apps/alamode/config/default/preprocess.sh @@ -0,0 +1,13 @@ +set -u + +rm -rf build +mkdir build +cd build + +${CMAKE} \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_VERBOSE_MAKEFILE=1 \ + -DSPGLIB_ROOT=${SPGLIB_ROOT} \ + -DFFTW3_ROOT=${FFTW3_ROOT} \ + -DCMAKE_CXX_FLAGS="-O3 ${MA_EXTRA_FLAGS}" \ + ../ diff --git a/apps/alamode/config/intel/preprocess.sh b/apps/alamode/config/intel/preprocess.sh new file mode 100644 index 0000000..8d1aa08 --- /dev/null +++ b/apps/alamode/config/intel/preprocess.sh @@ -0,0 +1,15 @@ +set -u + +rm -rf build +mkdir build +cd build + +${CMAKE} \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_VERBOSE_MAKEFILE=1 \ + -DUSE_MKL_FFT=yes \ + -DSPGLIB_ROOT=${SPGLIB_ROOT} \ + -DCMAKE_CXX_FLAGS="-O3 ${MA_EXTRA_FLAGS}" \ + -DCMAKE_C_COMPILER=icc \ + -DCMAKE_CXX_COMPILER=icpc \ + ../ diff --git a/apps/alamode/download.sh b/apps/alamode/download.sh new file mode 100644 index 0000000..75bc947 --- /dev/null +++ b/apps/alamode/download.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) +. $SCRIPT_DIR/../../scripts/util.sh +. $SCRIPT_DIR/version.sh +set_prefix + +URL=https://github.com/ttadano/alamode/archive/refs/tags/v.${__VERSION__}.tar.gz +ARCHIVE=${SOURCE_DIR}/${__NAME__}-${__VERSION__}.tar.gz + +if [ -f $ARCHIVE ]; then :; else + check wget $URL -O $ARCHIVE +fi diff --git a/apps/alamode/install.sh b/apps/alamode/install.sh new file mode 100644 index 0000000..287a447 --- /dev/null +++ b/apps/alamode/install.sh @@ -0,0 +1,80 @@ +#!/bin/sh +cat << EOF > config.txt +# configurable variables (e.g. compiler) + +# use default if not defined +export CMAKE="${CMAKE:-cmake}" +export ISSP_UCOUNT="${ISSP_UCOUNT:-/home/issp/materiapps/bin/issp-ucount}" +export MAKE_J="${MAKE_J:-"-j1"}" +export SCALAPACK_LIBRARIES="${SCALAPACK_LIBRARIES:-""}" +export MA_EXTRA_FLAGS="${MA_EXTRA_FLAGS:-""}" + +# export explicitly if defined +test -n "${CC+defined}" && export CC="$CC" +test -n "${FC+defined}" && export FC="$FC" + +EOF +. ./config.txt + +set -e + +XTRACED=$(set -o | awk '/xtrace/{ print $2 }') +if [ "$XTRACED" = "on" ]; then + SHFLAG="-x" +fi + +mode=${1:-default} +SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) +CONFIG_DIR=$SCRIPT_DIR/config/$mode +if [ ! -d $CONFIG_DIR ]; then + echo "Error: unknown mode: $mode" + echo "Available list:" + ls -1 $SCRIPT_DIR/config + exit 127 +fi +DEFAULT_CONFIG_DIR=$SCRIPT_DIR/config/default + +export UTIL_SH=$SCRIPT_DIR/../../scripts/util.sh +. $UTIL_SH +. $SCRIPT_DIR/version.sh +set_prefix + +. ${MA_ROOT}/env.sh +export PREFIX="${MA_ROOT}/${__NAME__}/${__NAME__}-${__VERSION__}-${__MA_REVISION__}" +if [ -d $PREFIX ]; then + echo "Error: $PREFIX exists" + exit 127 +fi +export LOG=${BUILD_DIR}/${__NAME__}-${__VERSION__}-${__MA_REVISION__}.log +mv config.txt $LOG +echo "mode = $mode" | tee -a $LOG + +rm -rf ${BUILD_DIR}/${__NAME__}-${__VERSION__} +pipefail check sh $SHFLAG ${SCRIPT_DIR}/setup.sh \| tee -a $LOG +cd ${BUILD_DIR}/${__NAME__}-${__VERSION__} +start_info | tee -a $LOG + +for process in preprocess build install postprocess; do + if [ -f $CONFIG_DIR/${process}.sh ]; then + echo "[${process}]" | tee -a $LOG + pipefail check sh $SHFLAG $CONFIG_DIR/${process}.sh \| tee -a $LOG + elif [ -f $DEFAULT_CONFIG_DIR/${process}.sh ]; then + echo "[${process}]" | tee -a $LOG + pipefail check sh $SHFLAG $DEFAULT_CONFIG_DIR/${process}.sh \| tee -a $LOG + fi +done + +finish_info | tee -a $LOG + +ROOTNAME=$(toupper ${__NAME__})_ROOT + +cat << EOF > ${BUILD_DIR}/${__NAME__}vars.sh +# ${__NAME__} $(basename $0 .sh) ${__VERSION__} ${__MA_REVISION__} $(date +%Y%m%d-%H%M%S) +. ${MA_ROOT}/env.sh +export ${ROOTNAME}=$PREFIX +export PATH=\${${ROOTNAME}}/bin:\$PATH +EOF +VARS_SH=${MA_ROOT}/${__NAME__}/${__NAME__}vars-${__VERSION__}-${__MA_REVISION__}.sh +rm -f $VARS_SH +cp -f ${BUILD_DIR}/${__NAME__}vars.sh $VARS_SH +cp -f $LOG ${MA_ROOT}/${__NAME__}/ diff --git a/apps/alamode/link.sh b/apps/alamode/link.sh new file mode 100644 index 0000000..c58d3e2 --- /dev/null +++ b/apps/alamode/link.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) +. $SCRIPT_DIR/../../scripts/util.sh +. $SCRIPT_DIR/version.sh +set_prefix + +. $MA_ROOT/env.sh + +VARS_SH=$MA_ROOT/${__NAME__}/${__NAME__}vars-$__VERSION__-$__MA_REVISION__.sh +rm -f $MA_ROOT/${__NAME__}/${__NAME__}vars.sh +ln -s $VARS_SH $MA_ROOT/${__NAME__}/${__NAME__}vars.sh diff --git a/apps/alamode/setup.sh b/apps/alamode/setup.sh new file mode 100644 index 0000000..368b338 --- /dev/null +++ b/apps/alamode/setup.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +ROOT_FILE=README.md + +SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) +. $SCRIPT_DIR/../../scripts/util.sh +. $SCRIPT_DIR/version.sh +set_prefix +sh ${SCRIPT_DIR}/download.sh + +NV=${__NAME__}-${__VERSION__} +cd $BUILD_DIR +if [ -d $NV ]; then :; else + check mkdir -p $NV + tarfile=$SOURCE_DIR/${NV}.tar.gz + sc=`calc_strip_components $tarfile $ROOT_FILE` + check tar zxf $tarfile -C $NV --strip-components=$sc + cd $NV + if [ -f $SCRIPT_DIR/patch/${NV}.patch ]; then + patch -p1 < $SCRIPT_DIR/patch/${NV}.patch + fi +fi diff --git a/apps/alamode/version.sh b/apps/alamode/version.sh new file mode 100644 index 0000000..d61e11d --- /dev/null +++ b/apps/alamode/version.sh @@ -0,0 +1,6 @@ +ALAMODE_VERSION="1.5.0" +ALAMODE_MA_REVISION="1" + +__NAME__=alamode +__VERSION__=${ALAMODE_VERSION} +__MA_REVISION__=${ALAMODE_MA_REVISION} diff --git a/tools/spglib/config/default/.dummy b/tools/spglib/config/default/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/tools/spglib/config/default/build.sh b/tools/spglib/config/default/build.sh new file mode 100644 index 0000000..977103e --- /dev/null +++ b/tools/spglib/config/default/build.sh @@ -0,0 +1,4 @@ +set -u + +cd build +make ${MAKE_J} diff --git a/tools/spglib/config/default/install.sh b/tools/spglib/config/default/install.sh new file mode 100644 index 0000000..372d1c6 --- /dev/null +++ b/tools/spglib/config/default/install.sh @@ -0,0 +1,4 @@ +set -u + +cd build +make install diff --git a/tools/spglib/config/default/preprocess.sh b/tools/spglib/config/default/preprocess.sh new file mode 100644 index 0000000..35450a0 --- /dev/null +++ b/tools/spglib/config/default/preprocess.sh @@ -0,0 +1,4 @@ +set -u + +rm -rf build && mkdir -p build && cd build +cmake -DCMAKE_INSTALL_PREFIX=$PREFIX ../ diff --git a/tools/spglib/download.sh b/tools/spglib/download.sh new file mode 100644 index 0000000..5770038 --- /dev/null +++ b/tools/spglib/download.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) +. $SCRIPT_DIR/../../scripts/util.sh +. $SCRIPT_DIR/version.sh +set_prefix + +VERSION_MAJOR=$(echo "${__VERSION__}" | cut -d . -f 1,2) +if [ -f $SOURCE_DIR/${__NAME__}-${__VERSION__}.tar.gz ]; then :; else + check wget -O $SOURCE_DIR/${__NAME__}-${__VERSION__}.tar.gz https://github.com/spglib/spglib/archive/refs/tags/v${__VERSION__}.tar.gz +fi diff --git a/tools/spglib/install.sh b/tools/spglib/install.sh new file mode 100644 index 0000000..10de356 --- /dev/null +++ b/tools/spglib/install.sh @@ -0,0 +1,80 @@ +#!/bin/sh +cat << EOF > config.txt +# configurable variables (e.g. compiler) + +# use default if not defined +export MAKE_J="${MAKE_J:-"-j1"}" + +# export explicitly if defined +test -n "${CC+defined}" && export CC="$CC" + +EOF +. ./config.txt + +set -e + +XTRACED=$(set -o | awk '/xtrace/{ print $2 }') +if [ "$XTRACED" = "off" ]; then + SHFLAG="" +else + SHFLAG="-x" +fi + +mode=${1:-default} +export SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) +CONFIG_DIR=$SCRIPT_DIR/config/$mode +if [ ! -d $CONFIG_DIR ]; then + echo "Error: unknown mode: $mode" + echo "Available list:" + ls -1 $SCRIPT_DIR/config + exit 127 +fi +DEFAULT_CONFIG_DIR=$SCRIPT_DIR/config/default + +export UTIL_SH=$SCRIPT_DIR/../../scripts/util.sh +. $UTIL_SH +. $SCRIPT_DIR/version.sh +set_prefix + +. ${MA_ROOT}/env.sh +export PREFIX="${MA_ROOT}/${__NAME__}/${__NAME__}-${__VERSION__}-${__MA_REVISION__}" +if [ -d $PREFIX ]; then + echo "Error: $PREFIX exists" + exit 127 +fi +export LOG=${BUILD_DIR}/${__NAME__}-${__VERSION__}-${__MA_REVISION__}.log +mv config.txt $LOG + +set +e +. $SCRIPT_DIR/../../tools/openssl/find.sh; if [ ${MA_HAVE_OPENSSL} = "no" ]; then echo "Error: openssl not found"; exit 127; fi +set -e + +rm -rf ${BUILD_DIR}/${__NAME__}-${__VERSION__} +pipefail sh $SHFLAG ${SCRIPT_DIR}/setup.sh \| tee -a $LOG +cd ${BUILD_DIR}/${__NAME__}-${__VERSION__} +start_info | tee -a $LOG + +for process in preprocess build install postprocess; do + if [ -f $CONFIG_DIR/${process}.sh ]; then + echo "[${process}]" | tee -a $LOG + pipefail check sh $SHFLAG $CONFIG_DIR/${process}.sh \| tee -a $LOG + elif [ -f $DEFAULT_CONFIG_DIR/${process}.sh ]; then + echo "[${process}]" | tee -a $LOG + pipefail check sh $SHFLAG $DEFAULT_CONFIG_DIR/${process}.sh \| tee -a $LOG + fi +done + +finish_info | tee -a $LOG + +ROOTNAME=$(toupper ${__NAME__})_ROOT + +cat << EOF > ${BUILD_DIR}/${__NAME__}vars.sh +# ${__NAME__} $(basename $0 .sh) ${__VERSION__} ${__MA_REVISION__} $(date +%Y%m%d-%H%M%S) +export ${ROOTNAME}=$PREFIX +export LD_LIBRARY_PATH=\${${ROOTNAME}}/lib64:\$LD_LIBRARY_PATH +export DYLD_LIBRARY_PATH=\${${ROOTNAME}}/lib64:\$DYLD_LIBRARY_PATH +EOF +VARS_SH=${MA_ROOT}/${__NAME__}/${__NAME__}vars-${__VERSION__}-${__MA_REVISION__}.sh +rm -f $VARS_SH +cp -f ${BUILD_DIR}/${__NAME__}vars.sh $VARS_SH +cp -f $LOG ${MA_ROOT}/${__NAME__}/ diff --git a/tools/spglib/link.sh b/tools/spglib/link.sh new file mode 100644 index 0000000..5e680dc --- /dev/null +++ b/tools/spglib/link.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) +. $SCRIPT_DIR/../../scripts/util.sh +. $SCRIPT_DIR/version.sh +set_prefix + +. $MA_ROOT/env.sh + +VARS_SH=$MA_ROOT/${__NAME__}/${__NAME__}vars-$__VERSION__-$__MA_REVISION__.sh +rm -f $MA_ROOT/env.d/${__NAME__}vars.sh +ln -s $VARS_SH $MA_ROOT/env.d/${__NAME__}vars.sh diff --git a/tools/spglib/setup.sh b/tools/spglib/setup.sh new file mode 100644 index 0000000..8d0ab27 --- /dev/null +++ b/tools/spglib/setup.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) +. $SCRIPT_DIR/../../scripts/util.sh +. $SCRIPT_DIR/version.sh +set_prefix + +sh $SCRIPT_DIR/download.sh + +cd $BUILD_DIR +if [ -d ${__NAME__}-${__VERSION__} ]; then :; else + check tar zxf $SOURCE_DIR/${__NAME__}-${__VERSION__}.tar.gz + if [ -f $SCRIPT_DIR/patch/${__NAME__}-${__VERSION__}.patch ]; then + cd ${__NAME__}-${__VERSION__} + cat $SCRIPT_DIR/patch/${__NAME__}-${__VERSION__}.patch | patch -p1 + fi +fi diff --git a/tools/spglib/version.sh b/tools/spglib/version.sh new file mode 100644 index 0000000..8196383 --- /dev/null +++ b/tools/spglib/version.sh @@ -0,0 +1,6 @@ +SPGLIB_VERSION="2.5.0" +SPGLIB_MA_REVISION="1" + +__NAME__=spglib +__VERSION__=${SPGLIB_VERSION} +__MA_REVISION__=${SPGLIB_MA_REVISION}