mirror of
https://github.com/LCPQ/quantum_package
synced 2024-09-01 17:13:42 +02:00
Merge branch 'master' of github.com:TApplencourt/quantum_package
This commit is contained in:
commit
82945e8c43
@ -12,7 +12,7 @@ before_script:
|
||||
script:
|
||||
- ./setup_environment.py
|
||||
- source ./quantum_package.rc
|
||||
- qp_create_ninja.py --production ./config/gfortran_example.cfg
|
||||
- qp_create_ninja.py --production ./config/gfortran.cfg
|
||||
- ninja
|
||||
- cd ocaml ; make ; cd -
|
||||
- cd testing_no_regression ; ./unit_test.py
|
||||
|
@ -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`
|
||||
|
10
ocaml/.gitignore
vendored
10
ocaml/.gitignore
vendored
@ -5,7 +5,6 @@ qptypes_generator.byte
|
||||
_build
|
||||
qp_basis_clean.native
|
||||
qp_create_ezfio_from_xyz.native
|
||||
qp_edit.native
|
||||
qp_print.native
|
||||
qp_run.native
|
||||
qp_set_ddci.native
|
||||
@ -33,17 +32,16 @@ test_molecule
|
||||
test_point3d
|
||||
qp_basis_clean
|
||||
qp_create_ezfio_from_xyz
|
||||
qp_edit
|
||||
qp_print
|
||||
qp_run
|
||||
qp_set_ddci
|
||||
qp_set_mo_class
|
||||
Input_pseudo.ml
|
||||
Input_integrals_bielec.ml
|
||||
Input_hartree_fock.ml
|
||||
Input_perturbation.ml
|
||||
Input_determinants.ml
|
||||
Input_hartree_fock.ml
|
||||
Input_integrals_bielec.ml
|
||||
Input_perturbation.ml
|
||||
Input_properties.ml
|
||||
Input_pseudo.ml
|
||||
qp_edit.ml
|
||||
qp_edit
|
||||
qp_edit.native
|
||||
|
@ -8,6 +8,20 @@ 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 " make -C ocaml"
|
||||
print ""
|
||||
sys.exit()
|
||||
|
||||
|
||||
# __ _
|
||||
# /__ | _ |_ _. | o ._ _|_ _
|
||||
# \_| |_ (_) |_) (_| | | | | | (_)
|
||||
@ -16,8 +30,10 @@ from os.path import join
|
||||
QP_ROOT = os.getcwd()
|
||||
QP_ROOT_BIN = join(QP_ROOT, "bin")
|
||||
QP_ROOT_INSTALL = join(QP_ROOT, "install")
|
||||
os.environ["PATH"] = ":".join( [QP_ROOT_BIN,os.environ["PATH"] ] )
|
||||
|
||||
d_dependancy = {
|
||||
|
||||
d_dependency = {
|
||||
"ocaml": ["m4", "curl", "zlib", "patch", "gcc"],
|
||||
"m4": ["make"],
|
||||
"curl": ["make"],
|
||||
@ -142,7 +158,7 @@ def check_python():
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def check_avabiliy(binary):
|
||||
def check_availabiliy(binary):
|
||||
|
||||
if binary == "python":
|
||||
check_python()
|
||||
@ -174,15 +190,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 +209,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 +238,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 +304,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 +319,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 +328,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 +345,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 +396,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,6 +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.1198231418)
|
||||
ref_energy["vdz"]["HBO"] = Energy(None, -19.1198254041)
|
||||
|
||||
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
|
||||
|
Loading…
Reference in New Issue
Block a user