Vous regardez une version antérieure (v. /display/EDDSDLTEL/GEM+5.1.1) de cette page.

afficher les différences afficher l'historique de la page

« Afficher la version précédente Vous regardez la version actuelle de cette page. (v. 8) afficher la version suivante »

1) Create directory

First create yourself a directory under your home(!) (so it gets backup up) in which you want to create the executable.
I usually call mine:

     ~/gem/v_5.1.1/Abs/...

Set a variable that we will use later and create the directory:

            abs_dir=~/gem/v_5.1.1/Abs/My_Abs      # Set 'My_Abs' to whatever you like
           mkdir -p ${abs_dir}

2) Populate directory

Go into the executable directory you created above.

           cd ${abs_dir}

a) Clone the Git repository you want

For example:

             git clone ~winger/gem/v_5.1.1/Abs/UQAM_development_FLake_CLASS/gem

then change into 'gem' directory that came with the clone:

             cd gem

b) Create working directories

So the object files, libraries and executables will not be under your home, create links for the directories 'build' and 'work'. Pick a place under which you want to keep the object files, libraries and executables, for example:

            work_space=~/projects/def-professor/${USER}/GEM_WORK_DIR     # Set 'professor' to the CC name of your professor. You can find all of them under ~/projects.

Create the directories and the links:

            mkdir -p ${work_space}/${abs_dir##*/}/build
            mkdir -p ${work_space}/${abs_dir##*/}/work
            ln -s ${work_space}/${abs_dir##*/}/build
            ln -s ${work_space}/${abs_dir##*/}/work

3) Create the executables

a) Acquire compiler:

            module add intel/2021.2.0 fftw-intel-2021

b) Set the variable 'abs_dir' to the name of your executable directory, including the 'gem' directory (needed under d))

            abs_dir=$(pwd)

c) Change into 'build' directory:

            cd build

d) Create make files and dependencies

            cmake   -DCOMPILER=intel   -DCMAKE_VERBOSE_MAKEFILE=ON    -DWORK_PREFIX=${abs_dir}/work    ${abs_dir}/project

e) Compile and create executable

            make -j4 work

The key '-j4' makes the command use 4 cores in parallel. But you can also run it on one core only with:

            make work

4) Modify source code

a) You can find the GEM routines under .../gem/src/*/*, for example :

Most dynamic routines are under:

            .../gem/src/gemdyn/base

Most physics routines are under:

            .../gem/src/rpnphy/base

Most surface routines are under:

            .../gem/src/rpnphy/surface

b) Recreate the executable

Make sure you are in the 'build' directory!

Only if you add any new routines or add include files or module "use" lines to an existing routine you first need to recreate the dependencies and make files by re-executing the full cmake command under point 4d) again.

Otherwise it is enough to just re-execute:

            make -j4 work

5) Use your executable

To use your own executable set 'GEM_ovbin' in your 'configexp.cfg' to the path of your executable directory, up until but excluding the 'gem' directory. For example:

            GEM_ovbin=~/gem/v_5.1.1/Abs/my_abs


  • Aucune étiquette