Gfortran compiling error after replacing with f77 - makefile

QI need to compile some files using gfortran. I went to the makefile and replaced all the "f77" with "gfortran". However I get this error when I do "make"
gfortran -c verbal.f
gfortran -c trgl6_octa.f
gfortran -c trgl6_icos.f
gfortran -c gauss_trgl.f
gfortran -c gauss_leg.f
gfortran -c sgf_3d_fs.f
gfortran -c sgf_3d_w.f
f77 -c -o sgf_3d_2p_w.o sgf_3d_2p_w.f
make: f77: Command not found
make: *** [sgf_3d_2p_w.o] Error 127
I do not understand where in the make file (pasted below) there is a hidden f77 that did not get replaced. I checked all the sources files for "f77" and there was none. I am very confused.
#
# Objects
# -------
#
OBJ0 = verbal.o
OBJ1 = trgl6_octa.o trgl6_icos.o gauss_trgl.o gauss_leg.o
OBJ2 = sgf_3d_fs.o sgf_3d_w.o sgf_3d_2p_w.o
OBJ2A = sgf_3d_3p.o sgf_3d_3p_ewald.o sgf_3d_3p_qqq.o
OBJ3 = prtcl_3d_mob.o
OBJ30 = elm_geom.o abc.o interp_p.o printel.o
OBJ33 = slp_trgl6.o slp_trgl6_sing.o slp_trgl3_sing.o
OBJ4 = gel.o gel_inv.o
OBJ = $(OBJ0) $(OBJ1) $(OBJ2) $(OBJ2A) $(OBJ3) $(OBJ30) $(OBJ33) $(OBJ4)
#
# link
# ----
#
prtcl_3d_mob: $(OBJ)
gfortran -c prtcl_3d_mob $(OBJ)
#
# compile
# ------
#
prtcl_3d_mob.o: prtcl_3d_mob.f
gfortran -c prtcl_3d_mob.f
trgl6_octa.o: trgl6_octa.f
gfortran -c trgl6_octa.f
trgl6_icos.o: trgl6_icos.f
gfortran -c trgl6_icos.f
verbal.o: verbal.f
gfortran -c verbal.f
sgf_3d_fs.o: sgf_3d_fs.f
gfortran -c sgf_3d_fs.f
sgf_3d_w.o: sgf_3d_w.f
gfortran -c sgf_3d_w.f
sgf_3d_3p.o: sgf_3d_3p.f
gfortran -c sgf_3d_3p.f
sgf_3d_3p_ewald.o: sgf_3d_3p_ewald.f
gfortran -c sgf_3d_3p_ewald.f
sgf_3d_3p_qqq.o: sgf_3d_3p_qqq.f
gfortran -c sgf_3d_3p_qqq.f
gel.o: gel.f
gfortran -c gel.f
gel_inv.o: gel_inv.f
gfortran -c gel_inv.f
prtcl_3d_geo.o: prtcl_3d_geo.f
gfortran -c prtcl_3d_geo.f
interp_p.o: interp_p.f
gfortran -c interp_p.f
abc.o: abc.f
gfortran -c abc.f
printel.o: printel.f
gfortran -c printel.f
elm_geom.o: elm_geom.f
gfortran -c elm_geom.f
slp_trgl6.o: slp_trgl6.f
gfortran -c slp_trgl6.f
slp_trgl6_sing.o: slp_trgl6_sing.f
gfortran -c slp_trgl6_sing.f
slp_trgl3_sing.o: slp_trgl3_sing.f
gfortran -c slp_trgl3_sing.f
gauss_leg.o: gauss_leg.f
gfortran -c gauss_leg.f
gauss_trgl.o: gauss_trgl.f
gfortran -c gauss_trgl.f
#
# clean
# -----
#
clean:
rm -f core
rm -f $(OBJ) prtcl_3d_mob
rm -f prtcl_3d_mob.net prtcl_3d_mob.out
rm -f matrix_inverse.out
rm -f particle_elements.out
#
# purge
# ---
#
purge:
rm -f core
rm -f $(OBJ) prtcl_3d_mob
rm -f prtcl_3d_mob.net prtcl_3d_mob.out
rm -f matrix_inverse.out
rm -f particle_elements.out
#
# clobber
# ---
#
clobber:
rm *
#
# all
# ---
#
all:
make prtcl_3d_mob

