Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
62c6ba3f
Commit
62c6ba3f
authored
Feb 02, 2016
by
Davis King
Browse files
Improved building of mex files.
parent
5c17c93f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
45 deletions
+36
-45
dlib/cmake_find_blas.txt
dlib/cmake_find_blas.txt
+36
-38
dlib/matlab/cmake_mex_wrapper
dlib/matlab/cmake_mex_wrapper
+0
-7
No files found.
dlib/cmake_find_blas.txt
View file @
62c6ba3f
...
@@ -49,10 +49,6 @@ if (UNIX)
...
@@ -49,10 +49,6 @@ if (UNIX)
include(CheckLibraryExists)
include(CheckLibraryExists)
# Don't try to use the Intel MKL when we are building a MATLAB mex file
# since it will usually conflict with MATLAB's copy of the MKL and cause
# problems.
if (NOT BUILDING_MATLAB_MEX_FILE)
# Search for the needed libraries from the MKL. We will try to link against the mkl_rt
# Search for the needed libraries from the MKL. We will try to link against the mkl_rt
# file first since this way avoids linking bugs in some cases.
# file first since this way avoids linking bugs in some cases.
find_library(mkl_rt mkl_rt ${mkl_search_path})
find_library(mkl_rt mkl_rt ${mkl_search_path})
...
@@ -65,6 +61,13 @@ if (UNIX)
...
@@ -65,6 +61,13 @@ if (UNIX)
set(lapack_found 1)
set(lapack_found 1)
set(found_intel_mkl 1)
set(found_intel_mkl 1)
message(STATUS "Found Intel MKL BLAS/LAPACK library")
message(STATUS "Found Intel MKL BLAS/LAPACK library")
if (BUILDING_MATLAB_MEX_FILE)
message(STATUS "\n!!!! Don't forget to set the BLAS_VERSION and LAPACK_VERSION environment variables to !!!!\n!!!! ${blas_libraries} so MATLAB doesn't explode when you run this mex file !!!!\n")
endif()
endif()
if (BUILDING_MATLAB_MEX_FILE)
return()
endif()
endif()
if (NOT found_intel_mkl)
if (NOT found_intel_mkl)
...
@@ -86,7 +89,6 @@ if (UNIX)
...
@@ -86,7 +89,6 @@ if (UNIX)
message(STATUS "Found Intel MKL BLAS/LAPACK library")
message(STATUS "Found Intel MKL BLAS/LAPACK library")
endif()
endif()
endif()
endif()
endif()
# try to find some other LAPACK libraries if we didn't find the MKL
# try to find some other LAPACK libraries if we didn't find the MKL
...
@@ -107,11 +109,7 @@ if (UNIX)
...
@@ -107,11 +109,7 @@ if (UNIX)
INCLUDE (CheckFunctionExists)
INCLUDE (CheckFunctionExists)
if (NOT blas_found)
if (NOT blas_found)
if (BUILDING_MATLAB_MEX_FILE)
find_library(cblas_lib libopenblas.a PATHS ${extra_paths})
else()
find_library(cblas_lib openblas PATHS ${extra_paths})
find_library(cblas_lib openblas PATHS ${extra_paths})
endif()
if (cblas_lib)
if (cblas_lib)
set(blas_libraries ${cblas_lib})
set(blas_libraries ${cblas_lib})
set(blas_found 1)
set(blas_found 1)
...
...
dlib/matlab/cmake_mex_wrapper
View file @
62c6ba3f
...
@@ -67,13 +67,6 @@ INCLUDE(InstallRequiredSystemLibraries)
...
@@ -67,13 +67,6 @@ INCLUDE(InstallRequiredSystemLibraries)
MACRO(add_mex_function name )
MACRO(add_mex_function name )
ADD_LIBRARY(${name} MODULE ${name}.cpp )
ADD_LIBRARY(${name} MODULE ${name}.cpp )
if (UNIX)
if (DEFINED ENV{MATLAB_HOME})
set_target_properties(${name} PROPERTIES LINK_FLAGS "-Wl,--version-script,$ENV{MATLAB_HOME}/extern/lib/glnxa64/mexFunction.map")
else()
set_target_properties(${name} PROPERTIES LINK_FLAGS "-Wl,--version-script,${MATLAB_HOME}/extern/lib/glnxa64/mexFunction.map")
endif()
endif()
# Change the output file extension to a mex extension.
# Change the output file extension to a mex extension.
if (WIN32)
if (WIN32)
...
...
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