mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-22 20:35:19 +01:00
Remove the raise, for only show the 'source message' / cleaning configure
This commit is contained in:
parent
46fe6fcc92
commit
7553b0877c
41
configure
vendored
41
configure
vendored
@ -45,7 +45,7 @@ QP_ROOT = os.getcwd()
|
|||||||
QP_ROOT_BIN = join(QP_ROOT, "bin")
|
QP_ROOT_BIN = join(QP_ROOT, "bin")
|
||||||
QP_ROOT_INSTALL = join(QP_ROOT, "install")
|
QP_ROOT_INSTALL = join(QP_ROOT, "install")
|
||||||
|
|
||||||
os.environ["PATH"] = os.environ["PATH"] + ":"+QP_ROOT_BIN
|
os.environ["PATH"] = os.environ["PATH"] + ":" + QP_ROOT_BIN
|
||||||
|
|
||||||
d_dependency = {
|
d_dependency = {
|
||||||
"ocaml": ["m4", "curl", "zlib", "patch", "gcc"],
|
"ocaml": ["m4", "curl", "zlib", "patch", "gcc"],
|
||||||
@ -72,7 +72,8 @@ path_github = {"head": "http://github.com/", "tail": "archive/master.tar.gz"}
|
|||||||
|
|
||||||
ocaml = Info(
|
ocaml = Info(
|
||||||
url='http://raw.github.com/ocaml/opam/master/shell/opam_installer.sh',
|
url='http://raw.github.com/ocaml/opam/master/shell/opam_installer.sh',
|
||||||
description=' Ocaml, Opam and the Core library (it will take some time roughly 20min)',
|
description=
|
||||||
|
' Ocaml, Opam and the Core library (it will take some time roughly 20min)',
|
||||||
default_path=join(QP_ROOT_BIN, "opam"))
|
default_path=join(QP_ROOT_BIN, "opam"))
|
||||||
|
|
||||||
m4 = Info(
|
m4 = Info(
|
||||||
@ -133,7 +134,7 @@ for m in ["ocaml", "m4", "curl", "zlib", "path", "irpf90", "docopt",
|
|||||||
exec ("d_info['{0}']={0}".format(m))
|
exec ("d_info['{0}']={0}".format(m))
|
||||||
|
|
||||||
|
|
||||||
def find_path(bin_, l_installed):
|
def find_path(bin_, l_installed, var_for_qp_root=False):
|
||||||
"""Use the global variable
|
"""Use the global variable
|
||||||
* l_installed
|
* l_installed
|
||||||
* d_info
|
* d_info
|
||||||
@ -143,6 +144,10 @@ def find_path(bin_, l_installed):
|
|||||||
locate = l_installed[bin_]
|
locate = l_installed[bin_]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
locate = d_info[bin_].default_path
|
locate = d_info[bin_].default_path
|
||||||
|
|
||||||
|
if var_for_qp_root:
|
||||||
|
locate = locate.replace(QP_ROOT, "${QP_ROOT}")
|
||||||
|
|
||||||
return locate
|
return locate
|
||||||
|
|
||||||
|
|
||||||
@ -158,7 +163,8 @@ def check_output(*popenargs, **kwargs):
|
|||||||
>>> check_output(['/usr/bin/python', '--version'])
|
>>> check_output(['/usr/bin/python', '--version'])
|
||||||
Python 2.6.2
|
Python 2.6.2
|
||||||
"""
|
"""
|
||||||
process = subprocess.Popen(stdout=subprocess.PIPE,stderr=subprocess.PIPE, *popenargs, **kwargs)
|
process = subprocess.Popen(stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE, *popenargs, **kwargs)
|
||||||
output, unused_err = process.communicate()
|
output, unused_err = process.communicate()
|
||||||
retcode = process.poll()
|
retcode = process.poll()
|
||||||
if retcode:
|
if retcode:
|
||||||
@ -277,7 +283,8 @@ def installation(l_install_descendant):
|
|||||||
def create_rule_ninja():
|
def create_rule_ninja():
|
||||||
|
|
||||||
l_rules = [
|
l_rules = [
|
||||||
"rule download", " command = wget --no-check-certificate ${url} -O ${out} -o /dev/null",
|
"rule download",
|
||||||
|
" command = wget --no-check-certificate ${url} -O ${out} -o /dev/null",
|
||||||
" description = Downloading ${descr}", ""
|
" description = Downloading ${descr}", ""
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -429,12 +436,15 @@ def create_ninja_and_rc(l_installed):
|
|||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
l_python.append(path)
|
l_python.append(path)
|
||||||
|
|
||||||
l_rc = [ 'export QP_ROOT={0}'.format(QP_ROOT) ] + \
|
path_ezfio = find_path('ezfio', l_installed, var_for_qp_root=True)
|
||||||
[ i.replace(QP_ROOT,"${QP_ROOT}") for i in
|
path_irpf90 = find_path("irpf90", l_installed, var_for_qp_root=True)
|
||||||
[
|
path_ninja = find_path("ninja", l_installed, var_for_qp_root=True)
|
||||||
'export QP_EZFIO={0}'.format(find_path('ezfio', l_installed)),
|
|
||||||
'export IRPF90={0}'.format(find_path("irpf90", l_installed)),
|
l_rc = [
|
||||||
'export NINJA={0}'.format(find_path("ninja", l_installed)),
|
'export QP_ROOT={0}'.format(QP_ROOT),
|
||||||
|
'export QP_EZFIO={0}'.format(path_ezfio),
|
||||||
|
'export IRPF90={0}'.format(path_irpf90),
|
||||||
|
'export NINJA={0}'.format(path_ninja),
|
||||||
'export QP_PYTHON={0}'.format(":".join(l_python)), "",
|
'export QP_PYTHON={0}'.format(":".join(l_python)), "",
|
||||||
'export PYTHONPATH="${QP_PYTHON}":"${PYTHONPATH}"',
|
'export PYTHONPATH="${QP_PYTHON}":"${PYTHONPATH}"',
|
||||||
'export PATH="${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml:"${PATH}"',
|
'export PATH="${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml:"${PATH}"',
|
||||||
@ -443,7 +453,7 @@ def create_ninja_and_rc(l_installed):
|
|||||||
'source ${QP_ROOT}/install/EZFIO/Bash/ezfio.sh', "",
|
'source ${QP_ROOT}/install/EZFIO/Bash/ezfio.sh', "",
|
||||||
'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',
|
||||||
""
|
""
|
||||||
] ]
|
]
|
||||||
|
|
||||||
path = join(QP_ROOT, "quantum_package.rc")
|
path = join(QP_ROOT, "quantum_package.rc")
|
||||||
with open(path, "w+") as f:
|
with open(path, "w+") as f:
|
||||||
@ -451,16 +461,14 @@ def create_ninja_and_rc(l_installed):
|
|||||||
|
|
||||||
print "[ OK ] ({0})".format(path)
|
print "[ OK ] ({0})".format(path)
|
||||||
|
|
||||||
print str_info("build"),
|
|
||||||
|
|
||||||
command = ['bash', '-c', 'source {0} && env'.format(path)]
|
command = ['bash', '-c', 'source {0} && env'.format(path)]
|
||||||
|
|
||||||
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||||
|
|
||||||
for line in proc.stdout:
|
for line in proc.stdout:
|
||||||
(key, _, value) = line.partition("=")
|
(key, _, value) = line.partition("=")
|
||||||
os.environ[key] = value.strip()
|
os.environ[key] = value.strip()
|
||||||
|
|
||||||
|
print str_info("build"),
|
||||||
|
|
||||||
qp_create_ninja = os.path.join(QP_ROOT, "scripts", "compilation",
|
qp_create_ninja = os.path.join(QP_ROOT, "scripts", "compilation",
|
||||||
"qp_create_ninja.py")
|
"qp_create_ninja.py")
|
||||||
|
|
||||||
@ -474,7 +482,6 @@ def create_ninja_and_rc(l_installed):
|
|||||||
|
|
||||||
|
|
||||||
def recommendation():
|
def recommendation():
|
||||||
print "Last Step:"
|
|
||||||
path = join(QP_ROOT, "quantum_package.rc")
|
path = join(QP_ROOT, "quantum_package.rc")
|
||||||
print "Now :"
|
print "Now :"
|
||||||
print " source {0}".format(path)
|
print " source {0}".format(path)
|
||||||
|
@ -23,10 +23,10 @@ try:
|
|||||||
from module_handler import get_l_module_descendant
|
from module_handler import get_l_module_descendant
|
||||||
from update_README import Doc_key, Needed_key
|
from update_README import Doc_key, Needed_key
|
||||||
from qp_path import QP_SRC, QP_PLUGINS
|
from qp_path import QP_SRC, QP_PLUGINS
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print "source .quantum_package.rc"
|
print "Please check if you have source the .quantum_package.rc"
|
||||||
raise
|
print "(`source .quantum_package.rc`)"
|
||||||
|
print sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def save_new_module(path, l_child):
|
def save_new_module(path, l_child):
|
||||||
|
Loading…
Reference in New Issue
Block a user