Makefile:找不到对象文件

时间:2014-09-22 04:39:53

标签: makefile

我有以下Makefile。每当我运行make时,我都会收到以下错误。

ifort: error #10236: File not found: 'mkl_matrix_multiply.o'

我一直试图弄清楚这一段时间,但没有运气。

C = icc 
FC = ifort
LD = ifort

OPT = -Ofast -vec_report6 -simd -xhost -debug -traceback -ftrapuv
OP = -Ofast -vec_report6 -simd -xhost

LINK =  -L$(MKLROOT)/lib/intel64 $(MKLROOT)/lib/intel64/libmkl_blas95_ilp64.a -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -lpthread -lm 

INCLUDE =  -openmp -i8 -I$(MKLROOT)/include/intel64/ilp64 -I$(MKLROOT)/include

mkl_matrix_multiply.exe: mkl_matrix_multiply.o timing.o
                $(LD) -o mkl_matrix_multiply.exe mkl_matrix_multiply.o timing.o

mkl_matrix_multiply.o: mkl_matrix_multiply.f90
                $(FC) $(INCLUDE) $(LINK) mkl_matrix_multiply.f90

timing.o: timing.c
                $(CC) $(OP) -c timing.c

dummy.o: dummy.c
                $(CC) $(OP) -c dummy.c

clean:
                rm -f *.o matrix_multiply.exe

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

好像你遗失了-c中的mkl_matrix_multiply.o rule

将您的makefile修改为

C = icc 
FC = ifort
LD = ifort

OPT = -Ofast -vec_report6 -simd -xhost -debug -traceback -ftrapuv
OP = -Ofast -vec_report6 -simd -xhost

LINK =  -L$(MKLROOT)/lib/intel64 $(MKLROOT)/lib/intel64/libmkl_blas95_ilp64.a -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -lpthread -lm 

 INCLUDE =  -openmp -i8 -I$(MKLROOT)/include/intel64/ilp64 -I$(MKLROOT)/include

mkl_matrix_multiply.exe: mkl_matrix_multiply.o timing.o
                $(LD) -o mkl_matrix_multiply.exe mkl_matrix_multiply.o timing.o

mkl_matrix_multiply.o: mkl_matrix_multiply.f90
                $(FC) -c $(INCLUDE) $(LINK) mkl_matrix_multiply.f90

timing.o: timing.c
                $(CC) $(OP) -c timing.c

dummy.o: dummy.c
                $(CC) $(OP) -c dummy.c

clean:
                rm -f *.o matrix_multiply.exe