Main menu

Navigation

Problem with porting CESM_1_2_1 to a generic machine

7 posts / 0 new
Last post
rangel@...
Problem with porting CESM_1_2_1 to a generic machine

Dear users,

I'm porting CESM1.2.1 on my machine, following user's guide, but I'm having problems.
First of all I' ve set environment variables this way:

export CASE=teste5
export CCSMROOT=/home/CLIMA/CESM/cesm1_2_1
export CSMDATA=$CCSMROOT/inputdata
export CASEROOT=$CCSMROOT/$CASE

-----------------------------------------------------------


The content of .bashrc is the following:

export PATH=/usr/local/ncarg/bin:$PATH:/usr/lib64/openmpi/bin/
export NCARG_ROOT=/usr/local/ncarg
export PATH=$NCARG_ROOT/bin:$PATH
export NCARG_LIB=$NCARG_ROOT/lib/ncarg
export NCARG_FONTCAPS=$NCARG_LIB/fontcaps
export NCARG_GRAPHCAPS=$NCARG_LIB/graphcaps
export NCARG_DATABASE=$NCARG_LIB/database
export NCARG_NCARG=$NCARG_LIB
export NCARG_USRRESFILE=/home/CLIMA/.hluresfile
export DISPLAY=:0.0
export FC=gfortran
export F77=gfortran
export F90=gfortran
export CC=gcc
export MPI=/usr/lib64/openmpi/
export MPI_INC=/usr/include/openmpi-x86_64/
export MPI_LIB=$MPI/lib
export MPIFC=mpif90
export MPIF77=mpif90
export MPIF90=mpif90
export MPICC=mpicc
export PNETCDF_PATH=/usr/local/PNETCDF
export NETCDF_PATH=/usr/local/NETCDF4
export PIO=/usr/local/PIO
export NETCDF=/usr/local/NETCDF4
export PNETCDF=/usr/local/PNETCDF
export METIS=/usr/local/METIS
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/:/usr/local/lib:$MPI_LIB

----------------------------------------------


The command nc-config --all gives:

[CLIMA@localhost bin]$ nc-config --all

This netCDF 4.3.2 has been built with the following features:

  --cc        -> gcc
  --cflags    ->  -I/usr/include -I/usr/include/hdf
  --libs      ->

  --has-c++   -> no
  --cxx       ->
  --has-c++4  -> no
  --cxx4      ->

  --fc        -> gfortran
  --fflags    -> -I/usr/include
  --flibs     -> -lnetcdff 
  --has-f90   -> yes

  --has-dap   -> yes
  --has-nc2   -> yes
  --has-nc4   -> yes
  --has-hdf5  -> yes
  --has-hdf4  -> yes
  --has-pnetcdf-> no

  --prefix    -> /usr
  --includedir-> /usr/include
  --version   -> netCDF 4.3.2


----------------------------------------------


The machine is user defined (which name is "labmeta"), and I added this block into config_machines.xml:

<machine MACH="labmeta">
        <DESC>Labmeta</DESC>                                 <!-- can be anything -->
        <OS>LINUX</OS>                              <!-- LINUX,Darwin,CNL,AIX,BGL,BGP -->
        <COMPILERS>gnu</COMPILERS>     <!-- intel,ibm,pgi,pathscale,gnu,cray,lahey -->
        <MPILIBS>openmpi</MPILIBS>                <!-- openmpi, mpich, ibm, mpi-serial -->
  <!--      <CESMSCRATCHROOT>/home/CLIMA/CESM/cesm1_2_1/teste5</CESMSCRATCHROOT>    -->                 <!-- complete path to the 'scratch' directory -->
        <RUNDIR>$CCSMROOT/$CASE/run</RUNDIR>                       <!-- complete path to the run directory -->
        <EXEROOT>$CCSMROOT/$CASE/bld</EXEROOT>                     <!-- complete path to the build directory -->
        <DIN_LOC_ROOT>$CCSMROOT/inputdata</DIN_LOC_ROOT>           <!-- complete path to the inputdata directory -->
        <DIN_LOC_ROOT_CLMFORC>USERDEFINED_optional_build</DIN_LOC_ROOT_CLMFORC> <!-- path to the optional forcing data for CLM (for CRUNCEP forcing) -->
        <DOUT_S>FALSE</DOUT_S>                                            <!-- logical for short term archiving -->
        <DOUT_S_ROOT>USERDEFINED_optional_run</DOUT_S_ROOT>               <!-- complete path to a short term archiving directory -->
        <DOUT_L_MSROOT>USERDEFINED_optional_run</DOUT_L_MSROOT>           <!-- complete path to a long term archiving directory -->
        <CCSM_BASELINE>USERDEFINED_optional_run</CCSM_BASELINE>           <!-- where the cesm testing scripts write and read baseline results -->
        <CCSM_CPRNC>USERDEFINED_optional_test</CCSM_CPRNC>                <!-- path to the cprnc tool used to compare netcdf history files in testing -->
        <BATCHQUERY>USERDEFINED_optional_run</BATCHQUERY>
        <BATCHSUBMIT>USERDEFINED_optional_run</BATCHSUBMIT>
        <SUPPORTED_BY>USERDEFINED_optional</SUPPORTED_BY>
        <GMAKE_J>1</GMAKE_J>
        <MAX_TASKS_PER_NODE>2</MAX_TASKS_PER_NODE>
</machine>

--------------------------------------------------------------------


The block regarding GNU inside config_compilers.xml is:

