ADD: added other eigen lib
This commit is contained in:
@@ -3,21 +3,6 @@
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
if (NOT TARGET eigen)
|
||||
if (NOT TARGET Eigen3::Eigen)
|
||||
include ("${CMAKE_CURRENT_LIST_DIR}/Eigen3Targets.cmake")
|
||||
endif ()
|
||||
|
||||
# Legacy variables, do *not* use. May be removed in the future.
|
||||
|
||||
set (EIGEN3_FOUND 1)
|
||||
set (EIGEN3_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/UseEigen3.cmake")
|
||||
|
||||
set (EIGEN3_DEFINITIONS "@EIGEN_DEFINITIONS@")
|
||||
set (EIGEN3_INCLUDE_DIR "@PACKAGE_EIGEN_INCLUDE_DIR@")
|
||||
set (EIGEN3_INCLUDE_DIRS "@PACKAGE_EIGEN_INCLUDE_DIR@")
|
||||
set (EIGEN3_ROOT_DIR "@PACKAGE_EIGEN_ROOT_DIR@")
|
||||
|
||||
set (EIGEN3_VERSION_STRING "@EIGEN_VERSION_STRING@")
|
||||
set (EIGEN3_VERSION_MAJOR "@EIGEN_VERSION_MAJOR@")
|
||||
set (EIGEN3_VERSION_MINOR "@EIGEN_VERSION_MINOR@")
|
||||
set (EIGEN3_VERSION_PATCH "@EIGEN_VERSION_PATCH@")
|
||||
endif (NOT TARGET Eigen3::Eigen)
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
#
|
||||
# Eigen3Config.cmake(.in)
|
||||
|
||||
# Use the following variables to compile and link against Eigen:
|
||||
# EIGEN3_FOUND - True if Eigen was found on your system
|
||||
# EIGEN3_USE_FILE - The file making Eigen usable
|
||||
# EIGEN3_DEFINITIONS - Definitions needed to build with Eigen
|
||||
# EIGEN3_INCLUDE_DIR - Directory where signature_of_eigen3_matrix_library can be found
|
||||
# EIGEN3_INCLUDE_DIRS - List of directories of Eigen and it's dependencies
|
||||
# EIGEN3_ROOT_DIR - The base directory of Eigen
|
||||
# EIGEN3_VERSION_STRING - A human-readable string containing the version
|
||||
# EIGEN3_VERSION_MAJOR - The major version of Eigen
|
||||
# EIGEN3_VERSION_MINOR - The minor version of Eigen
|
||||
# EIGEN3_VERSION_PATCH - The patch version of Eigen
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set ( EIGEN3_FOUND 1 )
|
||||
set ( EIGEN3_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/UseEigen3.cmake" )
|
||||
|
||||
set ( EIGEN3_DEFINITIONS "@EIGEN_DEFINITIONS@" )
|
||||
set ( EIGEN3_INCLUDE_DIR "@PACKAGE_EIGEN_INCLUDE_DIR@" )
|
||||
set ( EIGEN3_INCLUDE_DIRS "@PACKAGE_EIGEN_INCLUDE_DIR@" )
|
||||
set ( EIGEN3_ROOT_DIR "@PACKAGE_EIGEN_ROOT_DIR@" )
|
||||
|
||||
set ( EIGEN3_VERSION_STRING "@EIGEN_VERSION_STRING@" )
|
||||
set ( EIGEN3_VERSION_MAJOR "@EIGEN_VERSION_MAJOR@" )
|
||||
set ( EIGEN3_VERSION_MINOR "@EIGEN_VERSION_MINOR@" )
|
||||
set ( EIGEN3_VERSION_PATCH "@EIGEN_VERSION_PATCH@" )
|
||||
@@ -8,9 +8,18 @@ ei_set_sitename()
|
||||
ei_set_build_string()
|
||||
|
||||
add_custom_target(buildtests)
|
||||
add_custom_target(check COMMAND "ctest")
|
||||
add_custom_target(check COMMAND "ctest" ${EIGEN_CTEST_ARGS})
|
||||
add_dependencies(check buildtests)
|
||||
|
||||
# Convenience target for only building GPU tests.
|
||||
add_custom_target(buildtests_gpu)
|
||||
add_custom_target(check_gpu COMMAND "ctest" "--output-on-failure"
|
||||
"--no-compress-output"
|
||||
"--build-no-clean"
|
||||
"-T" "test"
|
||||
"-L" "gpu")
|
||||
add_dependencies(check_gpu buildtests_gpu)
|
||||
|
||||
# check whether /bin/bash exists (disabled as not used anymore)
|
||||
# find_file(EIGEN_BIN_BASH_EXISTS "/bin/bash" PATHS "/" NO_DEFAULT_PATH)
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
# The utility function DetermineOSVersion aims at providing an
|
||||
# improved version of the CMake variable ${CMAKE_SYSTEM} on Windows
|
||||
# machines.
|
||||
#
|
||||
# Usage:
|
||||
# include(EigenDetermineOSVersion)
|
||||
# DetermineOSVersion(OS_VERSION)
|
||||
# message("OS: ${OS_VERSION}")
|
||||
|
||||
# - A little helper variable which should not be directly called
|
||||
function(DetermineShortWindowsName WIN_VERSION win_num_version)
|
||||
if (${win_num_version} VERSION_EQUAL "6.1")
|
||||
set(_version "win7")
|
||||
elseif(${win_num_version} VERSION_EQUAL "6.0")
|
||||
set(_version "winVista")
|
||||
elseif(${win_num_version} VERSION_EQUAL "5.2")
|
||||
set(_version "winXpProf")
|
||||
elseif(${win_num_version} VERSION_EQUAL "5.1")
|
||||
set(_version "winXp")
|
||||
elseif(${win_num_version} VERSION_EQUAL "5.0")
|
||||
set(_version "win2000Prof")
|
||||
else()
|
||||
set(_version "unknownWin")
|
||||
endif()
|
||||
set(${WIN_VERSION} ${_version} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(DetermineOSVersion OS_VERSION)
|
||||
if (WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||
file (TO_NATIVE_PATH "$ENV{COMSPEC}" SHELL)
|
||||
exec_program( ${SHELL} ARGS "/c" "ver" OUTPUT_VARIABLE ver_output)
|
||||
|
||||
string(REGEX MATCHALL "[0-9]+"
|
||||
ver_list "${ver_output}")
|
||||
list(GET ver_list 0 _major)
|
||||
list(GET ver_list 1 _minor)
|
||||
|
||||
set(win_num_version ${_major}.${_minor})
|
||||
DetermineShortWindowsName(win_version "${win_num_version}")
|
||||
if(win_version)
|
||||
set(${OS_VERSION} ${win_version} PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
set(${OS_VERSION} ${CMAKE_SYSTEM} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,41 +0,0 @@
|
||||
include(CMakeDetermineVSServicePack)
|
||||
|
||||
# The code is almost identical to the CMake version. The only difference is that we remove
|
||||
# _DetermineVSServicePack_FastCheckVersionWithCompiler which lead to errors on some systems.
|
||||
function(EigenDetermineVSServicePack _pack)
|
||||
if(NOT DETERMINED_VS_SERVICE_PACK OR NOT ${_pack})
|
||||
if(NOT DETERMINED_VS_SERVICE_PACK)
|
||||
_DetermineVSServicePack_CheckVersionWithTryCompile(DETERMINED_VS_SERVICE_PACK _cl_version)
|
||||
if(NOT DETERMINED_VS_SERVICE_PACK)
|
||||
_DetermineVSServicePack_CheckVersionWithTryRun(DETERMINED_VS_SERVICE_PACK _cl_version)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DETERMINED_VS_SERVICE_PACK)
|
||||
if(_cl_version)
|
||||
# Call helper function to determine VS version
|
||||
_DetermineVSServicePackFromCompiler(_sp "${_cl_version}")
|
||||
|
||||
# temporary fix, until CMake catches up
|
||||
if (NOT _sp)
|
||||
if(${_cl_version} VERSION_EQUAL "17.00.50727.1")
|
||||
set(_sp "vc110")
|
||||
elseif(${_cl_version} VERSION_EQUAL "17.00.51106.1")
|
||||
set(_sp "vc110sp1")
|
||||
elseif(${_cl_version} VERSION_EQUAL "17.00.60315.1")
|
||||
set(_sp "vc110sp2")
|
||||
elseif(${_cl_version} VERSION_EQUAL "17.00.60610.1")
|
||||
set(_sp "vc110sp3")
|
||||
else()
|
||||
set(_sp ${CMAKE_CXX_COMPILER_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(_sp)
|
||||
set(${_pack} ${_sp} CACHE INTERNAL
|
||||
"The Visual Studio Release with Service Pack")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -61,6 +61,9 @@ set(ei_smoke_test_list
|
||||
mapped_matrix_1
|
||||
mapstaticmethods_1
|
||||
mapstride_1
|
||||
unaryviewstride_1
|
||||
unaryviewstride_2
|
||||
unaryviewstride_3
|
||||
matrix_square_root_1
|
||||
meta
|
||||
minres_2
|
||||
@@ -100,6 +103,7 @@ set(ei_smoke_test_list
|
||||
sizeof
|
||||
sizeoverflow
|
||||
smallvectors
|
||||
sparse_basic_1
|
||||
sparse_basic_3
|
||||
sparse_block_1
|
||||
sparse_extra_4
|
||||
@@ -128,4 +132,5 @@ set(ei_smoke_test_list
|
||||
unalignedassert
|
||||
unalignedcount
|
||||
vectorwiseop_1
|
||||
visitor_1)
|
||||
visitor_1
|
||||
vectorization_logic_1)
|
||||
|
||||
@@ -23,10 +23,14 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
set(EIGEN_SUBTESTS_LIST "${EIGEN_SUBTESTS_LIST}${targetname}\n")
|
||||
set_property(GLOBAL PROPERTY EIGEN_SUBTESTS_LIST "${EIGEN_SUBTESTS_LIST}")
|
||||
|
||||
set(is_gpu_test OFF)
|
||||
if(EIGEN_ADD_TEST_FILENAME_EXTENSION STREQUAL cu)
|
||||
set(is_gpu_test ON)
|
||||
if(EIGEN_TEST_HIP)
|
||||
hip_reset_flags()
|
||||
hip_add_executable(${targetname} ${filename} HIPCC_OPTIONS "-DEIGEN_USE_HIP ${ARGV2}")
|
||||
hip_add_executable(${targetname} ${filename} HIPCC_OPTIONS -std=c++14)
|
||||
target_compile_definitions(${targetname} PRIVATE -DEIGEN_USE_HIP)
|
||||
set_property(TARGET ${targetname} PROPERTY HIP_ARCHITECTURES gfx900 gfx906 gfx908 gfx90a gfx1030)
|
||||
elseif(EIGEN_TEST_CUDA_CLANG)
|
||||
set_source_files_properties(${filename} PROPERTIES LANGUAGE CXX)
|
||||
|
||||
@@ -36,54 +40,46 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib")
|
||||
endif()
|
||||
|
||||
if (${ARGC} GREATER 2)
|
||||
add_executable(${targetname} ${filename})
|
||||
else()
|
||||
add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
|
||||
endif()
|
||||
add_executable(${targetname} ${filename})
|
||||
set(CUDA_CLANG_LINK_LIBRARIES "cudart_static" "cuda" "dl" "pthread")
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(CUDA_CLANG_LINK_LIBRARIES ${CUDA_CLANG_LINK_LIBRARIES} "rt")
|
||||
endif()
|
||||
target_link_libraries(${targetname} ${CUDA_CLANG_LINK_LIBRARIES})
|
||||
else()
|
||||
if (${ARGC} GREATER 2)
|
||||
cuda_add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
|
||||
else()
|
||||
cuda_add_executable(${targetname} ${filename})
|
||||
endif()
|
||||
cuda_add_executable(${targetname} ${filename})
|
||||
endif()
|
||||
else()
|
||||
add_executable(${targetname} ${filename})
|
||||
endif()
|
||||
|
||||
if (targetname MATCHES "^eigen2_")
|
||||
add_dependencies(eigen2_buildtests ${targetname})
|
||||
else()
|
||||
add_dependencies(buildtests ${targetname})
|
||||
add_dependencies(buildtests ${targetname})
|
||||
|
||||
if (is_gpu_test)
|
||||
add_dependencies(buildtests_gpu ${targetname})
|
||||
endif()
|
||||
|
||||
if(EIGEN_NO_ASSERTION_CHECKING)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_NO_ASSERTION_CHECKING=1")
|
||||
target_compile_definitions(${targetname} PRIVATE EIGEN_NO_ASSERTION_CHECKING=1)
|
||||
else()
|
||||
if(EIGEN_DEBUG_ASSERTS)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_DEBUG_ASSERTS=1")
|
||||
target_compile_definitions(${targetname} PRIVATE EIGEN_DEBUG_ASSERTS=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_MAX_SIZE=${EIGEN_TEST_MAX_SIZE}")
|
||||
target_compile_definitions(${targetname} PRIVATE EIGEN_TEST_MAX_SIZE=${EIGEN_TEST_MAX_SIZE})
|
||||
|
||||
if(MSVC)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "/bigobj")
|
||||
target_compile_options(${targetname} PRIVATE "/bigobj")
|
||||
endif()
|
||||
|
||||
# let the user pass flags.
|
||||
if(${ARGC} GREATER 2)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "${ARGV2}")
|
||||
target_compile_options(${targetname} PRIVATE ${ARGV2})
|
||||
endif()
|
||||
|
||||
if(EIGEN_TEST_CUSTOM_CXX_FLAGS)
|
||||
ei_add_target_property(${targetname} COMPILE_FLAGS "${EIGEN_TEST_CUSTOM_CXX_FLAGS}")
|
||||
target_compile_options(${targetname} PRIVATE ${EIGEN_TEST_CUSTOM_CXX_FLAGS})
|
||||
endif()
|
||||
|
||||
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
||||
@@ -118,21 +114,14 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
add_dependencies("Build${current_subproject}" ${targetname})
|
||||
set_property(TEST ${testname_with_suffix} PROPERTY LABELS "${current_subproject}")
|
||||
endif()
|
||||
if (is_gpu_test)
|
||||
# Add gpu tag for testing only GPU tests.
|
||||
set_property(TEST ${testname_with_suffix} APPEND PROPERTY LABELS "gpu")
|
||||
endif()
|
||||
|
||||
if(EIGEN_SYCL)
|
||||
# Force include of the SYCL file at the end to avoid errors.
|
||||
set_property(TARGET ${targetname} PROPERTY COMPUTECPP_INCLUDE_AFTER 1)
|
||||
# Set COMPILE_FLAGS to COMPILE_DEFINITIONS instead to avoid having to duplicate the flags
|
||||
# to the device compiler.
|
||||
get_target_property(target_compile_flags ${targetname} COMPILE_FLAGS)
|
||||
separate_arguments(target_compile_flags)
|
||||
foreach(flag ${target_compile_flags})
|
||||
if(${flag} MATCHES "^-D.*")
|
||||
string(REPLACE "-D" "" definition_flag ${flag})
|
||||
set_property(TARGET ${targetname} APPEND PROPERTY COMPILE_DEFINITIONS ${definition_flag})
|
||||
list(REMOVE_ITEM target_compile_flags ${flag})
|
||||
endif()
|
||||
endforeach()
|
||||
set_property(TARGET ${targetname} PROPERTY COMPILE_FLAGS ${target_compile_flags})
|
||||
# Link against pthread and add sycl to target
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
@@ -209,12 +198,13 @@ macro(ei_add_test testname)
|
||||
if( (EIGEN_SPLIT_LARGE_TESTS AND suffixes) OR explicit_suffixes)
|
||||
add_custom_target(${testname})
|
||||
foreach(suffix ${suffixes})
|
||||
ei_add_test_internal(${testname} ${testname}_${suffix}
|
||||
"${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}")
|
||||
ei_add_test_internal(${testname} ${testname}_${suffix} "${ARGV1}" "${ARGV2}")
|
||||
add_dependencies(${testname} ${testname}_${suffix})
|
||||
target_compile_definitions(${testname}_${suffix} PRIVATE -DEIGEN_TEST_PART_${suffix}=1)
|
||||
endforeach()
|
||||
else()
|
||||
ei_add_test_internal(${testname} ${testname} "${ARGV1} -DEIGEN_TEST_PART_ALL=1" "${ARGV2}")
|
||||
ei_add_test_internal(${testname} ${testname} "${ARGV1}" "${ARGV2}")
|
||||
target_compile_definitions(${testname} PRIVATE -DEIGEN_TEST_PART_ALL=1)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
@@ -375,12 +365,6 @@ macro(ei_testing_print_summary)
|
||||
message(STATUS "S390X ZVECTOR: Using architecture defaults")
|
||||
endif()
|
||||
|
||||
if(EIGEN_TEST_CXX11)
|
||||
message(STATUS "C++11: ON")
|
||||
else()
|
||||
message(STATUS "C++11: OFF")
|
||||
endif()
|
||||
|
||||
if(EIGEN_TEST_SYCL)
|
||||
if(EIGEN_SYCL_TRISYCL)
|
||||
message(STATUS "SYCL: ON (using triSYCL)")
|
||||
@@ -455,15 +439,7 @@ endmacro()
|
||||
|
||||
macro(ei_get_compilerver VAR)
|
||||
if(MSVC)
|
||||
# on windows system, we use a modified CMake script
|
||||
include(EigenDetermineVSServicePack)
|
||||
EigenDetermineVSServicePack( my_service_pack )
|
||||
|
||||
if( my_service_pack )
|
||||
set(${VAR} ${my_service_pack})
|
||||
else()
|
||||
set(${VAR} "na")
|
||||
endif()
|
||||
set(${VAR} "${CMAKE_CXX_COMPILER_VERSION}")
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "PGI")
|
||||
set(${VAR} "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}")
|
||||
else()
|
||||
@@ -598,10 +574,7 @@ macro(ei_set_build_string)
|
||||
ei_get_compilerver(LOCAL_COMPILER_VERSION)
|
||||
ei_get_cxxflags(LOCAL_COMPILER_FLAGS)
|
||||
|
||||
include(EigenDetermineOSVersion)
|
||||
DetermineOSVersion(OS_VERSION)
|
||||
|
||||
set(TMP_BUILD_STRING ${OS_VERSION}-${LOCAL_COMPILER_VERSION})
|
||||
set(TMP_BUILD_STRING ${CMAKE_SYSTEM}-${LOCAL_COMPILER_VERSION})
|
||||
|
||||
if (NOT ${LOCAL_COMPILER_FLAGS} STREQUAL "")
|
||||
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-${LOCAL_COMPILER_FLAGS})
|
||||
@@ -618,10 +591,6 @@ macro(ei_set_build_string)
|
||||
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-64bit)
|
||||
endif()
|
||||
|
||||
if(EIGEN_TEST_CXX11)
|
||||
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-cxx11)
|
||||
endif()
|
||||
|
||||
if(EIGEN_BUILD_STRING_SUFFIX)
|
||||
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-${EIGEN_BUILD_STRING_SUFFIX})
|
||||
endif()
|
||||
@@ -671,8 +640,8 @@ endmacro()
|
||||
# Split all tests listed in EIGEN_TESTS_LIST into num_splits many targets
|
||||
# named buildtestspartN with N = { 0, ..., num_splits-1}.
|
||||
#
|
||||
# The intention behind the existance of this macro is the size of Eigen's
|
||||
# testsuite. Together with the relativly big compile-times building all tests
|
||||
# The intention behind the existence of this macro is the size of Eigen's
|
||||
# testsuite. Together with the relatively big compile-times building all tests
|
||||
# can take a substantial amount of time depending on the available hardware.
|
||||
#
|
||||
# The last buildtestspartN target will build possible remaining tests.
|
||||
@@ -775,8 +744,7 @@ macro(ei_add_smoke_tests smoke_test_list)
|
||||
if ("${test}" IN_LIST EIGEN_SUBTESTS_LIST)
|
||||
add_dependencies("${buildtarget}" "${test}")
|
||||
# Add label smoketest to be able to run smoketests using ctest
|
||||
get_property(test_labels TEST ${test} PROPERTY LABELS)
|
||||
set_property(TEST ${test} PROPERTY LABELS "${test_labels};smoketest")
|
||||
set_property(TEST ${test} APPEND PROPERTY LABELS "smoketest")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro(ei_add_smoke_tests)
|
||||
|
||||
28
libs/eigen/cmake/FindAccelerate.cmake
Normal file
28
libs/eigen/cmake/FindAccelerate.cmake
Normal file
@@ -0,0 +1,28 @@
|
||||
if (Accelerate_INCLUDES AND Accelerate_LIBRARIES)
|
||||
set(Accelerate_FIND_QUIETLY TRUE)
|
||||
endif ()
|
||||
|
||||
find_path(Accelerate_INCLUDES
|
||||
NAMES
|
||||
Accelerate.h
|
||||
PATHS $ENV{ACCELERATEDIR}
|
||||
)
|
||||
|
||||
find_library(Accelerate_LIBRARIES Accelerate PATHS $ENV{ACCELERATEDIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Accelerate DEFAULT_MSG
|
||||
Accelerate_INCLUDES Accelerate_LIBRARIES)
|
||||
|
||||
if (Accelerate_FOUND)
|
||||
get_filename_component(Accelerate_PARENTDIR ${Accelerate_INCLUDES} DIRECTORY)
|
||||
|
||||
file(GLOB_RECURSE SparseHeader ${Accelerate_PARENTDIR}/Sparse.h)
|
||||
|
||||
if ("${SparseHeader}" STREQUAL "")
|
||||
message(STATUS "Accelerate sparse matrix support was not found. Accelerate has been disabled.")
|
||||
set(Accelerate_FOUND FALSE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(Accelerate_INCLUDES Accelerate_LIBRARIES)
|
||||
File diff suppressed because it is too large
Load Diff
61
libs/eigen/cmake/FindCLANG_FORMAT.cmake
Normal file
61
libs/eigen/cmake/FindCLANG_FORMAT.cmake
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
|
||||
# Find clang-format
|
||||
#
|
||||
# CLANG_FORMAT_EXECUTABLE - Path to clang-format executable
|
||||
# CLANG_FORMAT_FOUND - True if the clang-format executable was found.
|
||||
# CLANG_FORMAT_VERSION - The version of clang-format found
|
||||
#
|
||||
# Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org)
|
||||
#
|
||||
# Licensed under the Mozilla Public License Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.mozilla.org/en-US/MPL/2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
find_program(CLANG_FORMAT_EXECUTABLE
|
||||
NAMES
|
||||
clang-format-9
|
||||
clang-format
|
||||
clang-format-11
|
||||
clang-format-10
|
||||
clang-format-8
|
||||
clang-format-7
|
||||
|
||||
DOC "clang-format executable")
|
||||
mark_as_advanced(CLANG_FORMAT_EXECUTABLE)
|
||||
|
||||
# Extract version from command "clang-format -version"
|
||||
if(CLANG_FORMAT_EXECUTABLE)
|
||||
execute_process(COMMAND ${CLANG_FORMAT_EXECUTABLE} -version
|
||||
OUTPUT_VARIABLE clang_format_version
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(clang_format_version MATCHES "^.*clang-format version .*")
|
||||
# clang_format_version sample: "clang-format version 3.9.1-4ubuntu3~16.04.1
|
||||
# (tags/RELEASE_391/rc2)"
|
||||
string(REGEX
|
||||
REPLACE "^.*clang-format version ([.0-9]+).*"
|
||||
"\\1"
|
||||
CLANG_FORMAT_VERSION
|
||||
"${clang_format_version}")
|
||||
# CLANG_FORMAT_VERSION sample: "3.9.1"
|
||||
else()
|
||||
set(CLANG_FORMAT_VERSION 0.0)
|
||||
endif()
|
||||
else()
|
||||
set(CLANG_FORMAT_VERSION 0.0)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set CLANG_FORMAT_FOUND to TRUE
|
||||
# if all listed variables are TRUE
|
||||
find_package_handle_standard_args(CLANG_FORMAT REQUIRED_VARS CLANG_FORMAT_EXECUTABLE VERSION_VAR CLANG_FORMAT_VERSION)
|
||||
@@ -382,7 +382,7 @@ endfunction(__build_ir)
|
||||
#######################
|
||||
#
|
||||
# Adds a SYCL compilation custom command associated with an existing
|
||||
# target and sets a dependancy on that new command.
|
||||
# target and sets a dependency on that new command.
|
||||
#
|
||||
# TARGET : Name of the target to add SYCL to.
|
||||
# SOURCES : Source files to be compiled for SYCL.
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
# - Try to find Eigen2 lib
|
||||
#
|
||||
# This module supports requiring a minimum version, e.g. you can do
|
||||
# find_package(Eigen2 2.0.3)
|
||||
# to require version 2.0.3 to newer of Eigen2.
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# EIGEN2_FOUND - system has eigen lib with correct version
|
||||
# EIGEN2_INCLUDE_DIR - the eigen include directory
|
||||
# EIGEN2_VERSION - eigen version
|
||||
|
||||
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
|
||||
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
|
||||
if(NOT Eigen2_FIND_VERSION)
|
||||
if(NOT Eigen2_FIND_VERSION_MAJOR)
|
||||
set(Eigen2_FIND_VERSION_MAJOR 2)
|
||||
endif()
|
||||
if(NOT Eigen2_FIND_VERSION_MINOR)
|
||||
set(Eigen2_FIND_VERSION_MINOR 0)
|
||||
endif()
|
||||
if(NOT Eigen2_FIND_VERSION_PATCH)
|
||||
set(Eigen2_FIND_VERSION_PATCH 0)
|
||||
endif()
|
||||
|
||||
set(Eigen2_FIND_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}")
|
||||
endif()
|
||||
|
||||
macro(_eigen2_check_version)
|
||||
file(READ "${EIGEN2_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header)
|
||||
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen2_world_version_match "${_eigen2_version_header}")
|
||||
set(EIGEN2_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen2_major_version_match "${_eigen2_version_header}")
|
||||
set(EIGEN2_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen2_minor_version_match "${_eigen2_version_header}")
|
||||
set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
|
||||
set(EIGEN2_VERSION ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION})
|
||||
if((${EIGEN2_WORLD_VERSION} NOTEQUAL 2) OR (${EIGEN2_MAJOR_VERSION} GREATER 10) OR (${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION}))
|
||||
set(EIGEN2_VERSION_OK FALSE)
|
||||
else()
|
||||
set(EIGEN2_VERSION_OK TRUE)
|
||||
endif()
|
||||
|
||||
if(NOT EIGEN2_VERSION_OK)
|
||||
|
||||
message(STATUS "Eigen2 version ${EIGEN2_VERSION} found in ${EIGEN2_INCLUDE_DIR}, "
|
||||
"but at least version ${Eigen2_FIND_VERSION} is required")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if (EIGEN2_INCLUDE_DIR)
|
||||
|
||||
# in cache already
|
||||
_eigen2_check_version()
|
||||
set(EIGEN2_FOUND ${EIGEN2_VERSION_OK})
|
||||
|
||||
else ()
|
||||
|
||||
find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
|
||||
PATHS
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
${KDE4_INCLUDE_DIR}
|
||||
PATH_SUFFIXES eigen2
|
||||
)
|
||||
|
||||
if(EIGEN2_INCLUDE_DIR)
|
||||
_eigen2_check_version()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR EIGEN2_VERSION_OK)
|
||||
|
||||
mark_as_advanced(EIGEN2_INCLUDE_DIR)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
# - Try to find Eigen3 lib
|
||||
#
|
||||
# This module supports requiring a minimum version, e.g. you can do
|
||||
# find_package(Eigen3 3.1.2)
|
||||
# to require version 3.1.2 or newer of Eigen3.
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# EIGEN3_FOUND - system has eigen lib with correct version
|
||||
# EIGEN3_INCLUDE_DIR - the eigen include directory
|
||||
# EIGEN3_VERSION - eigen version
|
||||
#
|
||||
# and the following imported target:
|
||||
#
|
||||
# Eigen3::Eigen - The header-only Eigen library
|
||||
#
|
||||
# This module reads hints about search locations from
|
||||
# the following environment variables:
|
||||
#
|
||||
# EIGEN3_ROOT
|
||||
# EIGEN3_ROOT_DIR
|
||||
|
||||
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
|
||||
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
|
||||
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
|
||||
|
||||
if(NOT Eigen3_FIND_VERSION)
|
||||
if(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||
set(Eigen3_FIND_VERSION_MAJOR 2)
|
||||
endif()
|
||||
if(NOT Eigen3_FIND_VERSION_MINOR)
|
||||
set(Eigen3_FIND_VERSION_MINOR 91)
|
||||
endif()
|
||||
if(NOT Eigen3_FIND_VERSION_PATCH)
|
||||
set(Eigen3_FIND_VERSION_PATCH 0)
|
||||
endif()
|
||||
|
||||
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
|
||||
endif()
|
||||
|
||||
macro(_eigen3_check_version)
|
||||
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
|
||||
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
|
||||
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
|
||||
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
set(EIGEN3_VERSION_OK FALSE)
|
||||
else()
|
||||
set(EIGEN3_VERSION_OK TRUE)
|
||||
endif()
|
||||
|
||||
if(NOT EIGEN3_VERSION_OK)
|
||||
|
||||
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
|
||||
"but at least version ${Eigen3_FIND_VERSION} is required")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if (EIGEN3_INCLUDE_DIR)
|
||||
|
||||
# in cache already
|
||||
_eigen3_check_version()
|
||||
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
|
||||
set(Eigen3_FOUND ${EIGEN3_VERSION_OK})
|
||||
|
||||
else ()
|
||||
|
||||
# search first if an Eigen3Config.cmake is available in the system,
|
||||
# if successful this would set EIGEN3_INCLUDE_DIR and the rest of
|
||||
# the script will work as usual
|
||||
find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET)
|
||||
|
||||
if(NOT EIGEN3_INCLUDE_DIR)
|
||||
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
|
||||
HINTS
|
||||
ENV EIGEN3_ROOT
|
||||
ENV EIGEN3_ROOT_DIR
|
||||
PATHS
|
||||
${CMAKE_INSTALL_PREFIX}/include
|
||||
${KDE4_INCLUDE_DIR}
|
||||
PATH_SUFFIXES eigen3 eigen
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EIGEN3_INCLUDE_DIR)
|
||||
_eigen3_check_version()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
|
||||
|
||||
mark_as_advanced(EIGEN3_INCLUDE_DIR)
|
||||
|
||||
endif()
|
||||
|
||||
if(EIGEN3_FOUND AND NOT TARGET Eigen3::Eigen)
|
||||
add_library(Eigen3::Eigen INTERFACE IMPORTED)
|
||||
set_target_properties(Eigen3::Eigen PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}")
|
||||
endif()
|
||||
@@ -1,105 +0,0 @@
|
||||
# Copyright (c) 2009 Boudewijn Rempt <boud@valdyas.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
# - try to find glew library and include files
|
||||
# GLEW_INCLUDE_DIR, where to find GL/glew.h, etc.
|
||||
# GLEW_LIBRARIES, the libraries to link against
|
||||
# GLEW_FOUND, If false, do not try to use GLEW.
|
||||
# Also defined, but not for general use are:
|
||||
# GLEW_GLEW_LIBRARY = the full path to the glew library.
|
||||
|
||||
if (WIN32)
|
||||
|
||||
if(CYGWIN)
|
||||
|
||||
find_path( GLEW_INCLUDE_DIR GL/glew.h)
|
||||
|
||||
find_library( GLEW_GLEW_LIBRARY glew32
|
||||
${OPENGL_LIBRARY_DIR}
|
||||
/usr/lib/w32api
|
||||
/usr/X11R6/lib
|
||||
)
|
||||
|
||||
|
||||
else(CYGWIN)
|
||||
|
||||
find_path( GLEW_INCLUDE_DIR GL/glew.h
|
||||
$ENV{GLEW_ROOT_PATH}/include
|
||||
)
|
||||
|
||||
find_library( GLEW_GLEW_LIBRARY
|
||||
NAMES glew glew32
|
||||
PATHS
|
||||
$ENV{GLEW_ROOT_PATH}/lib
|
||||
${OPENGL_LIBRARY_DIR}
|
||||
)
|
||||
|
||||
endif(CYGWIN)
|
||||
|
||||
else (WIN32)
|
||||
|
||||
if (APPLE)
|
||||
# These values for Apple could probably do with improvement.
|
||||
find_path( GLEW_INCLUDE_DIR glew.h
|
||||
/System/Library/Frameworks/GLEW.framework/Versions/A/Headers
|
||||
${OPENGL_LIBRARY_DIR}
|
||||
)
|
||||
set(GLEW_GLEW_LIBRARY "-framework GLEW" CACHE STRING "GLEW library for OSX")
|
||||
set(GLEW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
|
||||
else (APPLE)
|
||||
|
||||
find_path( GLEW_INCLUDE_DIR GL/glew.h
|
||||
/usr/include/GL
|
||||
/usr/openwin/share/include
|
||||
/usr/openwin/include
|
||||
/usr/X11R6/include
|
||||
/usr/include/X11
|
||||
/opt/graphics/OpenGL/include
|
||||
/opt/graphics/OpenGL/contrib/libglew
|
||||
)
|
||||
|
||||
find_library( GLEW_GLEW_LIBRARY GLEW
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
)
|
||||
|
||||
endif (APPLE)
|
||||
|
||||
endif (WIN32)
|
||||
|
||||
set( GLEW_FOUND "NO" )
|
||||
if(GLEW_INCLUDE_DIR)
|
||||
if(GLEW_GLEW_LIBRARY)
|
||||
# Is -lXi and -lXmu required on all platforms that have it?
|
||||
# If not, we need some way to figure out what platform we are on.
|
||||
set( GLEW_LIBRARIES
|
||||
${GLEW_GLEW_LIBRARY}
|
||||
${GLEW_cocoa_LIBRARY}
|
||||
)
|
||||
set( GLEW_FOUND "YES" )
|
||||
|
||||
#The following deprecated settings are for backwards compatibility with CMake1.4
|
||||
set (GLEW_LIBRARY ${GLEW_LIBRARIES})
|
||||
set (GLEW_INCLUDE_PATH ${GLEW_INCLUDE_DIR})
|
||||
|
||||
endif(GLEW_GLEW_LIBRARY)
|
||||
endif(GLEW_INCLUDE_DIR)
|
||||
|
||||
if(GLEW_FOUND)
|
||||
if(NOT GLEW_FIND_QUIETLY)
|
||||
message(STATUS "Found Glew: ${GLEW_LIBRARIES}")
|
||||
endif(NOT GLEW_FIND_QUIETLY)
|
||||
else(GLEW_FOUND)
|
||||
if(GLEW_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find Glew")
|
||||
endif(GLEW_FIND_REQUIRED)
|
||||
endif(GLEW_FOUND)
|
||||
|
||||
mark_as_advanced(
|
||||
GLEW_INCLUDE_DIR
|
||||
GLEW_GLEW_LIBRARY
|
||||
GLEW_Xmu_LIBRARY
|
||||
GLEW_Xi_LIBRARY
|
||||
)
|
||||
@@ -1,170 +0,0 @@
|
||||
# Try to find gnu scientific library GSL
|
||||
# See
|
||||
# http://www.gnu.org/software/gsl/ and
|
||||
# http://gnuwin32.sourceforge.net/packages/gsl.htm
|
||||
#
|
||||
# Once run this will define:
|
||||
#
|
||||
# GSL_FOUND = system has GSL lib
|
||||
#
|
||||
# GSL_LIBRARIES = full path to the libraries
|
||||
# on Unix/Linux with additional linker flags from "gsl-config --libs"
|
||||
#
|
||||
# CMAKE_GSL_CXX_FLAGS = Unix compiler flags for GSL, essentially "`gsl-config --cxxflags`"
|
||||
#
|
||||
# GSL_INCLUDE_DIR = where to find headers
|
||||
#
|
||||
# GSL_LINK_DIRECTORIES = link directories, useful for rpath on Unix
|
||||
# GSL_EXE_LINKER_FLAGS = rpath on Unix
|
||||
#
|
||||
# Felix Woelk 07/2004
|
||||
# Jan Woetzel
|
||||
#
|
||||
# www.mip.informatik.uni-kiel.de
|
||||
# --------------------------------
|
||||
|
||||
if(WIN32)
|
||||
# JW tested with gsl-1.8, Windows XP, MSVS 7.1
|
||||
set(GSL_POSSIBLE_ROOT_DIRS
|
||||
${GSL_ROOT_DIR}
|
||||
$ENV{GSL_ROOT_DIR}
|
||||
${GSL_DIR}
|
||||
${GSL_HOME}
|
||||
$ENV{GSL_DIR}
|
||||
$ENV{GSL_HOME}
|
||||
$ENV{EXTRA}
|
||||
"C:/Program Files/GnuWin32"
|
||||
)
|
||||
find_path(GSL_INCLUDE_DIR
|
||||
NAMES gsl/gsl_cdf.h gsl/gsl_randist.h
|
||||
PATHS ${GSL_POSSIBLE_ROOT_DIRS}
|
||||
PATH_SUFFIXES include
|
||||
DOC "GSL header include dir"
|
||||
)
|
||||
|
||||
find_library(GSL_GSL_LIBRARY
|
||||
NAMES libgsl.dll.a gsl libgsl
|
||||
PATHS ${GSL_POSSIBLE_ROOT_DIRS}
|
||||
PATH_SUFFIXES lib
|
||||
DOC "GSL library" )
|
||||
|
||||
if(NOT GSL_GSL_LIBRARY)
|
||||
find_file(GSL_GSL_LIBRARY
|
||||
NAMES libgsl.dll.a
|
||||
PATHS ${GSL_POSSIBLE_ROOT_DIRS}
|
||||
PATH_SUFFIXES lib
|
||||
DOC "GSL library")
|
||||
endif()
|
||||
|
||||
find_library(GSL_GSLCBLAS_LIBRARY
|
||||
NAMES libgslcblas.dll.a gslcblas libgslcblas
|
||||
PATHS ${GSL_POSSIBLE_ROOT_DIRS}
|
||||
PATH_SUFFIXES lib
|
||||
DOC "GSL cblas library dir" )
|
||||
|
||||
if(NOT GSL_GSLCBLAS_LIBRARY)
|
||||
find_file(GSL_GSLCBLAS_LIBRARY
|
||||
NAMES libgslcblas.dll.a
|
||||
PATHS ${GSL_POSSIBLE_ROOT_DIRS}
|
||||
PATH_SUFFIXES lib
|
||||
DOC "GSL library")
|
||||
endif()
|
||||
|
||||
set(GSL_LIBRARIES ${GSL_GSL_LIBRARY})
|
||||
|
||||
#message("DBG\n"
|
||||
# "GSL_GSL_LIBRARY=${GSL_GSL_LIBRARY}\n"
|
||||
# "GSL_GSLCBLAS_LIBRARY=${GSL_GSLCBLAS_LIBRARY}\n"
|
||||
# "GSL_LIBRARIES=${GSL_LIBRARIES}")
|
||||
|
||||
|
||||
else(WIN32)
|
||||
|
||||
if(UNIX)
|
||||
set(GSL_CONFIG_PREFER_PATH
|
||||
"$ENV{GSL_DIR}/bin"
|
||||
"$ENV{GSL_DIR}"
|
||||
"$ENV{GSL_HOME}/bin"
|
||||
"$ENV{GSL_HOME}"
|
||||
CACHE STRING "preferred path to GSL (gsl-config)")
|
||||
find_program(GSL_CONFIG gsl-config
|
||||
${GSL_CONFIG_PREFER_PATH}
|
||||
/usr/bin/
|
||||
)
|
||||
# message("DBG GSL_CONFIG ${GSL_CONFIG}")
|
||||
|
||||
if (GSL_CONFIG)
|
||||
# set CXXFLAGS to be fed into CXX_FLAGS by the user:
|
||||
set(GSL_CXX_FLAGS "`${GSL_CONFIG} --cflags`")
|
||||
|
||||
# set INCLUDE_DIRS to prefix+include
|
||||
exec_program(${GSL_CONFIG}
|
||||
ARGS --prefix
|
||||
OUTPUT_VARIABLE GSL_PREFIX)
|
||||
set(GSL_INCLUDE_DIR ${GSL_PREFIX}/include CACHE STRING INTERNAL)
|
||||
|
||||
# set link libraries and link flags
|
||||
#set(GSL_LIBRARIES "`${GSL_CONFIG} --libs`")
|
||||
exec_program(${GSL_CONFIG}
|
||||
ARGS --libs
|
||||
OUTPUT_VARIABLE GSL_LIBRARIES )
|
||||
|
||||
# extract link dirs for rpath
|
||||
exec_program(${GSL_CONFIG}
|
||||
ARGS --libs
|
||||
OUTPUT_VARIABLE GSL_CONFIG_LIBS )
|
||||
|
||||
# extract version
|
||||
exec_program(${GSL_CONFIG}
|
||||
ARGS --version
|
||||
OUTPUT_VARIABLE GSL_FULL_VERSION )
|
||||
|
||||
# split version as major/minor
|
||||
string(REGEX MATCH "(.)\\..*" GSL_VERSION_MAJOR_ "${GSL_FULL_VERSION}")
|
||||
set(GSL_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH ".\\.(.*)" GSL_VERSION_MINOR_ "${GSL_FULL_VERSION}")
|
||||
set(GSL_VERSION_MINOR ${CMAKE_MATCH_1})
|
||||
|
||||
# split off the link dirs (for rpath)
|
||||
# use regular expression to match wildcard equivalent "-L*<endchar>"
|
||||
# with <endchar> is a space or a semicolon
|
||||
string(REGEX MATCHALL "[-][L]([^ ;])+"
|
||||
GSL_LINK_DIRECTORIES_WITH_PREFIX
|
||||
"${GSL_CONFIG_LIBS}" )
|
||||
# message("DBG GSL_LINK_DIRECTORIES_WITH_PREFIX=${GSL_LINK_DIRECTORIES_WITH_PREFIX}")
|
||||
|
||||
# remove prefix -L because we need the pure directory for LINK_DIRECTORIES
|
||||
|
||||
if (GSL_LINK_DIRECTORIES_WITH_PREFIX)
|
||||
string(REGEX REPLACE "[-][L]" "" GSL_LINK_DIRECTORIES ${GSL_LINK_DIRECTORIES_WITH_PREFIX} )
|
||||
endif (GSL_LINK_DIRECTORIES_WITH_PREFIX)
|
||||
set(GSL_EXE_LINKER_FLAGS "-Wl,-rpath,${GSL_LINK_DIRECTORIES}" CACHE STRING INTERNAL)
|
||||
# message("DBG GSL_LINK_DIRECTORIES=${GSL_LINK_DIRECTORIES}")
|
||||
# message("DBG GSL_EXE_LINKER_FLAGS=${GSL_EXE_LINKER_FLAGS}")
|
||||
|
||||
# add_definitions("-DHAVE_GSL")
|
||||
# set(GSL_DEFINITIONS "-DHAVE_GSL")
|
||||
mark_as_advanced(
|
||||
GSL_CXX_FLAGS
|
||||
GSL_INCLUDE_DIR
|
||||
GSL_LIBRARIES
|
||||
GSL_LINK_DIRECTORIES
|
||||
GSL_DEFINITIONS
|
||||
)
|
||||
message(STATUS "Using GSL from ${GSL_PREFIX}")
|
||||
|
||||
else(GSL_CONFIG)
|
||||
message("FindGSL.cmake: gsl-config not found. Please set it manually. GSL_CONFIG=${GSL_CONFIG}")
|
||||
endif(GSL_CONFIG)
|
||||
|
||||
endif(UNIX)
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
if(GSL_LIBRARIES)
|
||||
if(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS)
|
||||
|
||||
set(GSL_FOUND 1)
|
||||
|
||||
endif(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS)
|
||||
endif(GSL_LIBRARIES)
|
||||
@@ -1,274 +0,0 @@
|
||||
# Find LAPACK library
|
||||
#
|
||||
# This module finds an installed library that implements the LAPACK
|
||||
# linear-algebra interface (see http://www.netlib.org/lapack/).
|
||||
# The approach follows mostly that taken for the autoconf macro file, acx_lapack.m4
|
||||
# (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
|
||||
#
|
||||
# This module sets the following variables:
|
||||
# LAPACK_FOUND - set to true if a library implementing the LAPACK interface
|
||||
# is found
|
||||
# LAPACK_INCLUDE_DIR - Directories containing the LAPACK header files
|
||||
# LAPACK_DEFINITIONS - Compilation options to use LAPACK
|
||||
# LAPACK_LINKER_FLAGS - Linker flags to use LAPACK (excluding -l
|
||||
# and -L).
|
||||
# LAPACK_LIBRARIES_DIR - Directories containing the LAPACK libraries.
|
||||
# May be null if LAPACK_LIBRARIES contains libraries name using full path.
|
||||
# LAPACK_LIBRARIES - List of libraries to link against LAPACK interface.
|
||||
# May be null if the compiler supports auto-link (e.g. VC++).
|
||||
# LAPACK_USE_FILE - The name of the cmake module to include to compile
|
||||
# applications or libraries using LAPACK.
|
||||
#
|
||||
# This module was modified by CGAL team:
|
||||
# - find libraries for a C++ compiler, instead of Fortran
|
||||
# - added LAPACK_INCLUDE_DIR, LAPACK_DEFINITIONS and LAPACK_LIBRARIES_DIR
|
||||
# - removed LAPACK95_LIBRARIES
|
||||
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# This macro checks for the existence of the combination of fortran libraries
|
||||
# given by _list. If the combination is found, this macro checks (using the
|
||||
# check_function_exists macro) whether can link against that library
|
||||
# combination using the name of a routine given by _name using the linker
|
||||
# flags given by _flags. If the combination of libraries is found and passes
|
||||
# the link test, LIBRARIES is set to the list of complete library paths that
|
||||
# have been found and DEFINITIONS to the required definitions.
|
||||
# Otherwise, LIBRARIES is set to FALSE.
|
||||
# N.B. _prefix is the prefix applied to the names of all cached variables that
|
||||
# are generated internally and marked advanced by this macro.
|
||||
macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _blas _path)
|
||||
#message("DEBUG: check_lapack_libraries(${_list} in ${_path} with ${_blas})")
|
||||
|
||||
# Check for the existence of the libraries given by _list
|
||||
set(_libraries_found TRUE)
|
||||
set(_libraries_work FALSE)
|
||||
set(${DEFINITIONS} "")
|
||||
set(${LIBRARIES} "")
|
||||
set(_combined_name)
|
||||
foreach(_library ${_list})
|
||||
set(_combined_name ${_combined_name}_${_library})
|
||||
|
||||
if(_libraries_found)
|
||||
# search first in ${_path}
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ${_path} NO_DEFAULT_PATH
|
||||
)
|
||||
# if not found, search in environment variables and system
|
||||
if ( WIN32 )
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ENV LIB
|
||||
)
|
||||
elseif ( APPLE )
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
|
||||
)
|
||||
else ()
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
|
||||
)
|
||||
endif()
|
||||
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
||||
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||
set(_libraries_found ${${_prefix}_${_library}_LIBRARY})
|
||||
endif()
|
||||
endforeach()
|
||||
if(_libraries_found)
|
||||
set(_libraries_found ${${LIBRARIES}})
|
||||
endif()
|
||||
|
||||
# Test this combination of libraries with the Fortran/f2c interface.
|
||||
# We test the Fortran interface first as it is well standardized.
|
||||
if(_libraries_found AND NOT _libraries_work)
|
||||
set(${DEFINITIONS} "-D${_prefix}_USE_F2C")
|
||||
set(${LIBRARIES} ${_libraries_found})
|
||||
# Some C++ linkers require the f2c library to link with Fortran libraries.
|
||||
# I do not know which ones, thus I just add the f2c library if it is available.
|
||||
find_dependency( F2C QUIET )
|
||||
if ( F2C_FOUND )
|
||||
set(${DEFINITIONS} ${${DEFINITIONS}} ${F2C_DEFINITIONS})
|
||||
set(${LIBRARIES} ${${LIBRARIES}} ${F2C_LIBRARIES})
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_DEFINITIONS ${${DEFINITIONS}})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas})
|
||||
#message("DEBUG: CMAKE_REQUIRED_DEFINITIONS = ${CMAKE_REQUIRED_DEFINITIONS}")
|
||||
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||
# Check if function exists with f2c calling convention (ie a trailing underscore)
|
||||
check_function_exists(${_name}_ ${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS} "")
|
||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
||||
mark_as_advanced(${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
|
||||
set(_libraries_work ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS})
|
||||
endif()
|
||||
|
||||
# If not found, test this combination of libraries with a C interface.
|
||||
# A few implementations (ie ACML) provide a C interface. Unfortunately, there is no standard.
|
||||
if(_libraries_found AND NOT _libraries_work)
|
||||
set(${DEFINITIONS} "")
|
||||
set(${LIBRARIES} ${_libraries_found})
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "")
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas})
|
||||
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||
check_function_exists(${_name} ${_prefix}_${_name}${_combined_name}_WORKS)
|
||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
||||
mark_as_advanced(${_prefix}_${_name}${_combined_name}_WORKS)
|
||||
set(_libraries_work ${${_prefix}_${_name}${_combined_name}_WORKS})
|
||||
endif()
|
||||
|
||||
# on failure
|
||||
if(NOT _libraries_work)
|
||||
set(${DEFINITIONS} "")
|
||||
set(${LIBRARIES} FALSE)
|
||||
endif()
|
||||
#message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}")
|
||||
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
|
||||
endmacro()
|
||||
|
||||
|
||||
#
|
||||
# main
|
||||
#
|
||||
|
||||
# LAPACK requires BLAS
|
||||
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||
find_dependency(BLAS)
|
||||
else()
|
||||
find_dependency(BLAS REQUIRED)
|
||||
endif()
|
||||
|
||||
if (NOT BLAS_FOUND)
|
||||
|
||||
message(STATUS "LAPACK requires BLAS.")
|
||||
set(LAPACK_FOUND FALSE)
|
||||
|
||||
# Is it already configured?
|
||||
elseif (LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)
|
||||
|
||||
set(LAPACK_FOUND TRUE)
|
||||
|
||||
else()
|
||||
|
||||
# reset variables
|
||||
set( LAPACK_INCLUDE_DIR "" )
|
||||
set( LAPACK_DEFINITIONS "" )
|
||||
set( LAPACK_LINKER_FLAGS "" ) # unused (yet)
|
||||
set( LAPACK_LIBRARIES "" )
|
||||
set( LAPACK_LIBRARIES_DIR "" )
|
||||
|
||||
#
|
||||
# If Unix, search for LAPACK function in possible libraries
|
||||
#
|
||||
|
||||
#intel mkl lapack?
|
||||
if(NOT LAPACK_LIBRARIES)
|
||||
check_lapack_libraries(
|
||||
LAPACK_DEFINITIONS
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"mkl_lapack"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
|
||||
)
|
||||
endif()
|
||||
|
||||
#acml lapack?
|
||||
if(NOT LAPACK_LIBRARIES)
|
||||
check_lapack_libraries(
|
||||
LAPACK_DEFINITIONS
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"acml"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Apple LAPACK library?
|
||||
if(NOT LAPACK_LIBRARIES)
|
||||
check_lapack_libraries(
|
||||
LAPACK_DEFINITIONS
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"Accelerate"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
|
||||
)
|
||||
endif()
|
||||
|
||||
if ( NOT LAPACK_LIBRARIES )
|
||||
check_lapack_libraries(
|
||||
LAPACK_DEFINITIONS
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"vecLib"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
|
||||
)
|
||||
endif ()
|
||||
|
||||
# Generic LAPACK library?
|
||||
# This configuration *must* be the last try as this library is notably slow.
|
||||
if ( NOT LAPACK_LIBRARIES )
|
||||
check_lapack_libraries(
|
||||
LAPACK_DEFINITIONS
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"lapack"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)
|
||||
set(LAPACK_FOUND TRUE)
|
||||
else()
|
||||
set(LAPACK_FOUND FALSE)
|
||||
endif()
|
||||
|
||||
if(NOT LAPACK_FIND_QUIETLY)
|
||||
if(LAPACK_FOUND)
|
||||
message(STATUS "A library with LAPACK API found.")
|
||||
else()
|
||||
if(LAPACK_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "A required library with LAPACK API not found. Please specify library location.")
|
||||
else()
|
||||
message(STATUS "A library with LAPACK API not found. Please specify library location.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Add variables to cache
|
||||
set( LAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}"
|
||||
CACHE PATH "Directories containing the LAPACK header files" FORCE )
|
||||
set( LAPACK_DEFINITIONS "${LAPACK_DEFINITIONS}"
|
||||
CACHE STRING "Compilation options to use LAPACK" FORCE )
|
||||
set( LAPACK_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}"
|
||||
CACHE STRING "Linker flags to use LAPACK" FORCE )
|
||||
set( LAPACK_LIBRARIES "${LAPACK_LIBRARIES}"
|
||||
CACHE FILEPATH "LAPACK libraries name" FORCE )
|
||||
set( LAPACK_LIBRARIES_DIR "${LAPACK_LIBRARIES_DIR}"
|
||||
CACHE PATH "Directories containing the LAPACK libraries" FORCE )
|
||||
|
||||
#message("DEBUG: LAPACK_INCLUDE_DIR = ${LAPACK_INCLUDE_DIR}")
|
||||
#message("DEBUG: LAPACK_DEFINITIONS = ${LAPACK_DEFINITIONS}")
|
||||
#message("DEBUG: LAPACK_LINKER_FLAGS = ${LAPACK_LINKER_FLAGS}")
|
||||
#message("DEBUG: LAPACK_LIBRARIES = ${LAPACK_LIBRARIES}")
|
||||
#message("DEBUG: LAPACK_LIBRARIES_DIR = ${LAPACK_LIBRARIES_DIR}")
|
||||
#message("DEBUG: LAPACK_FOUND = ${LAPACK_FOUND}")
|
||||
|
||||
endif()
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
#
|
||||
# UseEigen3.cmake
|
||||
|
||||
add_definitions ( ${EIGEN3_DEFINITIONS} )
|
||||
include_directories ( ${EIGEN3_INCLUDE_DIRS} )
|
||||
Reference in New Issue
Block a user