我正在尝试将Lapack库与我的Makefile和Fortran 90代码(gfortran)相关联,但每次键入时都会:make pkr_test
(pkr_test
是代码的名称)
我收到以下错误:
make[1]: * No rule to make target '/usr/ben/models/common/src/fitting.o'. Stop.
make[1]: Leaving directory '/usr/ben/models/common/src'
Makefile:20: recipe for target '/usr/ben/models/common/src/fitting.o' failed
make: * [/usr/ben/models/common/src/fitting.o] Error 2
我可以附加Makefile和Makefile。万一它会帮助你给我一个快速的解决方案。我实际上试图附上它,但我没有管理。
这是Makefile:
#
# Makefile for pqr_test
#
include ../../Makefile.in
#
MODS= $(DIR_test)wrt_two.o \
$(DIR_test)ppt_one.o \
$(DIR_test)cat_one.o \
$(DIR_test)uti_test.o \
$(DIR_test)ncdf_test.o \
$(DIR_test)quick_test.o \
$(DIR_test)ovr_one.o \
$(DIR_test)row_to.o \
$(DIR_test)fitting.o
#
OBJS=pqr_test.o
#
$(MODS) :
cd $(DIR_test) && make $(MODS)
#
pqr_test : $(MODS) $(OBJS)
cd $(DIR_test) && make $(MODS)
$(FC) $(FFLAGS) -L$(XML_LIB) -L$(NC_LIB_LOC) -L$(NC_LIB_LAPACK_LOC) -I$(NC_INCLUDE) -I$(NC_LAPACK_INCLUDE) \
-Wl,-rpath,$(NC_LIB_LOC) $(NC_LIB_LAPACK_LOC) $(MODS) $(OBJS) $(NC_LIB) $(NC_LIB_LAPACK) \
-lflib -o ../bin/pqr_test
#
pqr_test.o : pqr_test.f90
cd $(DIR_test) && make $(MODS)
$(FC) $(FFLAGS) -I$(DIR_test) -I$(XML_INCLUDE) -I$(NC_INCLUDE) -I$(NC_LAPACK_INCLUDE) -c pqr_test.f90
#
cleanup:
mv $(DIR_test)*.o $(DIR_test)../obj/
mv $(DIR_test)*.mod $(DIR_test)../mod/
mv *.o ../obj/
#
clean:
rm -f $(DIR_test)*.o
rm -f $(DIR_test)../obj/*.o
rm -f $(DIR_test)*.mod
rm -f $(DIR_test)../obj/*.o
rm -f *.o
rm -f ../obj/*.o
#