From 4fedc7274907a87b3b74a0b4ac299523366e2a6e Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Fri, 5 Jun 2015 22:33:19 +0200 Subject: [PATCH 01/23] First try of new setup --- doc/code_architecture/Script.md | 2 + install/scripts/build.sh | 10 ++ .../scripts}/fetch_from_web.py | 0 install/scripts/install_curl.sh | 19 +++ install/scripts/install_docopt.sh | 10 ++ install/scripts/install_emsl.sh | 10 ++ install/scripts/install_ezfio.sh | 16 +++ install/scripts/install_irpf90.sh | 24 ++++ install/scripts/install_m4.sh | 15 +++ install/scripts/install_ninja.sh | 14 +++ install/scripts/install_ocaml.sh | 41 +++++++ install/scripts/install_patch.sh | 19 +++ install/scripts/install_resultsFile.sh | 11 ++ install/scripts/install_zlib.sh | 16 +++ scripts/cache_compile.py | 62 ---------- scripts/compilation/qp_create_ninja.py | 28 +++-- scripts/install/install_curl.sh | 31 ----- scripts/install/install_docopt.sh | 21 ---- scripts/install/install_emsl.sh | 23 ---- scripts/install/install_ezfio.sh | 24 ---- scripts/install/install_irpf90.sh | 29 ----- scripts/install/install_m4.sh | 31 ----- scripts/install/install_ninja.sh | 23 ---- scripts/install/install_ocaml.sh | 67 ---------- scripts/install/install_resultsFile.sh | 24 ---- scripts/install/install_zlib.sh | 38 ------ setup_environment.sh | 116 ------------------ 27 files changed, 225 insertions(+), 499 deletions(-) create mode 100755 install/scripts/build.sh rename {scripts/install => install/scripts}/fetch_from_web.py (100%) create mode 100755 install/scripts/install_curl.sh create mode 100755 install/scripts/install_docopt.sh create mode 100755 install/scripts/install_emsl.sh create mode 100755 install/scripts/install_ezfio.sh create mode 100755 install/scripts/install_irpf90.sh create mode 100755 install/scripts/install_m4.sh create mode 100755 install/scripts/install_ninja.sh create mode 100755 install/scripts/install_ocaml.sh create mode 100755 install/scripts/install_patch.sh create mode 100755 install/scripts/install_resultsFile.sh create mode 100755 install/scripts/install_zlib.sh delete mode 100755 scripts/cache_compile.py delete mode 100755 scripts/install/install_curl.sh delete mode 100755 scripts/install/install_docopt.sh delete mode 100755 scripts/install/install_emsl.sh delete mode 100755 scripts/install/install_ezfio.sh delete mode 100755 scripts/install/install_irpf90.sh delete mode 100755 scripts/install/install_m4.sh delete mode 100755 scripts/install/install_ninja.sh delete mode 100755 scripts/install/install_ocaml.sh delete mode 100755 scripts/install/install_resultsFile.sh delete mode 100755 scripts/install/install_zlib.sh delete mode 100755 setup_environment.sh diff --git a/doc/code_architecture/Script.md b/doc/code_architecture/Script.md index b5c19dcd..c348aca5 100644 --- a/doc/code_architecture/Script.md +++ b/doc/code_architecture/Script.md @@ -23,6 +23,8 @@ It have some usefull property: - The dict of the root - The list reduced tree (For a list of module in input return only the root) +For tree syntax you can check http://en.wikipedia.org/wiki/Tree_%28data_structure%29#Terminologies_used_in_Trees + In the cli mode: - From a `NEEDED_CHILDREN_MODULE` file you can have all the descendant, and a png representation who correspond. diff --git a/install/scripts/build.sh b/install/scripts/build.sh new file mode 100755 index 00000000..6b7fc80a --- /dev/null +++ b/install/scripts/build.sh @@ -0,0 +1,10 @@ +#!/bin/bash -x +# This script should be included + +BUILD=_build/${TARGET} +rm -rf -- ${BUILD} +mkdir ${BUILD} || exit 1 +tar -zxf Downloads/${TARGET}.tar.gz --strip-components=1 --directory=${BUILD} || exit 1 +_install || exit 1 +rm -rf -- ${BUILD} _build/${TARGET}.log +exit 0 \ No newline at end of file diff --git a/scripts/install/fetch_from_web.py b/install/scripts/fetch_from_web.py similarity index 100% rename from scripts/install/fetch_from_web.py rename to install/scripts/fetch_from_web.py diff --git a/install/scripts/install_curl.sh b/install/scripts/install_curl.sh new file mode 100755 index 00000000..a8ce9724 --- /dev/null +++ b/install/scripts/install_curl.sh @@ -0,0 +1,19 @@ +#!/bin/bash -x +TARGET=curl + +function _install() +{ + cd .. + QPACKAGE_ROOT=$PWD + cd - + cd ${BUILD} || return 1 + mv curl.ermine ${QPACKAGE_ROOT}/bin/curl || return 1 +} + +BUILD=_build/${TARGET} +rm -rf -- ${BUILD} +mkdir ${BUILD} || exit 1 +tar -xvjf Downloads/${TARGET}.tar.bz2 --strip-components=1 --directory=${BUILD} || exit 1 +_install || exit 1 +rm -rf -- ${BUILD} _build/${TARGET}.log +exit 0 \ No newline at end of file diff --git a/install/scripts/install_docopt.sh b/install/scripts/install_docopt.sh new file mode 100755 index 00000000..d632ebd6 --- /dev/null +++ b/install/scripts/install_docopt.sh @@ -0,0 +1,10 @@ +#!/bin/bash -x + +TARGET=docopt + +function _install() +{ + cp -R ${BUILD} . || exit 1 +} + +source scripts/build.sh diff --git a/install/scripts/install_emsl.sh b/install/scripts/install_emsl.sh new file mode 100755 index 00000000..a87f91ec --- /dev/null +++ b/install/scripts/install_emsl.sh @@ -0,0 +1,10 @@ +#!/bin/bash -x + +TARGET=emsl + +function _install() +{ + cp -R ${BUILD} . || exit 1 +} + +source scripts/build.sh diff --git a/install/scripts/install_ezfio.sh b/install/scripts/install_ezfio.sh new file mode 100755 index 00000000..9b7b8c59 --- /dev/null +++ b/install/scripts/install_ezfio.sh @@ -0,0 +1,16 @@ +#!/bin/bash -x + +TARGET=ezfio + +function _install() +{ + cd .. + QPACKAGE_ROOT=$PWD + cd - + rm -rf ${QPACKAGE_ROOT}/EZFIO + cd ${BUILD}/config || return 1 + cd - + mv ${BUILD} ${QPACKAGE_ROOT}/install/EZFIO || return 1 +} + +source scripts/build.sh diff --git a/install/scripts/install_irpf90.sh b/install/scripts/install_irpf90.sh new file mode 100755 index 00000000..00dd7675 --- /dev/null +++ b/install/scripts/install_irpf90.sh @@ -0,0 +1,24 @@ +#!/bin/bash -x + +TARGET=irpf90 +function _install() +{ + cd .. + QPACKAGE_ROOT=$PWD + cd - + + make -C ${BUILD} || return 1 + rm -rf -- ./irpf90 + mv ${BUILD} . || return 1 + [[ -x ./irpf90/bin/irpf90 ]] || return 1 + [[ -x ./irpf90/bin/irpman ]] || return 1 + rm -rf -- ../bin/irpf90 ../bin/irpman + echo 'exec ${QMCCHEM_PATH}/install/irpf90/bin/irpf90 $@' > ../bin/irpf90 || return 1 + echo 'exec ${QMCCHEM_PATH}/install/irpf90/bin/irpman $@' > ../bin/irpman || return 1 + chmod +x ../bin/irpf90 ../bin/irpman || return 1 + return 0 +} + +source scripts/build.sh + + diff --git a/install/scripts/install_m4.sh b/install/scripts/install_m4.sh new file mode 100755 index 00000000..db65aa15 --- /dev/null +++ b/install/scripts/install_m4.sh @@ -0,0 +1,15 @@ +#!/bin/bash -x + +TARGET=m4 + +function _install() +{ + cd .. + QPACKAGE_ROOT=$PWD + cd - + cd ${BUILD} + ./configure && make || exit 1 + ln -sf ${PWD}/src/m4 ${QPACKAGE_ROOT}/bin || exit 1 +} + +source scripts/build.sh diff --git a/install/scripts/install_ninja.sh b/install/scripts/install_ninja.sh new file mode 100755 index 00000000..2aab6edd --- /dev/null +++ b/install/scripts/install_ninja.sh @@ -0,0 +1,14 @@ +#!/bin/bash -x + +TARGET=ninja + +function _install() +{ + cd ${BUILD} || return 1 + ./configure.py --bootstrap || return 1 + cd - + mv ${BUILD}/ninja ../bin/ || return 1 + return 0 +} + +source scripts/build.sh \ No newline at end of file diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh new file mode 100755 index 00000000..caa49c19 --- /dev/null +++ b/install/scripts/install_ocaml.sh @@ -0,0 +1,41 @@ +#!/bin/bash -x + +PACKAGES="core cryptokit ocamlfind sexplib" + +declare -i i +i=$(gcc -dumpversion | cut -d '.' -f 2) +if [[ i -lt 6 ]] +then + echo "GCC version $(gcc -dumpversion) too old. GCC >= 4.6 required." + exit 1 +fi + +cd .. +QPACKAGE_ROOT=$PWD +cd - + +cd Downloads || exit 1 +chmod +x ocaml.sh || exit 1 + +if [[ -d ${HOME}/.opam ]] +then + source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true +fi + +echo N | ./ocaml.sh ${QPACKAGE_ROOT}/bin/ || exit 1 +if [[ ! -f ${QPACKAGE_ROOT}/bin/opam ]] +then + echo "Installation of OPAM failed" + exit 2 +fi +${QPACKAGE_ROOT}/bin/opam config setup -a --dot-profile ${QPACKAGE_ROOT}/qmcchemrc || exit 1 +touch ${QPACKAGE_ROOT}/bin/opam + +export LD_LIBRARY_PATH=${QPACKAGE_ROOT}/lib:${LD_LIBRARY_PATH} +export LIBRARY_PATH=${QPACKAGE_ROOT}/lib:${LIBRARY_PATH} +export C_INCLUDE_PATH=${QPACKAGE_ROOT}/lib:${C_INCLUDE_PATH} +opam install ${PACKAGES} || exit 1 +rm -f ../_build/ocaml.log +exit 0 + + diff --git a/install/scripts/install_patch.sh b/install/scripts/install_patch.sh new file mode 100755 index 00000000..53eda01c --- /dev/null +++ b/install/scripts/install_patch.sh @@ -0,0 +1,19 @@ +#!/bin/bash -x + +TARGET=patch + +function _install() +{ + mkdir ${TARGET} + cd .. + QPACKAGE_ROOT=$PWD + cd - + cd ${BUILD} + ./configure --prefix=${QPACKAGE_ROOT}/install/${TARGET} && make || exit 1 + make install || exit 1 + cd - + cp ${TARGET}/bin/${TARGET} ${QPACKAGE_ROOT}/bin || exit 1 + rm -R -- ${TARGET} || exit 1 +} + +source scripts/build.sh \ No newline at end of file diff --git a/install/scripts/install_resultsFile.sh b/install/scripts/install_resultsFile.sh new file mode 100755 index 00000000..d4238d5f --- /dev/null +++ b/install/scripts/install_resultsFile.sh @@ -0,0 +1,11 @@ +#!/bin/bash -x + +TARGET=resultsFile + +function _install() +{ + cp -R ${BUILD} . || exit 1 +} + +source scripts/build.sh + diff --git a/install/scripts/install_zlib.sh b/install/scripts/install_zlib.sh new file mode 100755 index 00000000..7cd66d76 --- /dev/null +++ b/install/scripts/install_zlib.sh @@ -0,0 +1,16 @@ +#!/bin/bash -x + +TARGET=zlib + +function _install() +{ + mkdir ${TARGET} || exit 1 + cd .. + QPACKAGE_ROOT=$PWD + cd - + cd ${BUILD} + ./configure && make || exit 1 + make install prefix=$QPACKAGE_ROOT/install/${TARGET} || exit 1 +} + +source scripts/build.sh \ No newline at end of file diff --git a/scripts/cache_compile.py b/scripts/cache_compile.py deleted file mode 100755 index 9898eae5..00000000 --- a/scripts/cache_compile.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import shelve -import hashlib -import re - -r = re.compile(ur'-c\s+(\S+\.[fF]90)\s+-o\s+(\S+\.o)') -p = re.compile(ur'-I IRPF90_temp/\S*\s+') -mod = re.compile(ur'module\s+(?P\S+).+end\s?module\s+(?P=mod)?', re.MULTILINE | re.IGNORECASE) - -TMPDIR="/tmp/qp_compiler/" - -def main(): - # Create temp directory - if "qp_compiler" not in os.listdir("/tmp"): - os.mkdir("/tmp/qp_compiler/") - - line = sys.argv[1:] - command = " ".join(line) - command_clean = p.sub('',command) - - try: - match = r.search(command_clean) - input = match.group(1) - output = match.group(2) - except: - os.system(command) - return - m = hashlib.md5() - - # Fread : read input - with open(input,'r') as file: - fread = file.read() - m.update( " ".join( [ command, fread ] )) - - # Md5 Key containing command + content of Fread - key = TMPDIR+m.hexdigest() - try: - # Try to return the content of the .o file - with open(key,'r') as file: - result = file.read() - except IOError: - # Compile the file -> .o - os.system(command) - # Read the .o - with open(output,'r') as file: - result = file.read() - # Copy the .o in database - if not mod.search(fread.replace('\n',' ')): - with open(key,'w') as file: - file.write(result) - else: - print input+' -> module' - else: - # Write the .o file - with open(output,'w') as file: - file.write(result) - -if __name__ == '__main__': - main() diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index 343ccd89..62f4758d 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -296,7 +296,7 @@ def ninja_symlink_build(path_module, l_symlink): # o ._ ._ _|_ (_| / \ ._ _ _. | _ # | | |_) | | \_/ o | | | (_| |< (/_ # | -def get_l_file_for_module(path_module_abs): +def get_l_file_for_module(path_module): ''' return the list of irp.f in a module ''' @@ -306,17 +306,17 @@ def get_l_file_for_module(path_module_abs): l_template = [] - for f in os.listdir(path_module_abs): + for f in os.listdir(path_module.abs): if f.lower().endswith(tuple([".template.f", ".include.f"])): - l_template.append(join(path_module_abs, f)) + l_template.append(join(path_module.abs, f)) elif f.endswith(".irp.f"): - l_irp.append(join(path_module_abs, f)) + l_irp.append(join(path_module.abs, f)) elif f.lower().endswith(tuple([".f", ".f90", ".c", ".cpp", ".cxx"])): - l_src.append(join(path_module_abs, f)) + l_src.append(f) obj = '{0}.o'.format(os.path.splitext(f)[0]) - l_obj.append(join(path_module_abs, obj)) + l_obj.append(obj) elif f == "EZFIO.cfg": - l_irp.append(join(path_module_abs, "ezfio_interface.irp.f")) + l_irp.append(join(path_module.abs, "ezfio_interface.irp.f")) d = {"l_irp": l_irp, "l_src": l_src, @@ -334,12 +334,20 @@ def get_file_dependency(d_info_module): for module, l_children in d_info_module.iteritems(): - for key, values in get_l_file_for_module(module.abs).iteritems(): + for key, values in get_l_file_for_module(module).iteritems(): + if key in ["l_src"]: + values = [join(module.abs,o) for o in values] + if key in ["l_obj"]: + values = [join(module.abs,"IRPF90_temp",o) for o in values] d_irp[module][key] = values for children in l_children: - for key, values in get_l_file_for_module(children.abs).iteritems(): - d_irp[module][key].extend(values) + for key, values in get_l_file_for_module(children).iteritems(): + if key in ["l_src"]: + values = [join(module.abs,children.rel,o) for o in values] + if key in ["l_obj"]: + values = [join(module.abs,"IRPF90_temp",children.rel,o) for o in values] + d_irp[module][key].extend(values) return d_irp diff --git a/scripts/install/install_curl.sh b/scripts/install/install_curl.sh deleted file mode 100755 index 5f32e384..00000000 --- a/scripts/install/install_curl.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# Installs curl for ocaml -# Mon Jan 12 18:52:48 CET 2015 - -CURL="curl-7.30.0.ermine" -CURL_URL="http://qmcchem.ups-tlse.fr/files/scemama/${CURL}.tar.bz2" - -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit -1 -fi - -cd ${QPACKAGE_ROOT} - -curl -kL "https://github.com/LCPQ/quantum_package" &> /dev/null -if [[ $? -eq 0 ]] -then - exit 0 -fi - -rm -f -- ${QPACKAGE_ROOT}/bin/curl -${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${CURL_URL} CURL.tar.bz2 -tar -jxf CURL.tar.bz2 && rm CURL.tar.bz2 ||exit 1 -cd ${CURL} || exit 1 -mv curl.ermine ${QPACKAGE_ROOT}/bin/curl -cd ${QPACKAGE_ROOT} -rm -rf -- ${CURL} - diff --git a/scripts/install/install_docopt.sh b/scripts/install/install_docopt.sh deleted file mode 100755 index 862e61cd..00000000 --- a/scripts/install/install_docopt.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# Installs docopt -# lundi 27 avril 2015, 16:51:34 (UTC+0200) - -DOCOPT="docopt.py" -DOCOPT_URL="https://raw.githubusercontent.com/docopt/docopt/master/${DOCOPT}" - -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit -1 -fi - -cd ${QPACKAGE_ROOT} - -rm -f -- scripts/${DOCOPT}{,c} -${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${DOCOPT_URL} ${DOCOPT} - -mv ${DOCOPT} scripts/utility/${DOCOPT} diff --git a/scripts/install/install_emsl.sh b/scripts/install/install_emsl.sh deleted file mode 100755 index b0bbc820..00000000 --- a/scripts/install/install_emsl.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# -# Installs EMSL_Basis_Set_Exchange_Local -# Mon Jan 12 12:57:19 CET 2015 - -BASE="EMSL_Basis_Set_Exchange_Local" -URL="https://github.com/LCPQ/${BASE}/archive/master.tar.gz" - -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit -1 -fi - -cd ${QPACKAGE_ROOT} - -${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${URL} ${QPACKAGE_ROOT}/${BASE}.tar.gz -tar -zxf ${BASE}.tar.gz && rm ${BASE}.tar.gz ||exit 1 -rm -rf EMSL_Basis -mv ${BASE}-master EMSL_Basis - - diff --git a/scripts/install/install_ezfio.sh b/scripts/install/install_ezfio.sh deleted file mode 100755 index 7e9a39e2..00000000 --- a/scripts/install/install_ezfio.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# Installs EZFIO -# Mon Jan 12 16:06:44 CET 2015 - -BASE="ezfio" -URL="https://github.com/LCPQ/${BASE}/archive/master.tar.gz" - -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit -1 -fi - -cd ${QPACKAGE_ROOT} - -rm -rf -- EZFIO -${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${URL} ${QPACKAGE_ROOT}/${BASE}.tar.gz -tar -zxf ${BASE}.tar.gz && rm ${BASE}.tar.gz ||exit 1 -mv EZFIO-master EZFIO - - - diff --git a/scripts/install/install_irpf90.sh b/scripts/install/install_irpf90.sh deleted file mode 100755 index 251cd9f3..00000000 --- a/scripts/install/install_irpf90.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Installs irpf90 -# Mon Jan 12 16:00:20 CET 2015 - -BASE="irpf90" -URL="https://github.com/LCPQ/${BASE}/archive/master.tar.gz" - -# Check the QPACKAGE_ROOT directory -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit 1 -fi - -cd ${QPACKAGE_ROOT} - - -${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${URL} ${QPACKAGE_ROOT}/${BASE}.tar.gz -tar -zxf ${BASE}.tar.gz && rm ${BASE}.tar.gz ||exit 1 -mv ${BASE}-master irpf90 -make -C irpf90 -rm -rf -- bin/irpf90 bin/irpman -echo '${QPACKAGE_ROOT}/irpf90/bin/irpf90 $@' > bin/irpf90 -echo '${QPACKAGE_ROOT}/irpf90/bin/irpman $@' > bin/irpman -chmod +x bin/irpf90 bin/irpman - - diff --git a/scripts/install/install_m4.sh b/scripts/install/install_m4.sh deleted file mode 100755 index 6495b82e..00000000 --- a/scripts/install/install_m4.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# Installs m4 for ocaml -# Thu Oct 23 22:02:08 CEST 2014 - -M4_URL="http://ftp.gnu.org/gnu/m4/m4-latest.tar.gz" -M4=$(which m4) - -# Check the QPACKAGE_ROOT directory -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit 1 -fi - -cd ${QPACKAGE_ROOT} - -rm -f l${QPACKAGE_ROOT}/bin/m4 -if [[ -z ${M4} ]] -then - rm -f -- bin/m4 - ${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${M4_URL} M4.tar.gz - tar -zxf M4.tar.gz && rm M4.tar.gz ||exit 1 - cd m4* || exit 1 - ./configure && make || exit 1 - ln -s ${PWD}/src/m4 ${QPACKAGE_ROOT}/bin -else - ln -s ${M4} ${QPACKAGE_ROOT}/bin/m4 -fi - diff --git a/scripts/install/install_ninja.sh b/scripts/install/install_ninja.sh deleted file mode 100755 index e54c5366..00000000 --- a/scripts/install/install_ninja.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# -# Installs the ninja build system -# Thu May 28 13:21:16 CEST 2015 - -BASE="ninja" -URL="https://github.com/martine/ninja/archive/master.tar.gz" - -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit -1 -fi - -cd ${QPACKAGE_ROOT} - -${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${URL} ${QPACKAGE_ROOT}/${BASE}.tar.gz -tar -zxf ${BASE}.tar.gz && rm ${BASE}.tar.gz ||exit 1 -rm -rf ${BASE} -mv ${BASE}-master ${BASE} -cd ${BASE} -./configure.py --bootstrap diff --git a/scripts/install/install_ocaml.sh b/scripts/install/install_ocaml.sh deleted file mode 100755 index fe02e9df..00000000 --- a/scripts/install/install_ocaml.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# Downloads and installs ocaml, opam and core library -# Thu Oct 23 21:58:40 CEST 2014 - -PACKAGES="core cryptokit" -OPAM_BASE=$HOME/.opam - -# Check the QPACKAGE_ROOT directory -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit 1 -fi - -cd ${QPACKAGE_ROOT} - - -if [[ -f quantum_package.rc ]] -then - source quantum_package.rc -fi -make -C ocaml Qptypes.ml &> /dev/null - -if [[ $? -ne 0 ]] -then - - if [[ -d ${OPAM_BASE} ]] - then - echo "${OPAM_BASE} exists." - echo "Re-install ? [y/N]" - while read -r -n 1 -s answer; do - if [[ $answer = [YyNn] ]]; then - if [[ $answer = [Yy] ]] ; then - echo " - Remove your directory ${OPAM_BASE}" - echo " - Restart setup" - exit 1 - fi - if [[ $answer = [Nn] ]] ; then - make -C ocaml Qptypes.ml - exit 0 - fi - fi - done - fi -fi -${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py \ - "https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh" opam_installer.sh -chmod +x opam_installer.sh -echo N | ./opam_installer.sh ${QPACKAGE_ROOT}/bin - -if [[ ! -f ${QPACKAGE_ROOT}/bin/opam ]] -then - echo "Installation of OPAM failed" - exit 2 -fi -rm -f opam_installer.sh -${QPACKAGE_ROOT}/bin/opam config setup -a --dot-profile ${QPACKAGE_ROOT}/quantum_package.rc - -source ${QPACKAGE_ROOT}/quantum_package.rc -echo Y | opam install ${PACKAGES} - -make -C ocaml Qptypes.ml - -exit 0 - diff --git a/scripts/install/install_resultsFile.sh b/scripts/install/install_resultsFile.sh deleted file mode 100755 index dc5c5d11..00000000 --- a/scripts/install/install_resultsFile.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# Installs the resultsFile Python library -# Mon Jan 19 15:08:18 CET 2015 - -URL="https://github.com/LCPQ/resultsFile/archive/master.tar.gz" - -# Check the QPACKAGE_ROOT directory -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit 1 -fi - -cd ${QPACKAGE_ROOT} - - -rm -rf resultsFile-master -${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${URL} ${QPACKAGE_ROOT}/resultsFile.tar.gz -tar -zxf resultsFile.tar.gz && rm resultsFile.tar.gz ||exit 1 -mv resultsFile-master resultsFile - - diff --git a/scripts/install/install_zlib.sh b/scripts/install/install_zlib.sh deleted file mode 100755 index 30f0055b..00000000 --- a/scripts/install/install_zlib.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# Installs zlib for ocaml cryptokit -# Mon Jan 12 18:52:48 CET 2015 - -ZLIB="zlib-1.2.8" -ZLIB_URL="http://zlib.net/${ZLIB}.tar.gz" - -# Check the QPACKAGE_ROOT directory -if [[ -z ${QPACKAGE_ROOT} ]] -then - echo "The QPACKAGE_ROOT environment variable is not set." - echo "Please reload the quantum_package.rc file." - exit 1 -fi - -cd ${QPACKAGE_ROOT} - - -cat > /tmp/main.c << EOF -int main () {} -EOF -gcc /tmp/main.c -lz -if [[ $? -eq 0 ]] -then - rm /tmp/main.c "a.out" - exit 0 -fi -rm /tmp/main.c - -${QPACKAGE_ROOT}/scripts/install/fetch_from_web.py ${ZLIB_URL} ZLIB.tar.gz -tar -zxf ZLIB.tar.gz && rm ZLIB.tar.gz ||exit 1 -cd ${ZLIB} || exit 1 -./configure && make -make install prefix=$QPACKAGE_ROOT -cd ${QPACKAGE_ROOT} -rm -rf -- ${ZLIB} - diff --git a/setup_environment.sh b/setup_environment.sh deleted file mode 100755 index 0eb5e20d..00000000 --- a/setup_environment.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# -# Setup script. Downloads dependencies if they are not already present -# in the current installation. -# Thu Oct 23 22:02:08 CEST 2014 - -BLUE="" -RED="" -BLACK="(B" - -QPACKAGE_ROOT="$( cd "$(dirname "$BASH_SOURCE")" ; pwd -P )" - - -cat << EOF > quantum_package.rc -export QPACKAGE_ROOT=\$( cd \$(dirname "\${BASH_SOURCE}") ; pwd -P ) -export IRPF90="\${QPACKAGE_ROOT}/bin/irpf90" -export LD_LIBRARY_PATH="\${QPACKAGE_ROOT}"/lib:\${LD_LIBRARY_PATH} -export LIBRARY_PATH="\${QPACKAGE_ROOT}"/lib:\${LIBRARY_PATH} -export C_INCLUDE_PATH="\${QPACKAGE_ROOT}"/include:\${C_INCLUDE_PATH} - -export PYTHONPATH=\${PYTHONPATH}\$(find "\${QPACKAGE_ROOT}"/scripts -type d -printf ":%p") - -export PATH=\${PATH}\$(find "\${QPACKAGE_ROOT}"/scripts -type d -printf ":%p") -export PATH=\${PATH}:"\${QPACKAGE_ROOT}"/bin -export PATH=\${PATH}:"\${QPACKAGE_ROOT}"/ocaml -export PATH=\${PATH}:"\${QPACKAGE_ROOT}"/ninja -source "\${QPACKAGE_ROOT}"/bin/irpman &> /dev/null -EOF - - -source quantum_package.rc -mkdir -p install_logs -echo "${BLUE}===== Installing IRPF90 ===== ${BLACK}" -${QPACKAGE_ROOT}/scripts/install/install_irpf90.sh | tee ${QPACKAGE_ROOT}/install_logs/install_irpf90.log -if [[ ! -d ${QPACKAGE_ROOT}/irpf90 ]] || [[ ! -x ${QPACKAGE_ROOT}/bin/irpf90 ]] || [[ ! -x ${QPACKAGE_ROOT}/bin/irpman ]] -then - echo $RED "Error in IRPF90 installation" $BLACK - exit 1 -fi - -mkdir -p ${QPACKAGE_ROOT}/install_logs - -echo "${BLUE}===== Installing Ninja ===== ${BLACK}" -${QPACKAGE_ROOT}/scripts/install/install_ninja.sh | tee ${QPACKAGE_ROOT}/install_logs/install_ninja.log - -echo "${BLUE}===== Installing Zlib ===== ${BLACK}" -${QPACKAGE_ROOT}/scripts/install/install_zlib.sh | tee ${QPACKAGE_ROOT}/install_logs/install_zlib.log - -echo "${BLUE}===== Installing Curl ===== ${BLACK}" -${QPACKAGE_ROOT}/scripts/install/install_curl.sh | tee ${QPACKAGE_ROOT}/install_logs/install_curl.log - -echo "${BLUE}===== Installing M4 ===== ${BLACK}" -${QPACKAGE_ROOT}/scripts/install/install_m4.sh | tee ${QPACKAGE_ROOT}/install_logs/install_m4.log - -echo "${BLUE}===== Installing Docopt ===== ${BLACK}" -${QPACKAGE_ROOT}/scripts/install/install_docopt.sh | tee ${QPACKAGE_ROOT}/install_logs/install_docopt.log - -echo "${BLUE}===== Installing EMSL Basis set library ===== ${BLACK}" -${QPACKAGE_ROOT}/scripts/install/install_emsl.sh | tee ${QPACKAGE_ROOT}/install_logs/install_emsl.log - -if [[ ! -d ${QPACKAGE_ROOT}/EMSL_Basis ]] -then - echo $RED "Error in EMSL Basis set library installation" $BLACK - exit 1 -fi - -echo "${BLUE}===== Installing EZFIO ===== ${BLACK}" - -${QPACKAGE_ROOT}/scripts/install/install_ezfio.sh | tee ${QPACKAGE_ROOT}/install_logs/install_ezfio.log -if [[ ! -d ${QPACKAGE_ROOT}/EZFIO ]] -then - echo $RED "Error in EZFIO installation" $BLACK - exit 1 -fi - - -echo "${BLUE}===== Installing Ocaml compiler and libraries ===== ${BLACK}" -rm -f -- ocaml/Qptypes.ml -${QPACKAGE_ROOT}/scripts/install/install_ocaml.sh | tee ${QPACKAGE_ROOT}/install_logs/install_ocaml.log - -if [[ ! -f ${QPACKAGE_ROOT}/ocaml/Qptypes.ml ]] -then - echo $RED "Error in Ocaml installation" $BLACK - exit 1 -fi - -echo "${BLUE}===== Installing resultsFile Python library ===== ${BLACK}" -${QPACKAGE_ROOT}/scripts/install/install_resultsFile.sh -if [[ ! -d ${QPACKAGE_ROOT}/resultsFile ]] -then - echo $RED "Error in resultsFile installation" $BLACK - exit 1 -fi - - -echo $RED " -======================================================= -To complete the installation, add the following line to -your ~/.bashrc: - -source ${QPACKAGE_ROOT}/quantum_package.rc - -======================================================= -" $BLACK - - - - -if [[ $1 == "--robot" ]] ; -then - exit 0 -else - source quantum_package.rc - exec bash -fi - From 430b2ed597bdd59d8407e5282214ec4086a8e7ea Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Sat, 6 Jun 2015 10:44:04 +0200 Subject: [PATCH 02/23] Fix path for .F --- scripts/compilation/qp_create_ninja.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index 62f4758d..6041d0ec 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -300,7 +300,7 @@ def get_l_file_for_module(path_module): ''' return the list of irp.f in a module ''' - l_irp = [] + l_depend = [] l_src = [] l_obj = [] @@ -310,15 +310,16 @@ def get_l_file_for_module(path_module): if f.lower().endswith(tuple([".template.f", ".include.f"])): l_template.append(join(path_module.abs, f)) elif f.endswith(".irp.f"): - l_irp.append(join(path_module.abs, f)) + l_depend.append(join(path_module.abs, f)) elif f.lower().endswith(tuple([".f", ".f90", ".c", ".cpp", ".cxx"])): - l_src.append(f) + l_depend.append(join(path_module.abs,f)) + l_src.append(f) obj = '{0}.o'.format(os.path.splitext(f)[0]) l_obj.append(obj) elif f == "EZFIO.cfg": - l_irp.append(join(path_module.abs, "ezfio_interface.irp.f")) + l_depend.append(join(path_module.abs, "ezfio_interface.irp.f")) - d = {"l_irp": l_irp, + d = {"l_depend": l_depend, "l_src": l_src, "l_obj": l_obj, "l_template": l_template} @@ -340,7 +341,7 @@ def get_file_dependency(d_info_module): if key in ["l_obj"]: values = [join(module.abs,"IRPF90_temp",o) for o in values] d_irp[module][key] = values - + for children in l_children: for key, values in get_l_file_for_module(children).iteritems(): if key in ["l_src"]: @@ -403,17 +404,17 @@ def ninja_irpf90_make_build(path_module, l_needed_molule, d_irp): # D e p e n d a n c y # # ~#~#~#~#~#~#~#~#~#~ # - l_irp_need = d_irp[path_module]["l_irp"] + l_depend = d_irp[path_module]["l_depend"] l_src = d_irp[path_module]["l_src"] l_obj = d_irp[path_module]["l_obj"] l_template = d_irp[path_module]["l_template"] if l_needed_molule: - l_destination = ["l_symlink_{0}".format(path_module.rel)] + l_symlink = ["l_symlink_{0}".format(path_module.rel)] else: - l_destination = [] + l_symlink = [] - str_depend = " ".join(l_irp_need + l_destination + l_src + l_template) + str_depend = " ".join(l_depend + l_symlink + l_template) # ~#~#~#~#~#~#~#~#~#~#~ # # N i n j a _ b u i l d # From f26f761b0b8d205516604e326330b4df803fd697 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 12:35:40 +0200 Subject: [PATCH 03/23] New setup v2 --- install/scripts/install_irpf90.sh | 4 +- scripts/compilation/qp_create_ninja.py | 27 +- scripts/ezfio_interface/ei_handler.py | 8 +- setup_environment.py | 350 +++++++++++++++++++++++++ 4 files changed, 369 insertions(+), 20 deletions(-) create mode 100755 setup_environment.py diff --git a/install/scripts/install_irpf90.sh b/install/scripts/install_irpf90.sh index 00dd7675..4dc8e028 100755 --- a/install/scripts/install_irpf90.sh +++ b/install/scripts/install_irpf90.sh @@ -13,8 +13,8 @@ function _install() [[ -x ./irpf90/bin/irpf90 ]] || return 1 [[ -x ./irpf90/bin/irpman ]] || return 1 rm -rf -- ../bin/irpf90 ../bin/irpman - echo 'exec ${QMCCHEM_PATH}/install/irpf90/bin/irpf90 $@' > ../bin/irpf90 || return 1 - echo 'exec ${QMCCHEM_PATH}/install/irpf90/bin/irpman $@' > ../bin/irpman || return 1 + echo 'exec ${QPACKAGE_ROOT}/install/irpf90/bin/irpf90 $@' > ../bin/irpf90 || return 1 + echo 'exec ${QPACKAGE_ROOT}/install/irpf90/bin/irpman $@' > ../bin/irpman || return 1 chmod +x ../bin/irpf90 ../bin/irpman || return 1 return 0 } diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index 6041d0ec..256e382a 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -26,7 +26,7 @@ except ImportError: QPACKAGE_ROOT = os.environ['QPACKAGE_ROOT'] QPACKAGE_ROOT_SRC = join(QPACKAGE_ROOT, 'src') -QPACKAGE_ROOT_EZFIO = join(QPACKAGE_ROOT, 'EZFIO') +QPACKAGE_ROOT_EZFIO = join(QPACKAGE_ROOT, 'install', 'EZFIO') EZFIO_LIB = join(QPACKAGE_ROOT_EZFIO, "lib", "libezfio.a") @@ -57,8 +57,7 @@ def ninja_create_env_variable(pwd_config_file): l_string.append(str_) lib_lapack = get_compilation_option(pwd_config_file, "LAPACK_LIB") - lib_ezfio = join(QPACKAGE_ROOT_EZFIO, "lib", "libezfio_irp.a") - l_string.append("{0} = {1} {2}".format("LIB", lib_lapack, lib_ezfio)) + l_string.append("{0} = {1} {2}".format("LIB", lib_lapack, EZFIO_LIB)) l_string.append("") @@ -313,7 +312,7 @@ def get_l_file_for_module(path_module): l_depend.append(join(path_module.abs, f)) elif f.lower().endswith(tuple([".f", ".f90", ".c", ".cpp", ".cxx"])): l_depend.append(join(path_module.abs,f)) - l_src.append(f) + l_src.append(f) obj = '{0}.o'.format(os.path.splitext(f)[0]) l_obj.append(obj) elif f == "EZFIO.cfg": @@ -337,18 +336,20 @@ def get_file_dependency(d_info_module): for key, values in get_l_file_for_module(module).iteritems(): if key in ["l_src"]: - values = [join(module.abs,o) for o in values] - if key in ["l_obj"]: - values = [join(module.abs,"IRPF90_temp",o) for o in values] + values = [join(module.abs,o) for o in values] + if key in ["l_obj"]: + values = [join(module.abs,"IRPF90_temp",o) for o in values] + d_irp[module][key] = values - + for children in l_children: for key, values in get_l_file_for_module(children).iteritems(): - if key in ["l_src"]: - values = [join(module.abs,children.rel,o) for o in values] - if key in ["l_obj"]: - values = [join(module.abs,"IRPF90_temp",children.rel,o) for o in values] - d_irp[module][key].extend(values) + if key in ["l_src"]: + values = [join(module.abs,children.rel,o) for o in values] + if key in ["l_obj"]: + values = [join(module.abs,"IRPF90_temp",children.rel,o) for o in values] + + d_irp[module][key].extend(values) return d_irp diff --git a/scripts/ezfio_interface/ei_handler.py b/scripts/ezfio_interface/ei_handler.py index 2d551db9..06b444c4 100755 --- a/scripts/ezfio_interface/ei_handler.py +++ b/scripts/ezfio_interface/ei_handler.py @@ -368,7 +368,7 @@ def create_ezfio_stuff(dict_ezfio_cfg, config_or_default="config"): if begin[0] == '-': a_size_raw.append("{0}+{1}+1".format(end, begin[1:])) else: - a_size_raw.append("{0}-{1}+1".format(end, begin)) + a_size_raw.append("{0}-{1}+1".format(end, begin)) size_raw = ",".join(a_size_raw) @@ -454,10 +454,8 @@ def save_ezfio_config(module_lower, str_ezfio_config): Write the str_ezfio_config in "$QPACKAGE_ROOT/EZFIO/{0}.ezfio_interface_config".format(module_lower) """ - - root_ezfio = "{0}/EZFIO".format(os.environ['QPACKAGE_ROOT']) - path = "{0}/config/{1}.ezfio_interface_config".format(root_ezfio, - module_lower) + name = "{0}.ezfio_interface_config".format(module_lower) + path = os.path.join(os.environ['QP_EZFIO'], "config", name) with open(path, "w+") as f: f.write(str_ezfio_config) diff --git a/setup_environment.py b/setup_environment.py new file mode 100755 index 00000000..02bc204a --- /dev/null +++ b/setup_environment.py @@ -0,0 +1,350 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import subprocess +import os +import sys +import pprint + +from os.path import join + +# __ _ +# /__ | _ |_ _. | o ._ _|_ _ +# \_| |_ (_) |_) (_| | | | | | (_) +# + +QPACKAGE_ROOT = os.getcwd() +QPACKAGE_ROOT_BIN = join(QPACKAGE_ROOT, "bin") +QPACKAGE_ROOT_INSTALL = join(QPACKAGE_ROOT, "install") + +d_dependancy = { + "ocaml": ["m4", "curl", "zlib", "patch", "gcc"], + "m4": [], + "curl": [], + "zlib": ["gcc"], + "patch": [], + "ezfio": ["irpf90"], + "irpf90": ["python"], + "docopt": ["python"], + "resultsFile": ["python"], + "emsl": ["python"], + "gcc": [], + "python": [], + "ninja": ["gcc", "python"] +} + +from collections import namedtuple + +Info = namedtuple("Info", ["url", "description", "default_path"]) + +path_github = {"head": "http://github.com/", "tail": "archive/master.tar.gz"} + +ocaml = Info( + url='http://raw.github.com/ocaml/opam/master/shell/opam_installer.sh', + description=' ocaml', + default_path=join(QPACKAGE_ROOT_BIN, "opam")) + +m4 = Info( + url="http://ftp.gnu.org/gnu/m4/m4-latest.tar.gz", + description=" m4", + default_path=join(QPACKAGE_ROOT_BIN, "m4")) + +curl = Info( + url="http://qmcchem.ups-tlse.fr/files/scemama/curl-7.30.0.ermine.tar.bz2", + description=" curl", + default_path=join(QPACKAGE_ROOT_BIN, "curl")) + +zlib = Info( + url='http://zlib.net/zlib-1.2.8.tar.gz', + description=' zlib', + default_path=join(QPACKAGE_ROOT_INSTALL, "zlib")) + +path = Info( + url='ftp://ftp.gnu.org/gnu/patch/patch-2.7.5.tar.gz', + description=' path', + default_path=join(QPACKAGE_ROOT_BIN, "patch")) + +irpf90 = Info( + url='{head}/scemama/irpf90/archive/v1.6.5.tar.gz'.format(**path_github), + description=' irpf90', + default_path=join(QPACKAGE_ROOT_BIN, "irpf90")) + +docopt = Info( + url='{head}/docopt/docopt/{tail}'.format(**path_github), + description=' docop', + default_path=join(QPACKAGE_ROOT_INSTALL, "docopt")) + +resultsFile = Info( + url='{head}/LCPQ/resultsFile/{tail}'.format(**path_github), + description=' resultsFile', + default_path=join(QPACKAGE_ROOT_INSTALL, "resultsFile")) + +ninja = Info( + url='{head}/martine/ninja/{tail}'.format(**path_github), + description=' nina', + default_path=join(QPACKAGE_ROOT_BIN, "ninja")) + +emsl = Info( + url='{head}/LCPQ/EMSL_Basis_Set_Exchange_Local/{tail}'.format(** + path_github), + description=' emsl', + default_path=join(QPACKAGE_ROOT_INSTALL, "emsl")) + +ezfio = Info( + url='{head}/LCPQ/EZFIO/{tail}'.format(**path_github), + description=' EZFIO', + default_path=join(QPACKAGE_ROOT_INSTALL, "EZFIO")) + +d_info = dict() + +for m in ["ocaml", "m4", "curl", "zlib", "path", "irpf90", "docopt", + "resultsFile", "ninja", "emsl", "ezfio"]: + exec ("d_info['{0}']={0}".format(m)) + +l_need = [] + + +# _ +# |_ ._ _ _|_ o _ ._ +# | |_| | | (_ |_ | (_) | | +# +def check_output(*popenargs, **kwargs): + r"""Run command with arguments and return its output as a byte string. + + Backported from Python 2.7 as it's implemented as pure python on stdlib. + + >>> check_output(['/usr/bin/python', '--version']) + Python 2.6.2 + """ + process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs) + output, unused_err = process.communicate() + retcode = process.poll() + if retcode: + cmd = kwargs.get("args") + if cmd is None: + cmd = popenargs[0] + error = subprocess.CalledProcessError(retcode, cmd) + error.output = output + raise error + return output + + +def check_python(): + req_version = (2, 6) + cur_version = sys.version_info + + # Check python + if cur_version >= req_version: + l_installed["python"] = "" + else: + print "To old version (need >2.5). Abort" + sys.exit(1) + + +def check_avabiliy(binary): + + if binary == "zlib": + binary = "zlib-flate" + + if binary == "python": + check_python() + + try: + return check_output(["which", binary]) + except subprocess.CalledProcessError: + default_path = d_info[binary].default_path + if os.path.exists(default_path): + return default_path + else: + return 0 + + +def splitext(path): + for ext in ['.tar.gz', '.tar.bz2']: + if path.endswith(ext): + return path[:-len(ext)], path[-len(ext):] + return os.path.splitext(path) + + +l_installed = dict() + +print """ + _ + / |_ _ _ | o ._ _ + \_ | | (/_ (_ |< | | | (_| + _| +""" + +# Check all the other +for i in d_dependancy.keys(): + print "Checking if you have {0} avalaible...".format(i), + + r = check_avabiliy(i) + if r: + print "OK" + l_installed[i] = r.strip() + else: + print "We will try to compile if from source in a few moment" + l_need.append(i) + +# Expend the need_stuff for all the genealogy + +d_need_genealogy = dict() + +for need in l_need: + d_need_genealogy[need] = None + for childen in d_dependancy[need]: + if childen not in l_installed: + d_need_genealogy[childen] = None + +l_need_genealogy = d_need_genealogy.keys() + +print """ + __ + (_ ._ _ ._ _ _. ._ + __) |_| | | | | | | (_| | \/ + / +""" + +print "You have already installed :" +pprint.pprint(l_installed) + +print """ + ___ + | ._ _ _|_ _. | | _. _|_ o _ ._ + _|_ | | _> |_ (_| | | (_| |_ | (_) | | + +""" + +if l_need_genealogy: + print "You need to install" + pprint.pprint(l_need_genealogy) +else: + print "Nothing to do" + sys.exit() + +if "ninja" in l_need_genealogy: + + print """ +# ~#~#~#~#~#~#~#~#~#~#~#~#~ # +# I n s t a l l _ n i n j a # +# ~#~#~#~#~#~#~#~#~#~#~#~#~ # +""" + url = d_info["ninja"].url + extension = splitext(url)[1] + path_archive = "Downloads/{0}{1}".format("ninja", extension) + + l_cmd = ["cd install;", + "wget {0} -O {1} -o /dev/null ;".format(url, path_archive), + "./scripts/install_ninja.sh;", "cd -"] + + subprocess.check_call(" ".join(l_cmd), shell=True) + + +print """ +# ~#~#~#~#~#~#~#~#~#~#~#~#~#~ # +# C r e a t i n g _ n i n j a # +# ~#~#~#~#~#~#~#~#~#~#~#~#~#~ # +""" + + +def create_rule(): + + l_rules = [ + "rule download", " command = wget ${url} -O ${out} -o /dev/null", + " description = Downloading ${descr}", "", "rule install", + " command = ./scripts/install_${target}.sh > _build/${target}.log 2>&1", + " description = Installing ${descr}", "" + ] + + return l_rules + +l_string = create_rule() + +l_build = [] + +for need in l_need_genealogy: + + url = d_info[need].url + extension = splitext(url)[1] + + archive_path = "Downloads/{0}{1}".format(need, extension) + + descr = d_info[need].description + + # Build to dowload + l_build += ["build {0}: download".format(archive_path), + " url = {0}".format(url), + " descr = {0}".format(descr), ""] + + # Build to install + l_dependancy = [d_info[i].default_path for i in d_dependancy[need] if i in l_need_genealogy] + + l_build += ["build {0}: install {1} {2}".format(d_info[need].default_path, + archive_path, + " ".join(l_dependancy)), + " target = {0}".format(need), + " descr = {0}".format(descr), ""] + +l_string += l_build + +path = join(QPACKAGE_ROOT_INSTALL, "build.ninja") +with open(path, "w+") as f: + f.write("\n".join(l_string)) + +print "Done" +print "You can check at {0}".format(path) + +print """ +# ~#~#~#~#~#~#~#~#~ # +# R u n _ n i n j a # +# ~#~#~#~#~#~#~#~#~ # +""" + +subprocess.check_call("./bin/ninja -C install", shell=True) + + +print """ +# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # +# C r e a t e q u a n t u m _ p a c k a g e . r c +# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # +""" + +python_path = [join(QPACKAGE_ROOT, "scripts"), join(QPACKAGE_ROOT, "install")] + +l_python = [join(QPACKAGE_ROOT, "scripts")] +for dir_ in python_path: + for folder in os.listdir(dir_): + path = join(dir_, folder) + if os.path.isdir(path): + l_python.append(path) + + +def find_path(bin_): + try: + locate = l_installed[bin_] + except: + locate = d_info[bin_].default_path + return locate + + +l_rc = [ + 'export QPACKAGE_ROOT={0}'.format(QPACKAGE_ROOT), + 'export QP_EZFIO={0}'.format(find_path('ezfio')), + 'export IRPF90={0}'.format(find_path("irpf90")), + 'export NINJA={0}'.format(find_path("ninja")), + 'export PYTHONPATH=${{PYTHONPATH}}:{0}'.format(":".join(l_python)), '', + 'export PATH=${PATH}:${PYTHONPATH}:"${QPACKAGE_ROOT}"/bin', + 'export LD_LIBRARY_PATH="${QPACKAGE_ROOT}"/lib:${LD_LIBRARY_PATH}', + 'export LIBRARY_PATH="${QPACKAGE_ROOT}"/lib:${LIBRARY_PATH}', "" + 'source . ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true', + "" +] + +path = join(QPACKAGE_ROOT, "quantum_package.rc") +with open(path, "w+") as f: + f.write("\n".join(l_rc)) + +print "Done" +print "You can check at {0}".format(path) +print "Don't forget to source it" From e0f360084e1af466afdbeb87adbf45a9cd828a1a Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 14:49:10 +0200 Subject: [PATCH 04/23] QPACKAGE_ROOT => QP_ROOT =D --- .travis.yml | 2 +- install/scripts/install_curl.sh | 4 +- install/scripts/install_ezfio.sh | 6 +- install/scripts/install_irpf90.sh | 6 +- install/scripts/install_m4.sh | 4 +- install/scripts/install_ocaml.sh | 16 ++--- install/scripts/install_patch.sh | 6 +- install/scripts/install_zlib.sh | 6 +- scripts/compilation/cache_compile.py | 2 +- scripts/compilation/qp_create_ninja.py | 33 +++++----- scripts/compilation/read_compilation_cfg.py | 2 +- scripts/ezfio_interface/ei_handler.py | 32 +++++----- .../qp_convert_output_to_ezfio.py | 10 +-- scripts/ezfio_interface/qp_edit_template | 2 +- scripts/generate_h_apply.py | 2 +- scripts/get_basis.sh | 6 +- scripts/make_binary.sh | 42 ++++++------- scripts/module/clean_modules.sh | 6 +- scripts/module/create_executables_list.sh | 10 +-- scripts/module/create_gitignore.sh | 6 +- scripts/module/module_handler.py | 6 +- scripts/module/qp_install_module.py | 2 +- scripts/perturbation.py | 2 +- scripts/pseudo/put_pseudo_in_ezfio.py | 2 +- scripts/qp_include.sh | 14 ++--- scripts/qp_set_frozen_core.py | 2 +- scripts/save_current_mos.sh | 4 +- scripts/upgrade/upgrade_ezfio.sh | 16 ++--- scripts/upgrade/upgrade_irpf90.sh | 16 ++--- setup_environment.py | 62 ++++++++++--------- src/Ezfio_files/output.irp.f | 2 +- src/MOs/utils.irp.f | 2 +- src/Perturbation/perturbation.irp.f | 2 +- src/README.rst | 4 +- testing_no_regression/unit_test.py | 4 +- 35 files changed, 174 insertions(+), 169 deletions(-) diff --git a/.travis.yml b/.travis.yml index a4e27b3f..657c4f09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_script: - sudo apt-get install graphviz script: - - ./setup_environment.sh --robot + - ./setup_environment.py - source ./quantum_package.rc - qp_create_ninja.py --production ./config/gfortran_example.cfg - ninja diff --git a/install/scripts/install_curl.sh b/install/scripts/install_curl.sh index a8ce9724..c3a48024 100755 --- a/install/scripts/install_curl.sh +++ b/install/scripts/install_curl.sh @@ -4,10 +4,10 @@ TARGET=curl function _install() { cd .. - QPACKAGE_ROOT=$PWD + QP_ROOT=$PWD cd - cd ${BUILD} || return 1 - mv curl.ermine ${QPACKAGE_ROOT}/bin/curl || return 1 + mv curl.ermine ${QP_ROOT}/bin/curl || return 1 } BUILD=_build/${TARGET} diff --git a/install/scripts/install_ezfio.sh b/install/scripts/install_ezfio.sh index 9b7b8c59..4d7ac7e7 100755 --- a/install/scripts/install_ezfio.sh +++ b/install/scripts/install_ezfio.sh @@ -5,12 +5,12 @@ TARGET=ezfio function _install() { cd .. - QPACKAGE_ROOT=$PWD + QP_ROOT=$PWD cd - - rm -rf ${QPACKAGE_ROOT}/EZFIO + rm -rf ${QP_ROOT}/EZFIO cd ${BUILD}/config || return 1 cd - - mv ${BUILD} ${QPACKAGE_ROOT}/install/EZFIO || return 1 + mv ${BUILD} ${QP_ROOT}/install/EZFIO || return 1 } source scripts/build.sh diff --git a/install/scripts/install_irpf90.sh b/install/scripts/install_irpf90.sh index 4dc8e028..60bcf6dc 100755 --- a/install/scripts/install_irpf90.sh +++ b/install/scripts/install_irpf90.sh @@ -4,7 +4,7 @@ TARGET=irpf90 function _install() { cd .. - QPACKAGE_ROOT=$PWD + QP_ROOT=$PWD cd - make -C ${BUILD} || return 1 @@ -13,8 +13,8 @@ function _install() [[ -x ./irpf90/bin/irpf90 ]] || return 1 [[ -x ./irpf90/bin/irpman ]] || return 1 rm -rf -- ../bin/irpf90 ../bin/irpman - echo 'exec ${QPACKAGE_ROOT}/install/irpf90/bin/irpf90 $@' > ../bin/irpf90 || return 1 - echo 'exec ${QPACKAGE_ROOT}/install/irpf90/bin/irpman $@' > ../bin/irpman || return 1 + echo 'exec ${QP_ROOT}/install/irpf90/bin/irpf90 $@' > ../bin/irpf90 || return 1 + echo 'exec ${QP_ROOT}/install/irpf90/bin/irpman $@' > ../bin/irpman || return 1 chmod +x ../bin/irpf90 ../bin/irpman || return 1 return 0 } diff --git a/install/scripts/install_m4.sh b/install/scripts/install_m4.sh index db65aa15..ca62a025 100755 --- a/install/scripts/install_m4.sh +++ b/install/scripts/install_m4.sh @@ -5,11 +5,11 @@ TARGET=m4 function _install() { cd .. - QPACKAGE_ROOT=$PWD + QP_ROOT=$PWD cd - cd ${BUILD} ./configure && make || exit 1 - ln -sf ${PWD}/src/m4 ${QPACKAGE_ROOT}/bin || exit 1 + ln -sf ${PWD}/src/m4 ${QP_ROOT}/bin || exit 1 } source scripts/build.sh diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index caa49c19..a2f2ffae 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -11,7 +11,7 @@ then fi cd .. -QPACKAGE_ROOT=$PWD +QP_ROOT=$PWD cd - cd Downloads || exit 1 @@ -22,18 +22,18 @@ then source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true fi -echo N | ./ocaml.sh ${QPACKAGE_ROOT}/bin/ || exit 1 -if [[ ! -f ${QPACKAGE_ROOT}/bin/opam ]] +echo N | ./ocaml.sh ${QP_ROOT}/bin/ || exit 1 +if [[ ! -f ${QP_ROOT}/bin/opam ]] then echo "Installation of OPAM failed" exit 2 fi -${QPACKAGE_ROOT}/bin/opam config setup -a --dot-profile ${QPACKAGE_ROOT}/qmcchemrc || exit 1 -touch ${QPACKAGE_ROOT}/bin/opam +${QP_ROOT}/bin/opam config setup -a --dot-profile ${QP_ROOT}/qmcchemrc || exit 1 +touch ${QP_ROOT}/bin/opam -export LD_LIBRARY_PATH=${QPACKAGE_ROOT}/lib:${LD_LIBRARY_PATH} -export LIBRARY_PATH=${QPACKAGE_ROOT}/lib:${LIBRARY_PATH} -export C_INCLUDE_PATH=${QPACKAGE_ROOT}/lib:${C_INCLUDE_PATH} +export LD_LIBRARY_PATH=${QP_ROOT}/lib:${LD_LIBRARY_PATH} +export LIBRARY_PATH=${QP_ROOT}/lib:${LIBRARY_PATH} +export C_INCLUDE_PATH=${QP_ROOT}/lib:${C_INCLUDE_PATH} opam install ${PACKAGES} || exit 1 rm -f ../_build/ocaml.log exit 0 diff --git a/install/scripts/install_patch.sh b/install/scripts/install_patch.sh index 53eda01c..10522401 100755 --- a/install/scripts/install_patch.sh +++ b/install/scripts/install_patch.sh @@ -6,13 +6,13 @@ function _install() { mkdir ${TARGET} cd .. - QPACKAGE_ROOT=$PWD + QP_ROOT=$PWD cd - cd ${BUILD} - ./configure --prefix=${QPACKAGE_ROOT}/install/${TARGET} && make || exit 1 + ./configure --prefix=${QP_ROOT}/install/${TARGET} && make || exit 1 make install || exit 1 cd - - cp ${TARGET}/bin/${TARGET} ${QPACKAGE_ROOT}/bin || exit 1 + cp ${TARGET}/bin/${TARGET} ${QP_ROOT}/bin || exit 1 rm -R -- ${TARGET} || exit 1 } diff --git a/install/scripts/install_zlib.sh b/install/scripts/install_zlib.sh index 7cd66d76..8e1b3d8b 100755 --- a/install/scripts/install_zlib.sh +++ b/install/scripts/install_zlib.sh @@ -4,13 +4,15 @@ TARGET=zlib function _install() { + rm -rf -- ${TARGET} mkdir ${TARGET} || exit 1 cd .. - QPACKAGE_ROOT=$PWD + QP_ROOT=$PWD cd - cd ${BUILD} ./configure && make || exit 1 - make install prefix=$QPACKAGE_ROOT/install/${TARGET} || exit 1 + make install prefix=$QP_ROOT/install/${TARGET} || exit 1 + ln -f $QP_ROOT/install/${TARGET}/lib/libz.so $QP_ROOT/lib || exit 1 } source scripts/build.sh \ No newline at end of file diff --git a/scripts/compilation/cache_compile.py b/scripts/compilation/cache_compile.py index d6aac8be..398dc1b9 100755 --- a/scripts/compilation/cache_compile.py +++ b/scripts/compilation/cache_compile.py @@ -104,5 +104,5 @@ if __name__ == '__main__': try: cache_utility(command) - except: + except OSError: process = subprocess.Popen(command, shell=True) diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index 256e382a..7534d61f 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -24,11 +24,11 @@ except ImportError: # \_| | (_) |_) (_| | \/ (_| | | (_| |_) | (/_ _> # -QPACKAGE_ROOT = os.environ['QPACKAGE_ROOT'] -QPACKAGE_ROOT_SRC = join(QPACKAGE_ROOT, 'src') -QPACKAGE_ROOT_EZFIO = join(QPACKAGE_ROOT, 'install', 'EZFIO') +QP_ROOT = os.environ['QP_ROOT'] +QP_ROOT_SRC = join(QP_ROOT, 'src') +QP_ROOT_EZFIO = join(QP_ROOT, 'install', 'EZFIO') -EZFIO_LIB = join(QPACKAGE_ROOT_EZFIO, "lib", "libezfio.a") +EZFIO_LIB = join(QP_ROOT, "lib", "libezfio.a") # # |\ | _. ._ _ _ _| _|_ ._ | _ @@ -75,14 +75,14 @@ def dict_module_genelogy_path(d_module_genelogy): """ d = dict() for module_rel, l_children_rel in d_module_genelogy.iteritems(): - module_abs = join(QPACKAGE_ROOT_SRC, module_rel) + module_abs = join(QP_ROOT_SRC, module_rel) p = Path(module_abs, module_rel) try: - d[p] = Path(join(QPACKAGE_ROOT_SRC, l_children_rel), + d[p] = Path(join(QP_ROOT_SRC, l_children_rel), l_children_rel) except: - d[p] = [Path(join(QPACKAGE_ROOT_SRC, children), children) + d[p] = [Path(join(QP_ROOT_SRC, children), children) for children in l_children_rel] return d @@ -99,7 +99,7 @@ def get_l_module_with_ezfio_cfg(): """ from os import listdir from os.path import isfile, join - qp_src = QPACKAGE_ROOT_SRC + qp_src = QP_ROOT_SRC return [join(qp_src, m) for m in listdir(qp_src) if isfile(join(qp_src, m, "EZFIO.cfg"))] @@ -112,10 +112,10 @@ def get_l_ezfio_config(): l = [] - cmd = "{0}/*/*.ezfio_config".format(QPACKAGE_ROOT_SRC) + cmd = "{0}/*/*.ezfio_config".format(QP_ROOT_SRC) for path_in_module in glob.glob(cmd): name_lower = os.path.split(path_in_module)[1].lower() - path_in_ezfio = join(QPACKAGE_ROOT_EZFIO, "config", name_lower) + path_in_ezfio = join(QP_ROOT_EZFIO, "config", name_lower) l.append(EZ_config_path(path_in_module, path_in_ezfio)) return l @@ -146,7 +146,7 @@ def get_children_of_ezfio_cfg(l_module_with_ezfio_cfg): """ From a module list of ezfio_cfg return all the stuff create by him """ - config_folder = join(QPACKAGE_ROOT_EZFIO, "config") + config_folder = join(QP_ROOT_EZFIO, "config") l_util = dict() @@ -222,8 +222,9 @@ def ninja_ezfio_rule(): l_flag = ["export {0}='${0}'".format(flag) for flag in ["FC", "FCFLAGS", "IRPF90"]] - l_cmd = ["cd {0}".format(QPACKAGE_ROOT_EZFIO) - ] + l_flag + ["ninja"] + l_cmd = ["cd {0}".format(QP_ROOT_EZFIO) + ] + l_flag + ["make && ln -f {0} {1}".format(join(QP_ROOT, 'install', 'EZFIO',"lib","libezfio.a"), + EZFIO_LIB)] l_string = ["rule build_ezfio", " command = {0}".format(" ; ".join(l_cmd)), @@ -244,7 +245,7 @@ def ninja_ezfio_build(l_ezfio_config, l_util): str_ = " ".join(l_ezfio_config + l_ezfio_from_cfg) - ezfio_make_config = join(QPACKAGE_ROOT_EZFIO,"make.config") + ezfio_make_config = join(QP_ROOT_EZFIO, "make.config") l_string = ["build {0} {1}: build_ezfio {2}".format(EZFIO_LIB, ezfio_make_config, str_), ""] @@ -261,7 +262,7 @@ def get_source_destination(path_module, l_needed_molule): Return a list of Sym_link = namedtuple('Sym_link', ['source', 'destination']) for a module """ - return [Sym_link(m.abs, join(QPACKAGE_ROOT_SRC, path_module.rel, m.rel)) + return [Sym_link(m.abs, join(QP_ROOT_SRC, path_module.rel, m.rel)) for m in l_needed_molule] @@ -704,5 +705,5 @@ if __name__ == "__main__": l_string += ninja_binaries_build(module_to_compile, l_children, d_binaries_production) - with open(join(QPACKAGE_ROOT, "build.ninja"), "w+") as f: + with open(join(QP_ROOT, "build.ninja"), "w+") as f: f.write("\n".join(l_string)) diff --git a/scripts/compilation/read_compilation_cfg.py b/scripts/compilation/read_compilation_cfg.py index 592b017c..f3ca01ce 100755 --- a/scripts/compilation/read_compilation_cfg.py +++ b/scripts/compilation/read_compilation_cfg.py @@ -36,7 +36,7 @@ def get_compilation_option(pwd_cfg, flag_name): if __name__ == '__main__': - qpackage_root = os.environ['QPACKAGE_ROOT'] + qpackage_root = os.environ['QP_ROOT'] pwd_cfg = os.path.join(qpackage_root, "config/gfortran_example.cfg") print get_compilation_option(pwd_cfg, "FC") diff --git a/scripts/ezfio_interface/ei_handler.py b/scripts/ezfio_interface/ei_handler.py index 06b444c4..7e7482e8 100755 --- a/scripts/ezfio_interface/ei_handler.py +++ b/scripts/ezfio_interface/ei_handler.py @@ -21,11 +21,11 @@ Options: (aka all with the `interface: input` parameter) in `${pwd}` --ezfio_config Create the `${module_lower}_ezfio_interface_config` in - `${QPACKAGE_ROOT}/EZFIO/config/` + `${QP_ROOT}/EZFIO/config/` This file is needed by *EZFIO* to create the `libezfio.so` --ocaml Create the `Input_module.lower.ml` for the *qp_edit* --ezfio_default Create the `${module_lower}_ezfio_interface_default` in - `${QPACKAGE_ROOT}/data/ezfio_defaults` needed by + `${QP_ROOT}/data/ezfio_defaults` needed by the ocaml ocaml_global Create the qp_edit @@ -100,7 +100,7 @@ def get_type_dict(): # ~#~#~#~#~ # # P i c l e # # ~#~#~#~#~ # - qpackage_root = os.environ['QPACKAGE_ROOT'] + qpackage_root = os.environ['QP_ROOT'] # ~#~#~#~ # # I n i t # @@ -325,7 +325,7 @@ def save_ezfio_provider(path_head, dict_code_provider): path = "{0}/ezfio_interface.irp.f".format(path_head) l_output = ["! DO NOT MODIFY BY HAND", - "! Created by $QPACKAGE_ROOT/scripts/ezfio_interface.py", + "! Created by $QP_ROOT/scripts/ezfio_interface.py", "! from file {0}/EZFIO.cfg".format(path_head), "\n"] @@ -452,7 +452,7 @@ def create_ezfio_config(dict_ezfio_cfg): def save_ezfio_config(module_lower, str_ezfio_config): """ Write the str_ezfio_config in - "$QPACKAGE_ROOT/EZFIO/{0}.ezfio_interface_config".format(module_lower) + "$QP_ROOT/EZFIO/{0}.ezfio_interface_config".format(module_lower) """ name = "{0}.ezfio_interface_config".format(module_lower) path = os.path.join(os.environ['QP_EZFIO'], "config", name) @@ -469,11 +469,11 @@ def create_ezfio_default(dict_ezfio_cfg): def save_ezfio_default(module_lower, str_ezfio_default): """ Write the str_ezfio_config in - "$QPACKAGE_ROOT/data/ezfio_defaults/{0}.ezfio_interface_default".format(module_lower) + "$QP_ROOT/data/ezfio_defaults/{0}.ezfio_interface_default".format(module_lower) """ root_ezfio_default = "{0}/data/ezfio_defaults/".format( - os.environ['QPACKAGE_ROOT']) + os.environ['QP_ROOT']) path = "{0}/{1}.ezfio_interface_default".format(root_ezfio_default, module_lower) with open(path, "w+") as f: @@ -578,10 +578,10 @@ def create_ocaml_input(dict_ezfio_cfg, module_lower): def save_ocaml_input(module_lower, str_ocaml_input): """ Write the str_ocaml_input in - $QPACKAGE_ROOT/ocaml/Input_{0}.ml".format(module_lower) + $QP_ROOT/ocaml/Input_{0}.ml".format(module_lower) """ - path = "{0}/ocaml/Input_{1}.ml".format(os.environ['QPACKAGE_ROOT'], + path = "{0}/ocaml/Input_{1}.ml".format(os.environ['QP_ROOT'], module_lower) with open(path, "w+") as f: @@ -598,7 +598,7 @@ def get_l_module_with_auto_generate_ocaml_lower(): # I n i t # # ~#~#~#~ # - mypath = "{0}/src".format(os.environ['QPACKAGE_ROOT']) + mypath = "{0}/src".format(os.environ['QP_ROOT']) # ~#~#~#~#~#~#~#~ # # L _ f o l d e r # @@ -639,7 +639,7 @@ def create_ocaml_input_global(l_module_with_auto_generate_ocaml_lower): from ezfio_generate_ocaml import EZFIO_ocaml - qpackage_root = os.environ['QPACKAGE_ROOT'] + qpackage_root = os.environ['QP_ROOT'] path = qpackage_root + "/scripts/ezfio_interface/qp_edit_template" with open(path, "r") as f: @@ -661,10 +661,10 @@ def create_ocaml_input_global(l_module_with_auto_generate_ocaml_lower): def save_ocaml_input_auto(str_ocaml_input_global): """ Write the str_ocaml_input in - $QPACKAGE_ROOT/ocaml/Input_auto_generated.ml + $QP_ROOT/ocaml/Input_auto_generated.ml """ - path = "{0}/ocaml/Input_auto_generated.ml".format(os.environ['QPACKAGE_ROOT']) + path = "{0}/ocaml/Input_auto_generated.ml".format(os.environ['QP_ROOT']) with open(path, "w+") as f: f.write(str_ocaml_input_global) @@ -673,10 +673,10 @@ def save_ocaml_input_auto(str_ocaml_input_global): def save_ocaml_qp_edit(str_ocaml_qp_edit): """ Write the str_ocaml_qp_edit in - $QPACKAGE_ROOT/ocaml/qp_edit.ml + $QP_ROOT/ocaml/qp_edit.ml """ - path = "{0}/ocaml/qp_edit.ml".format(os.environ['QPACKAGE_ROOT']) + path = "{0}/ocaml/qp_edit.ml".format(os.environ['QP_ROOT']) with open(path, "w+") as f: f.write(str_ocaml_qp_edit) @@ -771,7 +771,7 @@ if __name__ == "__main__": # G e t _ l _ d i c t _ e z f i o _ c f g # # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# # - qpackage_root_src = join(os.environ['QPACKAGE_ROOT'], "src") + qpackage_root_src = join(os.environ['QP_ROOT'], "src") l_module_with_ezfio = [] diff --git a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py index 0857f598..4cf96ca6 100755 --- a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py +++ b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py @@ -24,14 +24,14 @@ from functools import reduce try: - QPACKAGE_ROOT = os.environ["QPACKAGE_ROOT"] + QP_ROOT = os.environ["QP_ROOT"] except: - print "Error: QPACKAGE_ROOT environment variable not found." + print "Error: QP_ROOT environment variable not found." sys.exit(1) else: - sys.path = [QPACKAGE_ROOT + "/EZFIO/Python", - QPACKAGE_ROOT + "/resultsFile", - QPACKAGE_ROOT + "/scripts"] + sys.path + sys.path = [QP_ROOT + "/EZFIO/Python", + QP_ROOT + "/resultsFile", + QP_ROOT + "/scripts"] + sys.path # ~#~#~#~#~#~ # # I m p o r t # diff --git a/scripts/ezfio_interface/qp_edit_template b/scripts/ezfio_interface/qp_edit_template index 2990a193..218b21ae 100644 --- a/scripts/ezfio_interface/qp_edit_template +++ b/scripts/ezfio_interface/qp_edit_template @@ -260,7 +260,7 @@ Edit input data | Assert_failure (file, line, ch) as e -> begin Printf.eprintf "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n"; - Printf.eprintf "Assert error in file $QPACKAGE_ROOT/ocaml/%s, line %d, character %d\n\n" file line ch; + Printf.eprintf "Assert error in file $QP_ROOT/ocaml/%s, line %d, character %d\n\n" file line ch; Printf.eprintf "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n"; (* restore_backup ezfio_file; *) raise e diff --git a/scripts/generate_h_apply.py b/scripts/generate_h_apply.py index 85eb63d3..563a7a56 100755 --- a/scripts/generate_h_apply.py +++ b/scripts/generate_h_apply.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import os -file = open(os.environ["QPACKAGE_ROOT"]+'/src/Determinants/H_apply.template.f','r') +file = open(os.environ["QP_ROOT"]+'/src/Determinants/H_apply.template.f','r') template = file.read() file.close() diff --git a/scripts/get_basis.sh b/scripts/get_basis.sh index 5db71852..bdc3a3aa 100755 --- a/scripts/get_basis.sh +++ b/scripts/get_basis.sh @@ -8,14 +8,14 @@ # Prints in stdout the name of a temporary file containing the basis set. # -if [[ -z ${QPACKAGE_ROOT} ]] +if [[ -z ${QP_ROOT} ]] then - print "The QPACKAGE_ROOT environment variable is not set." + print "The QP_ROOT environment variable is not set." print "Please reload the quantum_package.rc file." exit -1 fi -export EMSL_API_ROOT="${QPACKAGE_ROOT}"/EMSL_Basis/ +export EMSL_API_ROOT="${QP_ROOT}"/install/EMSL_Basis/ export PYTHONPATH="${EMSL_API_ROOT}":${PYTHONPATH} tmpfile="$1" diff --git a/scripts/make_binary.sh b/scripts/make_binary.sh index 832be596..d18e0d04 100755 --- a/scripts/make_binary.sh +++ b/scripts/make_binary.sh @@ -6,15 +6,15 @@ # -# Check the QPACKAGE_ROOT directory -if [[ -z ${QPACKAGE_ROOT} ]] +# Check the QP_ROOT directory +if [[ -z ${QP_ROOT} ]] then - echo "The QPACKAGE_ROOT environment variable is not set." + echo "The QP_ROOT environment variable is not set." echo "Please reload the quantum_package.rc file." exit 1 fi -cd ${QPACKAGE_ROOT} +cd ${QP_ROOT} if [[ -f quantum_package.rc \ && -f README.md \ && -d src \ @@ -35,7 +35,7 @@ fi # Build all sources -for dir in ${QPACKAGE_ROOT}/{src,ocaml} +for dir in ${QP_ROOT}/{src,ocaml} do make -C ${dir} if [[ $? -ne 0 ]] @@ -46,7 +46,7 @@ done # Copy the files in the static directory -QPACKAGE_STATIC=${QPACKAGE_ROOT}/quantum_package_static +QPACKAGE_STATIC=${QP_ROOT}/quantum_package_static function find_libs () { @@ -58,7 +58,7 @@ function find_libs () function find_exec () { - find ${QPACKAGE_ROOT}/$1 -perm /u+x -type f + find ${QP_ROOT}/$1 -perm /u+x -type f } @@ -111,12 +111,12 @@ cd - for i in ${FORTRAN_EXEC} do i=$(basename $i) - echo $i \$QPACKAGE_ROOT/bin/$i + echo $i \$QP_ROOT/bin/$i done >> ${QPACKAGE_STATIC}/data/executables -cp ${QPACKAGE_ROOT}/data/ezfio_defaults ${QPACKAGE_STATIC}/data +cp ${QP_ROOT}/data/ezfio_defaults ${QPACKAGE_STATIC}/data mkdir -p ${QPACKAGE_STATIC}/src/Bitmask -cp ${QPACKAGE_ROOT}/src/Bitmask/bitmasks_module.f90 ${QPACKAGE_STATIC}/src/Bitmask +cp ${QP_ROOT}/src/Bitmask/bitmasks_module.f90 ${QPACKAGE_STATIC}/src/Bitmask # echo "Copying dynamic libraries" @@ -143,10 +143,10 @@ cp -- ${QPACKAGE_STATIC}/extra_lib/lib{[gi]omp*,mkl*,lapack*,blas*,z*} ${QPACKAG echo "Copying EMSL_Basis directory" # ---------------------------- -cp -r -- ${QPACKAGE_ROOT}/EMSL_Basis ${QPACKAGE_STATIC}/ +cp -r -- ${QP_ROOT}/EMSL_Basis ${QPACKAGE_STATIC}/ if [[ $? -ne 0 ]] ; then - echo 'cp -r -- ${QPACKAGE_ROOT}/EMSL_Basis ${QPACKAGE_STATIC}/' + echo 'cp -r -- ${QP_ROOT}/EMSL_Basis ${QPACKAGE_STATIC}/' exit 1 fi @@ -155,10 +155,10 @@ fi echo "Copying scripts directory" # ------------------------- -cp -r -- ${QPACKAGE_ROOT}/scripts ${QPACKAGE_STATIC}/ +cp -r -- ${QP_ROOT}/scripts ${QPACKAGE_STATIC}/ if [[ $? -ne 0 ]] ; then - echo 'cp -r -- ${QPACKAGE_ROOT}/scripts ${QPACKAGE_STATIC}/' + echo 'cp -r -- ${QP_ROOT}/scripts ${QPACKAGE_STATIC}/' exit 1 fi @@ -168,13 +168,13 @@ echo "Creating quantum_package.rc" # --------------------------- cat << EOF > ${QPACKAGE_STATIC}/quantum_package.rc -export QPACKAGE_ROOT=\$( cd \$(dirname "\${BASH_SOURCE}") ; pwd -P ) -export LD_LIBRARY_PATH="\${QPACKAGE_ROOT}"/lib:\${LD_LIBRARY_PATH} -export LIBRARY_PATH="\${QPACKAGE_ROOT}"/lib:\${LIBRARY_PATH} -export PYTHONPATH="\${QPACKAGE_ROOT}"/scripts:\${PYTHONPATH} -export PATH="\${QPACKAGE_ROOT}"/scripts:\${PATH} -export PATH="\${QPACKAGE_ROOT}"/bin:\${PATH} -export PATH="\${QPACKAGE_ROOT}"/ocaml:\${PATH} +export QP_ROOT=\$( cd \$(dirname "\${BASH_SOURCE}") ; pwd -P ) +export LD_LIBRARY_PATH="\${QP_ROOT}"/lib:\${LD_LIBRARY_PATH} +export LIBRARY_PATH="\${QP_ROOT}"/lib:\${LIBRARY_PATH} +export PYTHONPATH="\${QP_ROOT}"/scripts:\${PYTHONPATH} +export PATH="\${QP_ROOT}"/scripts:\${PATH} +export PATH="\${QP_ROOT}"/bin:\${PATH} +export PATH="\${QP_ROOT}"/ocaml:\${PATH} EOF #exit 0 diff --git a/scripts/module/clean_modules.sh b/scripts/module/clean_modules.sh index 19db6f46..c4ec9dc4 100755 --- a/scripts/module/clean_modules.sh +++ b/scripts/module/clean_modules.sh @@ -2,13 +2,13 @@ # # Cleans a module directory -if [[ -z ${QPACKAGE_ROOT} ]] +if [[ -z ${QP_ROOT} ]] then - print "The QPACKAGE_ROOT environment variable is not set." + print "The QP_ROOT environment variable is not set." print "Please reload the quantum_package.rc file." exit -1 fi -source ${QPACKAGE_ROOT}/scripts/qp_include.sh +source ${QP_ROOT}/scripts/qp_include.sh function do_clean() { diff --git a/scripts/module/create_executables_list.sh b/scripts/module/create_executables_list.sh index 549eb3f6..2f530379 100755 --- a/scripts/module/create_executables_list.sh +++ b/scripts/module/create_executables_list.sh @@ -2,20 +2,20 @@ # # Thu Mar 26 01:27:14 CET 2015 -if [[ -z ${QPACKAGE_ROOT} ]] +if [[ -z ${QP_ROOT} ]] then - print "The QPACKAGE_ROOT environment variable is not set." + print "The QP_ROOT environment variable is not set." print "Please reload the quantum_package.rc file." exit -1 fi -cd ${QPACKAGE_ROOT}/data +cd ${QP_ROOT}/data rm -f executables -EXES=$(find ${QPACKAGE_ROOT}/src -perm /u+x -type f | grep -e "${QPACKAGE_ROOT}/src/[^/]*/[^/]*$" |sort ) +EXES=$(find ${QP_ROOT}/src -perm /u+x -type f | grep -e "${QP_ROOT}/src/[^/]*/[^/]*$" |sort ) for EXE in $EXES do - printf "%-30s %s\n" $(basename $EXE) $EXE | sed "s|${QPACKAGE_ROOT}|\$QPACKAGE_ROOT|g" >> executables + printf "%-30s %s\n" $(basename $EXE) $EXE | sed "s|${QP_ROOT}|\$QP_ROOT|g" >> executables done diff --git a/scripts/module/create_gitignore.sh b/scripts/module/create_gitignore.sh index a56a54b0..dde75e70 100755 --- a/scripts/module/create_gitignore.sh +++ b/scripts/module/create_gitignore.sh @@ -5,13 +5,13 @@ # Tue Jan 13 14:18:05 CET 2015 # -if [[ -z ${QPACKAGE_ROOT} ]] +if [[ -z ${QP_ROOT} ]] then - print "The QPACKAGE_ROOT environment variable is not set." + print "The QP_ROOT environment variable is not set." print "Please reload the quantum_package.rc file." exit -1 fi -source ${QPACKAGE_ROOT}/scripts/qp_include.sh +source ${QP_ROOT}/scripts/qp_include.sh function do_gitingore() diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index 6e9f0ba7..e8d58889 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -30,13 +30,13 @@ except ImportError: # Canot cache for namedtuple are not hashable def get_dict_child(): - """Loop over MODULE in QPACKAGE_ROOT/src, open all the NEEDED_CHILDREN_MODULES + """Loop over MODULE in QP_ROOT/src, open all the NEEDED_CHILDREN_MODULES and create a dict[MODULE] = [sub module needed, ...] """ d_ref = dict() - qpackage_root = os.environ['QPACKAGE_ROOT'] - dir_ = os.path.join(qpackage_root, 'src') + qp_root = os.environ['QP_ROOT'] + dir_ = os.path.join(qp_root, 'src') for o in os.listdir(dir_): diff --git a/scripts/module/qp_install_module.py b/scripts/module/qp_install_module.py index 11e8d7ea..2c5dd4fe 100755 --- a/scripts/module/qp_install_module.py +++ b/scripts/module/qp_install_module.py @@ -61,7 +61,7 @@ if __name__ == '__main__': elif arguments["create"]: l_children = arguments[""] - qpackage_root = os.environ['QPACKAGE_ROOT'] + qpackage_root = os.environ['QP_ROOT'] path = os.path.join(qpackage_root, "src", arguments[""]) print "You will create the module:" diff --git a/scripts/perturbation.py b/scripts/perturbation.py index 8b0f8b01..fab02b25 100755 --- a/scripts/perturbation.py +++ b/scripts/perturbation.py @@ -2,7 +2,7 @@ import os -Pert_dir = os.environ["QPACKAGE_ROOT"]+"/src/Perturbation/" +Pert_dir = os.environ["QP_ROOT"]+"/src/Perturbation/" perturbations = [] diff --git a/scripts/pseudo/put_pseudo_in_ezfio.py b/scripts/pseudo/put_pseudo_in_ezfio.py index d5dfb584..e11c8dc3 100755 --- a/scripts/pseudo/put_pseudo_in_ezfio.py +++ b/scripts/pseudo/put_pseudo_in_ezfio.py @@ -17,7 +17,7 @@ from docopt import docopt from subprocess import Popen, PIPE -qpackage_root = os.environ['QPACKAGE_ROOT'] +qpackage_root = os.environ['QP_ROOT'] EZFIO = "{0}/EZFIO".format(qpackage_root) sys.path = [EZFIO + "/Python"] + sys.path diff --git a/scripts/qp_include.sh b/scripts/qp_include.sh index 9146215f..f67e942f 100644 --- a/scripts/qp_include.sh +++ b/scripts/qp_include.sh @@ -13,23 +13,23 @@ function unique_list() function check_current_dir_is_src() { - if [[ "${PWD}" == "${QPACKAGE_ROOT}/src" ]] + if [[ "${PWD}" == "${QP_ROOT}/src" ]] then return 0 else - echo "Current directory should be \$QPACKAGE_ROOT/src" + echo "Current directory should be \$QP_ROOT/src" exit -1 fi } function check_current_dir_is_module() { - # If the prefix ${QPACKAGE_ROOT}/src/ can be removed from $PWD, it means that - # $PWD is somewhere below ${QPACKAGE_ROOT}/src/ so it is a module. - # If the prefix ${QPACKAGE_ROOT}/src/ can not be removed from $PWD, then - # "${PWD##${QPACKAGE_ROOT}/src/}" == "$PWD". + # If the prefix ${QP_ROOT}/src/ can be removed from $PWD, it means that + # $PWD is somewhere below ${QP_ROOT}/src/ so it is a module. + # If the prefix ${QP_ROOT}/src/ can not be removed from $PWD, then + # "${PWD##${QP_ROOT}/src/}" == "$PWD". - if [[ "${PWD##${QPACKAGE_ROOT}/src/}" != "$PWD" ]] + if [[ "${PWD##${QP_ROOT}/src/}" != "$PWD" ]] then return 0 else diff --git a/scripts/qp_set_frozen_core.py b/scripts/qp_set_frozen_core.py index bd36a2c0..843df4b3 100755 --- a/scripts/qp_set_frozen_core.py +++ b/scripts/qp_set_frozen_core.py @@ -3,7 +3,7 @@ import os import sys -sys.path = [ os.environ["QPACKAGE_ROOT"]+"/EZFIO/Python" ] + sys.path +sys.path = [ os.environ["QP_ROOT"]+"/EZFIO/Python" ] + sys.path from ezfio import ezfio ezfio.set_filename(sys.argv[1]) diff --git a/scripts/save_current_mos.sh b/scripts/save_current_mos.sh index 36149ae2..4ad81e93 100755 --- a/scripts/save_current_mos.sh +++ b/scripts/save_current_mos.sh @@ -4,9 +4,9 @@ # directory, where xxx is the corresponding mo_label. # Wed Apr 2 14:35:15 CEST 2014 -if [[ -z ${QPACKAGE_ROOT} ]] +if [[ -z ${QP_ROOT} ]] then - print "The QPACKAGE_ROOT environment variable is not set." + print "The QP_ROOT environment variable is not set." print "Please reload the quantum_package.rc file." exit -1 fi diff --git a/scripts/upgrade/upgrade_ezfio.sh b/scripts/upgrade/upgrade_ezfio.sh index c35a2dbd..71ee990a 100755 --- a/scripts/upgrade/upgrade_ezfio.sh +++ b/scripts/upgrade/upgrade_ezfio.sh @@ -3,24 +3,24 @@ # Upgrades the EZFIO library from the web. # Tue Nov 4 00:53:13 CET 2014 -if [[ -z ${QPACKAGE_ROOT} ]] +if [[ -z ${QP_ROOT} ]] then - print "The QPACKAGE_ROOT environment variable is not set." + print "The QP_ROOT environment variable is not set." print "Please reload the quantum_package.rc file." fi -cd -- ${QPACKAGE_ROOT} -mv -- ${QPACKAGE_ROOT}/EZFIO ${QPACKAGE_ROOT}/EZFIO.old +cd -- ${QP_ROOT} +mv -- ${QP_ROOT}/EZFIO ${QP_ROOT}/EZFIO.old -${QPACKAGE_ROOT}/scripts/install/install_ezfio.sh +${QP_ROOT}/scripts/install/install_ezfio.sh if [[ $? -eq 0 ]] then - rm -rf -- ${QPACKAGE_ROOT}/EZFIO.old + rm -rf -- ${QP_ROOT}/EZFIO.old echo "Successfully updated EZFIO" else - rm -rf -- ${QPACKAGE_ROOT}/EZFIO - mv -- ${QPACKAGE_ROOT}/EZFIO.old ${QPACKAGE_ROOT}/EZFIO + rm -rf -- ${QP_ROOT}/EZFIO + mv -- ${QP_ROOT}/EZFIO.old ${QP_ROOT}/EZFIO echo "Failed to update EZFIO" fi diff --git a/scripts/upgrade/upgrade_irpf90.sh b/scripts/upgrade/upgrade_irpf90.sh index dea48014..7f48614d 100755 --- a/scripts/upgrade/upgrade_irpf90.sh +++ b/scripts/upgrade/upgrade_irpf90.sh @@ -3,23 +3,23 @@ # Upgrades IRPF90 from the web. # Wed Mar 25 11:41:04 CET 2015 -if [[ -z ${QPACKAGE_ROOT} ]] +if [[ -z ${QP_ROOT} ]] then - print "The QPACKAGE_ROOT environment variable is not set." + print "The QP_ROOT environment variable is not set." print "Please reload the quantum_package.rc file." fi -cd -- ${QPACKAGE_ROOT} -mv -f -- ${QPACKAGE_ROOT}/irpf90 ${QPACKAGE_ROOT}/irpf90.old +cd -- ${QP_ROOT} +mv -f -- ${QP_ROOT}/irpf90 ${QP_ROOT}/irpf90.old -${QPACKAGE_ROOT}/scripts/install/install_irpf90.sh +${QP_ROOT}/scripts/install/install_irpf90.sh if [[ $? -eq 0 ]] then - rm -rf -- ${QPACKAGE_ROOT}/irpf90.old + rm -rf -- ${QP_ROOT}/irpf90.old echo "Successfully updated IRPF90" else - rm -rf -- ${QPACKAGE_ROOT}/irpf90 - mv -- ${QPACKAGE_ROOT}/irpf90.old ${QPACKAGE_ROOT}/irpf90 + rm -rf -- ${QP_ROOT}/irpf90 + mv -- ${QP_ROOT}/irpf90.old ${QP_ROOT}/irpf90 echo "Failed to update IRPF90" fi diff --git a/setup_environment.py b/setup_environment.py index 02bc204a..525f4636 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -13,9 +13,9 @@ from os.path import join # \_| |_ (_) |_) (_| | | | | | (_) # -QPACKAGE_ROOT = os.getcwd() -QPACKAGE_ROOT_BIN = join(QPACKAGE_ROOT, "bin") -QPACKAGE_ROOT_INSTALL = join(QPACKAGE_ROOT, "install") +QP_ROOT = os.getcwd() +QP_ROOT_BIN = join(QP_ROOT, "bin") +QP_ROOT_INSTALL = join(QP_ROOT, "install") d_dependancy = { "ocaml": ["m4", "curl", "zlib", "patch", "gcc"], @@ -42,58 +42,58 @@ path_github = {"head": "http://github.com/", "tail": "archive/master.tar.gz"} ocaml = Info( url='http://raw.github.com/ocaml/opam/master/shell/opam_installer.sh', description=' ocaml', - default_path=join(QPACKAGE_ROOT_BIN, "opam")) + default_path=join(QP_ROOT_BIN, "opam")) m4 = Info( url="http://ftp.gnu.org/gnu/m4/m4-latest.tar.gz", description=" m4", - default_path=join(QPACKAGE_ROOT_BIN, "m4")) + default_path=join(QP_ROOT_BIN, "m4")) curl = Info( url="http://qmcchem.ups-tlse.fr/files/scemama/curl-7.30.0.ermine.tar.bz2", description=" curl", - default_path=join(QPACKAGE_ROOT_BIN, "curl")) + default_path=join(QP_ROOT_BIN, "curl")) zlib = Info( url='http://zlib.net/zlib-1.2.8.tar.gz', description=' zlib', - default_path=join(QPACKAGE_ROOT_INSTALL, "zlib")) + default_path=join(QP_ROOT_INSTALL, "zlib")) path = Info( url='ftp://ftp.gnu.org/gnu/patch/patch-2.7.5.tar.gz', description=' path', - default_path=join(QPACKAGE_ROOT_BIN, "patch")) + default_path=join(QP_ROOT_BIN, "patch")) irpf90 = Info( url='{head}/scemama/irpf90/archive/v1.6.5.tar.gz'.format(**path_github), description=' irpf90', - default_path=join(QPACKAGE_ROOT_BIN, "irpf90")) + default_path=join(QP_ROOT_BIN, "irpf90")) docopt = Info( url='{head}/docopt/docopt/{tail}'.format(**path_github), description=' docop', - default_path=join(QPACKAGE_ROOT_INSTALL, "docopt")) + default_path=join(QP_ROOT_INSTALL, "docopt")) resultsFile = Info( url='{head}/LCPQ/resultsFile/{tail}'.format(**path_github), description=' resultsFile', - default_path=join(QPACKAGE_ROOT_INSTALL, "resultsFile")) + default_path=join(QP_ROOT_INSTALL, "resultsFile")) ninja = Info( url='{head}/martine/ninja/{tail}'.format(**path_github), description=' nina', - default_path=join(QPACKAGE_ROOT_BIN, "ninja")) + default_path=join(QP_ROOT_BIN, "ninja")) emsl = Info( url='{head}/LCPQ/EMSL_Basis_Set_Exchange_Local/{tail}'.format(** path_github), description=' emsl', - default_path=join(QPACKAGE_ROOT_INSTALL, "emsl")) + default_path=join(QP_ROOT_INSTALL, "emsl")) ezfio = Info( url='{head}/LCPQ/EZFIO/{tail}'.format(**path_github), description=' EZFIO', - default_path=join(QPACKAGE_ROOT_INSTALL, "EZFIO")) + default_path=join(QP_ROOT_INSTALL, "EZFIO")) d_info = dict() @@ -104,10 +104,10 @@ for m in ["ocaml", "m4", "curl", "zlib", "path", "irpf90", "docopt", l_need = [] -# _ -# |_ ._ _ _|_ o _ ._ -# | |_| | | (_ |_ | (_) | | -# +# _ +# |_ ._ _ _|_ o _ ._ +# | |_| | | (_ |_ | (_) | | +# def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. @@ -236,10 +236,10 @@ if "ninja" in l_need_genealogy: l_cmd = ["cd install;", "wget {0} -O {1} -o /dev/null ;".format(url, path_archive), - "./scripts/install_ninja.sh;", "cd -"] + "./scripts/install_ninja.sh 2>/dev/null;", "cd -"] subprocess.check_call(" ".join(l_cmd), shell=True) - + l_need_genealogy.remove("ninja") print """ # ~#~#~#~#~#~#~#~#~#~#~#~#~#~ # @@ -288,7 +288,7 @@ for need in l_need_genealogy: l_string += l_build -path = join(QPACKAGE_ROOT_INSTALL, "build.ninja") +path = join(QP_ROOT_INSTALL, "build.ninja") with open(path, "w+") as f: f.write("\n".join(l_string)) @@ -310,9 +310,9 @@ print """ # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # """ -python_path = [join(QPACKAGE_ROOT, "scripts"), join(QPACKAGE_ROOT, "install")] +python_path = [join(QP_ROOT, "scripts"), join(QP_ROOT, "install")] -l_python = [join(QPACKAGE_ROOT, "scripts")] +l_python = [join(QP_ROOT, "scripts")] for dir_ in python_path: for folder in os.listdir(dir_): path = join(dir_, folder) @@ -323,25 +323,27 @@ for dir_ in python_path: def find_path(bin_): try: locate = l_installed[bin_] - except: + except KeyError: locate = d_info[bin_].default_path return locate l_rc = [ - 'export QPACKAGE_ROOT={0}'.format(QPACKAGE_ROOT), + 'export QP_ROOT={0}'.format(QP_ROOT), 'export QP_EZFIO={0}'.format(find_path('ezfio')), 'export IRPF90={0}'.format(find_path("irpf90")), 'export NINJA={0}'.format(find_path("ninja")), - 'export PYTHONPATH=${{PYTHONPATH}}:{0}'.format(":".join(l_python)), '', - 'export PATH=${PATH}:${PYTHONPATH}:"${QPACKAGE_ROOT}"/bin', - 'export LD_LIBRARY_PATH="${QPACKAGE_ROOT}"/lib:${LD_LIBRARY_PATH}', - 'export LIBRARY_PATH="${QPACKAGE_ROOT}"/lib:${LIBRARY_PATH}', "" + 'export QP_PYTHON={0}'.format(":".join(l_python)), + "", + 'export PYTHONPATH="${PYTHONPATH}":"${QP_PYTHON}"', + 'export PATH="${PATH}":"${QP_PYTHON}":"${QP_ROOT}"/bin', + 'export LD_LIBRARY_PATH="${QP_ROOT}"/lib:"${LD_LIBRARY_PATH}"', + 'export LIBRARY_PATH="${QP_ROOT}"/lib:"${LIBRARY_PATH}"', "" 'source . ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true', "" ] -path = join(QPACKAGE_ROOT, "quantum_package.rc") +path = join(QP_ROOT, "quantum_package.rc") with open(path, "w+") as f: f.write("\n".join(l_rc)) diff --git a/src/Ezfio_files/output.irp.f b/src/Ezfio_files/output.irp.f index 1a45e865..ac693caf 100644 --- a/src/Ezfio_files/output.irp.f +++ b/src/Ezfio_files/output.irp.f @@ -10,7 +10,7 @@ END_PROVIDER BEGIN_SHELL [ /bin/bash ] - for NAME in $(\ls -d ${QPACKAGE_ROOT}/src/*/) + for NAME in $(\ls -d ${QP_ROOT}/src/*/) do NAME=$(basename ${NAME}) cat << EOF diff --git a/src/MOs/utils.irp.f b/src/MOs/utils.irp.f index 21d04c27..38357c5d 100644 --- a/src/MOs/utils.irp.f +++ b/src/MOs/utils.irp.f @@ -3,7 +3,7 @@ subroutine save_mos double precision, allocatable :: buffer(:,:) integer :: i,j - call system('$QPACKAGE_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename)) + call system('$QP_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename)) call ezfio_set_mo_basis_mo_tot_num(mo_tot_num) call ezfio_set_mo_basis_mo_label(mo_label) diff --git a/src/Perturbation/perturbation.irp.f b/src/Perturbation/perturbation.irp.f index 57dd5ffa..208deab5 100644 --- a/src/Perturbation/perturbation.irp.f +++ b/src/Perturbation/perturbation.irp.f @@ -2,7 +2,7 @@ BEGIN_SHELL [ /usr/bin/env python ] from perturbation import perturbations import os -filename = os.environ["QPACKAGE_ROOT"]+"/src/Perturbation/perturbation.template.f" +filename = os.environ["QP_ROOT"]+"/src/Perturbation/perturbation.template.f" file = open(filename,'r') template = file.read() file.close() diff --git a/src/README.rst b/src/README.rst index f74a56f9..7d7560ea 100644 --- a/src/README.rst +++ b/src/README.rst @@ -31,7 +31,7 @@ Creating a new module ===================== Every new module should be created using the interactive ``create_module.sh`` -script located in the ``${QPACKAGE_ROOT}/scripts`` directory. This will create +script located in the ``${QP_ROOT}/scripts`` directory. This will create all the required files with correct templates. @@ -88,7 +88,7 @@ HTML, man, etc. Creating a shell script ======================= -Shell scripts should be located in the ``${QPACKAGE_ROOT}/scripts`` directory. +Shell scripts should be located in the ``${QP_ROOT}/scripts`` directory. Relative paths should be avoided as much as possible, and the result of commands should be always checked. For example, when creating a directory the existence of the directory has to be checked. diff --git a/testing_no_regression/unit_test.py b/testing_no_regression/unit_test.py index 6fc13696..968c9759 100755 --- a/testing_no_regression/unit_test.py +++ b/testing_no_regression/unit_test.py @@ -5,9 +5,9 @@ import subprocess import os import sys -qpackage_root = os.environ['QPACKAGE_ROOT'] +qpackage_root = os.environ['QP_ROOT'] -EZFIO = "{0}/EZFIO".format(qpackage_root) +EZFIO = "{0}/install/EZFIO".format(qpackage_root) sys.path = [EZFIO + "/Python"] + sys.path from ezfio import ezfio From cee02e6839c7f1e77c853c18138ebb445f1aa59a Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 14:52:07 +0200 Subject: [PATCH 05/23] Fix zlib-flate --- setup_environment.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup_environment.py b/setup_environment.py index 525f4636..61195324 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -144,13 +144,15 @@ def check_python(): def check_avabiliy(binary): if binary == "zlib": - binary = "zlib-flate" + binary_name = "zlib-flate" + else: + binary_name = binary if binary == "python": check_python() try: - return check_output(["which", binary]) + return check_output(["which", binary_name]) except subprocess.CalledProcessError: default_path = d_info[binary].default_path if os.path.exists(default_path): From 03864ae351108f9281e1d6bc49631c99fa9a7878 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 14:52:07 +0200 Subject: [PATCH 06/23] Add Downloads and lib --- install/Downloads/.gitignore | 0 lib/.gitignore | 0 setup_environment.py | 6 ++++-- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 install/Downloads/.gitignore create mode 100644 lib/.gitignore diff --git a/install/Downloads/.gitignore b/install/Downloads/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/lib/.gitignore b/lib/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/setup_environment.py b/setup_environment.py index 525f4636..61195324 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -144,13 +144,15 @@ def check_python(): def check_avabiliy(binary): if binary == "zlib": - binary = "zlib-flate" + binary_name = "zlib-flate" + else: + binary_name = binary if binary == "python": check_python() try: - return check_output(["which", binary]) + return check_output(["which", binary_name]) except subprocess.CalledProcessError: default_path = d_info[binary].default_path if os.path.exists(default_path): From 3edda3c137e251a85e6da4b71233e4bd50a02309 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 15:06:49 +0200 Subject: [PATCH 07/23] Try check_output --- setup_environment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup_environment.py b/setup_environment.py index 61195324..073f36a1 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -109,7 +109,7 @@ l_need = [] # | |_| | | (_ |_ | (_) | | # def check_output(*popenargs, **kwargs): - r"""Run command with arguments and return its output as a byte string. + """Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. @@ -240,7 +240,7 @@ if "ninja" in l_need_genealogy: "wget {0} -O {1} -o /dev/null ;".format(url, path_archive), "./scripts/install_ninja.sh 2>/dev/null;", "cd -"] - subprocess.check_call(" ".join(l_cmd), shell=True) + subprocess.check_output(" ".join(l_cmd), shell=True) l_need_genealogy.remove("ninja") print """ From 9107350618a2649a6a05a0b6f8e3cfb6fca2b318 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 15:09:36 +0200 Subject: [PATCH 08/23] Fix typo --- setup_environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_environment.py b/setup_environment.py index 073f36a1..e1327ab5 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -240,7 +240,7 @@ if "ninja" in l_need_genealogy: "wget {0} -O {1} -o /dev/null ;".format(url, path_archive), "./scripts/install_ninja.sh 2>/dev/null;", "cd -"] - subprocess.check_output(" ".join(l_cmd), shell=True) + check_output(" ".join(l_cmd), shell=True) l_need_genealogy.remove("ninja") print """ From e259962e35eb3a60d31754e83013281a2253271f Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 15:16:28 +0200 Subject: [PATCH 09/23] Try to debug --- ocaml/Makefile | 20 ++++++++++---------- ocaml/Qpackage.ml | 6 +++--- setup_environment.py | 4 +++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ocaml/Makefile b/ocaml/Makefile index 7e514d1a..9c689f56 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -1,9 +1,9 @@ .NOPARALLEL: -# Check if QPACKAGE_ROOT is defined -ifndef QPACKAGE_ROOT +# Check if QP_ROOT is defined +ifndef QP_ROOT $(info -------------------- Error --------------------) -$(info QPACKAGE_ROOT undefined. Source the quantum_package.rc script) +$(info QP_ROOT undefined. Source the quantum_package.rc script) $(info -----------------------------------------------) $(error ) endif @@ -32,10 +32,10 @@ default: $(ALL_TESTS) $(ALL_EXE) .gitignore echo $$i ; \ done > .gitignore -executables: $(QPACKAGE_ROOT)/data/executables +executables: $(QP_ROOT)/data/executables -$(QPACKAGE_ROOT)/data/executables: - $(QPACKAGE_ROOT)/scripts/module/create_executables_list.sh +$(QP_ROOT)/data/executables: + $(QP_ROOT)/scripts/module/create_executables_list.sh external_libs: opam install cryptokit core @@ -62,8 +62,8 @@ qp_run.native: $(MLFILES) $(MLIFILES) executables $(OCAMLBUILD) $*.native -use-ocamlfind $(PKGS) ln -s $*.native $* -ezfio.ml: ${QPACKAGE_ROOT}/EZFIO/Ocaml/ezfio.ml - cp ${QPACKAGE_ROOT}/EZFIO/Ocaml/ezfio.ml . +ezfio.ml: ${QP_ROOT}/EZFIO/Ocaml/ezfio.ml + cp ${QP_ROOT}/EZFIO/Ocaml/ezfio.ml . qptypes_generator.byte: qptypes_generator.ml $(OCAMLBUILD) qptypes_generator.byte -use-ocamlfind @@ -71,8 +71,8 @@ qptypes_generator.byte: qptypes_generator.ml Qptypes.ml: qptypes_generator.byte ./qptypes_generator.byte > Qptypes.ml -${QPACKAGE_ROOT}/EZFIO/Ocaml/ezfio.ml: - $(MAKE) -C ${QPACKAGE_ROOT}/src ezfio +${QP_ROOT}/EZFIO/Ocaml/ezfio.ml: + $(MAKE) -C ${QP_ROOT}/src ezfio Input_auto_generated.ml qp_edit.ml: ei_handler.py ocaml_global diff --git a/ocaml/Qpackage.ml b/ocaml/Qpackage.ml index a3862f11..ef4476c6 100644 --- a/ocaml/Qpackage.ml +++ b/ocaml/Qpackage.ml @@ -5,8 +5,8 @@ open Qputils;; (** Variables related to the quantum package installation *) let root = - match (Sys.getenv "QPACKAGE_ROOT") with - | None -> failwith "QPACKAGE_ROOT environment variable is not set. + match (Sys.getenv "QP_ROOT") with + | None -> failwith "QP_ROOT environment variable is not set. Please source the quantum_package.rc file." | Some x -> x ;; @@ -59,7 +59,7 @@ let executables = lazy ( |> List.filter ~f:(fun x -> x <> "") in match e with - | [a;b] -> (a,String.substr_replace_all ~pattern:"$QPACKAGE_ROOT" ~with_:root b) + | [a;b] -> (a,String.substr_replace_all ~pattern:"$QP_ROOT" ~with_:root b) | _ -> ("","") ) in diff --git a/setup_environment.py b/setup_environment.py index e1327ab5..e866ea1c 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -238,9 +238,11 @@ if "ninja" in l_need_genealogy: l_cmd = ["cd install;", "wget {0} -O {1} -o /dev/null ;".format(url, path_archive), - "./scripts/install_ninja.sh 2>/dev/null;", "cd -"] + "./scripts/install_ninja.sh", "cd -"] check_output(" ".join(l_cmd), shell=True) + + print "Done" l_need_genealogy.remove("ninja") print """ From 4b448cea4d2ffc5c8609cbcbf218421d6e268427 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 15:19:06 +0200 Subject: [PATCH 10/23] Add _build --- install/_build/.gitignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 install/_build/.gitignore diff --git a/install/_build/.gitignore b/install/_build/.gitignore new file mode 100644 index 00000000..e69de29b From 273d46d3eaf39496dfd741ffe2ee3c2629516212 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 15:38:37 +0200 Subject: [PATCH 11/23] Fix ocaml instalation --- install/scripts/install_ocaml.sh | 3 +-- setup_environment.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index a2f2ffae..415f7585 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -28,8 +28,7 @@ then echo "Installation of OPAM failed" exit 2 fi -${QP_ROOT}/bin/opam config setup -a --dot-profile ${QP_ROOT}/qmcchemrc || exit 1 -touch ${QP_ROOT}/bin/opam +${QP_ROOT}/bin/opam config setup -a || exit 1 export LD_LIBRARY_PATH=${QP_ROOT}/lib:${LD_LIBRARY_PATH} export LIBRARY_PATH=${QP_ROOT}/lib:${LIBRARY_PATH} diff --git a/setup_environment.py b/setup_environment.py index e866ea1c..f0676757 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -41,7 +41,7 @@ path_github = {"head": "http://github.com/", "tail": "archive/master.tar.gz"} ocaml = Info( url='http://raw.github.com/ocaml/opam/master/shell/opam_installer.sh', - description=' ocaml', + description=' ocaml (it will take some time)', default_path=join(QP_ROOT_BIN, "opam")) m4 = Info( @@ -236,9 +236,9 @@ if "ninja" in l_need_genealogy: extension = splitext(url)[1] path_archive = "Downloads/{0}{1}".format("ninja", extension) - l_cmd = ["cd install;", - "wget {0} -O {1} -o /dev/null ;".format(url, path_archive), - "./scripts/install_ninja.sh", "cd -"] + l_cmd = ["cd install &&", + "wget {0} -O {1} -o /dev/null &&".format(url, path_archive), + "./scripts/install_ninja.sh &&", "cd -"] check_output(" ".join(l_cmd), shell=True) From 764f7a641e5a44303c7b8253375ef2c1888b8ead Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 15:39:18 +0200 Subject: [PATCH 12/23] Fix ocaml instalation #2 --- install/scripts/install_ocaml.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index 415f7585..338915d2 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -33,7 +33,7 @@ ${QP_ROOT}/bin/opam config setup -a || exit 1 export LD_LIBRARY_PATH=${QP_ROOT}/lib:${LD_LIBRARY_PATH} export LIBRARY_PATH=${QP_ROOT}/lib:${LIBRARY_PATH} export C_INCLUDE_PATH=${QP_ROOT}/lib:${C_INCLUDE_PATH} -opam install ${PACKAGES} || exit 1 +${QP_ROOT}/bin/opam install ${PACKAGES} || exit 1 rm -f ../_build/ocaml.log exit 0 From 12de4c1de3e4e55a96108ba26e57782fa1b6ba22 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 15:41:02 +0200 Subject: [PATCH 13/23] Fix ocaml instalation #3 --- install/scripts/install_ocaml.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index 338915d2..c566020b 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -28,13 +28,13 @@ then echo "Installation of OPAM failed" exit 2 fi -${QP_ROOT}/bin/opam config setup -a || exit 1 +${QP_ROOT}/bin/opam config setup -a --dot-profile ${QP_ROOT}/quantum_package.rc || exit 1 export LD_LIBRARY_PATH=${QP_ROOT}/lib:${LD_LIBRARY_PATH} export LIBRARY_PATH=${QP_ROOT}/lib:${LIBRARY_PATH} export C_INCLUDE_PATH=${QP_ROOT}/lib:${C_INCLUDE_PATH} -${QP_ROOT}/bin/opam install ${PACKAGES} || exit 1 + +source ${QPACKAGE_ROOT}/quantum_package.rc +echo Y | ${QP_ROOT}/bin/opam install ${PACKAGES} || exit 1 rm -f ../_build/ocaml.log -exit 0 - - +exit 0 \ No newline at end of file From 41098f94b2f777c45a867afd77452e19f9d65d85 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 15:59:26 +0200 Subject: [PATCH 14/23] Add install_verbose for opam... --- setup_environment.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/setup_environment.py b/setup_environment.py index f0676757..1d7a136b 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -41,7 +41,7 @@ path_github = {"head": "http://github.com/", "tail": "archive/master.tar.gz"} ocaml = Info( url='http://raw.github.com/ocaml/opam/master/shell/opam_installer.sh', - description=' ocaml (it will take some time)', + description=' ocaml (it will take some time roughly 20min)', default_path=join(QP_ROOT_BIN, "opam")) m4 = Info( @@ -238,7 +238,7 @@ if "ninja" in l_need_genealogy: l_cmd = ["cd install &&", "wget {0} -O {1} -o /dev/null &&".format(url, path_archive), - "./scripts/install_ninja.sh &&", "cd -"] + "./scripts/install_ninja.sh 2> /dev/null &&", "cd -"] check_output(" ".join(l_cmd), shell=True) @@ -259,6 +259,9 @@ def create_rule(): " description = Downloading ${descr}", "", "rule install", " command = ./scripts/install_${target}.sh > _build/${target}.log 2>&1", " description = Installing ${descr}", "" + "rule install_verbose", + " command = ./scripts/install_${target}.sh | tee _build/${target}.log 2>&1", + " description = Installing ${descr}", "" ] return l_rules @@ -284,9 +287,15 @@ for need in l_need_genealogy: # Build to install l_dependancy = [d_info[i].default_path for i in d_dependancy[need] if i in l_need_genealogy] - l_build += ["build {0}: install {1} {2}".format(d_info[need].default_path, - archive_path, - " ".join(l_dependancy)), + if need == "ocaml": + install ="install_verbose" + else: + install ="install" + + l_build += ["build {0}: {1} {2} {3}".format(d_info[need].default_path, + install, + archive_path, + " ".join(l_dependancy)), " target = {0}".format(need), " descr = {0}".format(descr), ""] From d2c110c472a5e5fe2536c546ab3b05f44a2a8aae Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 16:24:42 +0200 Subject: [PATCH 15/23] Fix ocaml #5 --- .travis.yml | 2 +- install/scripts/install_ocaml.sh | 2 +- setup_environment.py | 15 +++------------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 657c4f09..7b12513d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_script: - sudo apt-get install graphviz script: - - ./setup_environment.py + - travis_wait ./setup_environment.py - source ./quantum_package.rc - qp_create_ninja.py --production ./config/gfortran_example.cfg - ninja diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index c566020b..c2f1d663 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -34,7 +34,7 @@ export LD_LIBRARY_PATH=${QP_ROOT}/lib:${LD_LIBRARY_PATH} export LIBRARY_PATH=${QP_ROOT}/lib:${LIBRARY_PATH} export C_INCLUDE_PATH=${QP_ROOT}/lib:${C_INCLUDE_PATH} -source ${QPACKAGE_ROOT}/quantum_package.rc +source ${QP_ROOT}/quantum_package.rc echo Y | ${QP_ROOT}/bin/opam install ${PACKAGES} || exit 1 rm -f ../_build/ocaml.log exit 0 \ No newline at end of file diff --git a/setup_environment.py b/setup_environment.py index 1d7a136b..e995fccb 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -259,9 +259,6 @@ def create_rule(): " description = Downloading ${descr}", "", "rule install", " command = ./scripts/install_${target}.sh > _build/${target}.log 2>&1", " description = Installing ${descr}", "" - "rule install_verbose", - " command = ./scripts/install_${target}.sh | tee _build/${target}.log 2>&1", - " description = Installing ${descr}", "" ] return l_rules @@ -287,15 +284,9 @@ for need in l_need_genealogy: # Build to install l_dependancy = [d_info[i].default_path for i in d_dependancy[need] if i in l_need_genealogy] - if need == "ocaml": - install ="install_verbose" - else: - install ="install" - - l_build += ["build {0}: {1} {2} {3}".format(d_info[need].default_path, - install, - archive_path, - " ".join(l_dependancy)), + l_build += ["build {0}: install {1} {2}".format(d_info[need].default_path, + archive_path, + " ".join(l_dependancy)), " target = {0}".format(need), " descr = {0}".format(descr), ""] From 92fb69500cab8e40453058f898e6cb25221ff5e0 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 17:23:59 +0200 Subject: [PATCH 16/23] Remove install ocaml from ninja --- .travis.yml | 2 +- install/scripts/install_ocaml.sh | 21 +++++++-------------- setup_environment.py | 25 +++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b12513d..657c4f09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_script: - sudo apt-get install graphviz script: - - travis_wait ./setup_environment.py + - ./setup_environment.py - source ./quantum_package.rc - qp_create_ninja.py --production ./config/gfortran_example.cfg - ninja diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index c2f1d663..efdf0962 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -17,24 +17,17 @@ cd - cd Downloads || exit 1 chmod +x ocaml.sh || exit 1 -if [[ -d ${HOME}/.opam ]] -then - source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true -fi - echo N | ./ocaml.sh ${QP_ROOT}/bin/ || exit 1 -if [[ ! -f ${QP_ROOT}/bin/opam ]] -then - echo "Installation of OPAM failed" - exit 2 -fi -${QP_ROOT}/bin/opam config setup -a --dot-profile ${QP_ROOT}/quantum_package.rc || exit 1 + +${QP_ROOT}/bin/opam config setup -a|| exit 1 export LD_LIBRARY_PATH=${QP_ROOT}/lib:${LD_LIBRARY_PATH} export LIBRARY_PATH=${QP_ROOT}/lib:${LIBRARY_PATH} export C_INCLUDE_PATH=${QP_ROOT}/lib:${C_INCLUDE_PATH} +source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true -source ${QP_ROOT}/quantum_package.rc -echo Y | ${QP_ROOT}/bin/opam install ${PACKAGES} || exit 1 +${QP_ROOT}/bin/opam install ${PACKAGES} -y -q || exit 1 rm -f ../_build/ocaml.log -exit 0 \ No newline at end of file +exit 0 + + diff --git a/setup_environment.py b/setup_environment.py index e995fccb..8dfdb1f3 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -201,6 +201,7 @@ for need in l_need: l_need_genealogy = d_need_genealogy.keys() +l_need_genealogy = ["ocaml"] print """ __ (_ ._ _ ._ _ _. ._ @@ -269,6 +270,9 @@ l_build = [] for need in l_need_genealogy: + if need == "ocaml": + continue + url = d_info[need].url extension = splitext(url)[1] @@ -306,6 +310,27 @@ print """ """ subprocess.check_call("./bin/ninja -C install", shell=True) +print "Done" + +if "ocaml" in l_need_genealogy: + + print """ +# ~#~#~#~#~#~#~#~#~#~#~#~#~ # +# I n s t a l l _ o c a m l # +# ~#~#~#~#~#~#~#~#~#~#~#~#~ # +""" + url = d_info["ocaml"].url + extension = splitext(url)[1] + path_archive = "Downloads/{0}{1}".format("ocaml", extension) + + l_cmd = ["cd install &&", + "wget {0} -O {1} -o /dev/null &&".format(url, path_archive), + "./scripts/install_ocaml.sh"] + + os.system(" ".join(l_cmd)) + + print "Done" + l_need_genealogy.remove("ocaml") print """ From 9947ffbc2fd6e14668ecefb79af3a9be16d8b90f Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 17:42:29 +0200 Subject: [PATCH 17/23] Fix ninja #7 --- setup_environment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup_environment.py b/setup_environment.py index 8dfdb1f3..972eefb4 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -201,7 +201,6 @@ for need in l_need: l_need_genealogy = d_need_genealogy.keys() -l_need_genealogy = ["ocaml"] print """ __ (_ ._ _ ._ _ _. ._ @@ -309,7 +308,9 @@ print """ # ~#~#~#~#~#~#~#~#~ # """ -subprocess.check_call("./bin/ninja -C install", shell=True) +if [i for i in l_need_genealogy if i not in "ocaml"]: + subprocess.check_call("./bin/ninja -C install", shell=True) + print "Done" if "ocaml" in l_need_genealogy: From f35b20d7f4d0d7ba6303adaaa093953076cbb94e Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 18:13:51 +0200 Subject: [PATCH 18/23] Fix ocaml #8 --- install/scripts/install_ocaml.sh | 4 ++-- ocaml/Makefile | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index efdf0962..022cc59a 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash PACKAGES="core cryptokit ocamlfind sexplib" @@ -19,7 +19,7 @@ chmod +x ocaml.sh || exit 1 echo N | ./ocaml.sh ${QP_ROOT}/bin/ || exit 1 -${QP_ROOT}/bin/opam config setup -a|| exit 1 +${QP_ROOT}/bin/opam config setup -a -q || exit 1 export LD_LIBRARY_PATH=${QP_ROOT}/lib:${LD_LIBRARY_PATH} export LIBRARY_PATH=${QP_ROOT}/lib:${LIBRARY_PATH} diff --git a/ocaml/Makefile b/ocaml/Makefile index 9c689f56..6bf8d81b 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -62,8 +62,8 @@ qp_run.native: $(MLFILES) $(MLIFILES) executables $(OCAMLBUILD) $*.native -use-ocamlfind $(PKGS) ln -s $*.native $* -ezfio.ml: ${QP_ROOT}/EZFIO/Ocaml/ezfio.ml - cp ${QP_ROOT}/EZFIO/Ocaml/ezfio.ml . +ezfio.ml: ${QP_ROOT}/install/EZFIO/Ocaml/ezfio.ml + cp ${QP_ROOT}/install/EZFIO/Ocaml/ezfio.ml . qptypes_generator.byte: qptypes_generator.ml $(OCAMLBUILD) qptypes_generator.byte -use-ocamlfind @@ -71,8 +71,8 @@ qptypes_generator.byte: qptypes_generator.ml Qptypes.ml: qptypes_generator.byte ./qptypes_generator.byte > Qptypes.ml -${QP_ROOT}/EZFIO/Ocaml/ezfio.ml: - $(MAKE) -C ${QP_ROOT}/src ezfio +${QP_ROOT}/install/EZFIO/Ocaml/ezfio.ml: + $(MAKE) -C ${QP_ROOT}/install/src ezfio Input_auto_generated.ml qp_edit.ml: ei_handler.py ocaml_global From ec2d28f24006dcb9eead1a1c2d07637384175c34 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 19:00:14 +0200 Subject: [PATCH 19/23] Fast ocaml install --- install/scripts/install_ocaml.sh | 25 ++++++++++++++++++++++--- setup_environment.py | 4 ++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index 022cc59a..b0092659 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -1,5 +1,23 @@ #!/bin/bash +cd .. +QP_ROOT=$PWD +cd - + +# Fast installation +if [[ "$1" == "--fast" && ! -d ${HOME}/.opam ]] +then + MEGA_DL="${QP_ROOT}/bin/mega-dl.sh" + wget 'https://gist.githubusercontent.com/scemama/b9debaed0b76321229a5/raw/d06ca00e6ad7f3703ff4738b210f6f913c1bd8d5/mega-dl.sh' -O ${MEGA_DL} + chmod +x ${MEGA_DL} + url='https://mega.co.nz/#!ykh32ajD!2aeqh87c53tL-Z4W1msQvem-TrmRN3ftlZ_QdhKo3c4' + ${MEGA_DL} $url /tmp/opam.tgz + cd $HOME + tar -zxf /tmp/opam.tgz + cd - +fi + +# Normal installation PACKAGES="core cryptokit ocamlfind sexplib" declare -i i @@ -10,9 +28,10 @@ then exit 1 fi -cd .. -QP_ROOT=$PWD -cd - +if [[ -d ${HOME}/.opam ]] +then + source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true +fi cd Downloads || exit 1 chmod +x ocaml.sh || exit 1 diff --git a/setup_environment.py b/setup_environment.py index 972eefb4..2c682493 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -326,7 +326,7 @@ if "ocaml" in l_need_genealogy: l_cmd = ["cd install &&", "wget {0} -O {1} -o /dev/null &&".format(url, path_archive), - "./scripts/install_ocaml.sh"] + "./scripts/install_ocaml.sh --fast"] os.system(" ".join(l_cmd)) @@ -369,7 +369,7 @@ l_rc = [ 'export PATH="${PATH}":"${QP_PYTHON}":"${QP_ROOT}"/bin', 'export LD_LIBRARY_PATH="${QP_ROOT}"/lib:"${LD_LIBRARY_PATH}"', 'export LIBRARY_PATH="${QP_ROOT}"/lib:"${LIBRARY_PATH}"', "" - 'source . ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true', + 'source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true', "" ] From e6e78a521cd36fad2ab65da3b8893603c0f7c6f2 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 20:46:36 +0200 Subject: [PATCH 20/23] installation zlib OK --- COMPILE_RUN.md | 8 ++++---- data/Makefile | 7 ------- doc/code_architecture/Script.md | 12 ++++++------ install/scripts/install_ocaml.sh | 13 ------------- install/scripts/install_zlib.sh | 5 +++-- scripts/compilation/qp_create_ninja.py | 8 ++++---- .../qp_convert_output_to_ezfio.py | 4 ++-- setup_environment.py | 16 ++++++++-------- 8 files changed, 27 insertions(+), 46 deletions(-) delete mode 100644 data/Makefile diff --git a/COMPILE_RUN.md b/COMPILE_RUN.md index 7e9025b9..4e52aa9b 100644 --- a/COMPILE_RUN.md +++ b/COMPILE_RUN.md @@ -12,11 +12,11 @@ The script to create the dependencies file (aka `build.ninja`) is `create_ninja_ ## Compilation Flag -You need to specify all the flag useful for the compilation: like the optimization one, the mkl one .``$QPACKAGE_ROOT/config`` contains ``ifort.cfg`` and ``gfortran.cfg`` files which have the compiler flags that will be used to compile the code. You can edit these files to modify the compiling option. Put the file path when calling `create_ninja_build.py` +You need to specify all the flag useful for the compilation: like the optimization one, the mkl one .``$QP_ROOT/config`` contains ``ifort.cfg`` and ``gfortran.cfg`` files which have the compiler flags that will be used to compile the code. You can edit these files to modify the compiling option. Put the file path when calling `create_ninja_build.py` ## Example to create the Ninja file -`create_ninja_build.py --production $QPACKAGE_ROOT/config/ifort.cfg` +`create_ninja_build.py --production $QP_ROOT/config/ifort.cfg` # WARNING @@ -24,8 +24,8 @@ For now reload this command if you add a `IRP.f90` or `EZFIO.cfg` file or modify ## Compile -Just type `ninja` if you are in `$QPACKAGE_ROOT` (or `ninja -f $QPACKAGE_ROOT/build.ninja` elsewhere). The compilation will take approximately 3 min. +Just type `ninja` if you are in `$QP_ROOT` (or `ninja -f $QP_ROOT/build.ninja` elsewhere). The compilation will take approximately 3 min. If you have set the `--developement` flag in a specific module you can go in the corresponding IRPF90_temp and run `ninja` to only make the module and submodule binaries. (You can use the `-f` option too) -Now go in `$QPACKAGE_ROOT/ocaml` and type `make` \ No newline at end of file +Now go in `$QP_ROOT/ocaml` and type `make` diff --git a/data/Makefile b/data/Makefile deleted file mode 100644 index d02ec62b..00000000 --- a/data/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: executables - -.PHONY: executables - -executables: - cd $(QPACKAGE_ROOT)/src ; $(MAKE) executables - mv $(QPACKAGE_ROOT)/src/executables . diff --git a/doc/code_architecture/Script.md b/doc/code_architecture/Script.md index c348aca5..6c5ff34a 100644 --- a/doc/code_architecture/Script.md +++ b/doc/code_architecture/Script.md @@ -1,17 +1,17 @@ # `ei_handler.py` -This script in located in `$QPACKAGE_ROOT/scripts/ezfio_interface/`. +This script in located in `$QP_ROOT/scripts/ezfio_interface/`. It provide all the resource need to deal with the `EZFIO.cfg` files : - - The creation of `$MODULE_LOWER_ezfio_config` in `$QPACKAGE_ROOT/ezfio/config` + - The creation of `$MODULE_LOWER_ezfio_config` in `$QP_ROOT/ezfio/config` - The `ezfio_interface.irp.f` who containt all the provider associate (in `$MODULE/`) - - The `$MODULE_LOWER_ezfio_defaults` in `$QPACKAGE_ROOT/data/` + - The `$MODULE_LOWER_ezfio_defaults` in `$QP_ROOT/data/` - The `Input_$MODULE_LOWER.ml` for the *qp_edit* For more information you can type `ei_handler.py -h` # `module_handler.py` -This script in located in `$QPACKAGE_ROOT/scripts/module/`. +This script in located in `$QP_ROOT/scripts/module/`. It provide all the resource related to the tree dependancy of the modules. If more useful as a librairy than a cli. @@ -31,13 +31,13 @@ In the cli mode: # `qp_install_module.py` -This script is located in `$QPACKAGE_ROOT/scripts/module/`. +This script is located in `$QP_ROOT/scripts/module/`. It is usefull when you need to install a new module. (From the soon to come repo or from scratch). # `qp_create_ninja.py` -This script is located in `$QPACKAGE_ROOT/scripts/compilation/`. +This script is located in `$QP_ROOT/scripts/compilation/`. It will create the `build.ninja` file. It will use intersifly the `module_handler.py` module. To read all the flag for the compilation the module `read_compilation_cfg.py` is used. diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index b0092659..34410c62 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -4,19 +4,6 @@ cd .. QP_ROOT=$PWD cd - -# Fast installation -if [[ "$1" == "--fast" && ! -d ${HOME}/.opam ]] -then - MEGA_DL="${QP_ROOT}/bin/mega-dl.sh" - wget 'https://gist.githubusercontent.com/scemama/b9debaed0b76321229a5/raw/d06ca00e6ad7f3703ff4738b210f6f913c1bd8d5/mega-dl.sh' -O ${MEGA_DL} - chmod +x ${MEGA_DL} - url='https://mega.co.nz/#!ykh32ajD!2aeqh87c53tL-Z4W1msQvem-TrmRN3ftlZ_QdhKo3c4' - ${MEGA_DL} $url /tmp/opam.tgz - cd $HOME - tar -zxf /tmp/opam.tgz - cd - -fi - # Normal installation PACKAGES="core cryptokit ocamlfind sexplib" diff --git a/install/scripts/install_zlib.sh b/install/scripts/install_zlib.sh index 8e1b3d8b..26139f5c 100755 --- a/install/scripts/install_zlib.sh +++ b/install/scripts/install_zlib.sh @@ -12,7 +12,8 @@ function _install() cd ${BUILD} ./configure && make || exit 1 make install prefix=$QP_ROOT/install/${TARGET} || exit 1 - ln -f $QP_ROOT/install/${TARGET}/lib/libz.so $QP_ROOT/lib || exit 1 + ln -s -f $QP_ROOT/install/${TARGET}/lib/libz.so $QP_ROOT/lib || exit 1 + ln -s -f $QP_ROOT/install/${TARGET}/lib/libz.a $QP_ROOT/lib || exit 1 } -source scripts/build.sh \ No newline at end of file +source scripts/build.sh diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index 7534d61f..620c5f1b 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -223,7 +223,7 @@ def ninja_ezfio_rule(): for flag in ["FC", "FCFLAGS", "IRPF90"]] l_cmd = ["cd {0}".format(QP_ROOT_EZFIO) - ] + l_flag + ["make && ln -f {0} {1}".format(join(QP_ROOT, 'install', 'EZFIO',"lib","libezfio.a"), + ] + l_flag + ["ninja && ln -f {0} {1}".format(join(QP_ROOT, 'install', 'EZFIO',"lib","libezfio.a"), EZFIO_LIB)] l_string = ["rule build_ezfio", @@ -399,7 +399,7 @@ def ninja_irpf90_make_build(path_module, l_needed_molule, d_irp): l_creation = [join(path_module.abs, i) for i in ["irpf90.make", "irpf90_entities", "tags", - "IRPF90_temp/build.ninja"]] + "build.ninja"]] str_creation = " ".join(l_creation) # ~#~#~#~#~#~#~#~#~#~ # @@ -532,7 +532,7 @@ def ninja_binaries_rule(): # c m d # # ~#~#~ # - l_cmd = ["cd $module/IRPF90_temp", "ninja"] + l_cmd = ["cd $module", "ninja"] # ~#~#~#~#~#~ # # s t r i n g # @@ -554,7 +554,7 @@ def ninja_binaries_build(path_module, l_children, d_binaries): # c m d # # ~#~#~ # - ninja_module_path = join(path_module.abs, "IRPF90_temp", "build.ninja") + ninja_module_path = join(path_module.abs, "build.ninja") l_abs_bin = [binary.abs for binary in d_binaries[path_module]] # ~#~#~#~#~#~ # diff --git a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py index 4cf96ca6..ff7ad225 100755 --- a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py +++ b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py @@ -1,6 +1,6 @@ #!/usr/bin/env python """ -This function acceep +convert output of gamess/GAU$$IAN to ezfio Usage: qp_convert_output_to_ezfio.py [--ezfio=] @@ -29,7 +29,7 @@ except: print "Error: QP_ROOT environment variable not found." sys.exit(1) else: - sys.path = [QP_ROOT + "/EZFIO/Python", + sys.path = [QP_ROOT + "/install/EZFIO/Python", QP_ROOT + "/resultsFile", QP_ROOT + "/scripts"] + sys.path diff --git a/setup_environment.py b/setup_environment.py index 2c682493..9a6f2a37 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -65,7 +65,7 @@ path = Info( default_path=join(QP_ROOT_BIN, "patch")) irpf90 = Info( - url='{head}/scemama/irpf90/archive/v1.6.5.tar.gz'.format(**path_github), + url='{head}/scemama/irpf90/archive/v1.6.6.tar.gz'.format(**path_github), description=' irpf90', default_path=join(QP_ROOT_BIN, "irpf90")) @@ -143,16 +143,11 @@ def check_python(): def check_avabiliy(binary): - if binary == "zlib": - binary_name = "zlib-flate" - else: - binary_name = binary - if binary == "python": check_python() try: - return check_output(["which", binary_name]) + return check_output(["which", binary]) except subprocess.CalledProcessError: default_path = d_info[binary].default_path if os.path.exists(default_path): @@ -209,7 +204,12 @@ print """ """ print "You have already installed :" -pprint.pprint(l_installed) +def f( (a1,a2), (key,value) ): + return tuple(max(x,len(y)) for (x,y) in [(a1,key), (a2,value)] ) +fmt_tuple =reduce(f, l_installed.iteritems(), (0,0)) +for k,v in l_installed.iteritems(): + fmt = "{0:<%d} : {1:<%d}"%fmt_tuple + print fmt.format( k, v ) print """ ___ From 8f161ea7782a492023f89b6aa721c815eb624e08 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 21:43:41 +0200 Subject: [PATCH 21/23] Add bin/ocaml in path --- setup_environment.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/setup_environment.py b/setup_environment.py index 9a6f2a37..cdf1b1ed 100755 --- a/setup_environment.py +++ b/setup_environment.py @@ -19,10 +19,10 @@ QP_ROOT_INSTALL = join(QP_ROOT, "install") d_dependancy = { "ocaml": ["m4", "curl", "zlib", "patch", "gcc"], - "m4": [], - "curl": [], - "zlib": ["gcc"], - "patch": [], + "m4": ["make"], + "curl": ["make"], + "zlib": ["gcc", "make"], + "patch": ["make"], "ezfio": ["irpf90"], "irpf90": ["python"], "docopt": ["python"], @@ -30,7 +30,8 @@ d_dependancy = { "emsl": ["python"], "gcc": [], "python": [], - "ninja": ["gcc", "python"] + "ninja": ["gcc", "python"], + "make": [] } from collections import namedtuple @@ -366,7 +367,7 @@ l_rc = [ 'export QP_PYTHON={0}'.format(":".join(l_python)), "", 'export PYTHONPATH="${PYTHONPATH}":"${QP_PYTHON}"', - 'export PATH="${PATH}":"${QP_PYTHON}":"${QP_ROOT}"/bin', + 'export PATH="${PATH}":"${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml', 'export LD_LIBRARY_PATH="${QP_ROOT}"/lib:"${LD_LIBRARY_PATH}"', 'export LIBRARY_PATH="${QP_ROOT}"/lib:"${LIBRARY_PATH}"', "" 'source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true', From 2dbd82d2b67c3e740cfb288dfa63258f43e4f71a Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 22:17:40 +0200 Subject: [PATCH 22/23] Fix getbasis --- scripts/get_basis.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/get_basis.sh b/scripts/get_basis.sh index bdc3a3aa..ec07aa6d 100755 --- a/scripts/get_basis.sh +++ b/scripts/get_basis.sh @@ -15,8 +15,7 @@ then exit -1 fi -export EMSL_API_ROOT="${QP_ROOT}"/install/EMSL_Basis/ -export PYTHONPATH="${EMSL_API_ROOT}":${PYTHONPATH} +export EMSL_API_ROOT="${QP_ROOT}"/install/emsl tmpfile="$1" shift From ba06580028875f37e1f71330351add04dd316b14 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 8 Jun 2015 22:50:02 +0200 Subject: [PATCH 23/23] Fix put_pseudo.py --- scripts/pseudo/put_pseudo_in_ezfio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pseudo/put_pseudo_in_ezfio.py b/scripts/pseudo/put_pseudo_in_ezfio.py index e11c8dc3..ff63a18d 100755 --- a/scripts/pseudo/put_pseudo_in_ezfio.py +++ b/scripts/pseudo/put_pseudo_in_ezfio.py @@ -19,7 +19,7 @@ from subprocess import Popen, PIPE qpackage_root = os.environ['QP_ROOT'] -EZFIO = "{0}/EZFIO".format(qpackage_root) +EZFIO = "{0}/install/EZFIO".format(qpackage_root) sys.path = [EZFIO + "/Python"] + sys.path from ezfio import ezfio @@ -51,7 +51,7 @@ def get_pseudo_str(l_atom): 10.11238853 0 1.14052020 |1><1| """ - EMSL_root = "{0}/EMSL_Basis/".format(qpackage_root) + EMSL_root = "{0}/install/emsl/".format(qpackage_root) EMSL_path = "{0}/EMSL_api.py".format(EMSL_root) db_path = "{0}/db/Pseudo.db".format(EMSL_root)