Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NeoML test for android #193

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
00b1d20
Add MKL_USE_STATIC_LIBS in FindMKL.cmake
TemplateVoid Jun 16, 2020
6ed0546
Some refactoring
TemplateVoid Jun 17, 2020
cc8c300
Small fix
TemplateVoid Jun 17, 2020
9ce232b
Merge branch 'master' into master
SAngeliuk Jun 18, 2020
856f163
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jun 25, 2020
c0cf084
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jun 28, 2020
59d0fd5
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jul 6, 2020
81d94b8
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jul 9, 2020
6e505b7
Merge remote-tracking branch 'upstream/master'
TemplateVoid Sep 28, 2020
22dd79c
Merge remote-tracking branch 'upstream/master'
TemplateVoid Oct 6, 2020
70ca799
Merge remote-tracking branch 'upstream/master'
TemplateVoid Oct 6, 2020
1bc268a
Merge remote-tracking branch 'upstream/master'
TemplateVoid Nov 3, 2020
d4cd766
Merge remote-tracking branch 'upstream/master'
TemplateVoid Nov 19, 2020
22988e8
Merge remote-tracking branch 'upstream/master'
TemplateVoid Nov 27, 2020
4d8368b
Merge remote-tracking branch 'upstream/master'
TemplateVoid Dec 14, 2020
52ab0a9
Merge remote-tracking branch 'upstream/master'
TemplateVoid Dec 16, 2020
bd65545
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jan 12, 2021
25c73f8
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jan 13, 2021
c6698b7
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jan 13, 2021
eb9a08b
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jan 14, 2021
9eb2672
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jan 18, 2021
323ddae
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jan 18, 2021
d6e7238
Merge remote-tracking branch 'upstream/master'
TemplateVoid Jan 20, 2021
cf14c33
Add android test for neoml
TemplateVoid Jan 20, 2021
e87e9b4
Merge branch 'master' into NeoMLTestAndroid
TemplateVoid Mar 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add MKL_USE_STATIC_LIBS in FindMKL.cmake
Signed-off-by: TemplateVoid <[email protected]>
TemplateVoid committed Jun 16, 2020
commit 00b1d20e3d8cc05fbe6c6251ccca90bbdae3c85a
3 changes: 2 additions & 1 deletion NeoMathEngine/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -339,8 +339,9 @@ if(NOT ANDROID AND NOT IOS)
set(ENV{MKLROOT} ${FINE_ROOT}/ThirdParty/MKL/${CMAKE_SYSTEM_NAME})
endif()

set(MKL_USE_STATIC_LIBS ON)
find_package(MKL REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE MKL::Static)
target_link_libraries(${PROJECT_NAME} PRIVATE MKL::Libs)
target_compile_definitions(${PROJECT_NAME} PRIVATE NEOML_USE_MKL)
endif()

25 changes: 18 additions & 7 deletions cmake/FindMKL.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# CMake simple script to detect Intel(R) Math Kernel Library (MKL)
# Note, MKLROOT environment variable is not set by installer, it should be set manually.
#
# The module provides imported target: MKL::Static
# Options:
# MKL_USE_STATIC_LIBS Try to find static mkl libraries
#
# The module provides imported interface target: MKL::Libs
# Variables are defined by module:
# MKL_FOUND True/False
# MKL_INCLUDE_DIR MKL include folder
@@ -13,7 +16,7 @@
#
# find_package(MKL)
# add_executable(app main.cpp)
# target_link_libraries(app PRIVATE MKL::Static)
# target_link_libraries(app PRIVATE MKL::Libs)

find_path(MKL_INCLUDE_DIR
NAMES
@@ -37,7 +40,11 @@ else()
set(MKL_LIB_SUFFIX "lp64")
endif()

# Note that we try to find static libs
if(MKL_USE_STATIC_LIBS)
set(_MKL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()

find_library(MKL_CORE_LIB
NAMES mkl_core
PATHS
@@ -71,6 +78,10 @@ find_library(MKL_INTEL_LIB
IntelSWTools/compilers_and_libraries/windows/mkl/lib/${MKL_LIBRARY_DIR_SUFFIX}
)

if(MKL_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_MKL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()

set(MKL_FOUND TRUE)
if(NOT MKL_INCLUDE_DIR)
set(MKL_FOUND FALSE)
@@ -93,18 +104,18 @@ if(NOT MKL_INTEL_LIB)
endif()

if(MKL_FOUND)
add_library(MKL::Static IMPORTED INTERFACE)
target_include_directories(MKL::Static INTERFACE ${MKL_INCLUDE_DIR})
add_library(MKL::Libs IMPORTED INTERFACE)
target_include_directories(MKL::Libs INTERFACE ${MKL_INCLUDE_DIR})
if(UNIX)
set(MKL_LIBS ${MKL_INTEL_LIB} ${MKL_SEQUENTIAL_LIB} ${MKL_CORE_LIB})
if(NOT APPLE)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(MKL_LIBS -Wl,--start-group ${MKL_LIBS} -Wl,--end-group Threads::Threads)
endif()
target_link_libraries(MKL::Static INTERFACE ${MKL_LIBS} ${CMAKE_DL_LIBS})
target_link_libraries(MKL::Libs INTERFACE ${MKL_LIBS} ${CMAKE_DL_LIBS})
else()
target_link_libraries(MKL::Static INTERFACE ${MKL_INTEL_LIB} ${MKL_SEQUENTIAL_LIB} ${MKL_CORE_LIB})
target_link_libraries(MKL::Libs INTERFACE ${MKL_INTEL_LIB} ${MKL_SEQUENTIAL_LIB} ${MKL_CORE_LIB})
endif()

if(NOT MKL_FIND_QUIETLY)