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

Trouble with Make on x86 linux

Greetings. I'm just trying to get started with CAM and I'm having trouble getting it to build. I'm following the instructions starting on page 20 of the user guide.

I first ran the configure script with the -test option with no errors:

$ ../cam1/models/atm/cam/bld/configure -test -fc f95
creating /data/cam/test/Filepath
creating /data/cam/test/params.h
creating /data/cam/test/misc.h
creating /data/cam/test/preproc.h
creating /data/cam/test/Makefile
creating /data/cam/test/config_cache.xml
Looking for a valid GNU make... using gmake
Testing for Fortran 90 compatible compiler... using f95
Testing NetCDF library... ok
configure done.

However, when I run make it bombs out:

$ gmake 2> testgmake.txt

the contents of testgmake.txt are below:

cat: Srcfiles: No such file or directory
Makefile:1083: /data/cam/test/Depends: No such file or directory
makefile:15: /data/cam/cam1/models/utils/esmf/build//base: No such file or directory
gmake[1]: *** No rule to make target `/data/cam/cam1/models/utils/esmf/build//base'. Stop.
gmake: *** [/data/cam/test/esmf/lib/libO//libesmf.a] Error 2


I searched the message board archives but couldn't find any help.

Anyone have an idea?

Thanks!

--Brent
 
I'll respond to my own post. When the makefile calls the makefile for the ESMF, the variable ESMF_ARCH is undefined (a bug in the configure script?). I manually added this to the definitions list in the main makefile and made some progress.

After changing some of the defaults in the ESMF base_variables file, I now bomb out later in the build process.

Make runs for a while, building ESMF, before eventually dying. Here are the last few lines of the make process:

------------------------
f95 -c -I/data/cam/test/esmf/mod/modO/linux_intel -O -I/data/cam/cam1/models/utils/esmf -I/data/cam/cam1/models/utils/esmf/src/include -I/data/cam/cam1/models/utils/esmf/build/linux_intel -I/data/cam/cam1/models/utils/esmf/include -I/data/cam/cam1/models/utils/esmf/src/Infrastructure/mpiuni /data/cam/cam1/models/utils/esmf/src/Infrastructure/TimeMgmt/ESMF_TimeMgmtMod.F
ar cr /data/cam/test/esmf/lib/libO/linux_intel/libesmf.a ESMF_TimeMgmtMod.o
rm -f ESMF_TimeMgmtMod.o
gmake[7]: Leaving directory `/data/cam/test/esmf/mod/modO/linux_intel'
gmake[6]: Leaving directory `/data/cam/test/esmf/mod/modO/linux_intel'
gmake[5]: Leaving directory `/data/cam/cam1/models/utils/esmf/src/Infrastructure/TimeMgmt'
gmake[4]: Leaving directory `/data/cam/cam1/models/utils/esmf/src/Infrastructure'
gmake[3]: Leaving directory `/data/cam/cam1/models/utils/esmf/src'
gmake[2]: Leaving directory `/data/cam/cam1/models/utils/esmf'
gmake[1]: Leaving directory `/data/cam/cam1/models/utils/esmf'
f95 -c -DHIDE_MPI /data/cam/cam1/models/atm/cam/src/control/string_utils.F90
f95 -c -DHIDE_MPI /data/cam/cam1/models/csm_share/shr/shr_kind_mod.F90
f95 -c -DHIDE_MPI /data/cam/cam1/models/csm_share/shr/shr_mpi_mod.F90
f95 -c -DHIDE_MPI /data/cam/cam1/models/csm_share/shr/shr_sys_mod.F90
f95 -c -DHIDE_MPI /data/cam/cam1/models/atm/cam/src/control/mpishorthand.F
/data/cam/cam1/models/atm/cam/src/control/mpishorthand.F:1: error: misc.h: No such file or directory
gmake: *** [mpishorthand.o] Error 1
---------------------------------
misc.h resides in this build directory...any ideas why it's dying there?

Thanks

--Brent
 
I'll continue replying to myself...perhaps this can help someone else.

I fixed my earlier problem (the missing misc.h file) by altering the compile rules for fortran files and explicitly adding the build directory in the include path.

Make now proceeds further but now dies while compiling some of the modules, in particular the time_manager.F90 file.

This is the output from make containing the error messages:

---------------
f95 -c -I/data/cam/test -DHIDE_MPI /data/cam/cam1/models/atm/cam/src/control/time_manager.F90
In file /data/cam/cam1/models/atm/cam/src/control/time_manager.F90:873

off = esmf_timeinit(0, -offset, rc)
1
Error: Actual argument at (1) must be definable to match dummy INTENT = OUT/INOUT
In file /data/cam/cam1/models/atm/cam/src/control/time_manager.F90:694

off = esmf_timeinit(0, -offset, rc)
1
Error: Actual argument at (1) must be definable to match dummy INTENT = OUT/INOUT
In file /data/cam/cam1/models/atm/cam/src/control/time_manager.F90:644

off = esmf_timeinit(0, -offset, rc)
1
Error: Actual argument at (1) must be definable to match dummy INTENT = OUT/INOUT
In file /data/cam/cam1/models/atm/cam/src/control/time_manager.F90:188

step_size = esmf_timeinit(0, dtime, rc)
1
Error: Actual argument at (1) must be definable to match dummy INTENT = OUT/INOUT
make: *** [time_manager.o] Error 1
---------------------

I'm not sure how to begin to handle this error as it seems more code related and less related to the structure of the makefile.

Anyone?
 

eaton

CSEG and Liaisons
Perhaps the most difficult part of porting the cam3 code was dealing with the build of the esmf library. The version of esmf included with cam3 was prototype code. The build errors you're seeing now are looking like problems with the esmf build. What I would recommend is waiting just a week for the release of cam4 which includes a much more robust implementation of the esmf time manager code. It also includes the ability to link with a prebuilt esmf library. Note that CAM4 is being released as part of CCSM4 and not as a separate standalone model.
 
Top