Main menu

Navigation

Porting cesm1.2.0, 'underscore' problems

28 posts / 0 new
Last post
wu.ker.wang@...
Porting cesm1.2.0, 'underscore' problems

 

I'm trying to port cesm1.2.0 on local computer, using 'ibm' 13.1.0.8 compiler, netcdf version 4.2.1, ibm MPI compiler MPICC:= mpcc_r, MPIFC:= mpxlf95_r,

at the cesm.exe build step, there are always problems like that:

ERROR: cesm.buildexe.csh failed, in more detaild:

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

mpxlf95_r  -o /$EXEROOT/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/$EXEROOT/bld/lib/ -latm -lice -llnd -locn -lrof -lglc -lwav -lcsm_share -lmct -lmpeu -lpio -lgptl -L/sw/aix61/netcdf-4.2.1/lib -lnetcdff -lnetcdf -L/sw/aix61/netcdf-4.2.1/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz -L/sw/aix61/hdf5-1.8.8/lib -L/sw/aix53/zlib-1.2.6/lib -L/sw/aix53/szip-2.1/lib -lsz -lmass -lessl -g -q64 -lmass   -L/sw/aix61/netcdf-4.2.1/lib -lnetcdff -lnetcdf -L/sw/aix61/netcdf-4.2.1/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz -L/sw/aix61/hdf5-1.8.8/lib -L/sw/aix53/zlib-1.2.6/lib -L/sw/aix53/szip-2.1/lib -lsz -bdatapsize:64K -bstackpsize:64K -btextpsize:32K -qextname
ld: 0711-317 ERROR: Undefined symbol: .gptlfinalize_
ld: 0711-317 ERROR: Undefined symbol: .flush__
ld: 0711-317 ERROR: Undefined symbol: .gptldisable_
******************
ld: 0711-317 ERROR: Undefined symbol: .chdir_

ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.

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

I put the -qextname option in the FLAGS, but it still doesn't work.

I also tried to go to the director which included *.o files and run:

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

mpxlf95_r  -o /$EXEROOT/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/$EXEROOT/bld/lib/ -latm -lice -llnd -locn -lrof -lglc -lwav -lcsm_share -lmct -lmpeu -lpio -lgptl -L/sw/aix61/netcdf-4.2.1/lib -lnetcdff -lnetcdf -L/sw/aix61/netcdf-4.2.1/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz -L/sw/aix61/hdf5-1.8.8/lib -L/sw/aix53/zlib-1.2.6/lib -L/sw/aix53/szip-2.1/lib -lsz -lmass -lessl -g -q64 -lmass   -L/sw/aix61/netcdf-4.2.1/lib -lnetcdff -lnetcdf -L/sw/aix61/netcdf-4.2.1/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz -L/sw/aix61/hdf5-1.8.8/lib -L/sw/aix53/zlib-1.2.6/lib -L/sw/aix53/szip-2.1/lib -lsz -bdatapsize:64K -bstackpsize:64K -btextpsize:32K -qextname

-brename:.flush__,.flush_ **** -brename:.chdir_,.chdir

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

Then it seems works, and the cesm.exe file can be created.

 

But, does anyone knows how to change the FLAGS in the MARCOS file to make it work?

Thanks a lot!

Wuke Wang

abdulla.sakalli@...

Dear Wuke,

were you be able to solve the problem regarding the Macros file? I've the same problem on a AIX machine with xlf compilers.

 

Best regards

jedwards

The -qextname option needs an argument.  In the config_machines.xml file it looks like:

  <ADD_FFLAGS> -qextname=flush,chdir,gptlfinalize,gptldisable </ADD_FFLAGS>
  
In macros you would just add these flags to the FFLAGS.

CESM Software Engineer

abdulla.sakalli@...

Dear jedwards,

thank you for the quick reply. Unfortunately I got the same error after adding the

-qextname=flush,chdir,gptlfinalize,gptldisable

in the config_compilers.xml.

my configuration in the file is:

