From 245d51d1182254e93e161ca09e0c22c018f17a5e Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sun, 13 Jan 2019 14:22:10 +0100 Subject: [PATCH] Improved irpf90 installation --- configure | 10 +--------- etc/ezfio.rc | 18 +++++++++++------- etc/irpf90.rc | 20 ++++++++++++++++---- scripts/qp_export_as_tgz | 5 +++-- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/configure b/configure index 1d98bb87..4e99d23e 100755 --- a/configure +++ b/configure @@ -149,6 +149,7 @@ for PACKAGE in ${PACKAGES} ; do elif [[ ${PACKAGE} = irpf90 ]] ; then + # When changing version of irpf90, don't forget to update etc/irpf90.rc download \ "https://gitlab.com/scemama/irpf90/-/archive/v1.7.4/irpf90-v1.7.4.tar.gz" \ "${QP_ROOT}"/external/irpf90.tar.gz @@ -158,15 +159,6 @@ for PACKAGE in ${PACKAGES} ; do rm irpf90.tar.gz cd irpf90-* make - for i in irpf90 irpman irpf90_indent - do - cat << EOF > "${QP_ROOT}"/bin/$i -#!/bin/sh -exec $PWD/bin/$i \$@ -EOF - - chmod +x "${QP_ROOT}"/bin/$i - done ) diff --git a/etc/ezfio.rc b/etc/ezfio.rc index 67a8a008..ec557139 100644 --- a/etc/ezfio.rc +++ b/etc/ezfio.rc @@ -2,11 +2,15 @@ export QP_EZFIO=${QP_ROOT}/external/ezfio -if [[ -f ${QP_EZFIO}/Bash/ezfio.sh ]]; then - if [[ "$(ps -p $$ -ocomm=)" == "zsh" ]] ; then - autoload bashcompinit - bashcompinit - fi - source ${QP_EZFIO}/Bash/ezfio.sh -fi +function source_if_exists() { + if [[ -f $1 ]]; then + if [[ "$(ps -p $$ -ocomm=)" == "zsh" ]] ; then + autoload bashcompinit + bashcompinit + fi + source $1 + fi +} + +source_if_exists "${QP_EZFIO}/Bash/ezfio.sh" diff --git a/etc/irpf90.rc b/etc/irpf90.rc index e3a57d1d..cbf5552b 100644 --- a/etc/irpf90.rc +++ b/etc/irpf90.rc @@ -1,9 +1,21 @@ # Configuration of IRPF90 package -export IRPF90=${QP_ROOT}/bin/irpf90 +# Set the path of IRPF90 here: +export IRPF90_PATH=${QP_ROOT}/external/irpf90-v1.7.4 +export PATH=${PATH}:${IRPF90_PATH}/bin -# Load irpman shell completion -irpman=$(tail -1 "${QP_ROOT}/bin/irpman" | cut --delimiter " " --field=2) -source $(dirname ${irpman})/../irpman-completions.bash +export IRPF90=${IRPF90_PATH}/bin/irpf90 + +function source_if_exists() { + if [[ -f $1 ]]; then + if [[ "$(ps -p $$ -ocomm=)" == "zsh" ]] ; then + autoload bashcompinit + bashcompinit + fi + source $1 + fi +} + +source_if_exists "${IRPF90_PATH}/irpman-completions.bash" diff --git a/scripts/qp_export_as_tgz b/scripts/qp_export_as_tgz index ff5babf4..75686fe3 100755 --- a/scripts/qp_export_as_tgz +++ b/scripts/qp_export_as_tgz @@ -173,8 +173,9 @@ cp --recursive -- ${QP_ROOT}/external/ezfio/Bash ${QPACKAGE_STATIC}/external/e echo "Creating quantum_package.rc" # --------------------------- -cp ${QP_ROOT}/quantum_package.rc ${QP_ROOT}/etc/* ${QPACKAGE_STATIC}/ -echo 'export QP_ROOT="$( cd $(dirname \${BASH_SOURCE}) ; pwd -P )"' > ${QPACKAGE_STATIC}/etc/00.qp_root +cp ${QP_ROOT}/quantum_package.rc ${QPACKAGE_STATIC}/ +cp ${QP_ROOT}/etc/* ${QPACKAGE_STATIC}/etc/ +echo 'export QP_ROOT="$( cd $(dirname \${BASH_SOURCE}) ; pwd -P )"' > ${QPACKAGE_STATIC}/etc/00.qp_root.rc