linux - *** 没有规则可以创建 `module_netcdf_io.o' 目标,而 `driver.exe' 需要该目标。停止。错误

标签 linux makefile netcdf

我正在尝试在 Noah-MP 上运行 make。

但是,我不断收到此错误。 (*** 没有规则可以生成目标 module_netcdf_io.o',driver.exe' 需要的。停止。)

这是生成文件:

.SUFFIXES:
.SUFFIXES: .o .F

include user_build_options

OBJS =  module_sf_noahmplsm.o \
    module_model_constants.o \
    module_sf_myjsfc.o \
    module_sf_sfclay.o \
    module_sf_noahlsm.o \
    module_ascii_io.o \
    module_netcdf_io.o \
    module_io.o \
    kwm_date_utilities.o \
    module_sf_noahutl.o \
    driver.o

CMD = driver.exe

FFLAGS =    $(FREESOURCE) $(F90FLAGS)

all:    $(CMD)

driver.exe: $(OBJS)
    $(COMPILERF90) -o $(@) $(OBJS) $(NETCDFLIB)

.F.o:
    $(RM) $(*).f90
    $(CPP) $(CPPMACROS) $(NETCDFINC) $(*).F > $(*).f90
    $(COMPILERF90) -c $(FFLAGS) $(NETCDFINC) $(*).f90
    $(RM) $(*).f90

clean:
    $(RM) $(OBJS) $(CMD) *.mod *~

driver.exe:     driver.o
driver.exe:     module_sf_noahmplsm.o
driver.exe:     module_sf_noahutl.o
driver.exe:     module_io.o
module_io.o:        module_ascii_io.o
module_io.o:        module_netcdf_io.o
module_ascii_io.o:  kwm_date_utilities.o
module_sf_noahmplsm.o:  module_sf_myjsfc.o module_sf_sfclay.o module_sf_noahlsm.o
module_sf_myjsfc.o: module_model_constants.o

该文件夹包含以下文件:

graphics
bondville.dat
bondville.val
driver.F
GENPARM.TBL
kwm_date_utilities.F
Makefile
module_ascii_io.F
module_io.F
module_model_constants.F
module_netcdf_io.F
module_sf_myjsfc.F
module_sf_noahlsm.F
module_sf_noahmplsm.F
module_sf_noahutl.F
module_sf_sfclay.F
MPTABLE.TBL
README
SOILPARM.TBL
user_build_options
VEGPARM.TBL

将文件与 netcdf 目录链接所需的 user_build-options 如下所示:

#
#  Options for Linux with Intel Fortran
#

# COMPILERF90   =   ifort
# FREESOURCE    =   -free
# CPPMACROS =   -D_SIMPLE_DRIVER_
# F90FLAGS  =       -convert big_endian -g -O0 -check all,noshape,nopointer,noarg_temp_created -fp-model precise -fpe0 #-fp-model strict
# CPP       =   cpp -C -P -traditional 
# LIBS      =
# NETCDFDIR =   /home/tirtha/libs/netcdf/
# NETCDFINC =   /home/tirtha/libs/netcdf/include/
# NETCDFLIB =   /home/tirtha/libs/netcdf/lib/
# NCARG_ROOT    =   /home/tirtha/NCARG/ncl6.1/
# RM        =   rm -f
# CC        =   cc

我在运行代码之前删除了哈希标签。

最佳答案

(在评论中回答。参见Question with no answers, but issue solved in the comments (or extended in chat))

OP 写道:

I managed to solve the problem. It was a netcdf issue.

The main problem was that the compiler I had used to compile netcdf was not the same as the one I had used to compile Noah. Moreover, even when I was linking to a different netcdf directory (compiled with the same compiler), I wasn't using make clean. Doing that solved the problem.

关于linux - *** 没有规则可以创建 `module_netcdf_io.o' 目标,而 `driver.exe' 需要该目标。停止。错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26608221/

相关文章:

python - 如何修复 PYTHONPATHS 和 Python 的一个奇怪错误?

linux - llvm-cov 和 "unknown command line argument: -format=html"

c++ - makefile 不适用于 -std=c++11 选项

python - 您可以在 nc 文件中根据多年的日期范围提取数据吗?

python - 将气候学结果保存到 netcdf 文件

python - NetCDF 文件中的写入次数

c++ - 从另一个共享对象动态加载共享对象时的约束?

linux - 超时命令使用的信号

c++ - 在 Qt Creator 中缓慢构建 Symbian Qt 项目。耗时20多分钟

c++在我的makefile中包括特征