GNU make has a number of implicit rules https://www.gnu.org/software/make/manual/make.html#Catalogue-of-Rules
By default, it will compile .f files with the rule $(FC) $(FFLAGS) -c where by default FC is set to f77 (see link above for all of this).
As an explicit rule ("from .f to .o") is not found for a file, make invokes the default rule.
Solutions: either one of the two
Set FC to gfortran
add an explicit rule for sgf_3d_2p_w.o
In general, I write the rule myself as
%.o: %.f90
$(FC) $(FFLAGS) -c $<
in the Makefile. It makes it obvious that I need to define FC and FFLAGS.
Also, you can then remove all of the individual rules for compiling your files.

Related

Fortran Makefile with 2 executables

I'm trying to compile 2 F90 files and to execute each one separately using a Makefile. The language used is fortran. I am not used to this so I need your help.
The first file is called HECESE_avec_modif.f90 and the second one is called hecese_seq.f90.
The makefile is below :
# Define dependance for suffix .FFREE
# -----------------------------------
.SUFFIXES: .exe .out .o .f .f90
#
# Compilation options for ifort
# ---------------------------------
# ---------------------------------
#FLAGS_fred = -free -O2 -traceback -mcmodel=large\
# -check overflow -check bounds
#FLAGS_fred = -FR -free -ftz -O3 -fPIC
#F90_COMPILER = /opt/intel/bin/ifort
#---------------------------------------------------------
#
# Compilation options for G95
#
#FLAGS_fred = -C -O3 -ffree-form -ffree-line-length-huge -fzero
#FLAGS_fred = -O5 -ffree-form -ffree-line-length-huge -fzero
#F90_COMPILER = g95
#
# Compilation options for GFortran
FLAGS_fred = -ffree-form -ffree-line-length-none -O3 #-march=native
F90_COMPILER = gfortran -m64
F90_COMPILER7 = gfortran-7 -m64
#FLAGS_fred = -O3
#F90_COMPILER = gfortran
#FLAGS_CPPFOR = -L/usr/local/gfortran/lib/x86_64/
#
#
#FLAGS_fred = -free -O4
#
#
# ***************************************************
# ***************************************************
# ** **
# ** definition of file groups for F. Waymel **
# ** **
# ***************************************************
# ***************************************************
#
# 0.) group of all modules containing common variables
# for multiblocs initialisation
# ----------------------------------------------------
#
MAIN = HECESE_avec_modif.f90
MAIN2 = hecese_seq.f90
#
# Compilation of object files :
# -----------------------------
#
MAIN_OBJ =$(MAIN:.f90=.o)
MAIN_OBJ2 =$(MAIN2:.f90=.o)
# Creation of executable:
# ---------------------------------
#
#DEST1 = ~/bin
EXEC = hecesevfinale.out
EXEC2 = heceseseq.out
all : $(EXEC) $(EXEC2)
$(EXEC):$(MAIN_OBJ)
$(F90_COMPILER) -g $(FLAGS_fred) -o $(EXEC) $(MAIN_OBJ)
$(EXEC2):$(MAIN_OBJ2)
$(F90_COMPILER) -g $(FLAGS_fred) -o $(EXEC2) $(MAIN_OBJ2)
#
%.o : %.mod
.f90.o:
$(F90_COMPILER) -g $(FLAGS_fred) -c $<
# $(F90_COMPILER) -g $(FLAGS_fred) -c $<
%.o : %.mod
.f90.o:
$(F90_COMPILER) -g $(FLAGS_fred) -c $<
# $(F90_COMPILER) -g $(FLAGS_fred) -c $<
clean:
rm -f *.o *.mod *.out
#depend .depend:
# makedepf90 metas.f90 $(SOURCES90_fred1) $(SOURCES90_fred2) $(SOURCES90_mwl) $(SOURCES90_mwl2) > .depend
#include .depend
I think that I made a mistake related to the second file.
The message I get when I execute this makefile is :
gfortran -m64 -g -ffree-form -ffree-line-length-none -O3 -o hecesevfinale.out HECESE_avec_modif.o
make: *** No rule to make target 'hecese_seq.o', needed by 'heceseseq.out'. Stop.
I have another problem when I try to execute make clean.
I get :
makefile:82: warning: overriding recipe for target '.f90.o'
makefile:76: warning: ignoring old recipe for target '.f90.o'
Can you help me, please ?

