Added BLAS/LAPACK and TAUCS support

This commit is contained in:
Fernando Cacciola 2008-10-17 18:13:17 +00:00
parent 822bd15b47
commit 484ae74ae3
9 changed files with 198 additions and 44 deletions

6
.gitattributes vendored
View File

@ -1668,23 +1668,29 @@ Installation/CGALConfig_install.cmake.source.in -text
Installation/INSTALL_via_cmake -text
Installation/LICENSE.FREE_USE -text
Installation/cmake/modules/AddSubdirectories.cmake -text
Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake -text
Installation/cmake/modules/CGAL_Macros.cmake -text
Installation/cmake/modules/CGAL_SetupBLAS.cmake -text
Installation/cmake/modules/CGAL_SetupBoost.cmake -text
Installation/cmake/modules/CGAL_SetupFlags.cmake -text
Installation/cmake/modules/CGAL_SetupGMP.cmake -text
Installation/cmake/modules/CGAL_SetupGMPXX.cmake -text
Installation/cmake/modules/CGAL_SetupLAPACK.cmake -text
Installation/cmake/modules/CGAL_SetupMPFR.cmake -text
Installation/cmake/modules/CGAL_SetupTAUCS.cmake -text
Installation/cmake/modules/CGALcommon.cmake -text
Installation/cmake/modules/CheckCXXFileRuns.cmake -text
Installation/cmake/modules/CreateSingleSourceCGALProgram.cmake -text
Installation/cmake/modules/CreateSingleSourceCGALQt3Program.cmake -text
Installation/cmake/modules/CreateSingleSourceCGALQt4Program.cmake -text
Installation/cmake/modules/FindBLAS.cmake -text
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/FindGMP.cmake -text
Installation/cmake/modules/FindGMPXX.cmake -text
Installation/cmake/modules/FindLAPACK.cmake -text
Installation/cmake/modules/FindMPFR.cmake -text
Installation/cmake/modules/FindOpenGL.cmake -text
Installation/cmake/modules/FindPackageHandleStandardArgs.cmake -text

View File

@ -0,0 +1,51 @@
if ( NOT CGAL_TAUCS_FOUND )
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" )
set( CGAL_TAUCS_FOUND TRUE )
set_cache( TAUCS_IN_CGAL_AUXILIARY TRUE )
endif()
else()
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_FOUND TRUE )
endif()
endif()
endif()
endif()
endif()

View File

@ -123,4 +123,13 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
endif()
endmacro()
macro ( fetch_env_var VAR )
if ( "${${VAR}}" STREQUAL "" )
set( ${VAR}_env_value "$ENV{${VAR}}" )
if ( NOT "${${VAR}_env_value}" STREQUAL "" )
set( ${VAR} ${${VAR}_env_value} )
endif()
endif()
endmacro()
endif()

View File

@ -0,0 +1,19 @@
if ( NOT BLAS_FOUND )
find_package( BLAS )
if ( BLAS_FOUND )
message( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" )
message( STATUS "BLAS definitions: ${BLAS_DEFINITIONS}" )
#get_dependency_version(BLAS)
add_definitions( ${BLAS_DEFINITIONS} "-DCGAL_USE_BLAS=1" )
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${BLAS_LIBRARIES} )
endif()
endif()

View File

@ -0,0 +1,19 @@
if ( NOT LAPACK_FOUND )
find_package( LAPACK )
if ( LAPACK_FOUND )
message( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" )
message( STATUS "LAPACK definitions: ${LAPACK_DEFINITIONS}" )
#get_dependency_version(LAPACK)
add_definitions( ${LAPACK_DEFINITIONS} "-DCGAL_USE_LAPACK=1" )
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${LAPACK_LIBRARIES} )
endif()
endif()

View File

@ -0,0 +1,27 @@
include(CGAL_SetupBLAS)
include(CGAL_SetupLAPACK)
if ( NOT TAUCS_FOUND )
find_package( TAUCS )
if ( TAUCS_FOUND )
message( STATUS "TAUCS include: ${TAUCS_INCLUDE_DIR}" )
message( STATUS "TAUCS libraries: ${TAUCS_LIBRARIES}" )
message( STATUS "TAUCS definitions: ${TAUCS_DEFINITIONS}" )
get_dependency_version(TAUCS)
include_directories ( ${TAUCS_INCLUDE_DIR} )
add_definitions( ${TAUCS_DEFINITIONS} "-DCGAL_USE_TAUCS=1" )
link_directories( ${TAUCS_LIBRARIES_DIR} )
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${TAUCS_LIBRARIES} )
endif()
endif()

View File

@ -0,0 +1,24 @@
if ( BLAS_LIBRARIES )
set(BLAS_FOUND TRUE)
else()
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" )
else()
set( BLAS_LIBRARIES "$ENV{BLAS_LIBRARIES}" CACHE FILEPATH "The BLAS libraries" )
set( BLAS_DEFINITIONS "$ENV{BLAS_DEFINITIONS}" CACHE STRING "Definitions for the BLAS" )
endif()
if ( BLAS_LIBRARIES )
set(BLAS_FOUND TRUE)
endif()
endif()

View File

@ -0,0 +1,23 @@
if ( LAPACK_LIBRARIES )
set(LAPACK_FOUND TRUE)
else()
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" )
else()
set( LAPACK_LIBRARIES $ENV{LAPACK_LIBRARIES} CACHE FILEPATH "The LAPACK libraries" )
set( LAPACK_DEFINITIONS $ENV{LAPACK_DEFINITIONS} CACHE STRING "Definitions for the LAPACK libraries" )
endif()
if ( LAPACK_LIBRARIES )
set(LAPACK_FOUND TRUE)
endif()
endif()

View File

@ -1,45 +1,28 @@
# Try to find the TAUCS libraries
# TAUCS_FOUND - system has TAUCS lib
# TAUCS_INCLUDE_DIR - the TAUCS include directory
# TAUCS_LIBRARIES_DIR - Directory where the TAUCS libraries are located
# TAUCS_LIBRARIES - the TAUCS libraries
# TAUCS_IN_CGAL_AUXILIARY - TRUE if the TAUCS found is the one distributed with CGAL in the auxiliary folder
# TODO: support MacOSX
include(FindPackageHandleStandardArgs)
include(GeneratorSpecificSettings)
# Is it already configured?
if (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR )
set(TAUCS_FOUND TRUE)
else()
# Look first for the TAUCS distributed with CGAL in auxiliary/taucs
find_path(TAUCS_INCLUDE_DIR
NAMES taucs.h
PATHS ${CGAL_SOURCE_DIR}/auxiliary/taucs/include
ENV TAUCS_INC_DIR
DOC "The directory containing the TAUCS header files"
)
include(CGAL_Locate_CGAL_TAUCS)
if( CGAL_TAUCS_FOUND )
if ( TAUCS_INCLUDE_DIR STREQUAL "${CGAL_SOURCE_DIR}/auxiliary/taucs/include" )
set( TAUCS_IN_CGAL_AUXILIARY TRUE CACHE INTERNAL "" )
endif()
set( TAUCS_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" CACHE FILEPATH "Include directories for the TAUCS libraries" )
if ( AUTO_LINK_ENABLED )
set( TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" CACHE FILEPATH "Lib directories for the TAUCS libraries")
find_path(TAUCS_LIBRARIES_DIR
NAMES "libtaucs-vc71-mt.lib" "libtaucs-vc71-mt-gd.lib" "libtaucs-vc71-mt-o.lib" "libtaucs-vc71-mt-g.lib"
PATHS ${CGAL_SOURCE_DIR}/auxiliary/taucs/lib
ENV TAUCS_LIB_DIR
DOC "Directory containing the TAUCS library"
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"
)
else()
find_path(TAUCS_INCLUDE_DIR
NAMES taucs.h
PATHS ENV TAUCS_INC_DIR
DOC "The directory containing the TAUCS header files"
)
find_library(TAUCS_LIBRARIES NAMES "taucs"
PATHS ENV TAUCS_LIB_DIR
DOC "Path to the TAUCS library"
@ -51,15 +34,8 @@ else()
endif()
# Attempt to load a user-defined configuration for TAUCS if couldn't be found
if ( NOT TAUCS_INCLUDE_DIR OR NOT TAUCS_LIBRARIES_DIR )
include( TAUCSConfig OPTIONAL )
if ( TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR)
set(TAUCS_FOUND TRUE)
endif()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TAUCS "DEFAULT_MSG" TAUCS_INCLUDE_DIR TAUCS_LIBRARIES_DIR)
endif()
#mark_as_advanced(TAUCS_INCLUDE_DIR)
#mark_as_advanced(TAUCS_LIBRARIES)
#mark_as_advanced(TAUCS_LIBRARIES_DIR)