Subject: CCM3 interpic Linux
From: Helfried Scheifinger (helfriedscheifinger@everyday.com)
Date: Sun Jun 03 2001 - 06:05:16 MDT
Hi,
I have been trying to compile the ccm3 tools (interpic, definesurf
and interpsst) on a Linux platform (SuSE 6.4).
When I combined Hong’s with Erik Kluzek's suggestions (Feb. 8 2001)
the request for the netcdf.h file disappeared,
the compilation continued and stopped with the
following messages:
Building dependency for wrap_nf.d
gcc: warp_nf.F90: linker input file unused since linking not done
Building dependency for main.d
Building dependency for lininterp.d
gcc: lininterp.F90: linker input file unused since linking not done
Building dependency for lencs.d
gcc: lencs.F90: linker input file unused since linking not done
Building dependency for gauaw.d
gcc: gauaw.F90: linker input file unused since linking not done
Building dependency for fmain.d
gcc: fmain.F90: linker input file unused since linking not done
Building dependency for bsslzr.d
gcc: bsslzr.F90: linker input file unused since linking not done
Building dependency for addglobal.d
make: *** No rule to make target 'features.h', needed by 'addgloabl.o'.
Stop.
It seems that the features.h file is not present (I could not find it) or
it is not produced.
Does anybody have a suggestion, what to do?
Helfried Scheifinger
Carminweg 6/2/9
A - 1210 Vienna
Austria
HelfriedScheifinger@everyday.com
I used the following modified version of the Makefile (for interpic):
#-----------------------------------------------------------------------
# This Makefile is for building interpic on a CRAY, SGI or SUN.
#
# Note: If the NetCDF libraries and include files are not in /usr/local/lib
# and /usr/local/include then define the environment variables
# LIB_NETCDF and INC_NETCDF to point to the proper locations.
#
# Note: VPATH only looks in the current directory !!!!
# Create file named Filepath for multiple search paths
#
#------------------------------------------------------------------------
# Set up special characters
null :=
space := $(null) $(null)
# Check for the NetCDF library and include directories
ifeq ($(LIB_NETCDF),$(null))
LIB_NETCDF := /usr/netcdf/lib
endif
ifeq ($(INC_NETCDF),$(null))
INC_NETCDF := /usr/netcdf/include
endif
# Check for directory in which to put executable
ifeq ($(EXEDIR),$(null))
EXEDIR := .
endif
# Hardwire the name of the executable
EXENAME := interpic
# Determine platform
UNAMES := $(shell uname -s)
UNAMEM := $(findstring CRAY,$(shell uname -m))
#------------------------------------------------------------------------
# Load dependency search path. Use local directory unless File Filepath exists.
#------------------------------------------------------------------------
dirs := .
FILEPATH := $(wildcard Filepath)
ifeq ($(FILEPATH),Filepath)
dirs := $(dirs) $(shell cat Filepath)
endif
# Set cpp search path.
cpp_dirs := $(dirs) $(INC_NETCDF)
cpp_path := $(foreach dir,$(cpp_dirs),-I$(dir)) # format for command line
# Expand any tildes in directory names. Change spaces to colons.
VPATH := $(foreach dir,$(cpp_dirs),$(wildcard $(dir)))
VPATH := $(subst $(space),:,$(VPATH))
# Get list of files and determine objects and dependency files
FIND_FILES = $(wildcard $(dir)/*.c $(dir)/*.F90 $(dir)/*.F)
FILES = $(foreach dir, $(dirs),$(FIND_FILES))
SOURCES := $(sort $(notdir $(FILES)))
OBJS := $(addsuffix .o, $(basename $(SOURCES)))
DEPS := $(addsuffix .d, $(basename $(SOURCES)))
# Linux specific flags and rules according to hong2108@honmail.net
FC = pgf77
FFLAGS = -DLinux $(cpp_path) -r8 -i4 -O2 -Mrecursive -Kieee -Mdalign
LDFLAGS = -L$(LIB_NETCDF) -lnetcdf
RM := rm
CC := gcc
CCFLAG := -c -I$(INC_NETCDF)
.SUFFIXES:
.SUFFIXES: .F90 .c .o .F
.F90.o:
$(FC) $(FFLAGS) $<
.c.o:
$(CC) $(CCFLAG) -o $@ $<
$(EXEDIR)/$(EXENAME): $(OBJS)
$(FC) -o $@ $(OBJS) $(LDFLAGS)
clean:
$(RM) -f *.o $(EXEDIR)/$(EXENAME)
realclean:
$(RM) -f *.o *.d $(EXEDIR)/$(EXENAME)
#------------------------------------------------------------------------
#!!!!!!!!!!!!!!!!DO NOT EDIT BELOW THIS LINE.!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#------------------------------------------------------------------------
# These rules cause a dependency file to be generated (using cpp)
# for each source file. Files contained in the ccm distribution are
# the only files which are considered in generating each dependency. The
# following filters are applied to exclude any files which are not in the
# distribution (e.g. system header files like stdio.h).
#
# 1) Remove full paths from dependencies. This means gnumake will not break
# if new versions of files are created in the directory hierarchy
# specified by VPATH.
#
# 2) Because of a) above, remove any file dependencies for files not in the
# ccm source distribution.
#
# Finally, add the dependency file as a target of the dependency rules. This
# is done so that the dependency file will automatically be regenerated
# when necessary.
#
# i.e. change rule
# make.o : make.c make.h
# to:
# make.o make.d : make.c make.h
#------------------------------------------------------------------------
%.d : %.c
@echo "Building dependency for $@"
@$(CPP) -M $(cpp_path) $< | head -1 | sed -e \
's/\:.*\//:\ /' > $@
%.d : %.F
@echo "Building dependency for $@"
@$(CPP) -M $(cpp_path) $< | sed -e \
'/\/usr\/include\//d' -e 's/\:.*\//:\ /' -e 's/$*.o/& $@/g' > $@
%.d : %.F90
@echo "Building dependency for $@"
@$(CPP) -M $(cpp_path) $< | sed -e \
'/\/usr\/include\//d' -e 's/\:.*\//:\ /' -e 's/$*.o/& $@/g' > $@
# if goal is clean or realclean then don't include .d files
# without this is a hack, missing dependency files will be created
# and then deleted as part of the cleaning process
INCLUDE_DEPS=TRUE
ifeq ($(MAKECMDGOALS), realclean)
INCLUDE_DEPS=FALSE
endif
ifeq ($(MAKECMDGOALS), clean)
INCLUDE_DEPS=FALSE
endif
ifeq ($(INCLUDE_DEPS), TRUE)
-include $(DEPS)
endif
This archive was generated by hypermail 2b27 : Tue Jan 22 2002 - 11:15:50 MST