<compiler COMPILER="ibm" MACH="c2aECMWF">
<SFC> xlf90_r </SFC>
<MPIFC> mpxlf90_r </MPIFC>
<SCC> xlC </SCC>
<MPICC> mpcc_r </MPICC>
<ADD_CPPDEFS> -DAIX -DIBM -Dextname -DFORTRANUNDERSCORE -DIBMR2Fortran -Dappendus -D_LARGE_FILES</ADD_CPPDEFS>
<ADD_CFLAGS> -qarch=auto -qtune=auto -qcache=auto </ADD_CFLAGS>
<ADD_FFLAGS> -qarch=auto -qtune=auto -qcache=auto -qextname=flush,chdir,gptlfinalize,gptldisable </ADD_FFLAGS>
<LDFLAGS>-L/usr/local/apps/netcdf4/4.1.3/LP64/lib -lnetcdff -lnetcdf -lnetcdf_c++ -L/usr/local/apps/hdf5/1.8.9/LP64/lib -L/usr/local/apps/szip/2.1/LP64/lib -lsz </LDFLAGS>
<NETCDF_PATH>/usr/local/apps/netcdf4/4.1.3/LP64</NETCDF_PATH>
<ADD_SLIBS> -L/usr/local/apps/netcdf4/4.1.3/LP64/lib -lnetcdff -lnetcdf -L/usr/local/apps/hdf5/1.8.9/LP64/lib -L/usr/local/apps/zlib/1.2.6/LP64/lib -lhdf5_hl -lhdf5 -lz</ADD_SLIBS>
</compiler>

and the errors are:

mpxlf90_r -o /scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/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/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/lib/ -latm -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/lib/ -lice -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/lib/ -llnd -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/lib/ -locn -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/lib/ -lrof -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/lib/ -lglc -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/lib/ -lwav -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/lib -lcsm_share -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/mct/mct -lmct -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/mct/mpeu -lmpeu -L/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/pio -lpio -lgptl -L/usr/local/apps/netcdf4/4.1.3/LP64/lib -lnetcdff -lnetcdf -L/usr/local/apps/hdf5/1.8.9/LP64/lib -L/usr/local/apps/zlib/1.2.6/LP64/lib -lhdf5_hl -lhdf5 -lz -lmass -L/usr/local/apps/netcdf4/4.1.3/LP64/lib -lnetcdff -lnetcdf -lnetcdf_c++ -L/usr/local/apps/hdf5/1.8.9/LP64/lib -L/usr/local/apps/szip/2.1/LP64/lib -lsz
ld: 0711-317 ERROR: Undefined symbol: .flush__
ld: 0711-317 ERROR: Undefined symbol: .chdir_
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
gmake: *** [/scratch/ms/jrc/jry/AbdullaCLM/jry/EUCase/bld/cesm.exe] Error 8


Best regards
jedwards

Did you start from a clean case after making this change?   You didn't send me enough of the log file to see what's going on.  You should have -DCPRIBM in your Macros file. 

CESM Software Engineer

abdulla.sakalli@...

Dear jedwards,

Yes, I cleaned the case then, build it again. Please find the log file and the Macros file in attachment.

Best regards

jedwards

Can you send the csm_share.bldlog from the directory:

bld/csm_share/

I'm not sure it would help with this problem,   but you should also update to the 1.2.1 release.

 

 

 

CESM Software Engineer

abdulla.sakalli@...

Please find the log file in attachment.

 

Best regards

 

abdulla.sakalli@...

Dear all,

after discussing the case in above with the system administrator of the IBM AIX cluster, we realised that the xlf compiler is builded on the cluster by default with -qextname. Therefore we got the erro .flush__ istead of the .flush_ and .chdir_ instead of .chdir. The problem can be solved by using the -brename:.flush__,.flush_ -brename:.chdir_,.chdir. But I have at this point a problem. When I add the -brename to the LDFLAGS, the compiler try to compile every model with -brename:.flush__,.flush_ -brename:.chdir_,.chdir. If one of the model does not include the flush or chdir function then the compiling of the model crashes. I was be able to solve the flush problem by changing the code from call flush_() to call flush(). Since the chdir does not include the "_", I can not solve the compiling problem as with the flush problem. But the good thing is that the chdir function is called just during the compiling of the csm_share. If I"d add the -brename:.chdir_,.chdir in the flags just for the compiling of the csm_share, then the problem will be solved since I was be able to compile a simple fortran program which included the calling of the chdir function.

 

I tried to add in Macros file the followinng codes


