From 4cc040db0689148cbde621229f7ebe2302a4806d Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Fri, 8 Jan 2016 17:20:17 +0100 Subject: [PATCH] Updated Installation instructions (rest => markdown) --- Installation-instructions.md | 80 ++++++++++++++++++++++++++++++++++ Installation-instructions.rest | 34 --------------- 2 files changed, 80 insertions(+), 34 deletions(-) create mode 100644 Installation-instructions.md delete mode 100644 Installation-instructions.rest diff --git a/Installation-instructions.md b/Installation-instructions.md new file mode 100644 index 0000000..09b9b2a --- /dev/null +++ b/Installation-instructions.md @@ -0,0 +1,80 @@ +## 1) Setup the environment:: + +`$ ./configure (--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 (``) + +`` 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 ... + qp_module.py create -n [...] + qp_module.py download -n [...] +``` + + 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 +``` \ No newline at end of file diff --git a/Installation-instructions.rest b/Installation-instructions.rest deleted file mode 100644 index 855d2d6..0000000 --- a/Installation-instructions.rest +++ /dev/null @@ -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 -