gus@ldeo_columbia_edu
Member
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
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