10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-22 18:57:31 +02:00

Updated Installation instructions (rest => markdown)

Thomas Applencourt 2016-01-08 17:20:17 +01:00
parent b967279d89
commit 4cc040db06
2 changed files with 80 additions and 34 deletions

@ -0,0 +1,80 @@
## 1) Setup the environment::
`$ ./configure <config_file> (--production | --development)`
For example you can type `./configure config/gfortran.cfg --production`
This command have to purpose :
- Download and install all the requirements.
Installing OCaml and the Core library may take some time (up to 20min on an old machine).
- And 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)
By default, the Ocaml compiler will be installed in ``$HOME/.opam``.
For more info about the Ocaml installation, check the Opam website :
https://opam.ocaml.org/doc/Install.html
####Compilation Flags (`<config_file>`)
`<config_file>` is the path to the file who contain all the flags useful for the compilation: like the optimization flags, the Lapack libary, etc. We have two default configure file in ``$QP_ROOT/config`` : ``ifort.cfg`` and ``gfortran.cfg``. You can edit these files to modify the compiling options.
Note that the ``popcnt`` instruction accelerates *a lot* the programs, so the
SSE4.2, AVX or AVX2 instruction sets should be enabled if possible.
If you encounter an error saying that your Fortran compiler can't produce
executables, it means that the program was built using an instruction set
not supported by the current processor. In that case, use the ``-ax`` option
of the Intel Fortran compiler instead of the ``-x`` option, or the
``-march=native`` option of gfortran.
#### 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
* Else if you are a developer and you want to be able to compile specific modules use: `--development`. It will create for you the `build.ninja` in each module
### 2) Set environment variable
A configuration file named ``quantum_package.rc`` will be created.
To finish the installation, source this file in your shell::
`source quantum_package.rc`
And you can also source it inside your ``.bashrc`` file.
If you use a C-shell, you will have to translate the ``.bashrc`` file into
C-shell syntax and source it in your shell.
### Optional) Add some new module
From speed consideration, the quantum package have no executable out of the box. You need to install (and then compile) some module, if you wan't the executable ; the `qp_module.py` will help you.
```
Usage: qp_module.py list (--installed|--avalaible-local|--avalaible-remote)
qp_module.py install <name>...
qp_module.py create -n <name> [<children_module>...]
qp_module.py download -n <name> [<path_folder>...]
```
For exemple you can type : `qp_module.py install Full_CI`. This will install the `Full_CI` module. All the module installed a in the `$QP_ROOT/src/` if you wan't to check it.
### 3) Compiling the fortran
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 module `$QP_ROOT/src/module_name`- directory and run `ninja` to build only this module.
You can type `ninja all` in a module for compiling all the submodule
### 4) Compiling the OCaml
You need to compile the OCaml source code. OCaml as here to handle the hight level IO.
```
cd $QP_ROOT ; make -C ocaml/
```
### 5) Testing if all is ok
Some unit test are available in the `test` directory. For runing the test
```
cd $QP_ROOT/tests
bats bats/qp.bats
```

@ -1,34 +0,0 @@
Setup the environment::
./setup_environment.sh
This will automatically download and compile the requirements.
By default, the Ocaml compiler will be installed in ``$HOME/.opam``.
For more info about the Ocaml installation, check the Opam website :
https://opam.ocaml.org/doc/Install.html
A configuration file named ``quantum_package.rc`` will be created.
To finish the installation, source this file in your shell::
source quantum_package.rc
And you can also source it inside your ``.bashrc`` file.
If you use a C-shell, you will have to translate the ``.bashrc`` file into
C-shell syntax and source it in your shell.
Finally, create the ``Makefile.config`` file from the ``Makefile.config.example``.
Note that the ``popcnt`` instruction accelerates *a lot* the programs, so the
SSE4.2, AVX or AVX2 instruction sets should be enabled if possible.
If you encounter an error saying that your Fortran compiler can't produce
executables, it means that the program was built using an instruction set
not supported by the current processor. In that case, use the ``-ax`` option
of the Intel Fortran compiler instead of the ``-x`` option, or the
``-march=native`` option of gfortran.
Finally, build the binary files ::
make build