Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 2652

Makefile and MKL

$
0
0

Hi,

  I am using MKL (the student version) with MPICH2.In my Makefile, the paths for MKL are hardcoded. How can I make it that they get more general? I mean, that now that my professor will check the project, assuming he was MKL installed in his system, how can he compile it? I would like to provide a Makefile that would be (almost) ready to run.

OBJSDIR    =   obj
OBJS    = $(OBJSDIR)/main.o	$(OBJSDIR)/IO.o	$(OBJSDIR)/alloc.o	$(OBJSDIR)/communication.o	$(OBJSDIR)/accuracy.o
SOURCE  = main.cpp	src/IO.cpp	src/alloc.cpp	src/communication.cpp	src/accuracy.cpp
HEADER =	headers/IO.h	headers/alloc.h	headers/communication.h	headers/accuracy.h
OUT     =       test
CXX     = ../../mpich-install/bin/mpic++
CXXFLAGS	=	-I../../intel/mkl/include	-Wl,--start-group	 -Wl,--end-group	-lpthread	-lm	-ldl	-Wall
LDFLAGS   =       ../../intel/mkl/lib/intel64/libmkl_scalapack_lp64.a       -Wl,--start-group       ../../intel/mkl/lib/intel64/libmkl_intel_lp64.a ../../intel/mkl/lib/intel64/libmkl_core.a  ../../intel/mkl/lib/intel64/libmkl_sequential.a    -Wl,--end-group ../../intel/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread       -lm     -ldl

all:	$(OBJSDIR)	$(OUT)

$(OBJSDIR):
	mkdir	$(OBJSDIR)

$(OUT):	$(OBJS)
	$(CXX)	$(OBJS)	-o	$(OUT)	$(CXXFLAGS)	$(LDFLAGS)
#	make	-f	Makefile	clean

# create/compile the individual files >>separately<<
$(OBJSDIR)/main.o:    main.cpp
	$(CXX)	-c	main.cpp	$(CXXFLAGS)	-o	$@

$(OBJSDIR)/IO.o:	src/IO.cpp
	$(CXX)	-c	src/IO.cpp	$(CXXFLAGS)	-o	$@

$(OBJSDIR)/alloc.o:    src/alloc.cpp
	$(CXX)	-c	src/alloc.cpp	$(CXXFLAGS)	-o	$@

$(OBJSDIR)/communication.o:    src/communication.cpp
	$(CXX)	-c	src/communication.cpp	$(CXXFLAGS)	-o	$@

$(OBJSDIR)/accuracy.o:	src/accuracy.cpp
	$(CXX)	-c	src/accuracy.cpp	$(CXXFLAGS)	-o	$@

.PHONY:	clean
clean:
	rm	-rf	$(OBJSDIR)/*.o

 

So, how to modify CXXFLAGS and LDFLAGS? The linker advisor didn't help much.


Viewing all articles
Browse latest Browse all 2652

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>