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

Problems compiling CLM 3.0

bmr205@psu_edu

New Member
Hello,

I am getting the following error when compiling CLM 3.0:

"pgf90 -o /home1/bmr205/CLM3.0/clm3/bld/offline/clm -L/usr/global/netcdf/lib
-ln
etcdf -L/home1/bmr205/CLM3.0/clm3/bld/offline/obj/esmf/lib/libO/linux_pgi
-lesmf
-L/usr/global/mpich/lib -lmpich
/usr/bin/ld: cannot find -lesmf
gmake: *** [/home1/bmr205/CLM3.0/clm3/bld/offline/clm] Error 2"

I've tried tracing the definition of the library directory through the
Makefile but so far cannot get the compiler to build or find the library. What
is the preferred or default esmf library location?

Thank You
 

erik

Erik Kluzek
CSEG and Liaisons
Staff member
Hi Braczka

With CLM3.0 the version of ESMF used was the prototype ESMF version (which is now quite old) and the default is for it to build the ESMF directory underneath your bld directory and compile the ESMF source code and put the library in this directory. Look at the variables that are documented at the top of the CLM Makefile and make sure the defaults make sense and that you haven't defined these as env variables pointing to something else.

For example, make sure you haven't defined $ESMF_BLD as something and make sure the default of a ./esmf directory is actually being created. Also look in that directory and see how the ESMF build is going. Also look to make sure that the default location for the ESMF directory of $ROOTDIR/models/utils/esmf exists and has valid code in it. The ESMF library is built using ESMF makefiles from the CLM library with this rule...

$(ESMF_LIB)/$(ESMF_ARCH)/libesmf.a:
cd $(ESMF_ROOT);
$(MAKE) -j 1 BOPT=$(ESMF_BOPT) ESMF_BUILD=$(ESMF_BLD) ESMF_DIR=$(ESMF_ROOT) ESMF_ARCH=$(ESMF_ARCH);

