mirror of
https://github.com/LCPQ/quantum_package
synced 2024-10-31 19:23:50 +01:00
First try of new setup
This commit is contained in:
parent
b60c7c757d
commit
4fedc72749
@ -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.
|
||||
|
10
install/scripts/build.sh
Executable file
10
install/scripts/build.sh
Executable file
@ -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
|
19
install/scripts/install_curl.sh
Executable file
19
install/scripts/install_curl.sh
Executable file
@ -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
|
10
install/scripts/install_docopt.sh
Executable file
10
install/scripts/install_docopt.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
TARGET=docopt
|
||||
|
||||
function _install()
|
||||
{
|
||||
cp -R ${BUILD} . || exit 1
|
||||
}
|
||||
|
||||
source scripts/build.sh
|
10
install/scripts/install_emsl.sh
Executable file
10
install/scripts/install_emsl.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
TARGET=emsl
|
||||
|
||||
function _install()
|
||||
{
|
||||
cp -R ${BUILD} . || exit 1
|
||||
}
|
||||
|
||||
source scripts/build.sh
|
16
install/scripts/install_ezfio.sh
Executable file
16
install/scripts/install_ezfio.sh
Executable file
@ -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
|
24
install/scripts/install_irpf90.sh
Executable file
24
install/scripts/install_irpf90.sh
Executable file
@ -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
|
||||
|
||||
|
15
install/scripts/install_m4.sh
Executable file
15
install/scripts/install_m4.sh
Executable file
@ -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
|
14
install/scripts/install_ninja.sh
Executable file
14
install/scripts/install_ninja.sh
Executable file
@ -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
|
41
install/scripts/install_ocaml.sh
Executable file
41
install/scripts/install_ocaml.sh
Executable file
@ -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
|
||||
|
||||
|
19
install/scripts/install_patch.sh
Executable file
19
install/scripts/install_patch.sh
Executable file
@ -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
|
11
install/scripts/install_resultsFile.sh
Executable file
11
install/scripts/install_resultsFile.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
TARGET=resultsFile
|
||||
|
||||
function _install()
|
||||
{
|
||||
cp -R ${BUILD} . || exit 1
|
||||
}
|
||||
|
||||
source scripts/build.sh
|
||||
|
16
install/scripts/install_zlib.sh
Executable file
16
install/scripts/install_zlib.sh
Executable file
@ -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
|
@ -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<mod>\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()
|
@ -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,11 +334,19 @@ 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():
|
||||
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
|
||||
|
@ -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}
|
||||
|
@ -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}
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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}
|
||||
|
@ -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="[34m"
|
||||
RED="[31m"
|
||||
BLACK="(B[m"
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user