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
86eaaf45
Commit
86eaaf45
authored
Mar 18, 2018
by
Davis King
Browse files
merged
parents
c5689ea2
e26e09d3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
541 additions
and
153 deletions
+541
-153
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+142
-139
dlib/cmake_utils/check_if_neon_available.cmake
dlib/cmake_utils/check_if_neon_available.cmake
+3
-3
dlib/cmake_utils/find_blas.cmake
dlib/cmake_utils/find_blas.cmake
+385
-0
dlib/cmake_utils/set_compiler_specific_options.cmake
dlib/cmake_utils/set_compiler_specific_options.cmake
+1
-1
dlib/cmake_utils/tell_visual_studio_to_use_static_runtime.cmake
...make_utils/tell_visual_studio_to_use_static_runtime.cmake
+1
-1
dlib/cmake_utils/use_cpp_11.cmake
dlib/cmake_utils/use_cpp_11.cmake
+9
-9
No files found.
dlib/CMakeLists.txt
View file @
86eaaf45
...
@@ -89,10 +89,10 @@ endmacro()
...
@@ -89,10 +89,10 @@ endmacro()
# Suppress superfluous randlib warnings about libdlib.a having no symbols on MacOSX.
# Suppress superfluous randlib warnings about libdlib.a having no symbols on MacOSX.
if
(
APPLE
)
if
(
APPLE
)
set
(
CMAKE_C_ARCHIVE_CREATE
"<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set
(
CMAKE_C_ARCHIVE_CREATE
"<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set
(
CMAKE_CXX_ARCHIVE_CREATE
"<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set
(
CMAKE_CXX_ARCHIVE_CREATE
"<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set
(
CMAKE_C_ARCHIVE_FINISH
"<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>"
)
set
(
CMAKE_C_ARCHIVE_FINISH
"<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>"
)
set
(
CMAKE_CXX_ARCHIVE_FINISH
"<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>"
)
set
(
CMAKE_CXX_ARCHIVE_FINISH
"<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>"
)
endif
()
endif
()
# Don't try to call add_library(dlib) and setup dlib's stuff if it has already
# Don't try to call add_library(dlib) and setup dlib's stuff if it has already
...
@@ -104,30 +104,30 @@ endif()
...
@@ -104,30 +104,30 @@ endif()
if
(
NOT TARGET dlib
)
if
(
NOT TARGET dlib
)
set
(
DLIB_ISO_CPP_ONLY_STR
set
(
DLIB_ISO_CPP_ONLY_STR
"Enable this if you don't want to compile any non-ISO C++ code (i.e. you don't use any of the API Wrappers)"
)
"Enable this if you don't want to compile any non-ISO C++ code (i.e. you don't use any of the API Wrappers)"
)
set
(
DLIB_NO_GUI_SUPPORT_STR
set
(
DLIB_NO_GUI_SUPPORT_STR
"Enable this if you don't want to compile any of the dlib GUI code"
)
"Enable this if you don't want to compile any of the dlib GUI code"
)
set
(
DLIB_ENABLE_STACK_TRACE_STR
set
(
DLIB_ENABLE_STACK_TRACE_STR
"Enable this if you want to turn on the DLIB_STACK_TRACE macros"
)
"Enable this if you want to turn on the DLIB_STACK_TRACE macros"
)
set
(
DLIB_USE_BLAS_STR
set
(
DLIB_USE_BLAS_STR
"Disable this if you don't want to use a BLAS library"
)
"Disable this if you don't want to use a BLAS library"
)
set
(
DLIB_USE_LAPACK_STR
set
(
DLIB_USE_LAPACK_STR
"Disable this if you don't want to use a LAPACK library"
)
"Disable this if you don't want to use a LAPACK library"
)
set
(
DLIB_USE_CUDA_STR
set
(
DLIB_USE_CUDA_STR
"Disable this if you don't want to use NVIDIA CUDA"
)
"Disable this if you don't want to use NVIDIA CUDA"
)
set
(
DLIB_PNG_SUPPORT_STR
set
(
DLIB_PNG_SUPPORT_STR
"Disable this if you don't want to link against libpng"
)
"Disable this if you don't want to link against libpng"
)
set
(
DLIB_GIF_SUPPORT_STR
set
(
DLIB_GIF_SUPPORT_STR
"Disable this if you don't want to link against libgif"
)
"Disable this if you don't want to link against libgif"
)
set
(
DLIB_JPEG_SUPPORT_STR
set
(
DLIB_JPEG_SUPPORT_STR
"Disable this if you don't want to link against libjpeg"
)
"Disable this if you don't want to link against libjpeg"
)
set
(
DLIB_LINK_WITH_SQLITE3_STR
set
(
DLIB_LINK_WITH_SQLITE3_STR
"Disable this if you don't want to link against sqlite3"
)
"Disable this if you don't want to link against sqlite3"
)
#set (DLIB_USE_FFTW_STR "Disable this if you don't want to link against fftw" )
#set (DLIB_USE_FFTW_STR "Disable this if you don't want to link against fftw" )
set
(
DLIB_USE_MKL_FFT_STR
set
(
DLIB_USE_MKL_FFT_STR
"Disable this is you don't want to use the MKL DFTI FFT implementation"
)
"Disable this is you don't want to use the MKL DFTI FFT implementation"
)
set
(
DLIB_ENABLE_ASSERTS_STR
set
(
DLIB_ENABLE_ASSERTS_STR
"Enable this if you want to turn on the DLIB_ASSERT macro"
)
"Enable this if you want to turn on the DLIB_ASSERT macro"
)
option
(
DLIB_ENABLE_ASSERTS
${
DLIB_ENABLE_ASSERTS_STR
}
OFF
)
option
(
DLIB_ENABLE_ASSERTS
${
DLIB_ENABLE_ASSERTS_STR
}
OFF
)
...
@@ -199,30 +199,30 @@ if (NOT TARGET dlib)
...
@@ -199,30 +199,30 @@ if (NOT TARGET dlib)
set
(
source_files
set
(
source_files
base64/base64_kernel_1.cpp
base64/base64_kernel_1.cpp
bigint/bigint_kernel_1.cpp
bigint/bigint_kernel_1.cpp
bigint/bigint_kernel_2.cpp
bigint/bigint_kernel_2.cpp
bit_stream/bit_stream_kernel_1.cpp
bit_stream/bit_stream_kernel_1.cpp
entropy_decoder/entropy_decoder_kernel_1.cpp
entropy_decoder/entropy_decoder_kernel_1.cpp
entropy_decoder/entropy_decoder_kernel_2.cpp
entropy_decoder/entropy_decoder_kernel_2.cpp
entropy_encoder/entropy_encoder_kernel_1.cpp
entropy_encoder/entropy_encoder_kernel_1.cpp
entropy_encoder/entropy_encoder_kernel_2.cpp
entropy_encoder/entropy_encoder_kernel_2.cpp
md5/md5_kernel_1.cpp
md5/md5_kernel_1.cpp
tokenizer/tokenizer_kernel_1.cpp
tokenizer/tokenizer_kernel_1.cpp
unicode/unicode.cpp
unicode/unicode.cpp
data_io/image_dataset_metadata.cpp
data_io/image_dataset_metadata.cpp
data_io/mnist.cpp
data_io/mnist.cpp
global_optimization/global_function_search.cpp
global_optimization/global_function_search.cpp
filtering/kalman_filter.cpp
filtering/kalman_filter.cpp
test_for_odr_violations.cpp
test_for_odr_violations.cpp
)
)
set
(
dlib_needed_libraries
)
set
(
dlib_needed_libraries
)
set
(
dlib_needed_includes
)
set
(
dlib_needed_includes
)
if
(
DLIB_ISO_CPP_ONLY
)
if
(
DLIB_ISO_CPP_ONLY
)
add_library
(
dlib
${
source_files
}
)
add_library
(
dlib
${
source_files
}
)
else
()
else
()
set
(
source_files
${
source_files
}
set
(
source_files
${
source_files
}
...
@@ -457,51 +457,51 @@ if (NOT TARGET dlib)
...
@@ -457,51 +457,51 @@ if (NOT TARGET dlib)
# If we can't find libjpeg then statically compile it in.
# If we can't find libjpeg then statically compile it in.
add_definitions
(
-DDLIB_JPEG_STATIC
)
add_definitions
(
-DDLIB_JPEG_STATIC
)
set
(
source_files
${
source_files
}
set
(
source_files
${
source_files
}
external/libjpeg/jcomapi.cpp
external/libjpeg/jcomapi.cpp
external/libjpeg/jdapimin.cpp
external/libjpeg/jdapimin.cpp
external/libjpeg/jdapistd.cpp
external/libjpeg/jdapistd.cpp
external/libjpeg/jdatasrc.cpp
external/libjpeg/jdatasrc.cpp
external/libjpeg/jdcoefct.cpp
external/libjpeg/jdcoefct.cpp
external/libjpeg/jdcolor.cpp
external/libjpeg/jdcolor.cpp
external/libjpeg/jddctmgr.cpp
external/libjpeg/jddctmgr.cpp
external/libjpeg/jdhuff.cpp
external/libjpeg/jdhuff.cpp
external/libjpeg/jdinput.cpp
external/libjpeg/jdinput.cpp
external/libjpeg/jdmainct.cpp
external/libjpeg/jdmainct.cpp
external/libjpeg/jdmarker.cpp
external/libjpeg/jdmarker.cpp
external/libjpeg/jdmaster.cpp
external/libjpeg/jdmaster.cpp
external/libjpeg/jdmerge.cpp
external/libjpeg/jdmerge.cpp
external/libjpeg/jdphuff.cpp
external/libjpeg/jdphuff.cpp
external/libjpeg/jdpostct.cpp
external/libjpeg/jdpostct.cpp
external/libjpeg/jdsample.cpp
external/libjpeg/jdsample.cpp
external/libjpeg/jerror.cpp
external/libjpeg/jerror.cpp
external/libjpeg/jidctflt.cpp
external/libjpeg/jidctflt.cpp
external/libjpeg/jidctfst.cpp
external/libjpeg/jidctfst.cpp
external/libjpeg/jidctint.cpp
external/libjpeg/jidctint.cpp
external/libjpeg/jidctred.cpp
external/libjpeg/jidctred.cpp
external/libjpeg/jmemmgr.cpp
external/libjpeg/jmemmgr.cpp
external/libjpeg/jmemnobs.cpp
external/libjpeg/jmemnobs.cpp
external/libjpeg/jquant1.cpp
external/libjpeg/jquant1.cpp
external/libjpeg/jquant2.cpp
external/libjpeg/jquant2.cpp
external/libjpeg/jutils.cpp
external/libjpeg/jutils.cpp
external/libjpeg/jcapimin.cpp
external/libjpeg/jcapimin.cpp
external/libjpeg/jdatadst.cpp
external/libjpeg/jdatadst.cpp
external/libjpeg/jcparam.cpp
external/libjpeg/jcparam.cpp
external/libjpeg/jcapistd.cpp
external/libjpeg/jcapistd.cpp
external/libjpeg/jcmarker.cpp
external/libjpeg/jcmarker.cpp
external/libjpeg/jcinit.cpp
external/libjpeg/jcinit.cpp
external/libjpeg/jcmaster.cpp
external/libjpeg/jcmaster.cpp
external/libjpeg/jcdctmgr.cpp
external/libjpeg/jcdctmgr.cpp
external/libjpeg/jccoefct.cpp
external/libjpeg/jccoefct.cpp
external/libjpeg/jccolor.cpp
external/libjpeg/jccolor.cpp
external/libjpeg/jchuff.cpp
external/libjpeg/jchuff.cpp
external/libjpeg/jcmainct.cpp
external/libjpeg/jcmainct.cpp
external/libjpeg/jcphuff.cpp
external/libjpeg/jcphuff.cpp
external/libjpeg/jcprepct.cpp
external/libjpeg/jcprepct.cpp
external/libjpeg/jcsample.cpp
external/libjpeg/jcsample.cpp
external/libjpeg/jfdctint.cpp
external/libjpeg/jfdctint.cpp
external/libjpeg/jfdctflt.cpp
external/libjpeg/jfdctflt.cpp
external/libjpeg/jfdctfst.cpp
external/libjpeg/jfdctfst.cpp
)
)
endif
()
endif
()
set
(
source_files
${
source_files
}
set
(
source_files
${
source_files
}
image_loader/jpeg_loader.cpp
image_loader/jpeg_loader.cpp
...
@@ -511,8 +511,8 @@ if (NOT TARGET dlib)
...
@@ -511,8 +511,8 @@ if (NOT TARGET dlib)
if
(
DLIB_USE_BLAS OR DLIB_USE_LAPACK OR DLIB_USE_MKL_FFT
)
if
(
DLIB_USE_BLAS OR DLIB_USE_LAPACK OR DLIB_USE_MKL_FFT
)
# Try to find BLAS, LAPACK and MKL
# Try to find BLAS, LAPACK and MKL
include
(
cmake_utils/
cmake_
find_blas.
txt
)
include
(
cmake_utils/find_blas.
cmake
)
if
(
DLIB_USE_BLAS
)
if
(
DLIB_USE_BLAS
)
if
(
blas_found
)
if
(
blas_found
)
...
@@ -596,19 +596,21 @@ if (NOT TARGET dlib)
...
@@ -596,19 +596,21 @@ if (NOT TARGET dlib)
# make sure cuda is really working by doing a test compile
# make sure cuda is really working by doing a test compile
message
(
STATUS
"Building a CUDA test project to see if your compiler is compatible with CUDA..."
)
message
(
STATUS
"Building a CUDA test project to see if your compiler is compatible with CUDA..."
)
set
(
CUDA_TEST_CMAKE_FLAGS
"-DCMAKE_PREFIX_PATH=
${
CMAKE_PREFIX_PATH
}
"
set
(
CUDA_TEST_CMAKE_FLAGS
"-DCMAKE_INCLUDE_PATH=
${
CMAKE_INCLUDE_PATH
}
"
"-DCMAKE_PREFIX_PATH=
${
CMAKE_PREFIX_PATH
}
"
"-DCMAKE_LIBRARY_PATH=
${
CMAKE_LIBRARY_PATH
}
"
)
"-DCMAKE_INCLUDE_PATH=
${
CMAKE_INCLUDE_PATH
}
"
"-DCMAKE_LIBRARY_PATH=
${
CMAKE_LIBRARY_PATH
}
"
)
if
(
NOT MSVC
)
# see https://github.com/davisking/dlib/issues/363
if
(
NOT MSVC
)
# see https://github.com/davisking/dlib/issues/363
list
(
APPEND CUDA_TEST_CMAKE_FLAGS
"-DCUDA_HOST_COMPILER=
${
CUDA_HOST_COMPILER
}
"
)
list
(
APPEND CUDA_TEST_CMAKE_FLAGS
"-DCUDA_HOST_COMPILER=
${
CUDA_HOST_COMPILER
}
"
)
endif
()
endif
()
try_compile
(
cuda_test_compile_worked
${
PROJECT_BINARY_DIR
}
/cuda_test_build
try_compile
(
cuda_test_compile_worked
${
PROJECT_SOURCE_DIR
}
/cmake_utils/test_for_cuda cuda_test
${
PROJECT_BINARY_DIR
}
/cuda_test_build
CMAKE_FLAGS
${
CUDA_TEST_CMAKE_FLAGS
}
${
PROJECT_SOURCE_DIR
}
/cmake_utils/test_for_cuda cuda_test
OUTPUT_VARIABLE try_compile_output_message
CMAKE_FLAGS
${
CUDA_TEST_CMAKE_FLAGS
}
)
OUTPUT_VARIABLE try_compile_output_message
)
if
(
NOT cuda_test_compile_worked
)
if
(
NOT cuda_test_compile_worked
)
string
(
REPLACE
"
\n
"
"
\n
*** "
try_compile_output_message
"
${
try_compile_output_message
}
"
)
string
(
REPLACE
"
\n
"
"
\n
*** "
try_compile_output_message
"
${
try_compile_output_message
}
"
)
message
(
STATUS
"*****************************************************************************************************************"
)
message
(
STATUS
"*****************************************************************************************************************"
)
...
@@ -618,10 +620,11 @@ if (NOT TARGET dlib)
...
@@ -618,10 +620,11 @@ if (NOT TARGET dlib)
message
(
STATUS
"*****************************************************************************************************************"
)
message
(
STATUS
"*****************************************************************************************************************"
)
else
()
else
()
message
(
STATUS
"Checking if you have the right version of cuDNN installed."
)
message
(
STATUS
"Checking if you have the right version of cuDNN installed."
)
try_compile
(
cudnn_test_compile_worked
${
PROJECT_BINARY_DIR
}
/cudnn_test_build
try_compile
(
cudnn_test_compile_worked
${
PROJECT_SOURCE_DIR
}
/cmake_utils/test_for_cudnn cudnn_test
${
PROJECT_BINARY_DIR
}
/cudnn_test_build
CMAKE_FLAGS
${
CUDA_TEST_CMAKE_FLAGS
}
${
PROJECT_SOURCE_DIR
}
/cmake_utils/test_for_cudnn cudnn_test
)
CMAKE_FLAGS
${
CUDA_TEST_CMAKE_FLAGS
}
)
if
(
NOT cudnn_test_compile_worked
)
if
(
NOT cudnn_test_compile_worked
)
message
(
STATUS
"*** Found cuDNN, but it looks like the wrong version so dlib will not use it. ***"
)
message
(
STATUS
"*** Found cuDNN, but it looks like the wrong version so dlib will not use it. ***"
)
message
(
STATUS
"*** Dlib requires cuDNN V5.0 OR GREATER. Since cuDNN is not found DLIB WILL NOT USE CUDA. ***"
)
message
(
STATUS
"*** Dlib requires cuDNN V5.0 OR GREATER. Since cuDNN is not found DLIB WILL NOT USE CUDA. ***"
)
...
@@ -662,15 +665,15 @@ if (NOT TARGET dlib)
...
@@ -662,15 +665,15 @@ if (NOT TARGET dlib)
dnn/gpu_data.cpp
dnn/gpu_data.cpp
)
)
set
(
dlib_needed_libraries
${
dlib_needed_libraries
}
set
(
dlib_needed_libraries
${
dlib_needed_libraries
}
${
CUDA_CUBLAS_LIBRARIES
}
${
CUDA_CUBLAS_LIBRARIES
}
${
cudnn
}
${
cudnn
}
${
CUDA_curand_LIBRARY
}
${
CUDA_curand_LIBRARY
}
${
cusolver
}
${
cusolver
}
)
)
if
(
openmp_libraries
)
if
(
openmp_libraries
)
list
(
APPEND dlib_needed_libraries
${
openmp_libraries
}
)
list
(
APPEND dlib_needed_libraries
${
openmp_libraries
}
)
endif
()
endif
()
include_directories
(
${
cudnn_include
}
)
include_directories
(
${
cudnn_include
}
)
message
(
STATUS
"Enabling CUDA support for dlib. DLIB WILL USE CUDA"
)
message
(
STATUS
"Enabling CUDA support for dlib. DLIB WILL USE CUDA"
)
else
()
else
()
...
@@ -682,7 +685,7 @@ if (NOT TARGET dlib)
...
@@ -682,7 +685,7 @@ if (NOT TARGET dlib)
message
(
STATUS
"Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA"
)
message
(
STATUS
"Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA"
)
endif
()
endif
()
endif
()
endif
()
if
(
DLIB_LINK_WITH_SQLITE3
)
if
(
DLIB_LINK_WITH_SQLITE3
)
find_library
(
sqlite sqlite3
)
find_library
(
sqlite sqlite3
)
...
@@ -729,10 +732,10 @@ if (NOT TARGET dlib)
...
@@ -729,10 +732,10 @@ if (NOT TARGET dlib)
target_include_directories
(
dlib
target_include_directories
(
dlib
INTERFACE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/..>
INTERFACE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/..>
INTERFACE $<INSTALL_INTERFACE:include>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC
${
dlib_needed_includes
}
PUBLIC
${
dlib_needed_includes
}
)
)
target_link_libraries
(
dlib PUBLIC
${
dlib_needed_libraries
}
)
target_link_libraries
(
dlib PUBLIC
${
dlib_needed_libraries
}
)
if
(
DLIB_IN_PROJECT_BUILD
)
if
(
DLIB_IN_PROJECT_BUILD
)
target_compile_options
(
dlib PUBLIC
${
active_preprocessor_switches
}
)
target_compile_options
(
dlib PUBLIC
${
active_preprocessor_switches
}
)
...
@@ -770,52 +773,52 @@ if (NOT TARGET dlib)
...
@@ -770,52 +773,52 @@ if (NOT TARGET dlib)
# Install the library
# Install the library
if
(
NOT DLIB_IN_PROJECT_BUILD
)
if
(
NOT DLIB_IN_PROJECT_BUILD
)
set_target_properties
(
dlib PROPERTIES
set_target_properties
(
dlib PROPERTIES
VERSION
${
VERSION
}
)
VERSION
${
VERSION
}
)
install
(
TARGETS dlib
install
(
TARGETS dlib
EXPORT dlib
EXPORT dlib
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
# Windows considers .dll to be runtime artifacts
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
# Windows considers .dll to be runtime artifacts
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
install
(
DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/ DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dlib
install
(
DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/ DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dlib
FILES_MATCHING PATTERN
"*.h"
PATTERN
"*.cmake"
FILES_MATCHING PATTERN
"*.h"
PATTERN
"*.cmake"
REGEX
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
EXCLUDE
)
REGEX
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
EXCLUDE
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/config.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/config.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h
)
# overwrite config.h with the configured one
# overwrite config.h with the configured one
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dlib
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dlib
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/revision.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/revision.h
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/revision.h.in
${
CMAKE_CURRENT_BINARY_DIR
}
/revision.h
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/revision.h DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dlib
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/revision.h DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dlib
)
## Config.cmake generation and installation
## Config.cmake generation and installation
set
(
ConfigPackageLocation
"
${
CMAKE_INSTALL_LIBDIR
}
/cmake/dlib"
)
set
(
ConfigPackageLocation
"
${
CMAKE_INSTALL_LIBDIR
}
/cmake/dlib"
)
install
(
EXPORT dlib
install
(
EXPORT dlib
NAMESPACE dlib::
NAMESPACE dlib::
DESTINATION
${
ConfigPackageLocation
}
)
DESTINATION
${
ConfigPackageLocation
}
)
configure_file
(
cmake_utils/dlibConfig.cmake.in
"
${
CMAKE_CURRENT_BINARY_DIR
}
/config/dlibConfig.cmake"
@ONLY
)
configure_file
(
cmake_utils/dlibConfig.cmake.in
"
${
CMAKE_CURRENT_BINARY_DIR
}
/config/dlibConfig.cmake"
@ONLY
)
include
(
CMakePackageConfigHelpers
)
include
(
CMakePackageConfigHelpers
)
write_basic_package_version_file
(
write_basic_package_version_file
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/config/dlibConfigVersion.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/config/dlibConfigVersion.cmake"
VERSION
${
VERSION
}
VERSION
${
VERSION
}
COMPATIBILITY AnyNewerVersion
COMPATIBILITY AnyNewerVersion
)
)
install
(
FILES
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/config/dlibConfig.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/config/dlibConfig.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/config/dlibConfigVersion.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/config/dlibConfigVersion.cmake"
DESTINATION
${
ConfigPackageLocation
}
)
DESTINATION
${
ConfigPackageLocation
}
)
## dlib-1.pc generation and installation
## dlib-1.pc generation and installation
configure_file
(
"cmake_utils/dlib.pc.in"
"dlib-1.pc"
@ONLY
)
configure_file
(
"cmake_utils/dlib.pc.in"
"dlib-1.pc"
@ONLY
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dlib-1.pc"
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dlib-1.pc"
DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig"
)
DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig"
)
endif
()
endif
()
...
...
dlib/cmake_utils/check_if_neon_available.cmake
View file @
86eaaf45
...
@@ -12,9 +12,9 @@ set(ARM_NEON_IS_AVAILABLE 0)
...
@@ -12,9 +12,9 @@ set(ARM_NEON_IS_AVAILABLE 0)
# test if __ARM_NEON__ is defined
# test if __ARM_NEON__ is defined
try_compile
(
test_for_neon_worked
${
PROJECT_BINARY_DIR
}
/neon_test_build
${
CMAKE_CURRENT_LIST_DIR
}
/test_for_neon
try_compile
(
test_for_neon_worked
${
PROJECT_BINARY_DIR
}
/neon_test_build
${
CMAKE_CURRENT_LIST_DIR
}
/test_for_neon
neon_test
)
neon_test
)
if
(
test_for_neon_worked
)
if
(
test_for_neon_worked
)
message
(
STATUS
"__ARM_NEON__ defined."
)
message
(
STATUS
"__ARM_NEON__ defined."
)
set
(
ARM_NEON_IS_AVAILABLE 1
)
set
(
ARM_NEON_IS_AVAILABLE 1
)
endif
()
endif
()
dlib/cmake_utils/
cmake_
find_blas.
txt
→
dlib/cmake_utils/find_blas.
cmake
View file @
86eaaf45
...
@@ -32,139 +32,139 @@ SET(lapack_without_underscore 0)
...
@@ -32,139 +32,139 @@ SET(lapack_without_underscore 0)
message
(
STATUS
"Searching for BLAS and LAPACK"
)
message
(
STATUS
"Searching for BLAS and LAPACK"
)
if
(
UNIX OR MINGW
)
if
(
UNIX OR MINGW
)
message(STATUS "Searching for BLAS and LAPACK")
message
(
STATUS
"Searching for BLAS and LAPACK"
)
if (BUILDING_MATLAB_MEX_FILE)
if
(
BUILDING_MATLAB_MEX_FILE
)
# # This commented out stuff would link directly to MATLAB's built in
# # This commented out stuff would link directly to MATLAB's built in
# BLAS and LAPACK. But it's better to not link to anything and do a
# BLAS and LAPACK. But it's better to not link to anything and do a
#find_library(MATLAB_BLAS_LIBRARY mwblas PATHS ${MATLAB_LIB_FOLDERS} )
#find_library(MATLAB_BLAS_LIBRARY mwblas PATHS ${MATLAB_LIB_FOLDERS} )
#find_library(MATLAB_LAPACK_LIBRARY mwlapack PATHS ${MATLAB_LIB_FOLDERS} )
#find_library(MATLAB_LAPACK_LIBRARY mwlapack PATHS ${MATLAB_LIB_FOLDERS} )
#if (MATLAB_BLAS_LIBRARY AND MATLAB_LAPACK_LIBRARY)
#if (MATLAB_BLAS_LIBRARY AND MATLAB_LAPACK_LIBRARY)
# add_subdirectory(external/cblas)
# add_subdirectory(external/cblas)
# set(blas_libraries ${MATLAB_BLAS_LIBRARY} cblas )
# set(blas_libraries ${MATLAB_BLAS_LIBRARY} cblas )
# set(lapack_libraries ${MATLAB_LAPACK_LIBRARY} )
# set(lapack_libraries ${MATLAB_LAPACK_LIBRARY} )
# set(blas_found 1)
# set(blas_found 1)
# set(lapack_found 1)
# set(lapack_found 1)
# message(STATUS "Found MATLAB's BLAS and LAPACK libraries")
# message(STATUS "Found MATLAB's BLAS and LAPACK libraries")
#endif()
#endif()
# We need cblas since MATLAB doesn't provide cblas symbols.
# We need cblas since MATLAB doesn't provide cblas symbols.
add_subdirectory(external/cblas)
add_subdirectory
(
external/cblas
)
set(blas_libraries cblas )
set
(
blas_libraries cblas
)
set(blas_found 1)
set
(
blas_found 1
)
set(lapack_found 1)
set
(
lapack_found 1
)
message(STATUS "Will link with MATLAB's BLAS and LAPACK at runtime (hopefully!)")
message
(
STATUS
"Will link with MATLAB's BLAS and LAPACK at runtime (hopefully!)"
)
## Don't try to link to anything other than MATLAB's own internal blas
## Don't try to link to anything other than MATLAB's own internal blas
## and lapack libraries because doing so generally upsets MATLAB. So
## and lapack libraries because doing so generally upsets MATLAB. So
## we just end here no matter what.
## we just end here no matter what.
return()
return
()
endif()
endif
()
# First, search for libraries via pkg-config, which is the cleanest path
# First, search for libraries via pkg-config, which is the cleanest path
find_package(PkgConfig)
find_package
(
PkgConfig
)
pkg_check_modules(BLAS_REFERENCE cblas)
pkg_check_modules
(
BLAS_REFERENCE cblas
)
pkg_check_modules(LAPACK_REFERENCE lapack)
pkg_check_modules
(
LAPACK_REFERENCE lapack
)
if (BLAS_REFERENCE_FOUND AND LAPACK_REFERENCE_FOUND)
if
(
BLAS_REFERENCE_FOUND AND LAPACK_REFERENCE_FOUND
)
set(blas_libraries "${BLAS_REFERENCE_LDFLAGS}")
set
(
blas_libraries
"
${
BLAS_REFERENCE_LDFLAGS
}
"
)
set(lapack_libraries "${LAPACK_REFERENCE_LDFLAGS}")
set
(
lapack_libraries
"
${
LAPACK_REFERENCE_LDFLAGS
}
"
)
set(blas_found 1)
set
(
blas_found 1
)
set(lapack_found 1)
set
(
lapack_found 1
)
set(REQUIRES_LIBS "${REQUIRES_LIBS} cblas lapack")
set
(
REQUIRES_LIBS
"
${
REQUIRES_LIBS
}
cblas lapack"
)
message(STATUS "Found BLAS and LAPACK via pkg-config")
message
(
STATUS
"Found BLAS and LAPACK via pkg-config"
)
return()
return
()
endif()
endif
()
include(CheckTypeSize)
include
(
CheckTypeSize
)
check_type_size( "void*" SIZE_OF_VOID_PTR)
check_type_size
(
"void*"
SIZE_OF_VOID_PTR
)
if (SIZE_OF_VOID_PTR EQUAL 8)
if
(
SIZE_OF_VOID_PTR EQUAL 8
)
set( mkl_search_path
set
(
mkl_search_path
/opt/intel/mkl/*/lib/em64t
/opt/intel/mkl/*/lib/em64t
/opt/intel/mkl/lib/intel64
/opt/intel/mkl/lib/intel64
/opt/intel/lib/intel64
/opt/intel/lib/intel64
/opt/intel/mkl/lib
/opt/intel/mkl/lib
)
)
find_library(mkl_intel mkl_intel_lp64 ${mkl_search_path})
find_library
(
mkl_intel mkl_intel_lp64
${
mkl_search_path
}
)
mark_as_advanced(mkl_intel)
mark_as_advanced
(
mkl_intel
)
else()
else
()
set( mkl_search_path
set
(
mkl_search_path
/opt/intel/mkl/*/lib/32
/opt/intel/mkl/*/lib/32
/opt/intel/mkl/lib/ia32
/opt/intel/mkl/lib/ia32
/opt/intel/lib/ia32
/opt/intel/lib/ia32
)
)
find_library(mkl_intel mkl_intel ${mkl_search_path})
find_library
(
mkl_intel mkl_intel
${
mkl_search_path
}
)
mark_as_advanced(mkl_intel)
mark_as_advanced
(
mkl_intel
)
endif()
endif
()
include
(
CheckLibraryExists
)
include
(
CheckLibraryExists
)
# Get mkl_include_dir
# Get mkl_include_dir
set(mkl_include_search_path
set
(
mkl_include_search_path
/opt/intel/mkl/include
/opt/intel/mkl/include
/opt/intel/include
/opt/intel/include
)
)
find_path(mkl_include_dir mkl_version.h ${mkl_include_search_path})
find_path
(
mkl_include_dir mkl_version.h
${
mkl_include_search_path
}
)
mark_as_advanced(mkl_include_dir)
mark_as_advanced
(
mkl_include_dir
)
# 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
}
)
find_library(openmp_libraries iomp5 ${mkl_search_path})
find_library
(
openmp_libraries iomp5
${
mkl_search_path
}
)
mark_as_advanced( mkl_rt openmp_libraries )
mark_as_advanced
(
mkl_rt openmp_libraries
)
# if we found the MKL
# if we found the MKL
if ( mkl_rt)
if
(
mkl_rt
)
set(mkl_libraries ${mkl_rt} )
set
(
mkl_libraries
${
mkl_rt
}
)
set(blas_libraries ${mkl_rt} )
set
(
blas_libraries
${
mkl_rt
}
)
set(lapack_libraries ${mkl_rt} )
set
(
lapack_libraries
${
mkl_rt
}
)
set(blas_found 1)
set
(
blas_found 1
)
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"
)
endif()
endif
()
if (NOT found_intel_mkl)
# Search for the needed libraries from the MKL. This time try looking for a different
# set of MKL files and try to link against those.
find_library(mkl_core mkl_core ${mkl_search_path})
find_library(mkl_thread mkl_intel_thread ${mkl_search_path})
find_library(mkl_iomp iomp5 ${mkl_search_path})
find_library(mkl_pthread pthread ${mkl_search_path})
mark_as_advanced( mkl_intel mkl_core mkl_thread mkl_iomp mkl_pthread)
# If we found the MKL
if (mkl_intel AND mkl_core AND mkl_thread AND mkl_iomp AND mkl_pthread)
set(mkl_libraries ${mkl_intel} ${mkl_core} ${mkl_thread} ${mkl_iomp} ${mkl_pthread})
set(blas_libraries ${mkl_intel} ${mkl_core} ${mkl_thread} ${mkl_iomp} ${mkl_pthread})
set(lapack_libraries ${mkl_intel} ${mkl_core} ${mkl_thread} ${mkl_iomp} ${mkl_pthread})
set(blas_found 1)
set(lapack_found 1)
set(found_intel_mkl 1)
message(STATUS "Found Intel MKL BLAS/LAPACK library")
endif()
endif()
if (found_intel_mkl AND mkl_include_dir)
if
(
NOT found_intel_mkl
)
set(found_intel_mkl_headers 1)
# Search for the needed libraries from the MKL. This time try looking for a different
endif()
# set of MKL files and try to link against those.
find_library
(
mkl_core mkl_core
${
mkl_search_path
}
)
find_library
(
mkl_thread mkl_intel_thread
${
mkl_search_path
}
)
find_library
(
mkl_iomp iomp5
${
mkl_search_path
}
)
find_library
(
mkl_pthread pthread
${
mkl_search_path
}
)
mark_as_advanced
(
mkl_intel mkl_core mkl_thread mkl_iomp mkl_pthread
)
# If we found the MKL
if
(
mkl_intel AND mkl_core AND mkl_thread AND mkl_iomp AND mkl_pthread
)
set
(
mkl_libraries
${
mkl_intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
${
mkl_pthread
}
)
set
(
blas_libraries
${
mkl_intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
${
mkl_pthread
}
)
set
(
lapack_libraries
${
mkl_intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
${
mkl_pthread
}
)
set
(
blas_found 1
)
set
(
lapack_found 1
)
set
(
found_intel_mkl 1
)
message
(
STATUS
"Found Intel MKL BLAS/LAPACK library"
)
endif
()
endif
()
if
(
found_intel_mkl AND mkl_include_dir
)
set
(
found_intel_mkl_headers 1
)
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
set
(
extra_paths
set
(
extra_paths
/usr/lib64
/usr/lib64
/usr/lib64/atlas-sse3
/usr/lib64/atlas-sse3
/usr/lib64/atlas-sse2
/usr/lib64/atlas-sse2
/usr/lib64/atlas
/usr/lib64/atlas
/usr/lib
/usr/lib
/usr/lib/atlas-sse3
/usr/lib/atlas-sse3
/usr/lib/atlas-sse2
/usr/lib/atlas-sse2
/usr/lib/atlas
/usr/lib/atlas
/usr/lib/openblas-base
/usr/lib/openblas-base
/opt/OpenBLAS/lib
/opt/OpenBLAS/lib
$ENV{OPENBLAS_HOME}/lib
$ENV{OPENBLAS_HOME}/lib
)
)
INCLUDE
(
CheckFunctionExists
)
INCLUDE
(
CheckFunctionExists
)
...
@@ -199,9 +199,9 @@ if (UNIX OR MINGW)
...
@@ -199,9 +199,9 @@ if (UNIX OR MINGW)
mark_as_advanced
(
lapack_lib
)
mark_as_advanced
(
lapack_lib
)
endif
()
endif
()
# try to find some other BLAS libraries if we didn't find the MKL
# try to find some other BLAS libraries if we didn't find the MKL
if
(
NOT blas_found
)
if
(
NOT blas_found
)
find_library
(
atlas_lib atlas PATHS
${
extra_paths
}
)
find_library
(
atlas_lib atlas PATHS
${
extra_paths
}
)
find_library
(
cblas_lib cblas PATHS
${
extra_paths
}
)
find_library
(
cblas_lib cblas PATHS
${
extra_paths
}
)
...
@@ -236,7 +236,7 @@ if (UNIX OR MINGW)
...
@@ -236,7 +236,7 @@ if (UNIX OR MINGW)
mark_as_advanced
(
cblas_lib
)
mark_as_advanced
(
cblas_lib
)
endif
()
endif
()
if
(
NOT blas_found
)
if
(
NOT blas_found
)
find_library
(
generic_blas blas PATHS
${
extra_paths
}
)
find_library
(
generic_blas blas PATHS
${
extra_paths
}
)
if
(
generic_blas
)
if
(
generic_blas
)
...
@@ -268,64 +268,64 @@ if (UNIX OR MINGW)
...
@@ -268,64 +268,64 @@ if (UNIX OR MINGW)
elseif
(
WIN32 AND NOT MINGW
)
elseif
(
WIN32 AND NOT MINGW
)
message(STATUS "Searching for BLAS and LAPACK")
message
(
STATUS
"Searching for BLAS and LAPACK"
)
include(CheckTypeSize)
include
(
CheckTypeSize
)
check_type_size( "void*" SIZE_OF_VOID_PTR)
check_type_size
(
"void*"
SIZE_OF_VOID_PTR
)
if (SIZE_OF_VOID_PTR EQUAL 8)
if
(
SIZE_OF_VOID_PTR EQUAL 8
)
set( mkl_search_path
set
(
mkl_search_path
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_*/windows/mkl/lib/intel64"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_*/windows/mkl/lib/intel64"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_*/windows/compiler/lib/intel64"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_*/windows/compiler/lib/intel64"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/compiler/lib/intel64"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/compiler/lib/intel64"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64"
"C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64"
"C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64"
"C:/Program Files (x86)/Intel/Composer XE/compiler/lib/intel64"
"C:/Program Files (x86)/Intel/Composer XE/compiler/lib/intel64"
"C:/Program Files/Intel/Composer XE/mkl/lib/intel64"
"C:/Program Files/Intel/Composer XE/mkl/lib/intel64"
"C:/Program Files/Intel/Composer XE/compiler/lib/intel64"
"C:/Program Files/Intel/Composer XE/compiler/lib/intel64"
)
)
find_library(mkl_intel mkl_intel_lp64 ${mkl_search_path})
find_library
(
mkl_intel mkl_intel_lp64
${
mkl_search_path
}
)
else()
else
()
set( mkl_search_path
set
(
mkl_search_path
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_*/windows/mkl/lib/ia32"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_*/windows/mkl/lib/ia32"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_*/windows/compiler/lib/ia32"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_*/windows/compiler/lib/ia32"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl/lib/ia32"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl/lib/ia32"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/compiler/lib/ia32"
"C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/compiler/lib/ia32"
"C:/Program Files (x86)/Intel/Composer XE/mkl/lib/ia32"
"C:/Program Files (x86)/Intel/Composer XE/mkl/lib/ia32"
"C:/Program Files (x86)/Intel/Composer XE/compiler/lib/ia32"
"C:/Program Files (x86)/Intel/Composer XE/compiler/lib/ia32"
"C:/Program Files/Intel/Composer XE/mkl/lib/ia32"
"C:/Program Files/Intel/Composer XE/mkl/lib/ia32"
"C:/Program Files/Intel/Composer XE/compiler/lib/ia32"
"C:/Program Files/Intel/Composer XE/compiler/lib/ia32"
)
)
find_library(mkl_intel mkl_intel_c ${mkl_search_path})
find_library
(
mkl_intel mkl_intel_c
${
mkl_search_path
}
)
endif()
endif
()
INCLUDE
(
CheckFunctionExists
)
INCLUDE
(
CheckFunctionExists
)
# Search for the needed libraries from the MKL.
# Search for the needed libraries from the MKL.
find_library(mkl_core mkl_core ${mkl_search_path})
find_library
(
mkl_core mkl_core
${
mkl_search_path
}
)
find_library(mkl_thread mkl_intel_thread ${mkl_search_path})
find_library
(
mkl_thread mkl_intel_thread
${
mkl_search_path
}
)
find_library(mkl_iomp libiomp5md ${mkl_search_path})
find_library
(
mkl_iomp libiomp5md
${
mkl_search_path
}
)
mark_as_advanced( mkl_intel mkl_core mkl_thread mkl_iomp)
mark_as_advanced
(
mkl_intel mkl_core mkl_thread mkl_iomp
)
# If we found the MKL
# If we found the MKL
if (mkl_intel AND mkl_core AND mkl_thread AND mkl_iomp )
if
(
mkl_intel AND mkl_core AND mkl_thread AND mkl_iomp
)
set(blas_libraries ${mkl_intel} ${mkl_core} ${mkl_thread} ${mkl_iomp} )
set
(
blas_libraries
${
mkl_intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
)
set(lapack_libraries ${mkl_intel} ${mkl_core} ${mkl_thread} ${mkl_iomp} )
set
(
lapack_libraries
${
mkl_intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
)
set(blas_found 1)
set
(
blas_found 1
)
set(lapack_found 1)
set
(
lapack_found 1
)
message(STATUS "Found Intel MKL BLAS/LAPACK library")
message
(
STATUS
"Found Intel MKL BLAS/LAPACK library"
)
# Make sure the version of the Intel MKL we found is compatible with
# Make sure the version of the Intel MKL we found is compatible with
# the compiler we are using. One way to do this check is to see if we can
# the compiler we are using. One way to do this check is to see if we can
# link to it right now.
# link to it right now.
set(CMAKE_REQUIRED_LIBRARIES ${blas_libraries})
set
(
CMAKE_REQUIRED_LIBRARIES
${
blas_libraries
}
)
CHECK_FUNCTION_EXISTS(cblas_ddot HAVE_CBLAS)
CHECK_FUNCTION_EXISTS
(
cblas_ddot HAVE_CBLAS
)
if (NOT HAVE_CBLAS)
if
(
NOT HAVE_CBLAS
)
message("BLAS library does not have cblas symbols, so dlib will not use BLAS or LAPACK")
message
(
"BLAS library does not have cblas symbols, so dlib will not use BLAS or LAPACK"
)
set(blas_found 0)
set
(
blas_found 0
)
set(lapack_found 0)
set
(
lapack_found 0
)
endif()
endif
()
endif()
endif
()
endif
()
endif
()
...
@@ -333,18 +333,18 @@ endif()
...
@@ -333,18 +333,18 @@ endif()
# When all else fails use CMake's built in functions to find BLAS and LAPACK
# When all else fails use CMake's built in functions to find BLAS and LAPACK
if
(
NOT blas_found
)
if
(
NOT blas_found
)
find_package(BLAS QUIET)
find_package
(
BLAS QUIET
)
if (${BLAS_FOUND})
if
(
${
BLAS_FOUND
}
)
set(blas_libraries ${BLAS_LIBRARIES})
set
(
blas_libraries
${
BLAS_LIBRARIES
}
)
set(blas_found 1)
set
(
blas_found 1
)
if (NOT lapack_found)
if
(
NOT lapack_found
)
find_package(LAPACK QUIET)
find_package
(
LAPACK QUIET
)
if (${LAPACK_FOUND})
if
(
${
LAPACK_FOUND
}
)
set(lapack_libraries ${LAPACK_LIBRARIES})
set
(
lapack_libraries
${
LAPACK_LIBRARIES
}
)
set(lapack_found 1)
set
(
lapack_found 1
)
endif()
endif
()
endif()
endif
()
endif()
endif
()
endif
()
endif
()
...
...
dlib/cmake_utils/set_compiler_specific_options.cmake
View file @
86eaaf45
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
cmake_minimum_required
(
VERSION 2.8.12
)
cmake_minimum_required
(
VERSION 2.8.12
)
if
(
POLICY CMP0054
)
if
(
POLICY CMP0054
)
cmake_policy
(
SET CMP0054 NEW
)
cmake_policy
(
SET CMP0054 NEW
)
endif
()
endif
()
set
(
USING_OLD_VISUAL_STUDIO_COMPILER 0
)
set
(
USING_OLD_VISUAL_STUDIO_COMPILER 0
)
...
...
dlib/cmake_utils/tell_visual_studio_to_use_static_runtime.cmake
View file @
86eaaf45
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
cmake_minimum_required
(
VERSION 2.8.12
)
cmake_minimum_required
(
VERSION 2.8.12
)
if
(
POLICY CMP0054
)
if
(
POLICY CMP0054
)
cmake_policy
(
SET CMP0054 NEW
)
cmake_policy
(
SET CMP0054 NEW
)
endif
()
endif
()
if
(
MSVC OR
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"MSVC"
)
if
(
MSVC OR
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"MSVC"
)
...
...
dlib/cmake_utils/use_cpp_11.cmake
View file @
86eaaf45
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
cmake_minimum_required
(
VERSION 2.8.12
)
cmake_minimum_required
(
VERSION 2.8.12
)
if
(
POLICY CMP0054
)
if
(
POLICY CMP0054
)
cmake_policy
(
SET CMP0054 NEW
)
cmake_policy
(
SET CMP0054 NEW
)
endif
()
endif
()
...
@@ -60,14 +60,14 @@ else()
...
@@ -60,14 +60,14 @@ else()
# Set a flag if the compiler you are using is capable of providing C++11 features.
# Set a flag if the compiler you are using is capable of providing C++11 features.
get_property
(
cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES
)
get_property
(
cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES
)
if
(
";
${
cxx_features
}
;"
MATCHES
";cxx_rvalue_references;"
AND
if
(
";
${
cxx_features
}
;"
MATCHES
";cxx_rvalue_references;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_variadic_templates;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_variadic_templates;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_lambdas;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_lambdas;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_defaulted_move_initializers;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_defaulted_move_initializers;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_delegating_constructors;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_delegating_constructors;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_thread_local;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_thread_local;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_constexpr;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_constexpr;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_decltype_incomplete_return_types;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_decltype_incomplete_return_types;"
AND
";
${
cxx_features
}
;"
MATCHES
";cxx_auto_type;"
)
";
${
cxx_features
}
;"
MATCHES
";cxx_auto_type;"
)
set
(
COMPILER_CAN_DO_CPP_11 1
)
set
(
COMPILER_CAN_DO_CPP_11 1
)
# Tell cmake that we need C++11 for dlib
# Tell cmake that we need C++11 for dlib
...
...
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