You might want to try calling this part on your own (by looking up what the definition of each of the above tokens should be for your machine (ESMF_BOPT, ESMF_BLD, ESMF_ROOT and ESMF_ARCH) and then run the make by hand.

Good luck

Keep in mind CLM3.0 is quite old, and we can't spend a lot of time helping you.

Erik Kluzek
 
Dear all,

I tried to compile CLM3.0 with ifort, icc, on OS=Linux, but then I got an error which saying can not open compiled module file. Please help me. Does anybody know what happen? Thank you.
Best,
Rima

------------------------------------------------------------------------------------------------
ifort -c -free -c -r8 -i4 -recursive -extend_source -O2 -convert big_endian -prec-div -prec-sqrt -fp-speculation safe -mp1 -fp-model precise -ftz -I/sw/sgi
/mpt/1.22pre2/include /home/h/hbkrima1/bismillah/clm3/src/main/time_manager.F90
ifort -c -free -c -r8 -i4 -recursive -extend_source -O2 -convert big_endian -prec-div -prec-sqrt -fp-speculation safe -mp1 -fp-model precise -ftz -I/sw/sgi
/mpt/1.22pre2/include /home/h/hbkrima1/bismillah/clm3/src/main/ncdio.F90
ifort -c -free -c -r8 -i4 -recursive -extend_source -O2 -convert big_endian -prec-div -prec-sqrt -fp-speculation safe -mp1 -fp-model precise -ftz -I/sw/sgi
/mpt/1.22pre2/include /home/h/hbkrima1/bismillah/clm3/src/main/system_messages.F90
fortcom: Error: /home/h/hbkrima1/bismillah/clm3/src/main/time_manager.F90, line 18: Error in opening the compiled module file. Check INCLUDE paths. [ESM
F_TIMEMGMTMOD]
use ESMF_TimeMgmtMod, only: &
-------^
fortcom: Error: /home/h/hbkrima1/bismillah/clm3/src/main/time_manager.F90, line 87: Conflicting attributes or multiple declaration of name. [ESMF_TIMEMGR
]
type(esmf_timemgr) :: tm_id ! time manager ID
--------^
(...)
fortcom: Error: /home/h/hbkrima1/bismillah/clm3/src/main/time_manager.F90, line 21: Name in only-list does not exist. [ESMF_TIMEDECREMENT]
esmf_timeincrement, esmf_timedecrement, &
--------------------------^
fortcom: Severe: Too many errors, exiting
compilation aborted for /home/h/hbkrima1/bismillah/clm3/src/main/time_manager.F90 (code 1)
gmake: *** [time_manager.o] Error 1
gmake: *** Waiting for unfinished jobs....
/home/h/hbkrima1/bismillah/clm3/src/main/ncdio.F90(1558): (col. 75) remark: LOOP WAS VECTORIZED.
-------------------------------------------------------------------------
 
Dear All,

I also tried to compile with pgf90, pgcc, mpif90, OS=Linux, different error message appears :
------------------------------------------------------------------------------------
pgf90 -o /gfs1/work/hbkrima1/clm3.0_OK/clm BalanceCheckMod.o BareGroundFluxesMod.o Biogeophysics1Mod.o Biogeophysics2Mod.o BiogeophysicsLakeMod.o CanopyFluxesMod.o DGVMAllocationMod.o DGVMEcosystemDynMod.o DGVMEstablishmentMod.o DGVMFireMod.o DGVMKillMod.o DGVMLightMod.o DGVMMod.o DGVMMortalityMod.o DGVMReproductionMod.o DGVMRestMod.o DGVMTurnoverMod.o DriverInitMod.o FracWetMod.o FrictionVelocityMod.o Hydrology1Mod.o Hydrology2Mod.o HydrologyLakeMod.o QSatMod.o RtmMod.o RunoffMod.o STATICEcosysDynMod.o SnowHydrologyMod.o SoilHydrologyMod.o SoilTemperatureMod.o SurfaceAlbedoMod.o SurfaceRadiationMod.o TridiagonalMod.o VOCEmissionMod.o abortutils.o accFldsMod.o accumulMod.o areaMod.o atm_lndMod.o atmdrvMod.o clm_csmMod.o clm_varcon.o clm_varctl.o clm_varpar.o clm_varsur.o clmtype.o clmtypeInitMod.o controlMod.o decompMod.o do_close_dispose.o do_restwrite.o driver.o f_wrappers.o fileutils.o filterMod.o get_cpustamp.o get_thread_num.o getdatetime.o histFileMod.o histFldsMod.o iniTimeConst.o iniTimeVar.o inicFileMod.o initGridCellsMod.o initializeMod.o iobinary.o lnd2atmMod.o lp_coupling.o mkglacier.o mkgridMod.o mklai.o mklanwat.o mkpft.o mkrank.o mksoicol.o mksoitex.o mksrfdatMod.o mkurban.o mpiinc.o nanMod.o ncdio.o pft2colMod.o pftvarcon.o program_csm.o program_off.o restFileMod.o shr_alarm_mod.o shr_cal_mod.o shr_const_mod.o shr_date_mod.o shr_file_mod.o shr_kind_mod.o shr_mpi_mod.o shr_msg_mod.o shr_orb_mod.o shr_sys_mod.o shr_timer_mod.o shr_vmath_fwrap.o shr_vmath_mod.o snowdp2lev.o spmdGathScatMod.o spmdMod.o subgridAveMod.o surfFileMod.o system_cmd.o system_messages.o t_error.o t_initialize.o t_pclstr.o t_pr.o t_reset.o t_setoption.o t_stamp.o t_start.o t_stop.o time_manager.o -Wl,-rpath,-L/sw/dataformats/netcdf/3.6.2/lib/ -lnetcdf -lnetcdff -llapack -L/usr/lib64 -Wl,-rpath=/usr/lib64 -libverbs -libumad -lpthread -lrt -L/gfs1/work/hbkrima1/clm3.0_OK/obj/esmf/lib/libO/linux_pgi -lesmf -L/sw/pgi/linux86-64/7.2/mpi/mvapich/lib -lmpich
/usr/bin/ld: cannot find -lnetcdf
-------------------------------------------------------------------
I've tried tracing /usr/bin/ld, it is empty, but how come that path appear on the compilation? Something to do with the netcdf library path? Thank you.

Best regards,
Rima
 
Top