Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

Sommaire

1) Create directory

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

 ~/gem/${GEM_version}/Abs/...

For GEM4:
        GEM_version=v_4.8.12.u
For GEM5:
        GEM_version=v_5.0.0

2) Populate directory

Go into the executable directory you created above.

a) Set the model environment

Whenever you want to create/modify an executable you need to set the model environment first:

...

Volet
For

...

GEM4

...

with:

...


             .

...

s.ssmuse.dot

...

GEM/x/4.8.lts12

...


      or

...

the

...

alias

...


             4812

...


For

...

GEM5

...

with:

...


             .

...

r.load.dot

...

GEM/x/5.0

...


      or the alias
             500


b

...

) Open experiment

First you have to "open the experiment" to do the initial setup, create files to find original source code, create links to the building directory and Makefiles etc. with:

Volet

...

ouv_exp_gem
rdemklink -v

You have to do this only once!

...


c) Duplicating another executable directory (optional!)

If you want to duplicate another executable directory (from yourself or someone else) you must copy ONLY the source code, nothing else!
To copy all relevant files copy all files matching:

 *.[Ffchi]*

...


d) Create dependency

Then you need to create the dependencies (which routines include which include files and, vice versa, which include files are included in which routines). You need to redo this whenever you include another include file or add a routine!!!:

...

Volet
make

...

dep

...

It never hurts to redo this. It just takes time.

...


e) Compile

Whenever you modified or added one or more source code files you need to compile them to create the object file(s). To compile all routines that need compiling or to compile a modified module or include file execute:

...

Volet

     make

...

obj

...


To

...

speed

...

up

...

this

...

compilation

...

on

...

Beluga

...

you

...

can

...

also

...

use

...

3

...

cpus

...

with :

...


     make

...

-j3

...

obj

...

make obj will (re)compile all routines that need compiling. It never hurts to use make obj, it just takes time.
If you modified only one subroutine all you need to do is recompile it with

...

Volet
make

...

subroutine.o

...


You can also compile several routines in the same "make" command: make subroutine1.o subroutine2.o

Afterwards you can find all the compiled object files as well as all the routines that were checked out and links to your modified routines under:

    ${GEM_ovbin}/build-linux26-x86-64/intel1600

(You can find 'GEM_ovbin' in your file configexp.cfg.)

fe) Create the executable

To (re)create the executable you need to load and link it with:

...

Volet
make

...

gemdm

To verify if the executable got created check its date and size with:

    ls -l ${GEM_ovbin}/build-linux26-x86-64/bin/intel1600/maingemdm_Linux_x86-64.Abs

...

The executable should be at least a few tens of MB large. (You can find 'GEM_ovbin' in your file configexp.cfg.)



3) Modify the source code

Once you set the environment the variables $gemdyn and $rpnphy will get set, pointing to the source code in the environment:

...

You can check there which routines you want to modify. Once you know which routine(s) you want to modify go back into your "executable directory". Then "check out" all the routines you want to modify with:

...

Volet
     rde co

...

subroutine.F90

...


or
     rde co
comdeck.cdk

...

You can also check out several routines at the same time.
Once you modified or copied the routines you want you need to compile them and then recreate the executable, following points b) 2) to 4) above.

...