| ... | ... | @@ -16,28 +16,151 @@ This page walks you through compiling a code from the JuKKR package at the examp | 
|  |  | 1. Execute the `install.py` script in the interactive mode that walks you through the installation | 
|  |  | ```bash | 
|  |  | $ ./install -i | 
|  |  | *********************************************************** | 
|  |  | Welcome to the Installation script of the Juelich KKR codes. | 
|  |  |  | 
|  |  | You can find useful additional information in our KKR wiki: https://kkr.iff.kfa-juelich.de/doku.php | 
|  |  | and in our code's documentation: https://kkr.iffgit.fz-juelich.de/jukkr/index.html | 
|  |  |  | 
|  |  | Currently this script only supports individual builds of one of these codes: | 
|  |  | * kkrhost | 
|  |  | * kkrimp | 
|  |  | * voronoi | 
|  |  | * pkkprime | 
|  |  | * rhoq | 
|  |  |  | 
|  |  | To build a different code please go to the source/code subdirectory and build the code as in a previous version (see wiki). | 
|  |  |  | 
|  |  | *********************************************************** | 
|  |  | ``` | 
|  |  | 2. follow the instructions and enter the code you want to compile | 
|  |  | ```bash | 
|  |  |  | 
|  |  | Please input the the codename of the code you want to compile (one of ['kkrhost', 'kkrimp', 'voronoi', 'pkkprime', 'rhoq']). | 
|  |  | voronoi | 
|  |  | ``` | 
|  |  | 3. add parallelization (Attention: the compiler needs to support this, i.e. to use MPI with the Intel compiler use `mpiifort` as the compiler) | 
|  |  | 3. specify the compiler name and add parallelization (Attention: the compiler needs to support this, i.e. to use MPI with the Intel compiler use `mpiifort` as the compiler) | 
|  |  | ```bash | 
|  |  |  | 
|  |  | Please input the compiler name (e.g. 'gfortran', 'ifort', 'mpiifort'). Empty input will try the system's default. | 
|  |  | ifort | 
|  |  | Please input the parallelization scheme ('serial', 'mpi', 'openmp', 'hybrid') | 
|  |  | serial | 
|  |  | ``` | 
|  |  | 4. activate debug flags or add additional settings if needed (no change for the standard build) | 
|  |  | ```bash | 
|  |  | Please input additional flags for cmake (empty input skips adding additional flags) | 
|  |  | Next flag? (empty line exists read-in) | 
|  |  |  | 
|  |  | Use debug flags for compilation? (leave empty for 'Release' build) | 
|  |  |  | 
|  |  | ``` | 
|  |  | 5. wait for the script to create a `build` directory and run `cmake` | 
|  |  | ```bash | 
|  |  | Summary of inputs: | 
|  |  | ---------- | 
|  |  | Compiler: ifort | 
|  |  | Parallelization scheme: serial | 
|  |  | Cmake flags: [] | 
|  |  |  | 
|  |  | Found old build directory. Moving this to build_2 | 
|  |  | check-dependencies... | 
|  |  | make availabale? | 
|  |  | OK | 
|  |  | cmake availabale? | 
|  |  | OK | 
|  |  |  | 
|  |  | Now run cmake command: 'cd build && FC=$(which ifort) cmake  -DENABLE_MPI=OFF  -DENABLE_OMP=OFF   -DCOMPILE_KKRHOST=OFF  -DCOMPILE_KKRIMP=OFF  -DCOMPILE_KKRSUSC=OFF  -DCOMPILE_PKKPRIME=OFF  -DCOMPILE_VORONOI=ON  -DCOMPILE_RHOQ=OFF ..' | 
|  |  |  | 
|  |  | *********************************************************** | 
|  |  | ... | 
|  |  | ``` | 
|  |  | In the output you can check if the chosen compiler should work: | 
|  |  | ```bash | 
|  |  | ... | 
|  |  | -- The Fortran compiler identification is Intel 19.0.0.20181018 | 
|  |  | -- Check for working Fortran compiler: /opt/intel/Compiler/19.0/1.144/rwthlnk/bin/intel64/ifort | 
|  |  | -- Check for working Fortran compiler: /opt/intel/Compiler/19.0/1.144/rwthlnk/bin/intel64/ifort  -- works | 
|  |  | ... | 
|  |  | ``` | 
|  |  | 6. go into the `build` folder and execute `make` | 
|  |  | ```bash | 
|  |  |  | 
|  |  | $ cd build | 
|  |  | $ make -j 8 | 
|  |  | Scanning dependencies of target voronoi.exe | 
|  |  | [  5%] Building Fortran object CMakeFiles/voronoi.exe.dir/source/common/mod_verify77.f90.o | 
|  |  | [  5%] Building Fortran object CMakeFiles/voronoi.exe.dir/source/common/DataTypes.f90.o | 
|  |  | ... | 
|  |  | [100%] Linking Fortran executable voronoi.exe | 
|  |  | [100%] Built target voronoi.exe | 
|  |  | ``` | 
|  |  |  | 
|  |  | ## Compiling without the python script using the `ccmake` tool | 
|  |  |  | 
|  |  | 1. Create `build` directory and enter it | 
|  |  | ```bash | 
|  |  | $ mkdir build | 
|  |  | $ cd build | 
|  |  | ``` | 
|  |  | 2. Run `ccmake` tool. | 
|  |  | ```bash | 
|  |  | $ FC=mpiifort ccmake .. | 
|  |  |  | 
|  |  | Page 0 of 1 | 
|  |  | EMPTY CACHE | 
|  |  |  | 
|  |  |  | 
|  |  |  | 
|  |  | EMPTY CACHE: | 
|  |  | Press [enter] to edit option Press [d] to delete an entry                                         CMake Version 3.10.1 | 
|  |  | Press [c] to configure | 
|  |  | Press [h] for help           Press [q] to quit without generating | 
|  |  | Press [t] to toggle advanced mode (Currently Off) | 
|  |  | ``` | 
|  |  | The Fortran compiler used in the build is specified with the `FC` environment variable (`mpiifort` in this example). The path `..` should be the path where the `CMakeLists.txt` file of the JuKKR code is located. | 
|  |  |  | 
|  |  | The ccmake tool guides you through the possible compile settings. Since we start here from scratch we first need to configure by pressing the `c` key. This is how the output should look like if everything is set up correctly: | 
|  |  | ```bash | 
|  |  | Intel compiler found | 
|  |  |  | 
|  |  | Release build | 
|  |  |  | 
|  |  | both MPI and OpenMP are disabled | 
|  |  | ``` | 
|  |  |  | 
|  |  | 3. Choose compile settings (e.g. KKRhost code with mpi parallelization on intel hardware wheer the xHost flags activate optimizations): | 
|  |  | ```bash | 
|  |  | CMAKE_BUILD_TYPE                * | 
|  |  | CMAKE_INSTALL_PREFIX            */usr/local | 
|  |  | COMPILE_KKRHOST                 *ON | 
|  |  | COMPILE_KKRIMP                  *OFF | 
|  |  | COMPILE_KKRSUSC                 *OFF | 
|  |  | COMPILE_PKKPRIME                *OFF | 
|  |  | COMPILE_RHOQ                    *OFF | 
|  |  | COMPILE_VORONOI                 *OFF | 
|  |  | ENABLE_DEBUG_SYMBOLS            *OFF | 
|  |  | ENABLE_MPI                      *ON | 
|  |  | ENABLE_OMP                      *OFF | 
|  |  | ENABLE_OMP_EVERYWHERE           *OFF | 
|  |  | ENABLE_OPTRPT                   *OFF | 
|  |  | ENABLE_PATCH_INTEL              *OFF | 
|  |  | ENABLE_RLLSLL_STANDALONE        *OFF | 
|  |  | OPTFLAGS_AMD                    *OFF | 
|  |  | OPTFLAGS_AVX512                 *OFF | 
|  |  | OPTFLAGS_xHOST                  *ON | 
|  |  | TIMING_DETAIL                   *OFF | 
|  |  | WRITE_KLOOP_STANDALONE_INPUT    *OFF | 
|  |  | WRITE_RLLSLL_STANDALONE_INPUT   *OFF | 
|  |  | ``` | 
|  |  | 4. Again configure (press `c`) and then generate (press `g`) which let's CMake produce the Makefile | 
|  |  | ```bash | 
|  |  | $ ls | 
|  |  | CMakeCache.txt  CMakeFiles  cmake_install.cmake  Makefile  modules  sprkkr_rmesh.dim | 
|  |  | ``` | 
|  |  | 5. Compile the code using `make` | 
|  |  | ```bash | 
|  |  | $ make -j8 | 
|  |  | ... | 
|  |  | Scanning dependencies of target kkr.x | 
|  |  | [100%] Building Fortran object CMakeFiles/kkr.x.dir/source/KKRhost/main_all.F90.o | 
|  |  | [100%] Linking Fortran executable kkr.x | 
|  |  | [100%] Built target kkr.x | 
|  |  | ``` | 
|  |  | \ No newline at end of file |