2014-09-22 80 views
0

我有以下的Makefile。每當我運行make時,出現以下錯誤。Makefile:找不到對象文件

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 

任何幫助將不勝感激。

+0

您已經驗證缺口始終是一個定位符?你能鏈接到原始文件嗎?因爲它看起來可能會有一些解析錯誤。 – l0b0 2014-09-22 07:27:25

回答

1

好像你缺少-cmkl_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