<compiler COMPILER="gnu">
  <!-- http://gcc.gnu.org/onlinedocs/gfortran/ -->
  <ADD_CPPDEFS> -DFORTRANUNDERSCORE -DNO_R16</ADD_CPPDEFS>
  <ADD_CFLAGS compile_threaded="true"> -fopenmp </ADD_CFLAGS>
  <ADD_FFLAGS compile_threaded="true"> -fopenmp </ADD_FFLAGS>
  <ADD_LDFLAGS compile_threaded="true"> -fopenmp </ADD_LDFLAGS>
  <ADD_CMAKE_OPTS MODEL="cism"> -D CISM_GNU=ON </ADD_CMAKE_OPTS>
  <FIXEDFLAGS>  -ffixed-form </FIXEDFLAGS>
  <FREEFLAGS> -ffree-form </FREEFLAGS>
  <ADD_FFLAGS DEBUG="TRUE"> -g -Wall </ADD_FFLAGS>
  <!-- -ffree-line-length-none and -ffixed-line-length-none need to be in FFLAGS rather than in FIXEDFLAGS/FREEFLAGS
       so that these are passed to cmake builds (cmake builds don't use FIXEDFLAGS and FREEFLAGS). -->
  <FFLAGS> -O -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none </FFLAGS>
  <FFLAGS_NOOPT> -O0 </FFLAGS_NOOPT>
  <FC_AUTO_R8> -fdefault-real-8 </FC_AUTO_R8>
  <SFC> gfortran </SFC>
  <SCC> gcc </SCC>
  <SCXX> g++ </SCXX>
  <MPIFC> mpif90 </MPIFC>
  <MPICC> mpicc  </MPICC>
  <MPICXX> mpicxx </MPICXX>
  <CXX_LINKER>FORTRAN</CXX_LINKER>
  <SUPPORTS_CXX>TRUE</SUPPORTS_CXX>
</compiler>

-----------------------------------------------------------------


So, with everything set, I did the following command:
./create_newcase -case $CASEROOT -res f19_g16 -compset BC5CN -mach labmeta
which (apparently) successfully created the case.

The command ./cesm_setup inside directory teste5 gave:
Use of qw(...) as parentheses is deprecated at ./cesm_setup line 252.

So, I changed cesm_setup qw(...) to (qw(...)) and ./cesm_setup again:
Macros script already created ...skipping
 Machine/Decomp/Pes configuration has already been done ...skipping
 Running preview_namelist script
 infile is /home/CLIMA/CESM/cesm1_2_1/teste5/Buildconf/cplconf/cesm_namelist
CAM writing dry deposition namelist to drv_flds_in
CAM writing namelist to atm_in
CLM configure done.
CLM adding use_case 2000_control defaults for var sim_year with val 2000
CLM adding use_case 2000_control defaults for var sim_year_range with val constant
CLM adding use_case 2000_control defaults for var stream_year_first_ndep with val 2000
CLM adding use_case 2000_control defaults for var stream_year_last_ndep with val 2000
CLM adding use_case 2000_control defaults for var use_case_desc with val Conditions to simulate 2000 land-use
CICE configure done.
POP2 build-namelist: ocn_grid is gx1v6
POP2 build-namelist: ocn_tracer_modules are  iage
See ./CaseDoc for component namelists
If an old case build already exists, might want to run teste5.clean_build before building

Apparently ok, but then, ./teste5.build gave:

[CLIMA@localhost teste5]$ ./teste5.build
-------------------------------------------------------------------------
 CESM BUILDNML SCRIPT STARTING
 - To prestage restarts, untar a restart.tar file into /home/CLIMA/CESM/cesm1_2_1/teste5/run
 infile is /home/CLIMA/CESM/cesm1_2_1/teste5/Buildconf/cplconf/cesm_namelist
CAM writing dry deposition namelist to drv_flds_in
CAM writing namelist to atm_in
CLM configure done.
CLM adding use_case 2000_control defaults for var sim_year with val 2000
CLM adding use_case 2000_control defaults for var sim_year_range with val constant
CLM adding use_case 2000_control defaults for var stream_year_first_ndep with val 2000
CLM adding use_case 2000_control defaults for var stream_year_last_ndep with val 2000
CLM adding use_case 2000_control defaults for var use_case_desc with val Conditions to simulate 2000 land-use
CICE configure done.
POP2 build-namelist: ocn_grid is gx1v6
POP2 build-namelist: ocn_tracer_modules are  iage
 CESM BUILDNML SCRIPT HAS FINISHED SUCCESSFULLY
-------------------------------------------------------------------------
-------------------------------------------------------------------------
 CESM PRESTAGE SCRIPT STARTING
 - Case input data directory, DIN_LOC_ROOT, is /home/CLIMA/CESM/cesm1_2_1/inputdata
 - Checking the existence of input datasets in DIN_LOC_ROOT
 CESM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY
-------------------------------------------------------------------------
-------------------------------------------------------------------------
 CESM BUILDEXE SCRIPT STARTING
 COMPILER is gnu
 - Build Libraries: mct gptl pio csm_share
Wed Nov 25 15:32:59 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/mct/mct.bldlog.151125-153256
Wed Nov 25 15:33:10 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/gptl/gptl.bldlog.151125-153256
Wed Nov 25 15:33:11 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/pio/pio.bldlog.151125-153256
Wed Nov 25 15:33:22 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/csm_share/csm_share.bldlog.151125-153256
Wed Nov 25 15:33:36 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/atm.bldlog.151125-153256
Wed Nov 25 15:35:16 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/lnd.bldlog.151125-153256
Wed Nov 25 15:35:47 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/ice.bldlog.151125-153256
Wed Nov 25 15:36:04 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/ocn.bldlog.151125-153256
Wed Nov 25 15:36:42 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/glc.bldlog.151125-153256
Wed Nov 25 15:36:42 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/wav.bldlog.151125-153256
Wed Nov 25 15:36:42 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/rof.bldlog.151125-153256
Wed Nov 25 15:36:44 BRST 2015 /home/CLIMA/CESM/cesm1_2_1/teste5/bld/cesm.bldlog.151125-153256
ERROR: cesm.buildexe.csh failed, see /home/CLIMA/CESM/cesm1_2_1/teste5/bld/cesm.bldlog.151125-153256
ERROR: cat /home/CLIMA/CESM/cesm1_2_1/teste5/bld/cesm.bldlog.151125-153256

------------------------------------------------------------------------


File cesm.bldlog.txt is atached.

I've tried to reproduce everything that is here: https://bb.cgd.ucar.edu/regarding-error-during-porting-cesm120-new-machine but I don't know how to apply these suggestions on my machine, since we don't have a system administrator.
I really don't know what to do now ... if anybody could, please, help me, any kind of sugestions will be higly appreciated.

Attachment: 
jedwards

no attchement found

CESM Software Engineer

rangel@...

Sorry ... but now, file is ok.

 

Jedwards, if you could, please, spend a little time with my problem, I will be very thankful.

 

Kind regards.

jedwards
> chem_surfvals.F90:(.text+0xa46): undefined reference to `__netcdf_MOD_nf90_open'

You are not linking netcdf correctly - was it built with the same compiler and flags as you are building the model with?


CESM Software Engineer

rangel@...

I'm sorry for my late response, but just today I've had access to the computer. Thanks for your response.

I've installed netcdf again, but I don' know if it was done correctly. I first downloaded netcdf-4.3.3.1 version and installed locally:

./configure --prefix=/home/CLIMA/INSTALACOES/netcdf_f_c

make

make install

Then, I downloaded netcdf-fortran-4.4.2 and installed on the same directory:

./configure --prefix=/home/CLIMA/INSTALACOES/netcdf_f_c

make

make install


Then, I changed the ~/.bashrc file to:

export PATH=/usr/local/ncarg/bin:$PATH:/usr/lib64/openmpi/bin/
export NCARG_ROOT=/usr/local/ncarg
export PATH=$NCARG_ROOT/bin:$PATH
export NCARG_LIB=$NCARG_ROOT/lib/ncarg
export NCARG_FONTCAPS=$NCARG_LIB/fontcaps
export NCARG_GRAPHCAPS=$NCARG_LIB/graphcaps
export NCARG_DATABASE=$NCARG_LIB/database
export NCARG_NCARG=$NCARG_LIB
export NCARG_USRRESFILE=/home/CLIMA/.hluresfile
export DISPLAY=:0.0

export FC=gfortran
export F77=gfortran
export F90=gfortran
export CC=gcc
export MPI=/usr/lib64/openmpi/
export MPI_INC=/usr/include/openmpi-x86_64/
export MPI_LIB=$MPI/lib
export MPIFC=mpif90
export MPIF77=mpif90
export MPIF90=mpif90
export MPICC=mpicc
export PNETCDF_PATH=/home/CLIMA/INSTALACOES/parallel-netcdf
export NETCDF_PATH=/home/CLIMA/INSTALACOES/netcdf_f_c
export PIO=/home/CLIMA/INSTALACOES/PIO2
export NETCDF=/home/CLIMA/INSTALACOES/netcdf_f_c
export PNETCDF=/home/CLIMA/INSTALACOES/parallel-netcdf
export METIS=/usr/local/METIS
export PARMETIS=/usr/local/ParMETIS
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/:/usr/local/lib:/home/CLIMA/INSTALACOES/netcdf_f_c/lib:$PIO/lib:$PNETCDF/lib:$MPI_LIB


The cesm.bldlog is attached, but it shows the same error "chem_surfvals.F90:(.text+0xa46): undefined reference to `__netcdf_MOD_nf90_open'" that you pointed.

I really don't know what I'm doing wrong.

 

Attachment: 
jedwards

You need to add the -lnetcdff 

try adding it to LDFLAGS in the Macros file.

 

CESM Software Engineer

rangel@...

Dear jedwards,

thanks for your help. It worked ! The compilation was succesfully done!

Log in or register to post comments

Who's new

  • 1658093099@...
  • mborreggine@...
  • kabirtam@...
  • suns@...
  • liangpeng0405@...