How to Install MKL

How to Install MKL
Revision 1.1
Date
6/30/11
Revision
1.1
Author
Description
tkubaska
Changed references to 8.0.1 to 8.1.1
To install the Matrix Kernel Library (MKL), you must have an MKL license. After obtaining
your license number, download the MKL installation tar from
http://marcbug.scc-dc.com/svn/repository/tarballs/. The file is called l_mkl_p_8.1.1.004.tgz.
You must install alien first. alien is a program that lets you convert an rpm package into a deb
package. Become root and issue the command.
apt-get install alien
Untar the file into any directory.
gunzip l_mkl_p_8.1.1.004.tgz
tar xvf l_mkl_p_8.1.1.004.tar
The installation script that you are about to invoke uses bash. To avoid a script error, break the sh
link to dash and remake it to bash. The commands to do this are as follows.
root@marc004:/bin# ls -l
lrwxrwxrwx 1 root root 4
root@marc004:/bin# which
/bin/bash
root@marc004:/bin# rm sh
root@marc004:/bin# ln -s
root@marc004:/bin# ls -l
lrwxrwxrwx 1 root root 9
root@marc004:/bin#
sh
2010-05-26 03:21 sh -> dash
bash
/bin/bash sh
sh
2010-07-23 13:53 sh -> /bin/bash
If you don’t do the above, the installation script gives you the following error.
./.././install/install: 78: Syntax error: Bad for loop variable
Untarring l_mkl_p_8.1.1.004.tar creates the directory l_mkl_p_8.1.1.004. Enter this
directory and issue the command,
./install.sh
You then see the following text menu. Choose to “Proceed with Serial Number” and then enter
your serial number.
*********************************************************************
"Welcome to Installation"
Please make your selection by entering an option:
"Intel(R) Math Kernel Library 8.1.1 for Linux*"
1.
2.
3.
4.
5.
6.
Install
Readme
Release Notes
Installation Guide
Product Web Site URL
Intel(R) Support Web Site URL
June 30, 2011
Page 1 of 5
Intel Labs
7. Technical Support Web Site URL
x. Exit.
Please type a selection
: 1
======================================================================
Please select an option to continue:
1. Proceed with Serial Number to install and register. [Recommended]
2. Provide the absolute path for an existing license file.
x. Exit.
Please type your selection
:
1
======================================================================
"Intel(R) Math Kernel Library 8.1.1 for Linux*" Serial Number Required
Please enter your serial number for this Product or select a different option.
Your Serial Number is in XXXX-XXXXXXXX format.
1. Where do I find my Serial Number?
2. Intel(R) Privacy Policy
x. Exit.
Please type your selection or Serial Number
:
Enter your serial number here
If requested, enter your email address.
Setup may attempt to connect to the Intel(R) Registration Center to
validate your Serial Number.
This may take several minutes depending on your network. Please wait...
You may press Ctrl+C to cancel.
Which of the following would you like to install?
1. Intel(R) Math Kernel Library 8.1.1 for Linux*
x. Quit
Please type a selection:1
Licensing information is displayed.
:
:
:
11. APPLICABLE LAWS: Any claim arising under or relating to this Agreement shall be governed by
the internal substantive law
s of the State of Delaware, without regard to principles of conflict of laws. You agree that the
terms of the United Nation
s Convention on Contracts for the Sale of Goods do not apply to this Agreement. You agree that
your distribution and export/
re-export of the Software and permitted modifications shall be in compliance with the laws,
regulations, orders or other restrictions of applicable export laws.
* Other names and brands may be claimed as the property of others
Enter 'accept' to continue, 'reject' to exit
accept
Extracting...
############################################################## [100%]
RPM version 4.7.2
Copyright (C) 1998-2002 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL
You then see an error message that says you do not have rpm installed. You get this message
even if you have installed rpm.
Usage: rpm [-afgpWcdlsKiv?] [-a|--all] [-f|--file] [-g|--group] [-p|--package] [-W|--ftswalk] [--pkgid] [--hdrid]
[--fileid] [--specfile] [--triggeredby] [--whatrequires] [--whatprovides] [--nomanifest] [-c|--configfiles]
June 30, 2011
Page 2 of 5
Intel Labs
:
:
:
[--dupes] [--filesbypkg] [--fileclass] [--filecolor] [--fscontext] [--fileprovide] [--filerequire]
[--filecaps]
ERROR: Unable to find rpm tool, please add its location to your PATH and restart installation
Installation failed. You can find installation files in
/tmp/install_temp.b0fdb6363f763881453d2a1c06f35262.
Press Enter to continue.
Press Enter. If requested, type in your name and affiliation. Then, enter your country code.
:
:
:
[ZW]
Zimbabwe
Please enter the 2 character code for your Country/Region.
Hit Enter to see the list of Country/Region codes. :
US
Please enter your Company :
University of Texas at Austin
Setup will now connect to the Intel(R) Registration Center to register
your product(s).
This may take several minutes depending on your network. Please wait...
You may press Ctrl+C to cancel.
**********************************************************************
"Installation and registration is complete "
Thank you for using Intel(R) Software Development Products, tools for improving application
performance.
If you are re-installing, you will not see the above text. You’ll just get your prompt back.
MKL may appear to be installed. It is not. Nor did you get an option to choose the location for
MKL. /opt/intel contains only the licenses directory. Enter the directory /tmp. Notice that
there is an install_temp.***** directory. Enter that directory. Notice that it contains an rpm
file for MKL.
root@marc004:/tmp# ls
install_temp.b0fdb6363f763881453d2a1c06f35262 ……
root@marc004:/tmp# ls install_temp.b0fdb6363f763881453d2a1c06f35262/
intel-mkl-8.1.1p-4.i386.rpm mkl_license
Run alien to convert this rpm file to a deb file. Be patient. This takes a while. Ignore the
warning for “unknown tag.”.
root@marc004:/tmp/install_temp.b0fdb6363f763881453d2a1c06f35262# alien -k intel-mkl-8.1.1p4.i386.rpm
error: incorrect format: unknown tag
Warning: Skipping conversion of scripts in package intel-mkl: postinst
Warning: Use the --scripts parameter to include the scripts.
intel-mkl_8.1.1p-4_all.deb generated
root@marc004:/tmp/install_temp.b0fdb6363f763881453d2a1c06f35262#
Install the deb file.
root@marc004:/tmp/install_temp.b0fdb6363f763881453d2a1c06f35262# dpkg -i intel-mkl_8.1.1p4_all.deb
This installs MKL in /opt/intel.
Selecting previously deselected package intel-mkl.
(Reading database ... 163944 files and directories currently installed.)
Unpacking intel-mkl (from intel-mkl_8.1.1p-4_all.deb) ...
Setting up intel-mkl (8.1.1p-4) ...
root@marc004:/tmp/install_temp.b0fdb6363f763881453d2a1c06f35262# cd /opt/intel/
June 30, 2011
Page 3 of 5
Intel Labs
root@marc004:/opt/intel# ls
licenses mkl
root@marc004:/opt/intel# cd mkl
root@marc004:/opt/intel/mkl# ls
8.1.1
root@marc004:/opt/intel/mkl# cd 8.1.1
root@marc004:/opt/intel/mkl/8.1.1# ls
doc examples include interfaces lib
root@marc004:/opt/intel/mkl/8.1.1#
tests
tools
uninstall.sh
It makes more sense for your MCPC/Rocky Lake installation to have MKL installed in /shared
rather than /opt. Tar up the intel directory in /opt, copy it to /shared, and untar it. These look
like the appropriate MKL files.
tekubasx@marc004:/shared$ ls -l
total 8
drwxr-xr-x 3 YourUserName YourUserName 4096 2010-07-23 10:04 YourUserName
drwxr-xr-x 4 root
root
4096 2010-07-23 15:19 intel
tekubasx@marc004:/shared$ ls intel
licenses mkl
tekubasx@marc004:/shared$ ls intel/mkl
8.1.1
tekubasx@marc004:/shared$ ls intel/mkl/8.1.1/
doc examples include interfaces lib tests tools uninstall.sh
tekubasx@marc004:/shared$
Then, enter the directory /shared/intel/mkl/8.1.1/tools/environment. Edit the scripts
here to refer to /shared and not /opt. Remove the space after the shebang in the csh files.
Restore the sh link to dash.
root@marc004:/shared# cd
root@marc004:/bin# ls -l
lrwxrwxrwx 1 root root 9
root@marc004:/bin# rm sh
root@marc004:/bin# ln -s
root@marc004:/bin# ls -l
lrwxrwxrwx 1 root root 9
root@marc004:/bin#
/bin
sh
2010-07-23 13:53 sh -> /bin/bash
/bin/dash sh
sh
2010-07-23 16:31 sh -> /bin/dash
Copy mklvars32.sh to your home’s bin. When you want to work with MKL, source this script.
Also source, the script crosscompile.sh that came with the cross compiler isntallation.
tekubasx@marc004:/shared/intel/mkl/8.1.1/tools/environment$ source mklvars32.sh
tekubasx@marc004:/shared/intel/mkl/8.1.1/tools/environment$ env |grep LD
OLDPWD=/shared/intel/mkl/8.1.1/tools
LD_LIBRARY_PATH=/shared/intel/mkl/8.1.1/lib/32::/opt/sccKit/lib
tekubasx@marc004:/shared/intel/mkl/8.1.1/tools/environment$ env |grep INC
INCLUDE=/shared/intel/mkl/8.1.1/include:
tekubasx@marc004:/shared/intel/mkl/8.1.1/tools/environment$
Open up the permissions on /shared/intel/mkl/8.1.1/examples and its subdirectories and
files to 777.
If you try to execute an example, as shown below, you get an error.
YourUserName@marc004:/shared/intel/mkl/8.1.1/examples/cblas$ make lib32 function=cblas_dgemm
make cblas_dgemmx.res _IA=32 IE=i D=lib32 MKL_LIB=mkl_ia32
make[1]: Entering directory `/shared/intel/mkl/8.1.1/examples/cblas'
mkdir -p ./_results/lib32_intel
icc -w -I../../include source/cblas_dgemmx.c source/common_func.c L/shared/intel/mkl/8.1.1/lib/32 -lmkl_ia32 -lguide -lpthread -lm -o
_results/lib32_intel/cblas_dgemmx.out
/tmp/icczauL0T.o(.text+0x1bef): In function `GetValuesI':
: undefined reference to `__isoc99_sscanf'
/tmp/icczauL0T.o(.text+0x1ce6): In function `GetValuesD':
: undefined reference to `__isoc99_sscanf'
June 30, 2011
Page 4 of 5
Intel Labs
/tmp/icczauL0T.o(.text+0x1df4): In function `GetValuesS':
: undefined reference to `__isoc99_sscanf'
/tmp/icczauL0T.o(.text+0x1f1f): In function `GetValuesC':
: undefined reference to `__isoc99_sscanf'
/tmp/icczauL0T.o(.text+0x1f65): In function `GetValuesC':
: undefined reference to `__isoc99_sscanf'
/tmp/icczauL0T.o(.text+0x206c): more undefined references to `__isoc99_sscanf' follow
make[1]: *** [cblas_dgemmx.res] Error 1
make[1]: Leaving directory `/shared/intel/mkl/8.1.1/examples/cblas'
make: *** [lib32] Error 2
YourUserName@marc004:/shared/intel/mkl/8.1.1/examples/cblas$
You must edit the makefile to correct this error. Add the definition of _GNU_SOURCE to the
compilation/link line.
Replace
CC = icc -w -I../../include
with
CC = icc -D_GNU_SOURCE -w -I../../include
June 30, 2011
Page 5 of 5
Intel Labs