<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MKLROOT is set by sourcing in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005910#M18878</link>
    <description>&lt;P&gt;MKLROOT is set by sourcing the mklvars script in the MKL installation.&amp;nbsp; Of course, it requires such an installation.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Aug 2015 13:16:25 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2015-08-31T13:16:25Z</dc:date>
    <item>
      <title>Makefile and MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005907#M18875</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;&amp;nbsp; 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.&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;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 &amp;gt;&amp;gt;separately&amp;lt;&amp;lt;
$(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
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So, how to modify CXXFLAGS and LDFLAGS? The linker advisor didn't help much.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 12:03:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005907#M18875</guid>
      <dc:creator>Georgios_S_</dc:creator>
      <dc:date>2015-08-31T12:03:57Z</dc:date>
    </item>
    <item>
      <title>A typical solution would be</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005908#M18876</link>
      <description>&lt;P&gt;Sourcing mklvars.sh/csh or compilervars.sh/csh sets MKLROOT environment variable pointing to the MKL installation directory. Therefore you can use $(MKLROOT) in your Makefile. For example:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;CXXFLAGS = -I$(MKLROOT)/include	
LDFLAGS  = $(MKLROOT)/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_core.a $(MKLROOT)/lib/intel64/libmkl_sequential.a -Wl,--end-group $(MKLROOT)/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm -ldl&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 12:39:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005908#M18876</guid>
      <dc:creator>Roman_D_Intel1</dc:creator>
      <dc:date>2015-08-31T12:39:00Z</dc:date>
    </item>
    <item>
      <title>Hi Roman,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005909#M18877</link>
      <description>&lt;P&gt;Hi Roman,&lt;/P&gt;

&lt;P&gt;&amp;nbsp; this didn't work, since I am getting errors of this nature: g++: error: /lib/intel64/libmkl_scalapack_lp64.a: No such file or directory&lt;/P&gt;

&lt;P&gt;How to fix it?&lt;/P&gt;

&lt;P&gt;George&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 12:57:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005909#M18877</guid>
      <dc:creator>Georgios_S_</dc:creator>
      <dc:date>2015-08-31T12:57:12Z</dc:date>
    </item>
    <item>
      <title>MKLROOT is set by sourcing</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005910#M18878</link>
      <description>&lt;P&gt;MKLROOT is set by sourcing the mklvars script in the MKL installation.&amp;nbsp; Of course, it requires such an installation.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 13:16:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005910#M18878</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-08-31T13:16:25Z</dc:date>
    </item>
    <item>
      <title>That's it Tim, nice. I am</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005911#M18879</link>
      <description>&lt;P&gt;That's it Tim, nice. I am going to accept Roman's answer, but I would like Roman to edit his post with the information of Tim.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;George&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 14:00:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Makefile-and-MKL/m-p/1005911#M18879</guid>
      <dc:creator>Georgios_S_</dc:creator>
      <dc:date>2015-08-31T14:00:16Z</dc:date>
    </item>
  </channel>
</rss>

