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 -