make: Nothing to be done for 'all'. in Omnet

After Installng Omnetpp 5.5.1 in Ubuntu 18.04 ,For any folder in Omnetpp, make command is not making any sense.
As it showing the following message:
make: Nothing to be done for 'all'.
Even suggested methods on Internet are not working in my case.Please help.
My makefile is following for Aloha Folder.
#
# OMNeT++/OMNEST Makefile for aloha
#
# This file was generated with the command:
# opp_makemake -f --deep
#
# Name of target to be created (-o option)
TARGET = aloha$(D)$(EXE_SUFFIX)
TARGET_DIR = .
# User interface (uncomment one) (-u option)
USERIF_LIBS = $(ALL_ENV_LIBS) # that is, $(TKENV_LIBS) $(QTENV_LIBS) $(CMDENV_LIBS)
#USERIF_LIBS = $(CMDENV_LIBS)
#USERIF_LIBS = $(TKENV_LIBS)
#USERIF_LIBS = $(QTENV_LIBS)
# C++ include paths (with -I)
INCLUDE_PATH =
# Additional object and library files to link with
EXTRA_OBJS =
# Additional libraries (-L, -l options)
LIBS =
# Output directory
PROJECT_OUTPUT_DIR = out
PROJECTRELATIVE_PATH =
O = $(PROJECT_OUTPUT_DIR)/$(CONFIGNAME)/$(PROJECTRELATIVE_PATH)
# Object files for local .cc, .msg and .sm files
OBJS = $O/Host.o $O/Server.o
# Message files
MSGFILES =
# SM files
SMFILES =
#------------------------------------------------------------------------------
# Pull in OMNeT++ configuration (Makefile.inc)
ifneq ("$(OMNETPP_CONFIGFILE)","")
CONFIGFILE = $(OMNETPP_CONFIGFILE)
else
ifneq ("$(OMNETPP_ROOT)","")
CONFIGFILE = $(OMNETPP_ROOT)/Makefile.inc
else
CONFIGFILE = $(shell opp_configfilepath)
endif
endif
ifeq ("$(wildcard $(CONFIGFILE))","")
$(error Config file '$(CONFIGFILE)' does not exist -- add the OMNeT++ bin directory to the path so that opp_configfilepath can be found, or set the OMNETPP_CONFIGFILE variable to point to Makefile.inc)
endif
include $(CONFIGFILE)
# Simulation kernel and user interface libraries
OMNETPP_LIBS = $(OPPMAIN_LIB) $(USERIF_LIBS) $(KERNEL_LIBS) $(SYS_LIBS)
COPTS = $(CFLAGS) $(IMPORT_DEFINES) $(INCLUDE_PATH) -I$(OMNETPP_INCL_DIR)
MSGCOPTS = $(INCLUDE_PATH)
SMCOPTS =
# we want to recompile everything if COPTS changes,
# so we store COPTS into $COPTS_FILE and have object
# files depend on it (except when "make depend" was called)
COPTS_FILE = $O/.last-copts
ifneq ("$(COPTS)","$(shell cat $(COPTS_FILE) 2>/dev/null || echo '')")
$(shell $(MKPATH) "$O" && echo "$(COPTS)" >$(COPTS_FILE))
endif
#------------------------------------------------------------------------------
# User-supplied makefile fragment(s)
# >>>
# <<<
#------------------------------------------------------------------------------
# Main target
all: $(TARGET_DIR)/$(TARGET)
$(TARGET_DIR)/% :: $O/%
#mkdir -p $(TARGET_DIR)
$(Q)$(LN) $< $#
ifeq ($(TOOLCHAIN_NAME),clangc2)
$(Q)-$(LN) $(<:%.dll=%.lib) $(#:%.dll=%.lib)
endif
$O/$(TARGET): $(OBJS) $(wildcard $(EXTRA_OBJS)) Makefile $(CONFIGFILE)
#$(MKPATH) $O
#echo Creating executable: $#
$(Q)$(CXX) $(LDFLAGS) -o $O/$(TARGET) $(OBJS) $(EXTRA_OBJS) $(AS_NEEDED_OFF) $(WHOLE_ARCHIVE_ON) $(LIBS) $(WHOLE_ARCHIVE_OFF) $(OMNETPP_LIBS)
.PHONY: all clean cleanall depend msgheaders smheaders
.SUFFIXES: .cc
$O/%.o: %.cc $(COPTS_FILE) | msgheaders smheaders
#$(MKPATH) $(dir $#)
$(qecho) "$<"
$(Q)$(CXX) -c $(CXXFLAGS) $(COPTS) -o $# $<
%_m.cc %_m.h: %.msg
$(qecho) MSGC: $<
$(Q)$(MSGC) -s _m.cc -MD -MP -MF $O/$(basename $<)_m.h.d $(MSGCOPTS) $?
%_sm.cc %_sm.h: %.sm
$(qecho) SMC: $<
$(Q)$(SMC) -c++ -suffix cc $(SMCOPTS) $?
msgheaders: $(MSGFILES:.msg=_m.h)
smheaders: $(SMFILES:.sm=_sm.h)
clean:
$(qecho) Cleaning $(TARGET)
$(Q)-rm -rf $O
$(Q)-rm -f $(TARGET_DIR)/$(TARGET)
$(Q)-rm -f $(TARGET_DIR)/$(TARGET:%.dll=%.lib)
$(Q)-rm -f $(call opp_rwildcard, . , *_m.cc *_m.h *_sm.cc *_sm.h)
cleanall:
$(Q)$(MAKE) -s clean MODE=release
$(Q)$(MAKE) -s clean MODE=debug
$(Q)-rm -rf $(PROJECT_OUTPUT_DIR)
# include all dependencies
-include $(OBJS:%=%.d) $(MSGFILES:%.msg=$O/%_m.h.d)
This aforementioned file is missing some information like c++ INCLUDE_PATH and EXTRA_OBJS and LIBS.Is this the reason for not being run?Please Help.
The makefile says that 'Nothing to be done' because the executable is present and up to date, so it is indeed nothing to be done. This is not an error.
As you have indicated, you can execute ./aloha and then that throws a runtime error. This is NOT related to the build process.

modifying Makefile for silverfrost FTN95 ( Windows)

Compiling error
I am quite new to Fortran coding.
Currently, I have a makefile which has been previously used by original authors to compile the Fortran codes in Linux. However, I cannot understand what needs to be changed in the previous makefile to run it in Windows-based compiler Silverfrost FTN95.
While trying to compile in FTN95 I encountered the following error:
C:\Users\Geo-TGS\Documents\landslidemodel\src\TRIGRS>MAKE TPX
mpif90 -w -O3 -w -O3 -c ssizgrd.f95
process_begin: CreateProcess(NULL, mpif90 -w -O3 -w -O3 -c ssizgrd.f95, ...) failed.
make (e=2): The system cannot find the file specified.
makefile:59: recipe for target `ssizgrd.o' failed
MAKE: *** [ssizgrd.o] Error 2
C:\Users\Geo-TGS\Documents\landslidemodel\src\TRIGRS>make trg
mpif90 -w -O3 -w -O3 -c grids.f95
process_begin: CreateProcess(NULL, mpif90 -w -O3 -w -O3 -c grids.f95, ...) failed.
make (e=2): The system cannot find the file specified.
makefile:59: recipe for target `grids.o' failed
make: *** [grids.o] Error 2
Below is the Makefile code:
TRG = trg
PRG = prg
TPX = tpx
OBJT90 = trigrs.o flux.o prpijz.o svxmdv.o svijz.o dzero_brac.o
OBJT95 = grids.o input_vars.o model_vars.o dsimps.o input_file_defs.o iverson.o pstpi.o satfin.o savage.o steady.o trini.o unsinf.o ivestp.o pstpf.o rnoff.o satinf.o smallt.o svgstp.o unsfin.o unsth.o ssizgrd.o svlist.o
OBJT77 = calerf.o dbsct.o derfc.o irdgrd.o irdswm.o isvgrd.o roots.o srdgrd.o srdswm.o ssvgrd.o
OBJP90 = trigrs_p.o partial_p.o flux.o flux_p.o prpijz.o svxmdv.o svijz.o dzero_brac.o srdgrd_p.o irdgrd_p.o
OBJP95 = modules_p.o grids.o input_vars.o model_vars.o dsimps.o input_file_defs.o iverson.o pstpi.o pstpi_p.o satfin.o satfin_p.o savage.o steady.o trini.o trini_p.o unsinf.o unsinf_p.o ivestp.o ivestp_p.o pstpf.o pstpf_p.o rnoff.o satinf.o satinf_p.o smallt.o svgstp.o svgstp_p.o unsfin.o unsfin_p.o unsth.o unsth_p.o ssizgrd.o ssizgrd_p.o svlist.o rnoff_p.o steady_p.o
OBJP77 = calerf.o dbsct.o derfc.o irdgrd.o irdswm.o irdswm_p.o isvgrd.o roots.o srdgrd.o srdswm.o srdswm_p.o ssvgrd.o
OBJX90 = tpindx.o nxtcel.o
OBJX95 = ssizgrd.o
OBJX77 = isvgrd.o mpfldr.o rdflodir.o sindex.o slofac.o srdgrd1.o
LIBS =
CC = gcc -O3
CCFLAGS = -lgsl -lgslcblas -lm
FC = ftn95 -w -O3
FFLAGS =
F90 = f95 -w -O3
MPIF90 = mpif90 -w -O3
F90FLAGS = -w -O3
LDFLAGS = -w -O3
all: $(TRG) $(PRG)
#-----------------------------------------------------------------
$(TRG): $(OBJT95) $(OBJT90) $(OBJT77)
$(F90) $(CCLIBS) $(LDFLAGS) -o $# $(OBJT95) $(OBJT90) $(OBJT77) $(CCFLAGS) $(LIBS)
$(PRG): $(OBJP95) $(OBJP90) $(OBJP77)
$(MPIF90) $(CCLIBS) $(LDFLAGS) -o $# $(OBJP95) $(OBJP90) $(OBJP77)
$(CCFLAGS) $(LIBS)
$(TPX): $(OBJX95) $(OBJX90) $(OBJX77)
$(F90) $(CCLIBS) $(LDFLAGS) -o $# $(OBJX95) $(OBJX90) $(OBJX77) $(CCFLAGS) $(LIBS)
#-----------------------------------------------------------------
clean:
rm -f $(TRG) $(TPX) $(PRG)
rm -rf $(OBJT95) $(OBJT90) $(OBJT77) $(OBJP95) $(OBJP90) $(OBJP77)
rm -rf $(OBJX95) $(OBJX90) $(OBJX77)
rm -rf *.mod *.exe *.stackdump
.SUFFIXES: $(SUFFIXES) .f90 .f .c .f95
.f90.o:
$(MPIF90) $(F90FLAGS) -c $<
.f.o:
$(MPIF90) $(F90FLAGS) -c $<
.c.o:
$(CC) $(CCINCLUDE) -c -w $<
.f95.o:
$(MPIF90) $(F90FLAGS) -c $<
What changes need to be made for the code to compile?

/usr/bin/ld: cannot find -lmkl_rt When compiling makefile

here is the make file
# EXTRALIBS = -L/opt/SUNWspro/lib -lF77 -lM77 -lsunmath -lfsu
# LAPACK = -L/home/bramley/lib -llapack95
# BLAS = -L/home/bramley/lib -lblas95
# F95= /usr/local/intel/compiler60/ia32/bin/ifc
# OPTS= -O -w
# LIBS = $(LAPACK) $(BLAS)
include make.inc
runLU: luDriver.o LU8.o LU4.o rowswp.o elapsedtime.o kinds.mod \
utilities.o swaps.o checkLU.o WriteParameters.o writeB.o Writeipiv.o
$(F95) $(INCS) -o runLU $(OPTS) luDriver.o LU8.o LU4.o kinds.o \
utilities.o swaps.o elapsedtime.o WriteParameters.o checkLU.o \
rowswp.o writeB.o Writeipiv.o $(LIBS)
luDriver.o: luDriver.f90 kinds.mod
$(F95) $(OPTS) -c luDriver.f90
LU4.o: LU4.c
$(CC) $(INCS) $(OPTS) -c LU4.c
LU8.o: LU8.c
$(CC) $(INCS) $(OPTS) -c LU8.c
rowswp.o: rowswp.f90 kinds.mod
$(F95) $(OPTS) -c rowswp.f90
WriteParameters.o: WriteParameters.f90
$(F95) $(OPTS) -c WriteParameters.f90
kinds.mod: kinds.f90
$(F95) $(OPTS) -c kinds.f90
elapsedtime.o: elapsedtime.f90
$(F95) $(OPTS) -c elapsedtime.f90
checkLU.o: checkLU.f90 kinds.mod
$(F95) $(OPTS) -c checkLU.f90
swaps.o: swaps.f90 kinds.mod
$(F95) $(OPTS) -c swaps.f90
utilities.o: utilities.f90 kinds.mod
$(F95) $(OPTS) -c utilities.f90
writeB.o: writeB.f90
$(F95) $(OPTS) -c writeB.f90
Writeipiv.o: Writeipiv.f90
$(F95) $(OPTS) -c Writeipiv.f90
clean:
/bin/rm -f *.o *.mod runLU log B ipiv
kleen:
/bin/rm -f *.o *.mod runLU log results B ipiv
and here is make.inc
# F90 = ifort
F90 = gfortran
CC = gcc
F95 = $(F90)
OPTS = -O3
MKLROOT = /opt/intel/composer_xe_2013.3.163/mkl
LIBS = -L$(MKLROOT)/lib/intel64 -lmkl_rt -lpthread -lm
INCS = -I.
WHat should i do here when it says -lmkl_rt is not found ???
Use
source /opt/intel/composerxe/bin/compilervars.sh intel64
(best to put it in bash_profile). Adjust the path according to your installation.
It sets the correct LIBRARY_PATH variable (not LD_LIBRARY_PATH, that is for runtime!)
You should set the variable LD_LIBRARY_PATH and point it to the directory containing the missing library.

makefile-compiling-back-and-forth - follow up

In continuation with my earlier question
Makefile - compiling back and forth
I made an attempt in creating a single Makefile. The two subdirectories are HAM-src and GFS-src. However, I am still unable to build it. I paste my Makefile below:
export
SHELL = /bin/sh
top_srcdir=./Temp
objdir=$(top_srcdir)/obj
bindir=${exec_prefix}/bin
cfssrcdir=${top_srcdir}/GFS-src
hamsrcdir=${top_srcdir}/HAM-src
incdir=${top_srcdir}/include
exec=${bindir}/esm_gfs-ham_v0
PROG=$(exec)
LDR = mpxlf90_r -qsmp=noauto
FFLAG90 = $(OPTS90) $(FINCS) -qfree=f90 -NS2048 -qmoddir=$(objdir) -I$(objdir)
FFLAGM = -NS2048 -qfixed -qmoddir=$(objdir) -I$(objdir)
F77 = mpxlf95
F90 = mpxlf95
F90_x = xlf90_r
F90_r = mpxlf95_r
SRCHAM = $(hamsrcdir)/ham_control.f90 $(hamsrcdir)/mo_filename.f90 \
$(hamsrcdir)/ham_namelist.f90 $(hamsrcdir)/ham_submodel.f90 \
$(hamsrcdir)/ham_submodel_diag.f90 $(hamsrcdir)/ham_ham.f90
SRCGFS_MOD=$(cfssrcdir)/machine.f $(cfssrcdir)/resol_def.f \
$(cfssrcdir)/omegas.f $(cfssrcdir)/cnvcld_v.f
OBJGFS_MOD = $(patsubst $(cfssrcdir)/%.f,$(objdir)/%.o,$(SRCGFS_MOD))
OBJHAM = $(patsubst $(hamsrcdir)/%.f90,$(objdir)/%.o,$(SRCHAM))
.SUFFIXES: $(SUFFIXES) .f90 .f .o
all: $(PROG)
$(PROG): $(OBJHAM) $(OBJGFS_MOD)
$(LDR) $(CFS_LDFLAGS) -o $# $(OBJGFS_MOD) $(OBJHAM) $(CFS_LIBS) -L$(LDFLAGS)
$(objdir)/%.o: $(cfssrcdir)/%.f
$(F77) $(FFLAGS) -c $< -o $#
$(objdir)/%.o: $(hamsrcdir)/%.f90
$(F90_r) $(F90FLAGS) -c $< -o $#
########## dependencies for $(hamsrcdir) ###########
ham_filename.o: ham_control.o
ham_namelist.o: ham_control.o ham_filename.o
ham_submodel.o: ham_control.o ham_namelist.o $(objdir)/resol_def.o
ham_submodel_diag.o: ham_submodel.o
########## dependencies for $(cfssrcdir) ###########
$(objdir)/omegas.o: $(cfssrcdir)/omegas.f
$(F77) $(FFLAGM) -c $(cfssrcdir)/omegas.f -o $#
$(objdir)/cnvcld_v.o: $(cfssrcdir)/cnvcld_v.f
$(F77) $(FFLAGM) -c $(cfssrcdir)/cnvcld_v.f -o $#
The error:
mpxlf95_r -q64 -O3 -qstrict -qMAXMEM=-1 -qarch=auto -qtune=auto -qcache=auto -qfloat=fltint -qsuffix=cpp=f90 -lessl_r -lmass -lmassv -I./Temp/include -I./Temp/HAM-src -qmoddir=./Temp/obj -I./Temp/obj -c ./Temp/HAM-src/ham_namelist.f90 -o ./Temp/obj/ham_namelist.o
** ham_namelist === End of Compilation 1 ===
1501-510 Compilation successful for file ham_namelist.f90.
mpxlf95_r -q64 -O3 -qstrict -qMAXMEM=-1 -qarch=auto -qtune=auto -qcache=auto -qfloat=fltint -qsuffix=cpp=f90 -lessl_r -lmass -lmassv -I./Temp/include -./Temp/HAM-src -qmoddir=./Temp/obj -I./Temp/obj -c ./Temp/HAM-src/ham_submodel.f90 -o ./Temp/obj/ham_submodel.o
"./Temp/HAM-src/ham_submodel.f90", line 425.7: 1514-219 (S) Unable to access module symbol file for module resol_def. Check path and file permissions of file. Use association not done for this module.
1501-511 Compilation failed for file ham_submodel.f90.
gmake: *** [/gpfs1/home/cccrmod/ham_expt_dec11/regrid_test/CFS-HAM/SORC_CFS-HAM/Temp/obj/ham_submodel.o] Error 1
Why makefile does not compile the resol_def.f module on encountering the dependency?
Another issue - my makefile is not working properly. It goes in a sequence in which the sources are defined.
This is difficult to untangle (a minimal, complete example really would help), but I'd suggest you change this
ham_submodel.o: ham_control.o ham_namelist.o $(objdir)/resol_def.o
to this
$(objdir)/ham_submodel.o: ham_control.o ham_namelist.o $(objdir)/resol_def.o
and see if that solves the first problem. I don't understand the last line of your question ("Another issue...").

Resources