Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
b4435f29
Unverified
Commit
b4435f29
authored
Jun 11, 2018
by
Robert Kimball
Committed by
GitHub
Jun 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set MKLROOT when building MKLDNN (#1093)
* finally have something almost acceptable
parent
0b95efa6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
external_mkldnn.cmake
cmake/external_mkldnn.cmake
+38
-3
No files found.
cmake/external_mkldnn.cmake
View file @
b4435f29
...
...
@@ -41,6 +41,38 @@ if(MKLDNN_INCLUDE_DIR AND MKLDNN_LIB_DIR)
return
()
endif
()
# This section sets up MKL as an external project to be used later by MKLDNN
set
(
MKLURLROOT
"https://github.com/intel/mkl-dnn/releases/download/v0.14/"
)
set
(
MKLVERSION
"2018.0.3.20180406"
)
if
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"Linux"
)
set
(
MKLPACKAGE
"mklml_lnx_
${
MKLVERSION
}
.tgz"
)
set
(
MKL_SHA1_HASH aea0d9ce65773cfcf5d8292b8db553bde965fc8f
)
elseif
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"Darwin"
)
set
(
MKLPACKAGE
"mklml_mac_
${
MKLVERSION
}
.tgz"
)
set
(
MKL_SHA1_HASH d76083fd5a79767a96572ad0e23e7f4c892818f2
)
elseif
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"Windows"
)
set
(
MKLPACKAGE
"mklml_win_
${
MKLVERSION
}
.tgz"
)
set
(
MKL_SHA1_HASH d607ca92d7bfc101f0828c0b005098b75531669b
)
endif
()
set
(
MKLURL
${
MKLURLROOT
}${
MKLPACKAGE
}
)
ExternalProject_Add
(
ext_mkl
PREFIX mkl
URL
${
MKLURL
}
URL_HASH SHA1=
${
MKL_SHA1_HASH
}
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
INSTALL_COMMAND
""
UPDATE_COMMAND
""
DOWNLOAD_NO_PROGRESS TRUE
EXCLUDE_FROM_ALL TRUE
)
ExternalProject_Get_Property
(
ext_mkl source_dir
)
set
(
MKL_ROOT
${
EXTERNAL_PROJECTS_ROOT
}
/mkldnn/src/external/mkl
)
set
(
MKL_SOURCE_DIR
${
source_dir
}
)
set
(
MKLDNN_GIT_REPO_URL https://github.com/intel/mkl-dnn
)
set
(
MKLDNN_GIT_TAG
"0e7ca73"
)
...
...
@@ -48,9 +80,11 @@ set(MKLDNN_GIT_TAG "0e7ca73")
if
(
${
CMAKE_VERSION
}
VERSION_LESS 3.2
)
ExternalProject_Add
(
ext_mkldnn
DEPENDS ext_mkl
GIT_REPOSITORY
${
MKLDNN_GIT_REPO_URL
}
GIT_TAG
${
MKLDNN_GIT_TAG
}
UPDATE_COMMAND
""
CONFIGURE_COMMAND
# Uncomment below with any in-flight MKL-DNN patches
# PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/third-party/patches/mkldnn-cmake-openmp.patch
CMAKE_ARGS
...
...
@@ -60,6 +94,7 @@ if(${CMAKE_VERSION} VERSION_LESS 3.2)
-DCMAKE_C_COMPILER=
${
CMAKE_C_COMPILER
}
-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
-DCMAKE_INSTALL_PREFIX=
${
EXTERNAL_PROJECTS_ROOT
}
/mkldnn
-DMKLROOT=
${
MKL_ROOT
}
TMP_DIR
"
${
EXTERNAL_PROJECTS_ROOT
}
/mkldnn/tmp"
STAMP_DIR
"
${
EXTERNAL_PROJECTS_ROOT
}
/mkldnn/stamp"
DOWNLOAD_DIR
"
${
EXTERNAL_PROJECTS_ROOT
}
/mkldnn/download"
...
...
@@ -71,6 +106,7 @@ if(${CMAKE_VERSION} VERSION_LESS 3.2)
else
()
ExternalProject_Add
(
ext_mkldnn
DEPENDS ext_mkl
GIT_REPOSITORY
${
MKLDNN_GIT_REPO_URL
}
GIT_TAG
${
MKLDNN_GIT_TAG
}
UPDATE_COMMAND
""
...
...
@@ -83,6 +119,7 @@ else()
-DCMAKE_C_COMPILER=
${
CMAKE_C_COMPILER
}
-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
-DCMAKE_INSTALL_PREFIX=
${
EXTERNAL_PROJECTS_ROOT
}
/mkldnn
-DMKLROOT=
${
MKL_ROOT
}
TMP_DIR
"
${
EXTERNAL_PROJECTS_ROOT
}
/mkldnn/tmp"
STAMP_DIR
"
${
EXTERNAL_PROJECTS_ROOT
}
/mkldnn/stamp"
DOWNLOAD_DIR
"
${
EXTERNAL_PROJECTS_ROOT
}
/mkldnn/download"
...
...
@@ -94,12 +131,10 @@ else()
)
endif
()
ExternalProject_Get_Property
(
ext_mkldnn source_dir binary_dir
)
ExternalProject_Add_Step
(
ext_mkldnn
PrepareMKL
COMMAND
${
source_dir
}
/scripts/prepare_mkl.sh
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
MKL_SOURCE_DIR
}
${
MKL_ROOT
}
DEPENDEES download
DEPENDERS configure
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment