Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Regarding the error during porting cesm1.2.0 on new machine

Dear Uesrs,We are porting CESM1.2.0 on new machine( Linux + PGI compiler). We are following porting steps given in the cesm1.2.0 user guide(page no. 51-54) (via userdefined ). we are getting the error at the building steps which is referring to pio as :

[ankush@chandra test5]$ ./test5.build
-------------------------------------------------------------------------
 CESM BUILDNML SCRIPT STARTING
 - To prestage restarts, untar a restart.tar file into /home/ankush/ankush/test5/run
 infile is /home/ankush/test5/Buildconf/cplconf/cesm_namelist
 CESM BUILDNML SCRIPT HAS FINISHED SUCCESSFULLY
-------------------------------------------------------------------------
-------------------------------------------------------------------------
 CESM PRESTAGE SCRIPT STARTING
 - Case input data directory, DIN_LOC_ROOT, is /data/CESM_INPUT/inputdata
 - Checking the existence of input datasets in DIN_LOC_ROOT
 CESM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY
-------------------------------------------------------------------------
-------------------------------------------------------------------------
 CESM BUILDEXE SCRIPT STARTING
 COMPILER is pgi
 - Build Libraries: mct gptl pio csm_share
Tue Sep 17 17:10:39 IST 2013 /home/ankush/ankush/test5/bld/mct/mct.bldlog.130917-171038

Tue Sep 17 17:11:34 IST 2013 /home/ankush/ankush/test5/bld/gptl/gptl.bldlog.130917-171038
Tue Sep 17 17:11:37 IST 2013 /home/ankush/ankush/test5/bld/pio/pio.bldlog.130917-171038
ERROR: buildlib.pio failed, see /home/ankush/ankush/test5/bld/pio/pio.bldlog.130917-171038
ERROR: cat /home/ankush/ankush/test5/bld/pio/pio.bldlog.130917-171038since we are ignoring the PNETCDF path but it still looking for it.so before executing build we did the following settings in Macros file :

#---------HDF5/zlib----------
HDF5_PATH=/usr/local/pgilib/HDF5
INC_HDF5=-I$(HDF5_PATH)/include
LIB_HDF5=-L$(HDF5_PATH)/lib
#
ZLIB_PATH=/usr/local/pgilib/ZLIB
INC_ZLIB=-I$(ZLIB_PATH)/include
LIB_ZLIB=-L$(ZLIB_PATH)/lib
MPICC:= mpicc

MPICXX:= mpicxx

MPIFC:= mpif90



MPI_PATH:=/opt/pgi/linux86-64/2013/mpi/mpich/bin/
INC_MPI       := $(MPICH_PATH)/include
LIB_MPI       := $(MPICH_PATH)/lib
MPI_LIB_NAME:=mpi -lmpigf
NETCDF_PATH:= /usr/local/pgilib/NETCDF4
INC_NETCDF    := $(NETCDF_PATH)/include
LIB_NETCDF    := $(NETCDF_PATH)/lib $(LIB_HDF5) $(LIB_ZLIB)
MOD_NETCDF    := $(NETCDF_PATH)/include
PNETCDF_PATH:=

we did not edit the env_mach_specific. since we had tried to edit as shown in document (loading the module netcdf, pgi etc.). then it doesnt went for building step and thrown error. for more detail i am attaching the poi log file here.

I request you to please suggest me the useful setting to get rid of this error.and is it necessary to compile the netcdf libraries in parallel for cesm1.2.0.??Thanking you in anticipation.

Best Regards,

Ram
 

jedwards

CSEG and Liaisons
Staff member
It looks like a problem in your mpi library - please let us know the compiler version and mpi library version you are using.   Maybe the problem is only in the F90 interfacetry adding -DNO_MPIMOD to CPPDEFS in your Macros file. 
 
Dear jedwards, adding above mentioned flag in Macros has solved the above error (PIO) as you asked about mpi(mpich) verison, we are using mpif90 for 1.2.7 (release) of : 2005/06/22 16:33:49 (inbuilt with pgi cdk compiler), but now it stuck at new error which seems like related to some directory path (csm_share):error is given as :[ankush@chandra test5]$ ./test5.build      
-------------------------------------------------------------------------
 CESM BUILDNML SCRIPT STARTING
 - To prestage restarts, untar a restart.tar file into /home/ankush/ankush/test5/run
 infile is /home/ankush/test5/Buildconf/cplconf/cesm_namelist
 CESM BUILDNML SCRIPT HAS FINISHED SUCCESSFULLY
-------------------------------------------------------------------------
-------------------------------------------------------------------------
 CESM PRESTAGE SCRIPT STARTING
 - Case input data directory, DIN_LOC_ROOT, is /data/CESM_INPUT/inputdata
 - Checking the existence of input datasets in DIN_LOC_ROOT
 CESM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY
-------------------------------------------------------------------------
-------------------------------------------------------------------------
 CESM BUILDEXE SCRIPT STARTING
 COMPILER is pgi
 - Build Libraries: mct gptl pio csm_share
Wed Sep 18 16:06:26 IST 2013 /home/ankush/ankush/test5/bld/mct/mct.bldlog.130918-160624
Wed Sep 18 16:07:30 IST 2013 /home/ankush/ankush/test5/bld/gptl/gptl.bldlog.130918-160624
Wed Sep 18 16:07:33 IST 2013 /home/ankush/ankush/test5/bld/pio/pio.bldlog.130918-160624
Wed Sep 18 16:08:39 IST 2013 /home/ankush/ankush/test5/bld/csm_share/csm_share.bldlog.130918-160624
ERROR: buildlib.csm_share failed, see /home/ankush/ankush/test5/bld/csm_share/csm_share.bldlog.130918-160624
ERROR: cat /home/ankush/ankush/test5/bld/csm_share/csm_share.bldlog.130918-160624 As error message  suggest (in attached file), we looked out in file buildlib.csm_share is creating the directory path in(line 21) using xml variable EXEROOT($HOME/$CCSMUSER/$CASE). but in next like where it check for above directory(which is created successfully : /home/ankush/ankush/test5/bld/csm_share) build terminates with message 'could not cd to ....').(log is attached here)So , please check the above and help us.Thanking you in anticipation.RegardsRamCASIIT Delhi, New Delhi - 11016. 
 

jedwards

CSEG and Liaisons
Staff member
You'll need to work with your system support team to figure this out - is it a permissions problem in the created directory?
 
Dear Sir, As i am working with the machine admin for this porting. we checked for the permission of the directory all read,write and exceute  permission are given.as i mentioned in previous post in csm_share biuld file ("buildlib.csm_share" in directory CASE/Buildconf)  is giving this error at the line number 21 (given below)--------------------------1 #!/usr/bin/env perl
  2 use strict;
  3 #===============================================================================
  4 # Purpose:
  5 #     (a) Build csm_share library
  6 #===============================================================================
  7 my $case = $ENV{CASEROOT};
  8
  9
 10 unshift @INC, "$case/Tools";
 11 require XML::Lite;
 12 require SetupTools;
 13 # Read some xml files for required variables
 14 my %xmlvars = ();
 15 SetupTools::getxmlvars($case, %xmlvars);
 16 foreach my $attr (keys %xmlvars) {
 17     $xmlvars{$attr} = SetupTools::expand_env_var($xmlvars{$attr}, %xmlvars);
 18 }
 19
 20 my $libdir = "$xmlvars{EXEROOT}/csm_share";
 21 chdir($libdir) or die "Could not cd to $libdir: $!n";
 
the error it gives in log file is :Thu Sep 19 15:21:25 IST 2013 /home/ankush/ankush/test4/bld/csm_share/csm_share.bldlog.130919-151928
Could not cd to /ankush/test4/bld/csm_share: No such file or directory-----------------------------Since we checked all the possibalities( as much we know) but not able to figure it out.So please suggest any other possibality ?Thank you.Regards,Ram 
 

jedwards

CSEG and Liaisons
Staff member
Isn't your directory /home/ankush/ankush/test4/bld/csm_share?   It's trying to cd to /ankush/test4/bld/csm_share   so $HOME is not being resolved correctly.   Go into the .xml file in your case directory and hardcode the EXEROOT path - this should solve the problem.
 
Dear Jedwards,Thank you so much for your quick replies.Now it is giving the error while creating the ccsm.exe while is directing towards mpi flag named '-lmpi'.--------------Fri Sep 20 17:05:20 IST 2013 /home/ankush/ankush/test6/bld/wav.bldlog.130920-170026
Fri Sep 20 17:05:21 IST 2013 /home/ankush/ankush/test6/bld/rof.bldlog.130920-170026
Fri Sep 20 17:05:22 IST 2013 /home/ankush/ankush/test6/bld/cesm.bldlog.130920-170026
ERROR: cesm.buildexe.csh failed, see /home/ankush/ankush/test6/bld/cesm.bldlog.130920-170026
ERROR: cat /home/ankush/ankush/test6/bld/cesm.bldlog.130920-170026________Since we are using pgi(13.7) and inbuilt mpi with pgimpi (mpif90 for version 1.4.1p1

pgf90 13.7-0 64-bit target on x86-64 Linux -tp sandybridge).i am also attaching the log file and Macros file here. please see the attachements.Regards,Ram
 
Dear jedwards,above setting worked but now we get some other error related to 'netcdf'. Since we have tried with 'netcdf4.1.3', 'netcdf4.1.3 with HDF5' and with parallely compiled 'netcdf4.1.3 with HDF5' . in all above we got the same error as below:##############mpif90  -o /home/ankush/ankush/test7/bld/cesm.exe ccsm_comp_mod.o ccsm_driver.o mrg_mod.o seq_avdata_mod.o seq_diag_mct.o seq_domain_mct.o seq_flux_mct.o seq_frac_mct.o seq_hist_mod.o seq_map_esmf.o seq_map_mod.o seq_mctext_mod.o seq_rest_mod.o  -L/home/ankush/ankush/test7/bld/lib/ -latm  -L/home/ankush/ankush/test7/bld/lib/ -lice  -L/home/ankush/ankush/test7/bld/lib/ -llnd  -L/home/ankush/ankush/test7/bld/lib/ -locn  -L/home/ankush/ankush/test7/bld/lib/ -lrof  -L/home/ankush/ankush/test7/bld/lib/ -lglc  -L/home/ankush/ankush/test7/bld/lib/ -lwav -L/home/ankush/ankush/test7/bld/lib -lcsm_share  -L/home/ankush/ankush/test7/bld/mct/mct -lmct -L/home/ankush/ankush/test7/bld/mct/mpeu -lmpeu -L/home/ankush/ankush/test7/bld/pio -lpio -lgptl -L/usr/local/pgilib/NETCDF4-PAR/lib -lnetcdf   -time -Wl,--allow-multiple-definition
seq_map_mod.o: In function `.C13_283':
seq_map_mod.F90:(.data+0x1c90): undefined reference to `typesizes_'
seq_map_mod.F90:(.data+0x1c98): undefined reference to `netcdf_'
/home/ankush/ankush/test7/bld/lib//libcsm_share.a(seq_io_mod.o): In function `.STATICS23':
seq_io_mod.F90:(.data+0x2718): undefined reference to `typesizes_'
seq_io_mod.F90:(.data+0x2720): undefined reference to `netcdf_'
/home/ankush/ankush/test7/bld/lib//libcsm_share.a(shr_mct_mod.o): In function `shr_mct_mod_shr_mct_smatreadnc_':
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:109: undefined reference to `nf_open_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:111: undefined reference to `nf_strerror_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:116: undefined reference to `nf_inq_dimid_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:117: undefined reference to `nf_inq_dimlen_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:118: undefined reference to `nf_inq_dimid_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:119: undefined reference to `nf_inq_dimlen_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:120: undefined reference to `nf_inq_dimid_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:121: undefined reference to `nf_inq_dimlen_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:144: undefined reference to `nf_inq_varid_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:145: undefined reference to `nf_get_var_double_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:146: undefined reference to `nf_strerror_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:158: undefined reference to `nf_inq_varid_'
/opt/app/cesm1_2_0/models/csm_share/shr/shr_mct_mod.F90:159: undefined reference to `nf_get_var_int_'-------------/home/ankush/ankush/test7/bld/lib//libpio.a(pionfget_mod.o): In function `pionfget_mod_get_var_3d_int_':
/opt/app/cesm1_2_0/models/utils/pio/pionfget_mod.F90:5988: undefined reference to `netcdf_nf90_get_var_3d_fourbyteint_'
/opt/app/cesm1_2_0/models/utils/pio/pionfget_mod.F90:5992: undefined reference to `netcdf_nf90_get_var_3d_fourbyteint_'
/home/ankush/ankush/test7/bld/lib//libpio.a(pionfget_mod.o): In function `pionfget_mod_get_var_4d_int_':
/opt/app/cesm1_2_0/models/utils/pio/pionfget_mod.F90:6082: undefined reference to `netcdf_nf90_get_var_4d_fourbyteint_'
/opt/app/cesm1_2_0/models/utils/pio/pionfget_mod.F90:6086: undefined reference to `netcdf_nf90_get_var_4d_fourbyteint_'
/home/ankush/ankush/test7/bld/lib//libpio.a(pionfget_mod.o): In function `pionfget_mod_get_var_5d_int_':
/opt/app/cesm1_2_0/models/utils/pio/pionfget_mod.F90:6176: undefined reference to `netcdf_nf90_get_var_5d_fourbyteint_'
/opt/app/cesm1_2_0/models/utils/pio/pionfget_mod.F90:6180: undefined reference to `netcdf_nf90_get_var_5d_fourbyteint_'
/home/ankush/ankush/test7/bld/lib//libpio.a(pionfget_mod.o): In function `.C73_1028':
pionfget_mod.F90:(.data+0x1a70): undefined reference to `netcdf_'
pionfget_mod.F90:(.data+0x1a78): undefined reference to `typesizes_'
/home/ankush/ankush/test7/bld/lib//libpio.a(pio_msg_getput_callbacks.o): In function `.C24_1881':
pio_msg_getput_callbacks.F90:(.data+0x5b0): undefined reference to `typesizes_'
pio_msg_getput_callbacks.F90:(.data+0x5b8): undefined reference to `netcdf_'
gmake: *** [/home/ankush/ankush/test7/bld/cesm.exe] Error 2

