Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
b4ebd64d
Commit
b4ebd64d
authored
8 years ago
by
Norihiro Watanabe
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] add OGS_USE_MKL option
parent
a75e48a6
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+8
-0
8 additions, 0 deletions
CMakeLists.txt
MathLib/CMakeLists.txt
+4
-0
4 additions, 0 deletions
MathLib/CMakeLists.txt
scripts/cmake/Find.cmake
+4
-0
4 additions, 0 deletions
scripts/cmake/Find.cmake
scripts/cmake/cmake/FindMKL.cmake
+69
-0
69 additions, 0 deletions
scripts/cmake/cmake/FindMKL.cmake
with
85 additions
and
0 deletions
CMakeLists.txt
+
8
−
0
View file @
b4ebd64d
...
...
@@ -84,6 +84,9 @@ option(OGS_USE_EIGEN "Use Eigen linear solver" ON)
option
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES
"Use dynamically allocated shape matrices"
ON
)
option
(
EIGEN_NO_DEBUG
"Disables Eigen's assertions"
OFF
)
# MKL
option
(
OGS_USE_MKL
"Use Intel MKL"
OFF
)
# Logging
option
(
OGS_DISABLE_LOGGING
"Disables all logog messages."
OFF
)
...
...
@@ -135,6 +138,11 @@ if(OGS_USE_LIS)
set
(
OGS_USE_EIGEN ON
)
endif
()
if
(
OGS_USE_MKL
)
add_definitions
(
-DUSE_MKL
)
include_directories
(
SYSTEM
${
MKL_INCLUDE_DIR
}
)
endif
()
if
(
OGS_USE_PETSC
)
add_definitions
(
-DUSE_PETSC
)
set
(
OGS_USE_MPI ON CACHE BOOL
"Use MPI"
FORCE
)
...
...
This diff is collapsed.
Click to expand it.
MathLib/CMakeLists.txt
+
4
−
0
View file @
b4ebd64d
...
...
@@ -43,6 +43,10 @@ if (OGS_USE_LIS)
target_link_libraries
(
MathLib
${
LIS_LIBRARIES
}
)
endif
()
if
(
OGS_USE_MKL
)
target_link_libraries
(
MathLib
${
MKL_LIBRARIES
}
)
endif
()
if
(
OGS_USE_PETSC
)
target_link_libraries
(
MathLib
${
PETSC_LIBRARIES
}
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
scripts/cmake/Find.cmake
+
4
−
0
View file @
b4ebd64d
...
...
@@ -115,6 +115,10 @@ if(OGS_USE_LIS)
find_package
(
LIS REQUIRED
)
endif
()
if
(
OGS_USE_MKL
)
find_package
(
MKL REQUIRED
)
endif
()
if
(
OGS_USE_PETSC
)
message
(
STATUS
"Configuring for PETSc"
)
...
...
This diff is collapsed.
Click to expand it.
scripts/cmake/cmake/FindMKL.cmake
0 → 100644
+
69
−
0
View file @
b4ebd64d
# Find Intel Math Karnel Library (MKL)
#
# Options
# - MKL_DIR MKL root directory
# - MKL_OPENMP use OpenMP threading
#
# Results
# - MKL_INCLUDE_DIR
# - MKL_LIBRARIES
# Lookg for MKL root dir
#SET(MKL_DIR $ENV{MKL_DIR} CACHE PATH "MKL root directory")
if
(
NOT MKL_DIR
)
find_path
(
MKL_DIR
include/mkl.h
PATHS
$ENV{MKL_DIR}
/opt/intel/mkl/
)
endif
()
MESSAGE
(
"MKL_DIR :
${
MKL_DIR
}
"
)
# Find MKL include dir
FIND_PATH
(
MKL_INCLUDE_DIR NAMES mkl.h
PATHS
${
MKL_DIR
}
/include
)
# Set the directory path storing MKL libraries
if
(
NOT MKL_LIB_DIR
)
if
(
APPLE
)
set
(
MKL_LIB_DIR
${
MKL_DIR
}
/lib
)
else
()
if
(
${
CMAKE_HOST_SYSTEM_PROCESSOR
}
STREQUAL
"x86_64"
)
set
(
MKL_LIB_DIR
${
MKL_DIR
}
/lib/intel64
)
else
()
set
(
MKL_LIB_DIR
${
MKL_DIR
}
/lib/ia32
)
endif
()
endif
()
endif
()
# Find MKL libs
find_library
(
MKL_LIB_CORE mkl_core PATHS
${
MKL_LIB_DIR
}
)
if
(
${
CMAKE_HOST_SYSTEM_PROCESSOR
}
STREQUAL
"x86_64"
)
set
(
MKL_INTEL_LIB_NAME mkl_intel_lp64
)
else
()
set
(
MKL_INTEL_LIB_NAME mkl_intel
)
endif
()
find_library
(
MKL_LIB_INTEL
${
MKL_INTEL_LIB_NAME
}
PATHS
${
MKL_LIB_DIR
}
)
if
(
OPENMP_FOUND
)
set
(
MKL_THREAD_LIB_NAME
"mkl_gnu_thread"
)
else
()
set
(
MKL_THREAD_LIB_NAME
"mkl_sequential"
)
endif
()
find_library
(
MKL_LIB_THREAD
${
MKL_THREAD_LIB_NAME
}
PATHS
${
MKL_LIB_DIR
}
)
SET
(
MKL_LIBRARIES
"
${
MKL_LIB_INTEL
}
"
"
${
MKL_LIB_THREAD
}
"
"
${
MKL_LIB_CORE
}
"
)
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
MKL DEFAULT_MSG MKL_INCLUDE_DIR MKL_LIBRARIES
)
mark_as_advanced
(
MKL_INCLUDE_DIR MKL_LIBRARIES
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment