Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7110 Discussions

Setting MKL to use with Intel ParallelAccelerator

Saran
Beginner
927 Views

I am programming in Julia and for Parallel computing i am using ParallelAccelerator.jl package. I was able to setup OpenBLAS with g++. Kindly help me out to set up Intel MKL with g++. I have installed Julia using macOS dmg package hence I am unable find Make.inc file. This is article from Intel which explains setting up Julia with Intel MKL I am unable to setup Julia to use MKL instead its currently using OpenBLAS as you can see from the below output. 

julia> versioninfo()
Julia Version 0.5.2
Commit f4c6c9d4bb (2017-05-06 16:34 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)
julia> Pkg.build("ParallelAccelerator")
INFO: Building ParallelAccelerator
ParallelAccelerator: build.jl begin.
ParallelAccelerator: Building j2c-array shared library
System installed BLAS found
Checking for OpenMP support...
OpenMP support found in g++-7
Max OpenMP threads: 8
Using g++-7 to build ParallelAccelerator array runtime.
ParallelAccelerator: build.jl done.

This is how i setup openblas 

export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/opt/openblas/include/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/opt/openblas/lib/

Kindly let me know if there any other way to Setup MKL.

Thank You
Regards
Saran

0 Kudos
4 Replies
Jing_Xu
Employee
927 Views

Please check https://github.com/JuliaLang/julia. You can download the make.inc file there, as well.

Also, please try

export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$MKLROOT/include/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64/

0 Kudos
Saran
Beginner
927 Views

Jing X. (Intel) wrote:

export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$MKLROOT/include/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64/

Thank you for your response. I have added the path ~/.bash_profile rebuilt ParallelAccelerator.jl but now Julia is unable to detect there is no BLAS found .Hence I had to go back to OpenBLAS
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/opt/openblas/include/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/opt/openblas/lib/

And you have mentioned Make.inc file. In which folder do I place the file once I download it?

 

0 Kudos
Jing_Xu
Employee
927 Views

How did you set your environment variables? Did you set MKLROOT?

Make.inc is supposed to put into the root folder. Please take the folder structure on Github as a reference.

0 Kudos
Saran
Beginner
927 Views

Jing X. (Intel) wrote:
How did you set your environment variables? Did you set MKLROOT?

source /opt/intel/mkl/bin/mklvars.sh intel64
echo $MKLROOT 
/opt/intel/compilers_and_libraries_2017.4.181/mac/mkl

And in .bash_profile the following has been added
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$MKLROOT/include/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64/

As soon I do this the following is the result 
 

julia> Pkg.build("ParallelAccelerator")
INFO: Building ParallelAccelerator
ParallelAccelerator: build.jl begin.
ParallelAccelerator: Building j2c-array shared library
No BLAS installation detected (optional)
Using g++ to build ParallelAccelerator array runtime.
ParallelAccelerator: build.jl done.

julia> versioninfo()
Julia Version 0.5.2
Commit f4c6c9d4bb (2017-05-06 16:34 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

 

0 Kudos
Reply