mirror of https://github.com/CGAL/cgal
Merge of Fernando's CMake files for BLAS/LAPACK/TAUCS with the original
FindBLAS.cmake and FindLAPACK.cmake in CMake 2.6. The result is more or less equivalent to install_cgal's behavior. TODO: - use a C++ compiler instead of a Fortran one - try to be compatible with CMake 2.4 - find CBLAS (http://www.netlib.org/cblas)? Jet_fitting_3 and Surface_mesh_parameterization compile now with CMake (tested on Linux/gcc and Windows/VC++ 2005).
This commit is contained in:
parent
d70bdaea18
commit
0bbfad9e5c
|
|
@ -1685,6 +1685,7 @@ Installation/cmake/modules/FindBoost.cmake -text
|
|||
Installation/cmake/modules/FindCGALDependencies.cmake -text
|
||||
Installation/cmake/modules/FindCGAL_CORE.cmake -text
|
||||
Installation/cmake/modules/FindCORE.cmake -text
|
||||
Installation/cmake/modules/FindF2C.cmake -text
|
||||
Installation/cmake/modules/FindGMP.cmake -text
|
||||
Installation/cmake/modules/FindGMPXX.cmake -text
|
||||
Installation/cmake/modules/FindLAPACK.cmake -text
|
||||
|
|
|
|||
|
|
@ -1,51 +1,98 @@
|
|||
# Find TAUCS library shipped with CGAL
|
||||
#
|
||||
# This module searches for TAUCS in CGAL "auxiliary" folder
|
||||
# and in in $CGAL_TAUCS_DIR environment variable.
|
||||
#
|
||||
# This module sets the following variables:
|
||||
# CGAL_TAUCS_FOUND - set to true if TAUCS library shipped with CGAL
|
||||
# is found
|
||||
# CGAL_TAUCS_PLATFORM - name of TAUCS subfolder corresponding to the current compiler
|
||||
# CGAL_TAUCS_INCLUDE_DIR - list of folders (using full path name) containing
|
||||
# TAUCS (and optionaly BLAS and LAPACK) headers
|
||||
# CGAL_TAUCS_LIBRARIES_DIR -list of folders (using full path name) containing
|
||||
# TAUCS (and optionaly BLAS and LAPACK) libraries
|
||||
|
||||
if ( NOT CGAL_TAUCS_FOUND )
|
||||
|
||||
#
|
||||
# Find out TAUCS name for the current platform.
|
||||
# This code is a translation of TAUCS "configure" script.
|
||||
#
|
||||
|
||||
# The first task is to figure out CMAKE_SYSTEM_NAME
|
||||
# (on unix this is uname -s, for windows it is Windows).
|
||||
#message("DEBUG: CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
|
||||
#message("DEBUG: CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set( CGAL_TAUCS_PLATFORM "${CMAKE_SYSTEM_NAME}" )
|
||||
|
||||
# Convert to lower case
|
||||
STRING(TOLOWER "${CGAL_TAUCS_PLATFORM}" CGAL_TAUCS_PLATFORM)
|
||||
|
||||
# Sometimes uname returns a value that is
|
||||
# inconsistent with the way CGAL_TAUCS_PLATFORM is set. For example, on
|
||||
# Solaris, CGAL_TAUCS_PLATFORM=solaris but uname returns SunOS.
|
||||
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "sunos" )
|
||||
set( CGAL_TAUCS_PLATFORM "solaris" )
|
||||
endif()
|
||||
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "windows" )
|
||||
set( CGAL_TAUCS_PLATFORM "win32" )
|
||||
endif()
|
||||
|
||||
# LS 2007: added "darwin_intel" for Intel Macs.
|
||||
# "darwin" = original Darwin platform = PowerPC architecture.
|
||||
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "darwin" )
|
||||
# CMAKE_SYSTEM_PROCESSOR=uname -p
|
||||
if ( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386" )
|
||||
set( CGAL_TAUCS_PLATFORM "darwin_intel" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# LS 2007: append "64" if 64 bits processor (tested on Linux only)
|
||||
|
||||
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "linux" )
|
||||
# CMAKE_SYSTEM_PROCESSOR=uname -p
|
||||
if ( ${CMAKE_SYSTEM_PROCESSOR} MATCHES ".*64.*" )
|
||||
set( CGAL_TAUCS_PLATFORM "${CGAL_TAUCS_PLATFORM}64" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#message("DEBUG: CGAL_TAUCS_PLATFORM = ${CGAL_TAUCS_PLATFORM}")
|
||||
|
||||
|
||||
#
|
||||
# Search for TAUCS folder.
|
||||
#
|
||||
|
||||
if ( MSVC )
|
||||
|
||||
if ( EXISTS "${CMAKE_SOURCE_DIR}/auxiliary/taucs" )
|
||||
set( CGAL_TAUCS_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/auxiliary/taucs/include")
|
||||
set( CGAL_TAUCS_LIBRARIES_DIR "${CMAKE_SOURCE_DIR}/auxiliary/taucs/lib" )
|
||||
# Search for TAUCS in CGAL "auxiliary" folder
|
||||
if ( EXISTS "${CGAL_SOURCE_DIR}/auxiliary/taucs" )
|
||||
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_SOURCE_DIR}/auxiliary/taucs/include")
|
||||
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_SOURCE_DIR}/auxiliary/taucs/lib" )
|
||||
set( CGAL_TAUCS_FOUND TRUE )
|
||||
set_cache( TAUCS_IN_CGAL_AUXILIARY TRUE )
|
||||
endif()
|
||||
|
||||
else()
|
||||
else ( MSVC )
|
||||
|
||||
# Check $CGAL_TAUCS_DIR environment variable
|
||||
fetch_env_var(CGAL_TAUCS_DIR)
|
||||
|
||||
if ( NOT "${CGAL_TAUCS_DIR}" STREQUAL "" )
|
||||
if ( EXISTS ${CGAL_TAUCS_DIR} )
|
||||
|
||||
# Find out which platforms have been configured
|
||||
file( GLOB CGAL_TAUCS_BUILD_CONTENT_LIST RELATIVE "${CGAL_TAUCS_DIR}/build" "${CGAL_TAUCS_DIR}/build/*" )
|
||||
|
||||
set( CGAL_TAUCS_PLATFORMS "" )
|
||||
|
||||
foreach ( CGAL_TAUCS_BUILD_CONTENT ${CGAL_TAUCS_BUILD_CONTENT_LIST} )
|
||||
if ( IS_DIRECTORY "${CGAL_TAUCS_DIR}/build/${CGAL_TAUCS_BUILD_CONTENT}" )
|
||||
set( CGAL_TAUCS_PLATFORMS ${CGAL_TAUCS_PLATFORMS} ${CGAL_TAUCS_BUILD_CONTENT} )
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list( LENGTH CGAL_TAUCS_PLATFORMS CGAL_TAUCS_PLATFORMS_LEN )
|
||||
|
||||
# For now we'll just pick up the first platform as the one to use.
|
||||
if ( CGAL_TAUCS_PLATFORMS_LEN GREATER "0" )
|
||||
|
||||
list(GET CGAL_TAUCS_PLATFORMS 0 CGAL_TAUCS_PLATFORM )
|
||||
|
||||
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/src" "${CGAL_TAUCS_DIR}/build/${CGAL_TAUCS_PLATFORM}")
|
||||
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/lib/${CGAL_TAUCS_PLATFORM}" )
|
||||
|
||||
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/build/${CGAL_TAUCS_PLATFORM}"
|
||||
"${CGAL_TAUCS_DIR}/src" )
|
||||
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}"
|
||||
"${CGAL_TAUCS_DIR}/lib/${CGAL_TAUCS_PLATFORM}" )
|
||||
set( CGAL_TAUCS_FOUND TRUE )
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif ( MSVC )
|
||||
|
||||
endif()
|
||||
#message("DEBUG: CGAL_TAUCS_INCLUDE_DIR = ${CGAL_TAUCS_INCLUDE_DIR}")
|
||||
#message("DEBUG: CGAL_TAUCS_LIBRARIES_DIR = ${CGAL_TAUCS_LIBRARIES_DIR}")
|
||||
#message("DEBUG: CGAL_TAUCS_FOUND = ${CGAL_TAUCS_FOUND}")
|
||||
|
||||
endif()
|
||||
endif ( NOT CGAL_TAUCS_FOUND )
|
||||
|
||||
|
|
|
|||
|
|
@ -4,14 +4,23 @@ if ( NOT BLAS_FOUND )
|
|||
|
||||
if ( BLAS_FOUND )
|
||||
|
||||
message( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" )
|
||||
message( STATUS "BLAS definitions: ${BLAS_DEFINITIONS}" )
|
||||
if (BLAS_LIBRARIES_DIR)
|
||||
message( STATUS "BLAS library directories: ${BLAS_LIBRARIES_DIR}" )
|
||||
endif()
|
||||
if (BLAS_LIBRARIES)
|
||||
message( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" )
|
||||
endif()
|
||||
message( STATUS "BLAS link flags: ${BLAS_LINKER_FLAGS}" )
|
||||
|
||||
#get_dependency_version(BLAS)
|
||||
|
||||
add_definitions( ${BLAS_DEFINITIONS} "-DCGAL_USE_BLAS=1" )
|
||||
add_definitions( ${BLAS_DEFINITIONS} "-DCGAL_USE_BLAS" )
|
||||
set( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} ${BLAS_DEFINITIONS} )
|
||||
|
||||
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${BLAS_LIBRARIES} )
|
||||
link_directories( ${BLAS_LIBRARIES_DIR} )
|
||||
set( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ${BLAS_LIBRARIES_DIR} )
|
||||
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${BLAS_LIBRARIES} ${BLAS_LINKER_FLAGS} )
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,29 @@
|
|||
# LAPACK requires BLAS
|
||||
include( CGAL_SetupBLAS )
|
||||
|
||||
if ( NOT LAPACK_FOUND )
|
||||
|
||||
find_package( LAPACK )
|
||||
|
||||
if ( LAPACK_FOUND )
|
||||
|
||||
message( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" )
|
||||
message( STATUS "LAPACK definitions: ${LAPACK_DEFINITIONS}" )
|
||||
if (LAPACK_LIBRARIES_DIR)
|
||||
message( STATUS "LAPACK library directories: ${LAPACK_LIBRARIES_DIR}" )
|
||||
endif()
|
||||
if (LAPACK_LIBRARIES)
|
||||
message( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" )
|
||||
endif()
|
||||
message( STATUS "LAPACK link flags: ${LAPACK_LINKER_FLAGS}" )
|
||||
|
||||
#get_dependency_version(LAPACK)
|
||||
|
||||
add_definitions( ${LAPACK_DEFINITIONS} "-DCGAL_USE_LAPACK=1" )
|
||||
add_definitions( ${LAPACK_DEFINITIONS} "-DCGAL_USE_LAPACK" )
|
||||
set( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} ${LAPACK_DEFINITIONS} )
|
||||
|
||||
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${LAPACK_LIBRARIES} )
|
||||
link_directories( ${LAPACK_LIBRARIES_DIR} )
|
||||
set( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ${LAPACK_LIBRARIES_DIR} )
|
||||
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${LAPACK_LIBRARIES} ${LAPACK_LINKER_FLAGS} )
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
# TAUCS requires BLAS and LAPACK
|
||||
include(CGAL_SetupBLAS)
|
||||
include(CGAL_SetupLAPACK)
|
||||
|
||||
|
|
@ -8,17 +9,23 @@ if ( NOT TAUCS_FOUND )
|
|||
if ( TAUCS_FOUND )
|
||||
|
||||
message( STATUS "TAUCS include: ${TAUCS_INCLUDE_DIR}" )
|
||||
message( STATUS "TAUCS libraries: ${TAUCS_LIBRARIES}" )
|
||||
message( STATUS "TAUCS definitions: ${TAUCS_DEFINITIONS}" )
|
||||
if (TAUCS_LIBRARIES_DIR)
|
||||
message( STATUS "TAUCS library directories: ${TAUCS_LIBRARIES_DIR}" )
|
||||
endif()
|
||||
if (TAUCS_LIBRARIES)
|
||||
message( STATUS "TAUCS libraries: ${TAUCS_LIBRARIES}" )
|
||||
endif()
|
||||
|
||||
get_dependency_version(TAUCS)
|
||||
#get_dependency_version(TAUCS)
|
||||
|
||||
include_directories ( ${TAUCS_INCLUDE_DIR} )
|
||||
|
||||
add_definitions( ${TAUCS_DEFINITIONS} "-DCGAL_USE_TAUCS=1" )
|
||||
add_definitions( ${TAUCS_DEFINITIONS} "-DCGAL_USE_TAUCS" )
|
||||
set( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} ${TAUCS_DEFINITIONS} )
|
||||
|
||||
link_directories( ${TAUCS_LIBRARIES_DIR} )
|
||||
|
||||
set( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ${TAUCS_LIBRARIES_DIR} )
|
||||
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${TAUCS_LIBRARIES} )
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,24 +1,448 @@
|
|||
if ( BLAS_LIBRARIES )
|
||||
# Find BLAS library
|
||||
#
|
||||
# This module finds an installed library that implements the BLAS
|
||||
# linear-algebra interface (see http://www.netlib.org/blas/).
|
||||
# The list of libraries searched for is mainly taken
|
||||
# from the autoconf macro file, acx_blas.m4 (distributed at
|
||||
# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
|
||||
#
|
||||
# This module sets the following variables:
|
||||
# BLAS_FOUND - set to true if a library implementing the BLAS interface
|
||||
# is found
|
||||
# BLAS_DEFINITIONS - Compilation options to use BLAS
|
||||
# BLAS_LINKER_FLAGS - Linker flags to use BLAS (excluding -l
|
||||
# and -L).
|
||||
# BLAS_LIBRARIES_DIR - Directories containing the BLAS libraries.
|
||||
# May be null if BLAS_LIBRARIES contains libraries name using full path.
|
||||
# BLAS_LIBRARIES - List of libraries to link against BLAS interface.
|
||||
# May be null if the compiler supports auto-link (e.g. VC++).
|
||||
#
|
||||
# This module was modified by CGAL team:
|
||||
# - find BLAS library shipped with TAUCS
|
||||
# - find libraries for a C++ compiler, instead of Fortran
|
||||
# - added BLAS_DEFINITIONS and BLAS_LIBRARIES_DIR
|
||||
# - removed BLAS95_LIBRARIES
|
||||
#
|
||||
# TODO (CGAL):
|
||||
# - use a C++ compiler instead of a Fortran one
|
||||
# - try to be compatible with CMake 2.4
|
||||
# - find CBLAS (http://www.netlib.org/cblas)?
|
||||
|
||||
|
||||
# CheckFortranFunctionExists is new in CMake 2.6
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
|
||||
|
||||
include(CheckFortranFunctionExists)
|
||||
|
||||
include(GeneratorSpecificSettings)
|
||||
|
||||
|
||||
# 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_Fortran_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. 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_fortran_libraries LIBRARIES _prefix _name _flags _list _path)
|
||||
#message("DEBUG: check_fortran_libraries(${_list} in ${_path})")
|
||||
set(_libraries_work TRUE)
|
||||
set(${LIBRARIES})
|
||||
set(_combined_name)
|
||||
foreach(_library ${_list})
|
||||
set(_combined_name ${_combined_name}_${_library})
|
||||
|
||||
if(_libraries_work)
|
||||
if ( WIN32 )
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ${_path} ENV LIB
|
||||
)
|
||||
endif ( WIN32 )
|
||||
if ( APPLE )
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ${_path} /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
|
||||
)
|
||||
else ( APPLE )
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ${_path} /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
|
||||
)
|
||||
endif( APPLE )
|
||||
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
||||
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
|
||||
endif(_libraries_work)
|
||||
endforeach(_library ${_list})
|
||||
|
||||
if(_libraries_work)
|
||||
# Test this combination of libraries.
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}})
|
||||
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||
check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
|
||||
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
|
||||
endif(_libraries_work)
|
||||
|
||||
if(NOT _libraries_work)
|
||||
set(${LIBRARIES} FALSE)
|
||||
endif(NOT _libraries_work)
|
||||
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
|
||||
endmacro(check_fortran_libraries)
|
||||
|
||||
|
||||
# This macro setup BLAS variables to link with Fortran libraries:
|
||||
# - it adds "-DCGAL_USE_F2C" to use f2c calling convention
|
||||
# - its links with the f2c library if needed
|
||||
macro(append_f2c)
|
||||
# Use f2c calling convention
|
||||
set( BLAS_DEFINITIONS ${BLAS_DEFINITIONS} "-DCGAL_USE_F2C" )
|
||||
|
||||
# Some C++ linkers require f2c to link with Fortran libraries.
|
||||
# Implementation note: I do not know which ones, thus I just add
|
||||
# the f2c library if it is available.
|
||||
find_package( F2C QUIET )
|
||||
if ( F2C_FOUND )
|
||||
set( BLAS_DEFINITIONS ${BLAS_DEFINITIONS} ${F2C_DEFINITIONS} )
|
||||
set( BLAS_LIBRARIES ${BLAS_LIBRARIES} ${F2C_LIBRARIES} )
|
||||
endif()
|
||||
endmacro(append_f2c)
|
||||
|
||||
|
||||
#
|
||||
# main
|
||||
#
|
||||
|
||||
# Is it already configured?
|
||||
if (BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES)
|
||||
|
||||
set(BLAS_FOUND TRUE)
|
||||
|
||||
else()
|
||||
else(BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES)
|
||||
|
||||
# Look first for the BLAS distributed with CGAL in auxiliary/taucs.
|
||||
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
|
||||
include(CGAL_Locate_CGAL_TAUCS)
|
||||
if( CGAL_TAUCS_FOUND )
|
||||
|
||||
set( BLAS_LIBRARIES "${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}/libcblas.a;${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}/libf77blas.a" CACHE FILEPATH "The BLAS libraries" )
|
||||
set( BLAS_DEFINITIONS "-DCGAL_USE_F2C -DCGAL_USE_CBLASWRAP" CACHE STRING "Definitions for the BLAS" )
|
||||
# Search for BLAS libraries in ${CGAL_TAUCS_LIBRARIES_DIR} (BLAS shipped with CGAL),
|
||||
# else in $BLAS_LIB_DIR environment variable.
|
||||
if(CGAL_TAUCS_FOUND AND AUTO_LINK_ENABLED)
|
||||
|
||||
else()
|
||||
# if VC++: done
|
||||
#message("DEBUG: BLAS: VC++ case")
|
||||
set( BLAS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}"
|
||||
CACHE FILEPATH "Directories containing the BLAS libraries")
|
||||
|
||||
set( BLAS_LIBRARIES "$ENV{BLAS_LIBRARIES}" CACHE FILEPATH "The BLAS libraries" )
|
||||
set( BLAS_DEFINITIONS "$ENV{BLAS_DEFINITIONS}" CACHE STRING "Definitions for the BLAS" )
|
||||
else(CGAL_TAUCS_FOUND AND AUTO_LINK_ENABLED)
|
||||
|
||||
#message("DEBUG: BLAS: Unix case")
|
||||
|
||||
# If Unix, we need a Fortran compiler
|
||||
if (NOT MSVC) # safety: enable_language(Fortran) is broken for VC++
|
||||
enable_language(Fortran OPTIONAL)
|
||||
endif()
|
||||
if (CMAKE_Fortran_COMPILER_WORKS)
|
||||
|
||||
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
cblas_dgemm
|
||||
""
|
||||
"cblas;f77blas;atlas"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
set(BLAS_FOUND TRUE)
|
||||
# Some C++ linkers require f2c to link with Fortran libraries
|
||||
append_f2c()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"sgemm;dgemm;blas"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Some C++ linkers require f2c to link with Fortran libraries
|
||||
append_f2c()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# BLAS in Alpha CXML library?
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"cxml"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# BLAS in Alpha DXML library? (now called CXML, see above)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"dxml"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# BLAS in Sun Performance library?
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
"-xlic_lib=sunperf"
|
||||
"sunperf;sunmath"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( BLAS_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
# Extra library
|
||||
set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# BLAS in SCSL library? (SGI/Cray Scientific Library)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"scsl"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# BLAS in SGIMATH library?
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"complib.sgimath"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"essl;blas"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
#BLAS in intel mkl 10 library? (em64t 64bit)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_intel_lp64;mkl_intel_thread;mkl_core;guide;pthread"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( BLAS_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
### windows version of intel mkl 10?
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
SGEMM
|
||||
""
|
||||
"mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( BLAS_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#older versions of intel mkl libs
|
||||
|
||||
# BLAS in intel mkl library? (shared)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl;guide;pthread"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( BLAS_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#BLAS in intel mkl library? (static, 32bit)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_ia32;guide;pthread"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( BLAS_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#BLAS in intel mkl library? (static, em64t 64bit)
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"mkl_em64t;guide;pthread"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( BLAS_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#BLAS in acml library?
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"acml"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Apple BLAS library?
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
cblas_dgemm
|
||||
""
|
||||
"Accelerate"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( BLAS_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( NOT BLAS_LIBRARIES )
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
cblas_dgemm
|
||||
""
|
||||
"vecLib"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( BLAS_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif ( NOT BLAS_LIBRARIES )
|
||||
|
||||
# Generic BLAS library?
|
||||
# This configuration *must* be the last try as this library is notably slow.
|
||||
if(NOT BLAS_LIBRARIES)
|
||||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
""
|
||||
"blas"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{BLAS_LIB_DIR}"
|
||||
)
|
||||
if(BLAS_LIBRARIES)
|
||||
# Some C++ linkers require f2c to link with Fortran libraries
|
||||
append_f2c()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else(CMAKE_Fortran_COMPILER_WORKS)
|
||||
|
||||
message(STATUS "FindBLAS.cmake requires a Fortran compiler")
|
||||
|
||||
endif(CMAKE_Fortran_COMPILER_WORKS)
|
||||
|
||||
# Add variables to cache
|
||||
set( BLAS_DEFINITIONS "${BLAS_DEFINITIONS}"
|
||||
CACHE FILEPATH "Compilation options to use BLAS" )
|
||||
set( BLAS_LINKER_FLAGS "${BLAS_LINKER_FLAGS}"
|
||||
CACHE FILEPATH "Linker flags to use BLAS" )
|
||||
set( BLAS_LIBRARIES "${BLAS_LIBRARIES}"
|
||||
CACHE FILEPATH "BLAS libraries name" )
|
||||
|
||||
endif(CGAL_TAUCS_FOUND AND AUTO_LINK_ENABLED)
|
||||
|
||||
if(BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES)
|
||||
set(BLAS_FOUND TRUE)
|
||||
else()
|
||||
set(BLAS_FOUND FALSE)
|
||||
endif()
|
||||
|
||||
if(NOT BLAS_FIND_QUIETLY)
|
||||
if(BLAS_FOUND)
|
||||
message(STATUS "A library with BLAS API found.")
|
||||
else(BLAS_FOUND)
|
||||
if(BLAS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "A required library with BLAS API not found. Please specify library location.")
|
||||
else()
|
||||
message(STATUS "A library with BLAS API not found. Please specify library location.")
|
||||
endif()
|
||||
endif(BLAS_FOUND)
|
||||
endif(NOT BLAS_FIND_QUIETLY)
|
||||
|
||||
#message("DEBUG: BLAS_DEFINITIONS = ${BLAS_DEFINITIONS}")
|
||||
#message("DEBUG: BLAS_LINKER_FLAGS = ${BLAS_LINKER_FLAGS}")
|
||||
#message("DEBUG: BLAS_LIBRARIES = ${BLAS_LIBRARIES}")
|
||||
#message("DEBUG: BLAS_LIBRARIES_DIR = ${BLAS_LIBRARIES_DIR}")
|
||||
#message("DEBUG: BLAS_FOUND = ${BLAS_FOUND}")
|
||||
|
||||
endif(BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES)
|
||||
|
||||
#mark_as_advanced(BLAS_DEFINITIONS)
|
||||
#mark_as_advanced(BLAS_LINKER_FLAGS)
|
||||
#mark_as_advanced(BLAS_LIBRARIES)
|
||||
#mark_as_advanced(BLAS_LIBRARIES_DIR)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
# This module finds the f2c library.
|
||||
#
|
||||
# This module sets the following variables:
|
||||
# F2C_FOUND - set to true if library is found
|
||||
# F2C_DEFINITIONS - compilation options to use f2c
|
||||
# F2C_LIBRARIES - f2c library name (using full path name)
|
||||
|
||||
if (F2C_LIBRARIES)
|
||||
|
||||
set(F2C_FOUND TRUE)
|
||||
|
||||
else(F2C_LIBRARIES)
|
||||
|
||||
set(F2C_DEFINITIONS)
|
||||
|
||||
# F2C shipped with CGAL (as part of TAUCS)?
|
||||
# If found, we will search for f2c library in ${CGAL_TAUCS_LIBRARIES_DIR}.
|
||||
include(CGAL_Locate_CGAL_TAUCS)
|
||||
|
||||
find_library(F2C_LIBRARIES NAMES f2c g2c vcf2c
|
||||
PATHS ${CGAL_TAUCS_LIBRARIES_DIR}
|
||||
DOC "F2C library"
|
||||
)
|
||||
|
||||
if(F2C_LIBRARIES)
|
||||
set(F2C_FOUND TRUE)
|
||||
else()
|
||||
set(F2C_FOUND FALSE)
|
||||
endif()
|
||||
|
||||
if(NOT F2C_FIND_QUIETLY)
|
||||
if(F2C_FOUND)
|
||||
message(STATUS "f2c library found.")
|
||||
else(F2C_FOUND)
|
||||
if(F2C_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "f2c library not found. Please specify library location.")
|
||||
else()
|
||||
message(STATUS "f2c library not found. Please specify library location.")
|
||||
endif()
|
||||
endif(F2C_FOUND)
|
||||
endif(NOT F2C_FIND_QUIETLY)
|
||||
|
||||
endif(F2C_LIBRARIES)
|
||||
|
|
@ -1,23 +1,265 @@
|
|||
if ( LAPACK_LIBRARIES )
|
||||
# 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_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++).
|
||||
#
|
||||
# This module was modified by CGAL team:
|
||||
# - find LAPACK library shipped with TAUCS
|
||||
# - find libraries for a C++ compiler, instead of Fortran
|
||||
# - added LAPACK_DEFINITIONS and LAPACK_LIBRARIES_DIR
|
||||
# - removed LAPACK95_LIBRARIES
|
||||
#
|
||||
# TODO (CGAL):
|
||||
# - use a C++ compiler instead of a Fortran one
|
||||
# - try to be compatible with CMake 2.4
|
||||
# - find CLAPACK (http://www.netlib.org/clapack)?
|
||||
|
||||
|
||||
# CheckFortranFunctionExists is new in CMake 2.6
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
|
||||
|
||||
include(CheckFortranFunctionExists)
|
||||
|
||||
include(GeneratorSpecificSettings)
|
||||
|
||||
|
||||
# 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_Fortran_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. 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 LIBRARIES _prefix _name _flags _list _blas _path)
|
||||
#message("DEBUG: check_lapack_libraries(${_list} in ${_path})")
|
||||
set(_libraries_work TRUE)
|
||||
set(${LIBRARIES})
|
||||
set(_combined_name)
|
||||
foreach(_library ${_list})
|
||||
set(_combined_name ${_combined_name}_${_library})
|
||||
|
||||
if(_libraries_work)
|
||||
if ( WIN32 )
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ${_path} ENV LIB
|
||||
)
|
||||
endif ( WIN32 )
|
||||
if ( APPLE )
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ${_path} /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
|
||||
)
|
||||
else ( APPLE )
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ${_path} /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
|
||||
)
|
||||
endif( APPLE )
|
||||
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
||||
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
|
||||
endif(_libraries_work)
|
||||
endforeach(_library ${_list})
|
||||
|
||||
if(_libraries_work)
|
||||
# Test this combination of libraries.
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas})
|
||||
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||
check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
|
||||
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
|
||||
endif(_libraries_work)
|
||||
|
||||
if(NOT _libraries_work)
|
||||
set(${LIBRARIES} FALSE)
|
||||
endif(NOT _libraries_work)
|
||||
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
|
||||
endmacro(check_lapack_libraries)
|
||||
|
||||
|
||||
#
|
||||
# main
|
||||
#
|
||||
|
||||
# Is it already configured?
|
||||
if (LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)
|
||||
|
||||
set(LAPACK_FOUND TRUE)
|
||||
|
||||
else()
|
||||
else(LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)
|
||||
|
||||
# unused (yet)
|
||||
set(LAPACK_LINKER_FLAGS)
|
||||
|
||||
# Look first for the LAPACK distributed with CGAL in auxiliary/taucs.
|
||||
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
|
||||
include(CGAL_Locate_CGAL_TAUCS)
|
||||
if( CGAL_TAUCS_FOUND )
|
||||
|
||||
set( LAPACK_LIBRARIES "${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}/liblapack.a" CACHE FILEPATH "The LAPACK libraries" )
|
||||
# Search for LAPACK libraries in ${CGAL_TAUCS_LIBRARIES_DIR} (LAPACK shipped with CGAL),
|
||||
# else in $LAPACK_LIB_DIR environment variable.
|
||||
if(CGAL_TAUCS_FOUND AND AUTO_LINK_ENABLED)
|
||||
|
||||
else()
|
||||
# if VC++: done
|
||||
#message("DEBUG: LAPACK: VC++ case")
|
||||
set( LAPACK_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}"
|
||||
CACHE FILEPATH "Directories containing the LAPACK libraries")
|
||||
|
||||
set( LAPACK_LIBRARIES $ENV{LAPACK_LIBRARIES} CACHE FILEPATH "The LAPACK libraries" )
|
||||
set( LAPACK_DEFINITIONS $ENV{LAPACK_DEFINITIONS} CACHE STRING "Definitions for the LAPACK libraries" )
|
||||
else(CGAL_TAUCS_FOUND AND AUTO_LINK_ENABLED)
|
||||
|
||||
#message("DEBUG: LAPACK: Unix case")
|
||||
|
||||
# If Unix, we need a Fortran compiler
|
||||
if (NOT MSVC) # safety: enable_language(Fortran) is broken for VC++
|
||||
enable_language(Fortran OPTIONAL)
|
||||
endif()
|
||||
|
||||
# LAPACK requires BLAS
|
||||
find_package(BLAS QUIET)
|
||||
|
||||
if(CMAKE_Fortran_COMPILER_WORKS AND BLAS_FOUND)
|
||||
|
||||
#intel mkl lapack?
|
||||
if(NOT LAPACK_LIBRARIES)
|
||||
check_lapack_libraries(
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"mkl_lapack"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{LAPACK_LIB_DIR}"
|
||||
)
|
||||
if(LAPACK_LIBRARIES)
|
||||
set(LAPACK_FOUND TRUE)
|
||||
# Use f2c calling convention
|
||||
set( LAPACK_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#acml lapack?
|
||||
if(NOT LAPACK_LIBRARIES)
|
||||
check_lapack_libraries(
|
||||
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_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"Accelerate"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{LAPACK_LIB_DIR}"
|
||||
)
|
||||
if(LAPACK_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( LAPACK_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( NOT LAPACK_LIBRARIES )
|
||||
check_lapack_libraries(
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"vecLib"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{LAPACK_LIB_DIR}"
|
||||
)
|
||||
if(LAPACK_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( LAPACK_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif ( NOT LAPACK_LIBRARIES )
|
||||
|
||||
# Generic LAPACK library?
|
||||
# This configuration *must* be the last try as this library is notably slow.
|
||||
if ( NOT LAPACK_LIBRARIES )
|
||||
check_lapack_libraries(
|
||||
LAPACK_LIBRARIES
|
||||
LAPACK
|
||||
cheev
|
||||
""
|
||||
"lapack"
|
||||
"${BLAS_LIBRARIES}"
|
||||
"${CGAL_TAUCS_LIBRARIES_DIR} $ENV{LAPACK_LIB_DIR}"
|
||||
)
|
||||
if(LAPACK_LIBRARIES)
|
||||
# Use f2c calling convention
|
||||
set( LAPACK_DEFINITIONS "-DCGAL_USE_F2C" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else(CMAKE_Fortran_COMPILER_WORKS AND BLAS_FOUND)
|
||||
|
||||
message(STATUS "FindLAPACK.cmake requires a Fortran compiler")
|
||||
|
||||
endif(CMAKE_Fortran_COMPILER_WORKS AND BLAS_FOUND)
|
||||
|
||||
# Add variables to cache
|
||||
set( LAPACK_DEFINITIONS "${LAPACK_DEFINITIONS}"
|
||||
CACHE FILEPATH "Compilation options to use LAPACK" )
|
||||
set( LAPACK_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}"
|
||||
CACHE FILEPATH "Linker flags to use LAPACK" )
|
||||
set( LAPACK_LIBRARIES "${LAPACK_LIBRARIES}"
|
||||
CACHE FILEPATH "LAPACK libraries name" )
|
||||
|
||||
endif(CGAL_TAUCS_FOUND AND AUTO_LINK_ENABLED)
|
||||
|
||||
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(LAPACK_FOUND)
|
||||
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(LAPACK_FOUND)
|
||||
endif(NOT LAPACK_FIND_QUIETLY)
|
||||
|
||||
#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(LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)
|
||||
|
||||
#mark_as_advanced(LAPACK_DEFINITIONS)
|
||||
#mark_as_advanced(LAPACK_LINKER_FLAGS)
|
||||
#mark_as_advanced(LAPACK_LIBRARIES)
|
||||
#mark_as_advanced(LAPACK_LIBRARIES_DIR)
|
||||
|
|
|
|||
|
|
@ -1,41 +1,103 @@
|
|||
# This module finds the TAUCS libraries.
|
||||
#
|
||||
# This module sets the following variables:
|
||||
# TAUCS_FOUND - Set to true if headers and libraries are found
|
||||
# TAUCS_INCLUDE_DIR - Directories containing the TAUCS header files
|
||||
# TAUCS_DEFINITIONS - Compilation options to use TAUCS
|
||||
# TAUCS_LIBRARIES_DIR - Directories containing the TAUCS libraries.
|
||||
# May be null if TAUCS_LIBRARIES contains libraries name using full path.
|
||||
# TAUCS_LIBRARIES - TAUCS libraries name.
|
||||
# May be null if the compiler supports auto-link (e.g. VC++).
|
||||
|
||||
include(GeneratorSpecificSettings)
|
||||
|
||||
# Is it already configured?
|
||||
if (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR)
|
||||
|
||||
set(TAUCS_FOUND TRUE)
|
||||
|
||||
elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES)
|
||||
|
||||
set(TAUCS_FOUND TRUE)
|
||||
|
||||
else()
|
||||
|
||||
# Unused (yet)
|
||||
set(TAUCS_DEFINITIONS)
|
||||
|
||||
# Look first for the TAUCS distributed with CGAL in auxiliary/taucs.
|
||||
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
|
||||
include(CGAL_Locate_CGAL_TAUCS)
|
||||
|
||||
# Search for TAUCS headers in ${CGAL_TAUCS_INCLUDE_DIR} (TAUCS shipped with CGAL),
|
||||
# else in $TAUCS_INC_DIR environment variable.
|
||||
if( CGAL_TAUCS_FOUND )
|
||||
|
||||
set( TAUCS_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" CACHE FILEPATH "Include directories for the TAUCS libraries" )
|
||||
|
||||
set( TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" CACHE FILEPATH "Lib directories for the TAUCS libraries")
|
||||
|
||||
set( TAUCS_LIBRARIES "${CGAL_TAUCS_LIBRARIES_DIR}/libtaucs.a;${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}/libmetis.a;${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}/libatlas.a;${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}/libg2c.so"
|
||||
CACHE FILEPATH "The TAUCS libraries"
|
||||
)
|
||||
|
||||
set( TAUCS_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}"
|
||||
CACHE FILEPATH "Directories containing the TAUCS header files")
|
||||
else()
|
||||
|
||||
find_path(TAUCS_INCLUDE_DIR
|
||||
NAMES taucs.h
|
||||
PATHS ENV TAUCS_INC_DIR
|
||||
DOC "The directory containing the TAUCS header files"
|
||||
PATHS ${CGAL_TAUCS_INCLUDE_DIR}
|
||||
ENV TAUCS_INC_DIR
|
||||
DOC "Directories containing the TAUCS header files"
|
||||
)
|
||||
|
||||
find_library(TAUCS_LIBRARIES NAMES "taucs"
|
||||
PATHS ENV TAUCS_LIB_DIR
|
||||
DOC "Path to the TAUCS library"
|
||||
)
|
||||
|
||||
if ( TAUCS_LIBRARIES )
|
||||
get_filename_component(TAUCS_LIBRARIES_DIR ${TAUCS_LIBRARIES} PATH CACHE)
|
||||
endif()
|
||||
|
||||
# Search for TAUCS libraries in ${CGAL_TAUCS_LIBRARIES_DIR} (TAUCS shipped with CGAL),
|
||||
# else in $TAUCS_LIB_DIR environment variable.
|
||||
if( CGAL_TAUCS_FOUND AND AUTO_LINK_ENABLED )
|
||||
# if VC++: done
|
||||
#message("DEBUG: TAUCS: VC++ case")
|
||||
set( TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}"
|
||||
CACHE FILEPATH "Directories containing the TAUCS libraries")
|
||||
else()
|
||||
#message("DEBUG: TAUCS: Unix case")
|
||||
find_library(TAUCS_LIBRARY
|
||||
NAMES "taucs"
|
||||
PATHS ${CGAL_TAUCS_LIBRARIES_DIR}
|
||||
ENV TAUCS_LIB_DIR
|
||||
DOC "TAUCS library"
|
||||
)
|
||||
find_library(METIS_LIBRARY
|
||||
NAMES "metis"
|
||||
PATHS ${CGAL_TAUCS_LIBRARIES_DIR}
|
||||
ENV TAUCS_LIB_DIR
|
||||
DOC "Metis library"
|
||||
)
|
||||
if(TAUCS_LIBRARY AND METIS_LIBRARY)
|
||||
set( TAUCS_LIBRARIES "${TAUCS_LIBRARY};${METIS_LIBRARY}"
|
||||
CACHE FILEPATH "TAUCS libraries name" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR)
|
||||
set(TAUCS_FOUND TRUE)
|
||||
elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES)
|
||||
set(TAUCS_FOUND TRUE)
|
||||
else()
|
||||
set(TAUCS_FOUND FALSE)
|
||||
endif()
|
||||
|
||||
if(NOT TAUCS_FIND_QUIETLY)
|
||||
if(TAUCS_FOUND)
|
||||
message(STATUS "TAUCS libraries found.")
|
||||
else(TAUCS_FOUND)
|
||||
if(TAUCS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "TAUCS libraries not found. Please specify libraries location.")
|
||||
else()
|
||||
message(STATUS "TAUCS libraries not found. Please specify libraries location.")
|
||||
endif()
|
||||
endif(TAUCS_FOUND)
|
||||
endif(NOT TAUCS_FIND_QUIETLY)
|
||||
|
||||
#message("DEBUG: TAUCS_INCLUDE_DIR = ${TAUCS_INCLUDE_DIR}")
|
||||
#message("DEBUG: TAUCS_LIBRARIES = ${TAUCS_LIBRARIES}")
|
||||
#message("DEBUG: TAUCS_LIBRARIES_DIR = ${TAUCS_LIBRARIES_DIR}")
|
||||
#message("DEBUG: TAUCS_FOUND = ${TAUCS_FOUND}")
|
||||
|
||||
endif(TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR)
|
||||
|
||||
#mark_as_advanced(TAUCS_INCLUDE_DIR)
|
||||
#mark_as_advanced(TAUCS_DEFINITIONS)
|
||||
#mark_as_advanced(TAUCS_LIBRARIES)
|
||||
#mark_as_advanced(TAUCS_LIBRARIES_DIR)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
# Created by the script cgal_create_cmake_script
|
||||
# This is the CMake script for compiling a CGAL application.
|
||||
|
||||
|
||||
project( Jet_fitting_3_example )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5)
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
find_package(CGAL QUIET COMPONENTS Core )
|
||||
|
||||
if ( CGAL_FOUND )
|
||||
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
include( CreateSingleSourceCGALProgram )
|
||||
include( GeneratorSpecificSettings )
|
||||
|
||||
# Link with BLAS and LAPACK (required)
|
||||
include( CGAL_SetupBLAS )
|
||||
include( CGAL_SetupLAPACK )
|
||||
|
||||
# Link with Boost.ProgramOptions (optional)
|
||||
find_package(Boost 1.33.1 QUIET COMPONENTS program_options)
|
||||
if(Boost_PROGRAM_OPTIONS_FOUND)
|
||||
add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" )
|
||||
set( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" )
|
||||
|
||||
if( AUTO_LINK_ENABLED )
|
||||
message( STATUS "Boost.ProgramOptions library: found" )
|
||||
else()
|
||||
message( STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}" )
|
||||
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
create_single_source_cgal_program( "Mesh_estimation.cpp" )
|
||||
create_single_source_cgal_program( "Single_estimation.cpp" )
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
# Created by the script cgal_create_cmake_script
|
||||
# This is the CMake script for compiling a CGAL application.
|
||||
|
||||
|
||||
project( Jet_fitting_3_test )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5)
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
find_package(CGAL QUIET COMPONENTS Core )
|
||||
|
||||
if ( CGAL_FOUND )
|
||||
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
include( CreateSingleSourceCGALProgram )
|
||||
|
||||
# Link with BLAS and LAPACK (required)
|
||||
include( CGAL_SetupBLAS )
|
||||
include( CGAL_SetupLAPACK )
|
||||
|
||||
create_single_source_cgal_program( "blind_1pt.cpp" )
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
|
||||
|
|
@ -12,12 +12,44 @@ find_package(CGAL QUIET COMPONENTS Core )
|
|||
|
||||
if ( CGAL_FOUND )
|
||||
|
||||
# Optimization for applications dealing with large data
|
||||
if (MSVC)
|
||||
# Use /EHa option to catch stack overflows.
|
||||
# Note: TAUCS needs a stack >= 2MB. CGAL default is 10MB.
|
||||
SET (CGAL_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W2 /Zm1000 /EHa /GR")
|
||||
|
||||
# Allow Windows applications to use up to 3GB of RAM
|
||||
SET (CGAL_EXE_LINKER_FLAGS_INIT "${CGAL_EXE_LINKER_FLAGS_INIT} /LARGEADDRESSAWARE")
|
||||
|
||||
# Turn off stupid VC++ warnings
|
||||
SET (CGAL_CXX_FLAGS_INIT "${CGAL_CXX_FLAGS_INIT} /wd4267 /wd4311 /wd4800 /wd4503 /wd4244 /wd4345")
|
||||
|
||||
# Speed up VC++ debugger
|
||||
SET (CGAL_CXX_FLAGS_DEBUG_INIT "${CGAL_CXX_FLAGS_DEBUG_INIT} /D_HAS_ITERATOR_DEBUGGING=0")
|
||||
endif()
|
||||
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
include( CreateSingleSourceCGALProgram )
|
||||
include( GeneratorSpecificSettings )
|
||||
|
||||
# Link with BLAS, LAPACK and TAUCS (optional)
|
||||
include( CGAL_SetupTAUCS )
|
||||
|
||||
# Link with Boost.ProgramOptions (optional)
|
||||
find_package(Boost 1.33.1 QUIET COMPONENTS program_options)
|
||||
if(Boost_PROGRAM_OPTIONS_FOUND)
|
||||
add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" )
|
||||
set( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" )
|
||||
|
||||
if( AUTO_LINK_ENABLED )
|
||||
message( STATUS "Boost.ProgramOptions library: found" )
|
||||
else()
|
||||
message( STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}" )
|
||||
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include_directories (BEFORE include)
|
||||
|
||||
create_single_source_cgal_program( "Authalic_parameterization.cpp" )
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
# Created by the script cgal_create_cmake_script
|
||||
# This is the CMake script for compiling a CGAL application.
|
||||
|
||||
|
||||
project( Surface_mesh_parameterization_test )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5)
|
||||
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
find_package(CGAL QUIET COMPONENTS Core )
|
||||
|
||||
if ( CGAL_FOUND )
|
||||
|
||||
# Optimization for applications dealing with large data
|
||||
if (MSVC)
|
||||
# Use /EHa option to catch stack overflows.
|
||||
# Note: TAUCS needs a stack >= 2MB. CGAL default is 10MB.
|
||||
SET (CGAL_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W2 /Zm1000 /EHa /GR")
|
||||
|
||||
# Allow Windows applications to use up to 3GB of RAM
|
||||
SET (CGAL_EXE_LINKER_FLAGS_INIT "${CGAL_EXE_LINKER_FLAGS_INIT} /LARGEADDRESSAWARE")
|
||||
|
||||
# Turn off stupid VC++ warnings
|
||||
SET (CGAL_CXX_FLAGS_INIT "${CGAL_CXX_FLAGS_INIT} /wd4267 /wd4311 /wd4800 /wd4503 /wd4244 /wd4345")
|
||||
|
||||
# Speed up VC++ debugger
|
||||
SET (CGAL_CXX_FLAGS_DEBUG_INIT "${CGAL_CXX_FLAGS_DEBUG_INIT} /D_HAS_ITERATOR_DEBUGGING=0")
|
||||
endif()
|
||||
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
include( CreateSingleSourceCGALProgram )
|
||||
|
||||
# Link with BLAS, LAPACK and TAUCS (optional)
|
||||
include( CGAL_SetupTAUCS )
|
||||
|
||||
include_directories (BEFORE include)
|
||||
|
||||
create_single_source_cgal_program( "extensive_parameterization_test.cpp" )
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
|
||||
Loading…
Reference in New Issue