mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-22 20:35:19 +01:00
Corrected Doc and travis for building
This commit is contained in:
parent
04a482f0fe
commit
022e117873
@ -1,31 +1,41 @@
|
||||
# Compile
|
||||
|
||||
We need to create the file who contain all the tree dependencies for the binaries. It's not a MakeFile, but a Ninja file. (So don't type `make` is hopeless, type `ninja` instead)
|
||||
We need to create the file which contains all the tree dependencies for the
|
||||
binaries. It's not a Makefile, but a Ninja file (so don't type `make` is
|
||||
hopeless, type `ninja` instead).
|
||||
|
||||
The script to create the dependencies file (aka `build.ninja`) is `create_ninja_build.py`.
|
||||
The script to create the dependency file (aka `build.ninja`) is
|
||||
`qp_create_ninja.py`.
|
||||
|
||||
## What utilization of the code will you do?
|
||||
|
||||
* If you only want the binaries (for production workflow) use the flag `--production` in when calling this script. It's quicker
|
||||
* If you only want the binaries (for production workflow) use the flag
|
||||
`--production` in when calling this script. It's quicker
|
||||
* Else if you are a developer and you want to be able to compile specific
|
||||
modules use: `--development`
|
||||
|
||||
* Else if you are a developer and you want to be able to only compile one specific module use: `--development`
|
||||
## Compilation Flags
|
||||
|
||||
## Compilation Flag
|
||||
|
||||
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`
|
||||
You need to specify all the flags useful for the compilation: like the
|
||||
optimization flags, the Lapack libary, etc. ``$QP_ROOT/config`` contains
|
||||
``ifort.cfg`` and ``gfortran.cfg`` containing the compiler flags that will be
|
||||
used. You can edit these files to modify the compiling options.
|
||||
|
||||
## Example to create the Ninja file
|
||||
|
||||
`create_ninja_build.py --production $QP_ROOT/config/ifort.cfg`
|
||||
`qp_create_ninja.py --production $QP_ROOT/config/ifort.cfg`
|
||||
|
||||
# WARNING
|
||||
|
||||
For now reload this command if you add a `IRP.f90` or `EZFIO.cfg` file or modify the `NEED_CHILDREN_MODULE`!
|
||||
For now you need to execute this command if you add a `irp.f` or `EZFIO.cfg`
|
||||
file or modify the `NEED_CHILDREN_MODULE`!
|
||||
|
||||
## Compile
|
||||
## Compiling
|
||||
|
||||
Just type `ninja` if you are in `$QP_ROOT` (or `ninja -f $QP_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)
|
||||
If you have set the `--developement` flag in a specific module you can go in
|
||||
the corresponding module directory and run `ninja` to build only this module.
|
||||
|
||||
Now go in `$QP_ROOT/ocaml` and type `make`
|
||||
Finally, go in `$QP_ROOT/ocaml` and type `make`
|
||||
|
@ -8,6 +8,19 @@ import pprint
|
||||
|
||||
from os.path import join
|
||||
|
||||
def finalize():
|
||||
path = join(QP_ROOT, "quantum_package.rc")
|
||||
print "For more info on compiling the code, read the COMPILE_RUN.md file."
|
||||
print ""
|
||||
print "You can check {0} and run:".format(path)
|
||||
print ""
|
||||
print " source {0}".format(path)
|
||||
print " qp_create_ninja.py --production $QP_ROOT/config/ifort.cfg"
|
||||
print " ninja"
|
||||
print ""
|
||||
sys.exit()
|
||||
|
||||
|
||||
# __ _
|
||||
# /__ | _ |_ _. | o ._ _|_ _
|
||||
# \_| |_ (_) |_) (_| | | | | | (_)
|
||||
@ -17,7 +30,7 @@ QP_ROOT = os.getcwd()
|
||||
QP_ROOT_BIN = join(QP_ROOT, "bin")
|
||||
QP_ROOT_INSTALL = join(QP_ROOT, "install")
|
||||
|
||||
d_dependancy = {
|
||||
d_dependency = {
|
||||
"ocaml": ["m4", "curl", "zlib", "patch", "gcc"],
|
||||
"m4": ["make"],
|
||||
"curl": ["make"],
|
||||
@ -142,7 +155,7 @@ def check_python():
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def check_avabiliy(binary):
|
||||
def check_availabiliy(binary):
|
||||
|
||||
if binary == "python":
|
||||
check_python()
|
||||
@ -174,15 +187,17 @@ print """
|
||||
"""
|
||||
|
||||
# Check all the other
|
||||
for i in d_dependancy.keys():
|
||||
print "Checking if you have {0} avalaible...".format(i),
|
||||
length = max( [ len(i) for i in d_dependency ] )
|
||||
fmt = "%"+str(length)+"s"
|
||||
for i in d_dependency.keys():
|
||||
print "Checking if %s is avalaible..."%( i.center(length) ),
|
||||
|
||||
r = check_avabiliy(i)
|
||||
r = check_availabiliy(i)
|
||||
if r:
|
||||
print "OK"
|
||||
print "[ OK ]"
|
||||
l_installed[i] = r.strip()
|
||||
else:
|
||||
print "We will try to compile if from source in a few moment"
|
||||
print "Will compile it"
|
||||
l_need.append(i)
|
||||
|
||||
# Expend the need_stuff for all the genealogy
|
||||
@ -191,7 +206,7 @@ d_need_genealogy = dict()
|
||||
|
||||
for need in l_need:
|
||||
d_need_genealogy[need] = None
|
||||
for childen in d_dependancy[need]:
|
||||
for childen in d_dependency[need]:
|
||||
if childen not in l_installed:
|
||||
d_need_genealogy[childen] = None
|
||||
|
||||
@ -220,11 +235,11 @@ print """
|
||||
"""
|
||||
|
||||
if l_need_genealogy:
|
||||
print "You need to install"
|
||||
print "You need to install:"
|
||||
pprint.pprint(l_need_genealogy)
|
||||
else:
|
||||
print "Nothing to do"
|
||||
sys.exit()
|
||||
print "Nothing to do."
|
||||
finalize()
|
||||
|
||||
if "ninja" in l_need_genealogy:
|
||||
|
||||
@ -286,7 +301,7 @@ for need in l_need_genealogy:
|
||||
" 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_dependancy = [d_info[i].default_path for i in d_dependency[need] if i in l_need_genealogy]
|
||||
|
||||
l_build += ["build {0}: install {1} {2}".format(d_info[need].default_path,
|
||||
archive_path,
|
||||
@ -301,7 +316,7 @@ with open(path, "w+") as f:
|
||||
f.write("\n".join(l_string))
|
||||
|
||||
print "Done"
|
||||
print "You can check at {0}".format(path)
|
||||
print "You can check {0}".format(path)
|
||||
|
||||
print """
|
||||
# ~#~#~#~#~#~#~#~#~ #
|
||||
@ -310,7 +325,7 @@ print """
|
||||
"""
|
||||
|
||||
if [i for i in l_need_genealogy if i not in "ocaml"]:
|
||||
subprocess.check_call("./bin/ninja -C install", shell=True)
|
||||
subprocess.check_call("ninja -C install", shell=True)
|
||||
|
||||
print "Done"
|
||||
|
||||
@ -327,7 +342,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 --fast"]
|
||||
"./scripts/install_ocaml.sh"]
|
||||
|
||||
os.system(" ".join(l_cmd))
|
||||
|
||||
@ -378,6 +393,5 @@ path = join(QP_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"
|
||||
print "Done."
|
||||
finalize()
|
||||
|
@ -163,7 +163,7 @@ def run_hf(geo, basis, mult=1, pseudo=False, remove_after_sucess=True):
|
||||
|
||||
ref_energy["sto-3g"]["methane"] = Energy(-39.7267433402, None)
|
||||
ref_energy["vdz"]["SO2"] = Energy(None, -41.48912297776174)
|
||||
ref_energy["vdz"]["HBO"] = Energy(None, -19.1198254041)
|
||||
ref_energy["vdz"]["HBO"] = Energy(None, -19.1198231418)
|
||||
|
||||
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
|
||||
# G l o b a l _ v a r i a b l e #
|
||||
|
Loading…
Reference in New Issue
Block a user