10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-07 22:53:57 +01:00
quantum_package/COMPILE_RUN.md

39 lines
1.4 KiB
Markdown
Raw Normal View History

2015-06-03 18:55:29 +02:00
# Compile
2015-06-09 11:02:45 +02:00
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).
2015-06-03 18:55:29 +02:00
2015-06-09 11:02:45 +02:00
The script to create the dependency file (aka `build.ninja`) is
`qp_create_ninja.py`.
2015-06-03 18:55:29 +02:00
## What utilization of the code will you do?
2015-06-09 11:02:45 +02:00
* 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
2015-06-10 18:16:29 +02:00
modules use: `--development`. It will create for you the `build.ninja` in each
module
2015-06-03 18:55:29 +02:00
2015-06-09 11:02:45 +02:00
## Compilation Flags
2015-06-03 18:55:29 +02:00
2015-06-09 11:02:45 +02:00
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.
2015-06-03 18:55:29 +02:00
## Example to create the Ninja file
2015-06-10 18:16:29 +02:00
`qp_create_ninja.py create --production $QP_ROOT/config/ifort.cfg`
2015-06-03 18:55:29 +02:00
2015-06-09 11:02:45 +02:00
## Compiling
2015-06-03 18:55:29 +02:00
2015-06-09 11:02:45 +02:00
Just type `ninja` if you are in `$QP_ROOT` (or `ninja -f $QP_ROOT/build.ninja`
elsewhere). The compilation will take approximately 3 min.
2015-06-03 18:55:29 +02:00
2015-06-09 11:02:45 +02:00
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.
2015-06-10 18:16:29 +02:00
You can type `ninja all` in a module for compiling all the submodule
2015-06-03 18:55:29 +02:00
2015-06-09 11:02:45 +02:00
Finally, go in `$QP_ROOT/ocaml` and type `make`