ifeq ($(MODEL), csm_share)

    LDFLAGS += -brename:.chdir_,chdir

endif

the question is, how can I tell the compiler to use the -brename flags just for the csm_share compiling? Thank you all for your help in advance.

 

Best wishes

abdulla.sakalli@...

Dear All,

I also downloaded and ported the cesm1_2_1 and then tried to compile the code. The errors were the same. Can please anybody tell me how can I use the -brename:.chdir_,.chdir just during the compiling of the csm_share library? that'd maybe solve the problem. Thanks all four your help in advance. Or does anybody ported the cesm on IBM AIX machine with xlf compiler? If you can upload the Macros file, I'd very appreciated it. Then I can compire it with my Macros file. Maybe Just some flag(s) is needed.

 

Best regards

jedwards

It seems that the problem may be that your compiler is defining the qextname flag by default, this is a non-standard install of the compiler.  

You can try putting the flag into a Depends.$(machine) file - look for examples of how to do this in the Machines directory.  In this way you can limit use of this flag to only the shr_sys_mod.F90 file, which is what I think you want to do.

CESM Software Engineer

abdulla.sakalli@...

For All who have problem with building the models due to flush and chdir functions. After stuied the codes in cesm1.2.1, I find out that the adding the following line in the file scripts/ccsm_utils/Machines/Makefile

LDFLAGS+=-brename:.flush__,.flush_ -brename:.chdir_,.chdir

solve the problem. By using this configuration, the brename option will be use for building the cesm.exe and this solved the problem. Defining of new Dependend files or adding the above line in Macros, did not solved the problem for me.

Best regards

 

wu.ker.wang@...

Dear all,

I am really sorry for late reply. I just come back from a conference and holiday.

To solve the problem discessed above, you can also add the following line in the file scripts/ccsm_utils/Machines/config_compilers.xml:

<ADD_LDFLAGS MODEL="driver"> -brename:.flush__,.flush_ -brename:.chdir_,.chdir </ADD_LDFLAGS>

Sorry again for late reply.

Best regards,

 

Wuke

jedwards

Either the gptl library build failed or the cesm link step couldn't find it.   Looking at the link line it looks like you are missing the path to gptl

 

mpiifort -o /home/asampath/CESM/caseout/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/asampath/CESM/caseout/lib/ -latm  -L/home/asampath/CESM/caseout/lib/ -lice  -L/home/asampath/CESM/caseout/lib/ -llnd  -L/home/asampath/CESM/caseout/lib/ -locn  -L/home/asampath/CESM/caseout/lib/ -lrof  -L/home/asampath/CESM/caseout/lib/ -lglc  -L/home/asampath/CESM/caseout/lib/ -lwav -L/home/asampath/CESM/caseout/lib -lcsm_share  -L/home/asampath/CESM/caseout/mct/mct -lmct -L/home/asampath/CESM/caseout/mct/mpeu -lmpeu -L/home/asampath/CESM/caseout/pio -lpio -lgptl -L/home/asampath/netcdfall3/lib -lnetcdff -L/home/asampath/netcdfall3/lib -lnetcdf -lnetcdf -L/opt/intel/impi/5.0.3.048/intel64/lib -lmpi  

CESM Software Engineer

jedwards

I don't think that there is anything wrong with your mct build - the problem is in the timing library build.   

CESM Software Engineer

jedwards

Is this a different build with the same error?    I ask because the last build you showed me was linking libraries in /home/asampath/CESM/caseout/lib and this one has them in /home/asampath/CESM/cesm1_2_0/scripts/mycase_T31_IRCP85CN/bld/lib

In either case verify that libgptl.a is there and that the link step is finding this library.

CESM Software Engineer

jedwards

You need to figure out why the gptl library is not getting linked.   Where is the file libgptl.a?   What is in directory

/home/asampath/CESM/cesm1_2_2/scripts/port1/bld/intel/mpi/nodebug/nothreads/lib


Try the following change in your Makefile:

ULIBS += -L$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/$(NINST_VALUE)/csm_share -lcsm_share -L$(SHAREDPATH)/lib -lpio -lgptl -lmct -lmpeu

