wiki:Documentation/UserGuide/CompileMethods

Version 2 (modified by jgipsl, 10 years ago) (diff)

--

Compile methods

It is possible to compile ORCHIDEE using standard makefiles created based on AA_make and AA_make.gdef. This is the standard methode until now. It is also possible to compile using the script makeorchidee_fcm based on the tool FCM.

How to compile using standard makefiles

The compile options are set in modipsl/util/AA_make.gdef for all predefined environements. Using the script modipsl/util/ins_make the main makefile is created in modipsl/modeles/ORCHIDEE/Makefile. To change a compile option, it is necessary to change in AA_make.gdef and relaunch ins_make. The target machine is determined automatically by ins_make if the machine is in a predefined list. It is also possible to specify the target using the optional argument -t. Create makefiles and compile as follow:

cd modipsl/util
./ins_make [-t target]
cd ../modeles/ORCHIDEE
gmake driver

How to compile ORCHIDEE using with FCM method

Main makefile in modipsl/config/ORCHIDEE_OL

A main makefile is found in modipsl/config/ORCHIDEE_OL directory. This makefile will first compile IOIPSL and then ORCHIDEE using the script makeorchidee_fcm.

The default set up compiles ORCHIDEE for MPI parallel run mode. The default options for compiling ORCHIDEE can be changed in AA_make in the following section(regenerate makefiles using the script ins_make in modipsl/util after modification) :

# driver : Only compiling ORCHIDEE (with fcm method)
driver :
        (cd ../../modeles/ORCHIDEE ; ./makeorchidee_fcm        -j 8 -parallel mpi -prod -arch ${FCM_ARCH} -driver ; )

Example 1 : compile the ORCHIDEE offline model :

cd modipsl/config/ORCHIDEE_OL
gmake

Example 2 : Clean temporary files created during compilation of IOIPSL and ORCHIDEE (the executable is not deleted) :

cd modipsl/config/ORCHIDEE_OL
gmake clean

Example 3 : Compile using debug compile options

cd modipsl/config/ORCHIDEE_OL
vi AA_make                       => add -debug(or -dev):  ./makeorchidee_fcm -debug -j 8 -parallel mpi -prod -arch ${FCM_ARCH} -driver 
../../util/ins_make
gmake

makeorchidee_fcm

The script makeorchidee_fcm compiles ORCHIDEE using the FCM, a software developed by the Hadley Centre. While using this script the dependencies between fortran modules do not need to be set in advance. Fcm determines the dependencies.

Compile options for different target machines or compilers are defined in the directory arch/. For each target machine two files must exist : archname.fcm and archname.path. Use ./makeorchidee_fcm -h to get information about available arguments. See here the main arguments are

./makeorchidee_fcm -h

########################################################################
# Manuel en ligne
########################################################################
more <<eod


makeorchidee_fcm [Options] 

[ -parallel|-p PARALLEL_TYPE ] : activate parallelization with 3 options : 
    PARALLEL_TYPE =
    ( mpi | MPI )  : use Message Passing Interface standard
    ( omp | OMP )  : use OpenMP standard
    ( mpi_omp | MPI_OMP ) : use both MPI and OpenMP
    ( none | NONE | seq ) : sequential mode (default)
[ -driver ] : compilation of ORCHIDEE driver if equal TRUE
[ -arch ARCHitecture ] : if TRUE, change architecture for ARCHitecture
[ -xios ] : compilation with XIOS
[ -noxios ] : compilation without XIOS
[ -prod ] : compilation for production (all optimization)
[ -dev ] : compilation for development (low optimization and -g)
[ -d|-debug ] : compilation for debugging (no optmization and all debug options)
| -full ] : activate full recompiling 
| -clean ] : delete all files produceed during previous compilation
[ -j x ] : activate parallel compiling on x task, default 1 task
[ -ext_src path] : path to an additional set of routines to compile with the model

Using fcm, the dependencies between the modules are not predefined. fcm will determine the correct order to compile. makeorchidee_fcm do not compile IOIPSL. This must be done in advance.

Example 1 : compile at curie for MPI parallel run mode

./makeorchidee_fcm -parallel mpi -arch X64_CURIE -driver

Example 2 : compile at ada for MPI-OpenMP parallel run mode

./makeorchidee_fcm -parallel mpi_omp -arch X64_CURIE -driver

Example 3 : compile using gfortran compiler for sequential run mode (make sure that the files arch/gfortran.fcm and arch/gfortran.path are suitable for your environement especially the path to netcdf library)

./makeorchidee_fcm -parallel seq -arch gfortran -driver

Example 4 : clean files created during previous compilation

./makeorchidee_fcm -clean