ORcompDCAO DCAO
(Creación página de compilación en sala compus DCAO) |
(→Installation steps using modipsl) |
||
(No se muestran 23 ediciones intermedias realizadas por un usuario) | |||
Línea 2: | Línea 2: | ||
= Installation steps using modipsl = |
= Installation steps using modipsl = |
||
− | * Go to the installation directory <code>[INSTALLDIR]</code> (for hydra <code>[INSTALLDIR]=/share</code>) |
+ | * Required packages: |
+ | <pre># apt-get install subversion git libnetcdf-dev libnetcdff-dev netcdf-bin make |
||
+ | ncview ksh csh mpi mpich vim |
||
+ | </pre> |
||
+ | * Additional for python and netcdf (not required by ORCHIDEE) |
||
+ | <pre># apt-get install python-matplotlib python-matplotlib-data python-matplotlib-doc |
||
+ | python-mpltoolkits.basemap python-mpltoolkits.basemap-data dvipng python-netcdf4 |
||
+ | </pre> |
||
+ | * And fake gmake (Ubunutu) |
||
+ | <pre>ln -s /usr/bin/make /usr/bin/gmake</pre> |
||
+ | * Go to the installation directory <code>[INSTALLDIR]</code> (for hydra <code>[INSTALLDIR]=/home/administrador/installOR</code>) |
||
<pre>$ cd [INSTALLDIR]</pre> |
<pre>$ cd [INSTALLDIR]</pre> |
||
* Getting the IPSL-models suite |
* Getting the IPSL-models suite |
||
Línea 9: | Línea 9: | ||
<pre>$ cd modipsl/util</pre> |
<pre>$ cd modipsl/util</pre> |
||
* Getting the off-line version of ORCHIDEE |
* Getting the off-line version of ORCHIDEE |
||
− | <pre>$ ./model ORCHIDEE_trunk >& run_get_model.log</pre> |
+ | <!--pre>$ ./model ORCHIDEE_trunk >& run_get_model.log</pre--> |
+ | <pre>$ ./model ORCHIDEE_trunk</pre> |
||
* We got some issues with the ports, thus, it needs to be manually done: |
* We got some issues with the ports, thus, it needs to be manually done: |
||
<pre>$ cd ../modeles</pre> |
<pre>$ cd ../modeles</pre> |
||
* Getting IOIPSL: |
* Getting IOIPSL: |
||
<pre>$ mkdir -p IOIPSL/src |
<pre>$ mkdir -p IOIPSL/src |
||
− | $ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/tags/v2_2_2/src IOIPSL/src</pre> |
+ | $ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/tags/v2_2_4/src IOIPSL/src</pre> |
* Getting XIOS library |
* Getting XIOS library |
||
<pre>$ svn co -r 1043 https://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS</pre> |
<pre>$ svn co -r 1043 https://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS</pre> |
||
Línea 25: | Línea 25: | ||
passw: ipsl2000 --> |
passw: ipsl2000 --> |
||
* These are the final versions of the codes |
* These are the final versions of the codes |
||
− | ** ORCHIDEE: 4622 |
+ | ** ORCHIDEE: 6094 |
** ORCHIDEE_OL: 4622 |
** ORCHIDEE_OL: 4622 |
||
** IOIPSL: 3379 |
** IOIPSL: 3379 |
||
** XIOS: 1043 |
** XIOS: 1043 |
||
− | * Preparing compilation environment for <code>hydra</code>. One need to add into <code>AA_make.gdef</code> specifications for <code>hydra</code> (at the end of file): |
+ | * Preparing compilation environment for <code>hydra</code>. One need to add into <code>AA_make.gdef</code> specifications for <code>DCAO_gfortran</code> (at the end of file): |
<pre> |
<pre> |
||
− | #-Q- ifort_hydra #- Global definitions for hydra, ifort |
+ | #-Q- DCAO_gfortran #- Global definitions for DCAO, mpi gfortran |
− | #-Q- ifort_hydra LIB_MPI = MPI1 |
+ | #-Q- DCAO_gfortran LIB_MPI = MPI1 |
− | #-Q- ifort_hydra LIB_MPI_BIS = MPI1 |
+ | #-Q- DCAO_gfortran LIB_MPI_BIS = MPI1 |
− | #-Q- ifort_hydra FCM_ARCH = ifort_hydra |
+ | #-Q- DCAO_gfortran FCM_ARCH = DCAO_gfortran |
− | #-Q- ifort_hydra M_K = make |
+ | #-Q- DCAO_gfortran M_K = make |
− | #-Q- ifort_hydra P_C = cpp |
+ | #-Q- DCAO_gfortran P_C = cpp |
− | #-Q- ifort_hydra P_O = -P -C -traditional $(P_P) |
+ | #-Q- DCAO_gfortran P_O = -fpreprocessed -P -C -traditional $(P_P) |
− | #-Q- ifort_hydra F_C = /usr/local/bin/mpif90 -c -cpp |
+ | #-Q- DCAO_gfortran F_C = gfortran -c -cpp |
− | #-Q- ifort_hydra #-D- MD F_D = -g |
+ | #-Q- DCAO_gfortran #-D- MD F_D = -g -Wall -fbounds-check -pedantic -finit-real=nan |
− | #-Q- ifort_hydra #-D- MN F_D = |
+ | #-Q- DCAO_gfortran #-D- MN F_D = |
− | #-Q- ifort_hydra #-P- I4R4 F_P = -i4 |
+ | #-Q- DCAO_gfortran #-P- I4R4 F_P = |
− | #-Q- ifort_hydra #-P- I4R8 F_P = -i4 -r8 |
+ | #-Q- DCAO_gfortran #-P- I4R8 F_P = -fdefault-real-8 |
− | #-Q- ifort_hydra #-P- I8R8 F_P = -i8 -r8 |
+ | #-Q- DCAO_gfortran #-P- I8R8 F_P = -fdefault-integer-8 -fdefault-real-8 |
− | #-Q- ifort_hydra F_O = -DCPP_PARA -O3 $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) -fp-model precise |
+ | #-Q- DCAO_gfortran w_w = -O3 -funroll-all-loops $(F_D) $(F_P) -I$(MODDIR) |
− | #-Q- ifort_hydra F_L = /usr/local/bin/mpif90 |
+ | #-Q- DCAO_gfortran F_O = $(w_w) -J$(MODDIR) |
− | #-Q- ifort_hydra M_M = 0 |
+ | #-Q- DCAO_gfortran F_L = gfortran |
− | #-Q- ifort_hydra L_X = 0 |
+ | #-Q- DCAO_gfortran M_M = 0 |
− | #-Q- ifort_hydra L_O = |
+ | #-Q- DCAO_gfortran L_X = 0 |
− | #-Q- ifort_hydra A_C = ar -rs |
+ | #-Q- DCAO_gfortran L_O = |
− | #-Q- ifort_hydra A_G = ar -x |
+ | #-Q- DCAO_gfortran A_C = ar -rs |
− | #-Q- ifort_hydra C_C = cc -c |
+ | #-Q- DCAO_gfortran A_G = ar -x |
− | #-Q- ifort_hydra C_O = |
+ | #-Q- DCAO_gfortran C_C = cc -c |
− | #-Q- ifort_hydra C_L = cc |
+ | #-Q- DCAO_gfortran C_O = |
− | #-Q- ifort_hydra #- |
+ | #-Q- DCAO_gfortran C_L = cc |
− | #-Q- ifort_hydra NCDF_INC = /usr/local/include |
+ | #-Q- DCAO_gfortran #- |
− | #-Q- ifort_hydra NCDF_LIB = -L/usr/local/lib -lnetcdf -lnetcdff |
+ | #-Q- DCAO_gfortran NCDF_INC = /usr/include |
− | #-Q- ifort_hydra #- |
+ | #-Q- DCAO_gfortran NCDF_LIB = -L/usr/lib/x86_64-linux-gnu -lnetcdf |
+ | #-Q- DCAO_gfortran #- |
||
</pre> |
</pre> |
||
− | * Creation of the configuration \verb+arch+ files for the compilation of each component |
+ | * Creation of the configuration <code>arch</code> files for the compilation of each component |
− | * XIOS |
||
− | ** going there: |
||
− | <pre>$ cd ../modeles/XIOS/arch</pre> |
||
− | ** Using CICLAD's ifort compilation as reference |
||
− | <pre>$ cp arch-ifort_CICLAD.fcm arch-ifort_hydra.fcm</pre> |
||
− | ** Adapting values (following ifort bug issue for version 12.0.3, [https://software.intel.com/en-us/forums/intel-c-compiler/topic/289446 ifort bug]): |
||
− | <pre>%CCOMPILER /usr/local/bin/mpicc |
||
− | %FCOMPILER /usr/local/bin/mpif90 |
||
− | %LINKER /usr/local/bin/mpif90 -nofor-main |
||
− | %BASE_CFLAGS -std=c++0x |
+ | == XIOS == |
− | %PROD_CFLAGS -O3 -D BOOST_DISABLE_ASSERTS |
+ | ** Creation of 'fcm' compilation environtment file for <code>DCAO_gfortran</code> |
− | %DEV_CFLAGS -g -traceback |
+ | <pre>$ vim ../modeles/XIOS/arch/arch-DCAO_gfortran.fcm</pre> |
− | %DEBUG_CFLAGS -DBZ_DEBUG -g -traceback -fno-inline |
+ | ** values: |
+ | <pre>################################################################################ |
||
+ | ################### Projet XIOS ################### |
||
+ | ################################################################################ |
||
− | %BASE_FFLAGS -D__NONE__ |
+ | %CCOMPILER /usr/bin/mpicc |
− | %PROD_FFLAGS -O3 |
+ | %FCOMPILER /usr/bin/mpif90 |
− | %DEV_FFLAGS -g -O2 -traceback |
+ | %LINKER /usr/bin/mpif90 -nofor-main |
− | %DEBUG_FFLAGS -g -traceback |
+ | |
+ | %BASE_CFLAGS -ansi -w -D_GLIBCXX_USE_CXX11_ABI=0 |
||
+ | %PROD_CFLAGS -O3 -DBOOST_DISABLE_ASSERTS |
||
+ | %DEV_CFLAGS -g -O2 |
||
+ | %DEBUG_CFLAGS -g |
||
+ | |||
+ | %BASE_FFLAGS -D__NONE__ -ffree-line-length-none |
||
+ | %PROD_FFLAGS -O3 |
||
+ | %DEV_FFLAGS -g -O2 |
||
+ | %DEBUG_FFLAGS -g |
||
%BASE_INC -D__NONE__ |
%BASE_INC -D__NONE__ |
||
− | %BASE_LD -lstdc++ |
+ | %BASE_LD -lstdc++ |
− | %CPP /usr/local/bin/mpicc -EP |
+ | %CPP cpp |
− | %FPP cpp -P |
+ | %FPP cpp -P |
%MAKE gmake</pre> |
%MAKE gmake</pre> |
||
− | ** Getting paths: |
+ | ** Creation of 'path' compilation environtment file for <code>DCAO_gfortran</code> |
− | <pre>$ cp arch-ifort_CICLAD.path arch-ifort_hydra.path</pre> |
+ | <pre>$ vim ../modeles/XIOS/arch/arch-DCAO_gfortran.path</pre> |
− | ** Adapting values: |
+ | ** values: |
− | <pre>NETCDF_INCDIR="-I/usr/local/include" |
+ | <pre>NETCDF_INCDIR="-I $NETCDF_INC_DIR" |
− | NETCDF_LIBDIR="-L/usr/local/lib" |
+ | NETCDF_LIBDIR="-L $NETCDF_LIB_DIR" |
− | NETCDF_LIB="-lnetcdf -lnetcdff" |
+ | NETCDF_LIB="-lnetcdff -lnetcdf" |
− | MPI_INCDIR="" |
+ | |
− | MPI_LIBDIR="" |
+ | MPI_INCDIR="" |
− | MPI_LIB="" |
+ | MPI_LIBDIR="" |
− | HDF5_INCDIR="" |
+ | MPI_LIB="-lcurl" |
− | HDF5_LIBDIR="" |
+ | |
− | HDF5_LIB=""</pre> |
+ | HDF5_INCDIR="-I $HDF5_INC_DIR" |
− | * ORCHIDEE |
+ | HDF5_LIBDIR="-L $HDF5_LIB_DIR" |
− | ** Going there |
+ | HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz" |
− | <pre>$ cd ../../ORCHIDEE/arch</pre> |
+ | |
− | ** Using CICLAD's ifort compilation as reference |
+ | #OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1" |
− | <pre>$ cp arch-ifort_CICLAD.fcm arch-ifort_hydra.fcm</pre> |
+ | #OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib" |
− | ** Adapting values: |
+ | #OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"</pre> |
− | <pre>%COMPILER /usr/local/bin/mpif90 |
+ | |
− | %LINK /usr/local/bin/mpif90 |
+ | ** Creation of 'env' compilation environtment file for <code>DCAO_gfortran</code> |
− | %AR ar |
+ | <pre>$ vim ../modeles/XIOS/arch/arch-DCAO_gfortran.env</pre> |
− | %MAKE gmake |
+ | |
− | %FPP_FLAGS -P -traditional |
+ | ** values: |
+ | <pre>export HDF5_INC_DIR=/usr/include |
||
+ | export HDF5_LIB_DIR=/usr/lib/x86_64-linux-gnu |
||
+ | |||
+ | export NETCDF_INC_DIR=/usr/include |
||
+ | export NETCDF_LIB_DIR=/usr/lib/x86_64-linux-gnu</pre> |
||
+ | |||
+ | == ORCHIDEE == |
||
+ | ** Creation of 'fcm' compilation environtment file for <code>DCAO_gfortran</code> |
||
+ | <pre>$ vim ../modeles/ORCHIDEE/arch/arch-DCAO_gfortran.fcm</pre> |
||
+ | ** values: |
||
+ | <pre>%COMPILER /usr/bin/mpicc |
||
+ | %LINK /usr/bin/mpif90 |
||
+ | %AR ar |
||
+ | %MAKE make |
||
+ | %FPP_FLAGS -P -C -traditional -nostdinc |
||
%FPP_DEF |
%FPP_DEF |
||
− | %BASE_FFLAGS -i4 -r8 -fp-model precise |
+ | %BASE_FFLAGS -fdefault-real-8 |
− | %PROD_FFLAGS -O3 |
+ | %PROD_FFLAGS -O3 -funroll-all-loops |
− | %DEV_FFLAGS -g -O2 -traceback -fp-stack-check -ftrapuv -check bounds |
+ | %DEV_FFLAGS -O |
− | %DEBUG_FFLAGS -fpe0 -O0 -g -traceback -fp-stack-check -ftrapuv -check bounds -check all |
+ | %DEBUG_FFLAGS -ffpe-trap=invalid,zero,overflow -Wall -fbounds-check -g3 -O0 -fstack-protector-all |
− | %MPI_FFLAGS |
+ | %MPI_FFLAGS |
%OMP_FFLAGS -openmp -openmp-threadprivate compat |
%OMP_FFLAGS -openmp -openmp-threadprivate compat |
||
− | %BASE_LD -i4 -r8 |
+ | %BASE_LD |
− | %MPI_LD |
+ | %MPI_LD |
%OMP_LD -openmp</pre> |
%OMP_LD -openmp</pre> |
||
− | ** getting paths |
+ | ** Creation of 'path' compilation environtment file for <code>DCAO_gfortran</code> |
− | <pre>$ cp arch-ifort_CICLAD.path arch-ifort_hydra.path</pre> |
+ | <pre>$ vim ../modeles/ORCHIDEE/arch/arch-DCAO_gfortran.path</pre> |
− | ** Adapting values: |
+ | ** values: |
− | <pre>NETCDF_LIBDIR="/usr/local/lib -lnetcdf -lnetcdff -lstdc++" |
+ | <pre>NETCDF_INCDIR="-I/usr/include" |
− | NETCDF_INCDIR=/usr/local/include |
+ | NETCDF_LIBDIR="-L/usr/lib/x86_64-linux-gnu" |
− | IOIPSL_INCDIR=../../../lib |
+ | NETCDF_LIB="-lnetcdf -lnetcdff" |
− | IOIPSL_LIBDIR=../../../lib |
+ | |
− | XIOS_INCDIR=${ORCHDIR}/../XIOS/inc |
+ | IOIPSL_INCDIR="-I${ORCHDIR}/../../lib -I${ORCHDIR}/../IOIPSL/inc" |
− | XIOS_LIBDIR="${ORCHDIR}/../XIOS/lib -lxios"</pre> |
+ | IOIPSL_LIBDIR="-L${ORCHDIR}/../../lib -L${ORCHDIR}/../IOIPSL/lib" |
− | ** Going back to <code>util</code> to proceed |
+ | IOIPSL_LIB="-lioipsl" |
− | <pre>$ cd ../../../util</pre> |
+ | |
+ | XIOS_INCDIR="-I${ORCHDIR}/../XIOS/inc" |
||
+ | XIOS_LIBDIR="-L${ORCHDIR}/../XIOS/lib" |
||
+ | XIOS_LIB="-lxios"</pre> |
||
+ | |||
+ | == Building & compiling == |
||
** Installing the code: |
** Installing the code: |
||
− | <pre>$ ./ins_make -t ifort_hydra >& run_ins_make.log</pre> |
+ | <pre>$ ./ins_make -t DCAO_gfortran >& run_ins_make.log</pre> |
** Going there: |
** Going there: |
||
<pre>$ cd ../config/ORCHIDEE_OL</pre> |
<pre>$ cd ../config/ORCHIDEE_OL</pre> |
||
Línea 128: | Línea 128: | ||
** Compiling XIOS in sequential (in <code>Makefile</Code>, adding no-parallel compilation): |
** Compiling XIOS in sequential (in <code>Makefile</Code>, adding no-parallel compilation): |
||
<pre>./make_xios --netcdf_lib netcdf4_seq (...)</pre> |
<pre>./make_xios --netcdf_lib netcdf4_seq (...)</pre> |
||
− | ** Compiling: |
+ | ** Compiling (we must compile without XIOS, otherwise it is not working): |
− | <pre>$ gmake >& run_gmake.log</pre> |
+ | <pre>$ gmake without_xios >& run_gmake.log</pre> |
** Checking if everything went fine: |
** Checking if everything went fine: |
||
<pre>$ cat -n run_gmake.log | grep Error |
<pre>$ cat -n run_gmake.log | grep Error |
||
+ | $ cat -n run_gmake.log | grep undefined |
||
+ | $ ls ../../bin/ |
||
+ | orchideedriver orchidee_ol </pre> |
||
+ | |||
+ | = Compiling rebuild = |
||
+ | |||
+ | Due to the fact that <code>hydra</code> does not have the netcdf libraries compiled in parallel, ORCHDEE output is written with multiple files being a file for each process. In order to overcome this output. IPSL does prepare a tool to join the files and provide the expected output. This tool is called <code>rebuild</code> (a Kornshell script which encapsulates de exacutable <code>flio_rbld</code>) and it comes with the <code>IOIPSL</code> libraries. The IOIPSL libraries, are a set of old libraries developed by the IPSL (M. A. Foujuls, J. Polcher among others) to deal with the netCDF data access for all the models developed at the IOIPSL. Compiling IOIPSL (following [http://lmdz.lmd.jussieu.fr/utilisateurs/faq-en/installation/comment-installer-ioipsl-et-loutil-rebuild install rebuild]. It has to be compiled independently. Here it is explained how it has to be done. |
||
+ | |||
+ | * Go to the instalation directory <code>[INSTALLDIR]</code> |
||
+ | <pre>$ cd [INSTALLDIR]</pre> |
||
+ | * getting the last version of the code |
||
+ | <pre>$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl_IOIPSLtools</pre> |
||
+ | * going to prepare compilation/installation |
||
+ | <pre>$ cd modipsl_IOIPSLtools/util</pre> |
||
+ | * preparing environment |
||
+ | <pre>./model IOIPSL_PLUS</pre> |
||
+ | * We got some issues with the ports, thus, it needs to be manually done: |
||
+ | <pre>$ cd ../modeles</pre> |
||
+ | * Getting IOIPSL ('''NOTE:''' notice the difference in library's version from the previous one): |
||
+ | <pre>$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/tags/v2_2_3 IOIPSL</pre> |
||
+ | * Comming back to the <code>util</code> folder |
||
+ | <pre>$ cd ../util</pre> |
||
+ | * Creation of the compilation environment for <code>`DCAO'</code> using <code>'gfortran'</code> inside <code>AA_make.gdef</code> as in the full compilation |
||
+ | <pre>$ cp ../../modipsl/util/AA_make.gdef ./</pre> |
||
+ | * Preparing makefiles |
||
+ | <pre>$ ./ins_make -t "DCAO_gfortran" -p I4R8</pre> |
||
+ | * going to src folder to compile |
||
+ | <pre>$ cd ../modeles/IOIPSL/src</pre> |
||
+ | * cleaning (you never know...) |
||
+ | <pre>$ make clean</pre> |
||
+ | * compiling |
||
+ | <pre>$ make >& run_make.log</pre> |
||
+ | * Checking no errors: |
||
+ | <pre>$ cat -n run_make.log | grep Error</pre> |
||
+ | * compilation of tools (file concatenation) |
||
+ | <pre>$ cd ../tools </pre> |
||
+ | * cleaning (you never know...) |
||
+ | <pre>$ make clean</pre> |
||
+ | * compiling |
||
+ | <pre>$ make >& run_make.log</pre> |
||
+ | * Checking no errors: |
||
+ | <pre>$ cat -n run_make.log | grep Error</pre> |
||
+ | * One should have: |
||
+ | <pre>$ ls ../../../bin/ |
||
+ | flio_rbld rebuild</pre> |
||
+ | |||
+ | = debug Instalation = |
||
+ | Getting a debugging copy for test purposes |
||
+ | |||
+ | == Instalation steps using modipsl == |
||
+ | * Go to the instalation directory <code>[INSTALLDIR]</code> |
||
+ | <pre>$ cd [INSTALLDIR]</pre> |
||
+ | * Getting the IPSL-models suite (r 3379) |
||
+ | <pre>$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl_dbg</pre> |
||
+ | * Once we got the codes, we need to copy the specificities of the installation for <code>hydra</code> |
||
+ | <pre>$ cp ../../modipsl/util/AA_make.gdef ./ |
||
+ | $ cp ../../modipsl/modeles/XIOS/arch/*hydra* ../modeles/XIOS/arch/ |
||
+ | $ cp ../../modipsl/modeles/ORCHIDEE/arch/*hydra* ../modeles/ORCHIDEE/arch/</pre> |
||
+ | * Everything is the same as for the installation, except that we need to indicate debugging compilation: |
||
+ | <pre>./ins_make -t DCAO_gfortran -d >& run_ins_make.log</pre> |
||
+ | * And on <code>Makefile</code> from <code>config/ORCHIDEE_OL</code>, change all the <code>-prod</code> by <code>-debug</code> |
||
+ | <pre>(...) |
||
+ | xios : |
||
+ | (cd ../../modeles/XIOS ; ./make_xios --netcdf_lib netcdf4_seq \ |
||
+ | --debug --arch ${FCM_ARCH} --job 8 ; cp bin/xios_server.exe ../../bin/. ; ) |
||
+ | (...) |
||
+ | driver : |
||
+ | (cd ../../modeles/ORCHIDEE ; ./makeorchidee_fcm -j 8 -parallel mpi -debug -arch ${FCM_ARCH} -driver ; ) |
||
+ | (...) |
||
+ | driver_xios : |
||
+ | (cd ../../modeles/ORCHIDEE ; ./makeorchidee_fcm -xios2 -j 8 -parallel mpi -debug -arch ${FCM_ARCH} -driver ; ) |
||
+ | (...)</pre> |
||
+ | * Compiling: |
||
+ | <pre>$ gmake >& run_gmake.log</pre> |
||
+ | * Checking if everything went fine: |
||
+ | <pre>$ cat -n run_gmake.log | grep Error |
||
$ cat -n run_gmake.log | grep undefined |
$ cat -n run_gmake.log | grep undefined |
||
$ ls ../../bin/ |
$ ls ../../bin/ |
Última revisión de 09:21 2 oct 2019
Compilation at DCAO's computational classroom
Contenido |
[editar] Installation steps using modipsl
- Required packages:
# apt-get install subversion git libnetcdf-dev libnetcdff-dev netcdf-bin make ncview ksh csh mpi mpich vim
- Additional for python and netcdf (not required by ORCHIDEE)
# apt-get install python-matplotlib python-matplotlib-data python-matplotlib-doc python-mpltoolkits.basemap python-mpltoolkits.basemap-data dvipng python-netcdf4
- And fake gmake (Ubunutu)
ln -s /usr/bin/make /usr/bin/gmake
- Go to the installation directory
[INSTALLDIR]
(for hydra[INSTALLDIR]=/home/administrador/installOR
)
$ cd [INSTALLDIR]
- Getting the IPSL-models suite
$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl
- Going to the
util
folder:
$ cd modipsl/util
- Getting the off-line version of ORCHIDEE
$ ./model ORCHIDEE_trunk
- We got some issues with the ports, thus, it needs to be manually done:
$ cd ../modeles
- Getting IOIPSL:
$ mkdir -p IOIPSL/src $ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/tags/v2_2_4/src IOIPSL/src
- Getting XIOS library
$ svn co -r 1043 https://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS
- By the end one should have:
$ ls IOIPSL ORCHIDEE XIOS
- Going back to
util
to proceed
$ cd ../util
- These are the final versions of the codes
- ORCHIDEE: 6094
- ORCHIDEE_OL: 4622
- IOIPSL: 3379
- XIOS: 1043
- Preparing compilation environment for
hydra
. One need to add intoAA_make.gdef
specifications forDCAO_gfortran
(at the end of file):
#-Q- DCAO_gfortran #- Global definitions for DCAO, mpi gfortran #-Q- DCAO_gfortran LIB_MPI = MPI1 #-Q- DCAO_gfortran LIB_MPI_BIS = MPI1 #-Q- DCAO_gfortran FCM_ARCH = DCAO_gfortran #-Q- DCAO_gfortran M_K = make #-Q- DCAO_gfortran P_C = cpp #-Q- DCAO_gfortran P_O = -fpreprocessed -P -C -traditional $(P_P) #-Q- DCAO_gfortran F_C = gfortran -c -cpp #-Q- DCAO_gfortran #-D- MD F_D = -g -Wall -fbounds-check -pedantic -finit-real=nan #-Q- DCAO_gfortran #-D- MN F_D = #-Q- DCAO_gfortran #-P- I4R4 F_P = #-Q- DCAO_gfortran #-P- I4R8 F_P = -fdefault-real-8 #-Q- DCAO_gfortran #-P- I8R8 F_P = -fdefault-integer-8 -fdefault-real-8 #-Q- DCAO_gfortran w_w = -O3 -funroll-all-loops $(F_D) $(F_P) -I$(MODDIR) #-Q- DCAO_gfortran F_O = $(w_w) -J$(MODDIR) #-Q- DCAO_gfortran F_L = gfortran #-Q- DCAO_gfortran M_M = 0 #-Q- DCAO_gfortran L_X = 0 #-Q- DCAO_gfortran L_O = #-Q- DCAO_gfortran A_C = ar -rs #-Q- DCAO_gfortran A_G = ar -x #-Q- DCAO_gfortran C_C = cc -c #-Q- DCAO_gfortran C_O = #-Q- DCAO_gfortran C_L = cc #-Q- DCAO_gfortran #- #-Q- DCAO_gfortran NCDF_INC = /usr/include #-Q- DCAO_gfortran NCDF_LIB = -L/usr/lib/x86_64-linux-gnu -lnetcdf #-Q- DCAO_gfortran #-
- Creation of the configuration
arch
files for the compilation of each component
[editar] XIOS
- Creation of 'fcm' compilation environtment file for
DCAO_gfortran
- Creation of 'fcm' compilation environtment file for
$ vim ../modeles/XIOS/arch/arch-DCAO_gfortran.fcm
- values:
################################################################################ ################### Projet XIOS ################### ################################################################################ %CCOMPILER /usr/bin/mpicc %FCOMPILER /usr/bin/mpif90 %LINKER /usr/bin/mpif90 -nofor-main %BASE_CFLAGS -ansi -w -D_GLIBCXX_USE_CXX11_ABI=0 %PROD_CFLAGS -O3 -DBOOST_DISABLE_ASSERTS %DEV_CFLAGS -g -O2 %DEBUG_CFLAGS -g %BASE_FFLAGS -D__NONE__ -ffree-line-length-none %PROD_FFLAGS -O3 %DEV_FFLAGS -g -O2 %DEBUG_FFLAGS -g %BASE_INC -D__NONE__ %BASE_LD -lstdc++ %CPP cpp %FPP cpp -P %MAKE gmake
- Creation of 'path' compilation environtment file for
DCAO_gfortran
- Creation of 'path' compilation environtment file for
$ vim ../modeles/XIOS/arch/arch-DCAO_gfortran.path
- values:
NETCDF_INCDIR="-I $NETCDF_INC_DIR" NETCDF_LIBDIR="-L $NETCDF_LIB_DIR" NETCDF_LIB="-lnetcdff -lnetcdf" MPI_INCDIR="" MPI_LIBDIR="" MPI_LIB="-lcurl" HDF5_INCDIR="-I $HDF5_INC_DIR" HDF5_LIBDIR="-L $HDF5_LIB_DIR" HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz" #OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1" #OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib" #OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
- Creation of 'env' compilation environtment file for
DCAO_gfortran
- Creation of 'env' compilation environtment file for
$ vim ../modeles/XIOS/arch/arch-DCAO_gfortran.env
- values:
export HDF5_INC_DIR=/usr/include export HDF5_LIB_DIR=/usr/lib/x86_64-linux-gnu export NETCDF_INC_DIR=/usr/include export NETCDF_LIB_DIR=/usr/lib/x86_64-linux-gnu
[editar] ORCHIDEE
- Creation of 'fcm' compilation environtment file for
DCAO_gfortran
- Creation of 'fcm' compilation environtment file for
$ vim ../modeles/ORCHIDEE/arch/arch-DCAO_gfortran.fcm
- values:
%COMPILER /usr/bin/mpicc %LINK /usr/bin/mpif90 %AR ar %MAKE make %FPP_FLAGS -P -C -traditional -nostdinc %FPP_DEF %BASE_FFLAGS -fdefault-real-8 %PROD_FFLAGS -O3 -funroll-all-loops %DEV_FFLAGS -O %DEBUG_FFLAGS -ffpe-trap=invalid,zero,overflow -Wall -fbounds-check -g3 -O0 -fstack-protector-all %MPI_FFLAGS %OMP_FFLAGS -openmp -openmp-threadprivate compat %BASE_LD %MPI_LD %OMP_LD -openmp
- Creation of 'path' compilation environtment file for
DCAO_gfortran
- Creation of 'path' compilation environtment file for
$ vim ../modeles/ORCHIDEE/arch/arch-DCAO_gfortran.path
- values:
NETCDF_INCDIR="-I/usr/include" NETCDF_LIBDIR="-L/usr/lib/x86_64-linux-gnu" NETCDF_LIB="-lnetcdf -lnetcdff" IOIPSL_INCDIR="-I${ORCHDIR}/../../lib -I${ORCHDIR}/../IOIPSL/inc" IOIPSL_LIBDIR="-L${ORCHDIR}/../../lib -L${ORCHDIR}/../IOIPSL/lib" IOIPSL_LIB="-lioipsl" XIOS_INCDIR="-I${ORCHDIR}/../XIOS/inc" XIOS_LIBDIR="-L${ORCHDIR}/../XIOS/lib" XIOS_LIB="-lxios"
[editar] Building & compiling
- Installing the code:
$ ./ins_make -t DCAO_gfortran >& run_ins_make.log
- Going there:
$ cd ../config/ORCHIDEE_OL
- No need to loading the right environment since in
hydra
its by default - Compiling XIOS in sequential (in
Makefile
, adding no-parallel compilation):
- No need to loading the right environment since in
./make_xios --netcdf_lib netcdf4_seq (...)
- Compiling (we must compile without XIOS, otherwise it is not working):
$ gmake without_xios >& run_gmake.log
- Checking if everything went fine:
$ cat -n run_gmake.log | grep Error $ cat -n run_gmake.log | grep undefined $ ls ../../bin/ orchideedriver orchidee_ol
[editar] Compiling rebuild
Due to the fact that hydra
does not have the netcdf libraries compiled in parallel, ORCHDEE output is written with multiple files being a file for each process. In order to overcome this output. IPSL does prepare a tool to join the files and provide the expected output. This tool is called rebuild
(a Kornshell script which encapsulates de exacutable flio_rbld
) and it comes with the IOIPSL
libraries. The IOIPSL libraries, are a set of old libraries developed by the IPSL (M. A. Foujuls, J. Polcher among others) to deal with the netCDF data access for all the models developed at the IOIPSL. Compiling IOIPSL (following install rebuild. It has to be compiled independently. Here it is explained how it has to be done.
- Go to the instalation directory
[INSTALLDIR]
$ cd [INSTALLDIR]
- getting the last version of the code
$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl_IOIPSLtools
- going to prepare compilation/installation
$ cd modipsl_IOIPSLtools/util
- preparing environment
./model IOIPSL_PLUS
- We got some issues with the ports, thus, it needs to be manually done:
$ cd ../modeles
- Getting IOIPSL (NOTE: notice the difference in library's version from the previous one):
$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/tags/v2_2_3 IOIPSL
- Comming back to the
util
folder
$ cd ../util
- Creation of the compilation environment for
`DCAO'
using'gfortran'
insideAA_make.gdef
as in the full compilation
$ cp ../../modipsl/util/AA_make.gdef ./
- Preparing makefiles
$ ./ins_make -t "DCAO_gfortran" -p I4R8
- going to src folder to compile
$ cd ../modeles/IOIPSL/src
- cleaning (you never know...)
$ make clean
- compiling
$ make >& run_make.log
- Checking no errors:
$ cat -n run_make.log | grep Error
- compilation of tools (file concatenation)
$ cd ../tools
- cleaning (you never know...)
$ make clean
- compiling
$ make >& run_make.log
- Checking no errors:
$ cat -n run_make.log | grep Error
- One should have:
$ ls ../../../bin/ flio_rbld rebuild
[editar] debug Instalation
Getting a debugging copy for test purposes
[editar] Instalation steps using modipsl
- Go to the instalation directory
[INSTALLDIR]
$ cd [INSTALLDIR]
- Getting the IPSL-models suite (r 3379)
$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl_dbg
- Once we got the codes, we need to copy the specificities of the installation for
hydra
$ cp ../../modipsl/util/AA_make.gdef ./ $ cp ../../modipsl/modeles/XIOS/arch/*hydra* ../modeles/XIOS/arch/ $ cp ../../modipsl/modeles/ORCHIDEE/arch/*hydra* ../modeles/ORCHIDEE/arch/
- Everything is the same as for the installation, except that we need to indicate debugging compilation:
./ins_make -t DCAO_gfortran -d >& run_ins_make.log
- And on
Makefile
fromconfig/ORCHIDEE_OL
, change all the-prod
by-debug
(...) xios : (cd ../../modeles/XIOS ; ./make_xios --netcdf_lib netcdf4_seq \ --debug --arch ${FCM_ARCH} --job 8 ; cp bin/xios_server.exe ../../bin/. ; ) (...) driver : (cd ../../modeles/ORCHIDEE ; ./makeorchidee_fcm -j 8 -parallel mpi -debug -arch ${FCM_ARCH} -driver ; ) (...) driver_xios : (cd ../../modeles/ORCHIDEE ; ./makeorchidee_fcm -xios2 -j 8 -parallel mpi -debug -arch ${FCM_ARCH} -driver ; ) (...)
- Compiling:
$ gmake >& run_gmake.log
- Checking if everything went fine:
$ cat -n run_gmake.log | grep Error $ cat -n run_gmake.log | grep undefined $ ls ../../bin/ orchidee_ol xios_server.exe