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

netcdf.inc not found and the main Makefile

Hello All

I built and ran CAM3 successfully in several computers.
However, I failed to build CAM3 in one computer here where I have
the Rocks Cluster (i.e. CentOS) Linux distribution.

It turns out that on that system there are no NetCDF include files
in standard places (/usr/include, /usr/local/include, etc),
but only in a non-standard directory where I installed it.
Because of this the CAM3 configure script coud not find the file netcdf.inc and failed,
when testing the NetCDF functionality.
This happened despite my telling the configure script the correct location of NetCDF
and MPI include and library directories.

Apparently the CAM3 build succeded on other systems by using the netcdf.inc file it found
on standard directories, not the one pointed by INC_NETCDF.
Similar problems may happen when testing MPI and the Fortran compiler functionality.

I found out that a small change to the main Makefile:
code/cam1/models/atm/cam/bld/Makefile
fixes the problem.
Here is the patch:

*********

--- ../../code/cam1/models/atm/cam/bld/Makefile.original 2008-08-19 15:52:02.000000000 -0400
+++ ../../code/cam1/models/atm/cam/bld/Makefile 2008-08-19 19:04:01.000000000 -0400
@@ -170,12 +170,12 @@
echo "LDFLAGS: $(LDFLAGS)"
echo "OBJS: $(OBJS)"

-test_fc: test_fc.o
- $(FC) -o $@ test_fc.o $(LDFLAGS)
-test_nc: test_nc.o
- $(FC) -o $@ test_nc.o -L$(LIB_NETCDF) -lnetcdf $(LDFLAGS)
-test_mpi: test_mpi.o
- $(FC) -o $@ test_mpi.o $(LDFLAGS)
+test_fc: test_fc.F90
+ $(FC) -o $@ $< $(LDFLAGS)
+test_nc: test_nc.F90
+ $(FC) -I$(INC_NETCDF) -o $@ $< -L$(LIB_NETCDF) -lnetcdf $(LDFLAGS)
+test_mpi: test_mpi.F
+ $(FC) -I$(INC_MPI) -o $@ $< -L$(LIB_MPI) $(LDFLAGS)

# Architecture-specific flags and rules
#


********

No warranty, but it works for me. :)
I hope this can help somebody with the same problem.

Thank you,
Gus Correa
 
Top