> ULIBS += -L$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/$(NINST_VALUE)/csm_share -lcsm_share -L$(SHAREDPATH)/lib -lpio -lgptl -lmct -lmpeu $(SHAREDPATH)/gptl/libgptl.a

CESM Software Engineer

advita6@...

Hi CESM user,

Could someone help me to fix the above error.?

 

Thanks

adv

santos

You probably should not try to compile GPTL manually, since it's hard to know how that will interact with the CESM scripts.

From your original case, can you attach the GPTL log? Also, what is the output of this command:

> ls /home/asampath/CESM/cesm1_2_2/scripts/port1/bld/intel/mpi/nodebug/nothreads/include

When posting your log files, if you add ".txt" to the end, you can attach them in a forum post here.

 

Sean Patrick Santos

CESM Software Engineering Group

advita6@...

Hi ,

Thanks for your reply. I just did it to locate the origin of error. Please find here the attached files .

 

Attachment: 

adv

santos

You need to use the flag "-DFORTRANUNDERSCORE" to compile gptl with the Intel compiler.

Sean Patrick Santos

CESM Software Engineering Group

advita6@...

Hi Santo,./check_case
check_case OK
[asampath@npp port1]$ csh port1.run
-------------------------------------------------------------------------
 CESM BUILDNML SCRIPT STARTING
 - To prestage restarts, untar a restart.tar file into /home/asampath/CESM/cesm1_2_2/scripts/port1/run
 infile is /home/asampath/CESM/cesm1_2_2/scripts/port1/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 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/asampath/CESM/inputdata
 - Checking the existence of input datasets in DIN_LOC_ROOT
 CESM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY
-------------------------------------------------------------------------
Wed Aug 12 22:34:01 CDT 2015 -- CSM EXECUTION BEGINS HERE
Wed Aug 12 22:34:01 CDT 2015 -- CSM EXECUTION HAS FINISHED
grep: cpl.log.150812-223329: No such file or directory
Model did not complete - see /home/asampath/CESM/cesm1_2_2/scripts/port1/run/cesm.log.150812-223329


What might be causing this?

Thank you

Thank you. It works. now issues in run.

 

 

 

Attachment: 

adv

santos

The "runjob" command is specific to systems with Cobalt. I don't know what system you are running with, but if you are getting this error with a non-cobalt system, you are using the wrong mkbatch script, and you should start with a different one.

Sean Patrick Santos

CESM Software Engineering Group

advita6@...

Hi,

This the error i get. I have attached here the log file.

Model did not complete - see /home/asampath/CESM/cesm1_2_2/scripts/port1/run/cesm.log.150813-144742

Could you please help me to fix this bug?

Thank you

adv

santos

I don't recognize this "kmt" error. You may want to make a new post in the POP2 forum to ask about this.

Sean Patrick Santos

CESM Software Engineering Group

advita6@...

Hi,

I created the case with new resolution. Now  i get the different error. Could you please help me to fix that. I don't have to use batch submission. I use direct execution of xx.run.

Here attached the copy of xxxx.run. I am not what to use mpiexec or mpirun. Both are there. And then How many processors per node i should set. ? 

Sun Aug 16 19:37:24 CDT 2015 -- CSM EXECUTION BEGINS HERE
Sun Aug 16 19:37:27 CDT 2015 -- CSM EXECUTION HAS FINISHED
grep: cpl.log.150816-193653: No such file or directory
Model did not complete - see /home/asampath/CESM/cesm1_2_2/scripts/port1/run/cesm.log.150816-193653
[asampath@npp port1]$ vi /home/asampath/CESM/cesm1_2_2/scripts/port1/run/cesm.log.150816-193653

I also posted in pop2 forum. I didn't receive reply. Could you please help me to fix this bug? I'm stuck .

 

Thank you.

Attachment: 

adv

jedwards

This suggests a basic error with running MPI jobs - start with a simple program such as the hello world Fortran in the users guide and work with your administrators to 

get MPI working correctly.   

CESM Software Engineer

santos

Since this has strayed very, very far from the original topic, I am locking it. Please start a new post when new issues arise.

Sean Patrick Santos

CESM Software Engineering Group

Topic locked

Who's new

  • jwolff
  • tinna.gunnarsdo...
  • sarthak2235@...
  • eolivares@...
  • shubham.gandhi@...