#####################For more info please see the attached log file. so, please suggest the required setting to do with 'netcdf4.1.3' ?Thanking you in anticipation.Regards,Ram
 
Dear Sir, we have tried by setting '-lnetcdff' in the source makefile and created a newcase (Same as suggested by jedwards for some simillar error on post). now in the error we can see 'lnetcdff' but the it still not working.Please see the attached log here 
 

jedwards

CSEG and Liaisons
Staff member
Try building and linking a small fortran program that uses netcdf: program foo  use netcdfend program Also you can try running the commandnc-config --flibsto find what libraries you need to link.
 

eaton

CSEG and Liaisons
The undefined externals now appear to be hdf5 and curl related.  This could be avoided by using a netcdf lib that's built without hdf5 support.  Or following Jim's suggestion to use nc-config to identify all the library dependencies should work as well.
 
Hi,Thanx for the reply. Problem is solved after setting netcdf -flibs flags as suggested by you . Build is running successfully.But now we are getting problem during run. Error is -------------------------------------------------------------------------
 CESM BUILDNML SCRIPT STARTING
- To prestage restarts, untar a restart.tar file into /home/ankush/ankush/test7/run
/opt/app/cesm1_2_0/scripts/ccsm_utils/Tools/user_nlcreate: Command not found.
/opt/app/cesm1_2_0/models/drv/bld/build-namelist: Command not found.
ERROR: cpl.buildnml.csh failed
ERROR from preview namelist - EXITING----------------------------------------------------------------------------------------------------The /opt/app/cesm1_2_0/scripts/ccsm_utils/Tools/user_nlcreate file is there with all -rwx permissions. As suggestted, in one of your other posts, I have added -x (#! /bin/csh -fx) option to the cpl.buildnml.csh script. Also, I am attaching test7.run.log file.Please suggest the required setting for this. ThanksRam,
 

jedwards

CSEG and Liaisons
Staff member
Is it possible that the script is running from a different host than you are logged into?   You'll need to fiugre out why this script is not exectuted...   /opt/app/cesm1_2_0/scripts/ccsm_utils/Tools/user_nlcreate
 
Dear Jedwards,
Thank you ! for your reply. actually we have SGE6 scheduler on the server. frankly speaking i ahve not much knowledge of job schedulers. thus we are modifyng the run script as given below:Also the scripts is attached here.################################!/bin/csh -fx
#===============================================================================
# USERDEFINED
# This is where the batch submission is set.  The above code computes
# the total number of tasks, nodes, and other things that can be useful
# here.  Use PBS, BSUB, or whatever the local environment supports.
#===============================================================================
#$ -N test7
#$ -q medium.q
#$ -pe mpi 16
#$ -cwd
#$ -j y
#$ -V
#$ -S /bin/csh -V

##BSUB -l nodes=1:ppn=16:walltime=00:59:00
##BSUB -q batch
###BSUB -k eo
###BSUB -J test7
###BSUB -W 00:59:00
#limit coredumpsize 1000000
#limit stacksize unlimited
------/opt/pgi/linux86-64/2013/mpi2/mpich/bin/mpirun -np 16 $EXEROOT/cesm.exe >&! cesm.log.$LID---########So, i request you to see the above changes and suggest if i am making some mistake due to which it throws the above error in run.
Thanking you in anticipation.Regards,Ram
 

jedwards

CSEG and Liaisons
Staff member
Figure out how to run the hello world test program from the users guide:http://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/usersguide/c1720.htmlthat will inform how your runscript should look.    
 
Hello, I meet with a similar issuse when porting the CESM. The error is about "/usr/bin/ld: cannot find -lopenmpi". I tried to comment out the 'MPI_PATH' in Macros file and it seems the building is done sucessfully without more error. I want to ask if this will lead to further issue. Or any other solutions for this error.
 

jedwards

CSEG and Liaisons
Staff member
This error seems to indicate that your c and fortran compilers are not playing well together - what are the compiler versions?
 
Hi,This is Charan, from University of Hyderabad, I am trying to build CESM 1.2.0 in HPC i am getting error while building######################################################]$ ./trail_01.build ------------------------------------------------------------------------- CESM BUILDNML SCRIPT STARTING - To prestage restarts, untar a restart.tar file into /moes/home/ashok/charan/for_use/rundir infile is /moes/home/ashok/charan/cesm1_2_0/scripts/trail_01/Buildconf/cplconf/cesm_namelist  CESM BUILDNML SCRIPT HAS FINISHED SUCCESSFULLY-------------------------------------------------------------------------------------------------------------------------------------------------- CESM PRESTAGE SCRIPT STARTING - Case input data directory, DIN_LOC_ROOT, is /imd/uohyd/ccsm/inputdata - Checking the existence of input datasets in DIN_LOC_ROOT CESM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY-------------------------------------------------------------------------------------------------------------------------------------------------- CESM BUILDEXE SCRIPT STARTING COMPILER is Intel - Build Libraries: mct gptl pio csm_share Wed May 11 11:35:01 IST 2016 /moes/home/ashok/charan/for_use/exeroot/mct/mct.bldlog.160511-113451Wed May 11 11:36:07 IST 2016 /moes/home/ashok/charan/for_use/exeroot/gptl/gptl.bldlog.160511-113451ERROR: buildlib.gptl failed, see /moes/home/ashok/charan/for_use/exeroot/gptl/gptl.bldlog.160511-113451ERROR: cat /moes/home/ashok/charan/for_use/exeroot/gptl/gptl.bldlog.160511-113451######################################################################################## Please HelpThank you
 
Top