Scalahansolo
Scalahansolo

Reputation: 3055

Makefile: object file not found

I have the following Makefile. Whenever I run make, I get the following error.

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

I have been trying to figure this out for a while now with no luck.

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

Any help would be greatly appreciated.

Upvotes: 0

Views: 945

Answers (1)

Sagar Sakre
Sagar Sakre

Reputation: 2426

Seems like you are missing -c in mkl_matrix_multiply.o rule.

Modify your makefile as

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

Upvotes: 1

Related Questions