From ca67ac5c1fe865dfe074b50e55e96ed34a7446d9 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Mar 2019 09:40:08 +0100 Subject: [PATCH] Remove all mentions of BLAS, LAPACK, and TAUCS in our CMake scripts --- Installation/CMakeLists.txt | 4 +- Installation/INSTALL.md | 8 - .../modules/CGAL_Locate_CGAL_TAUCS.cmake | 121 ----- Installation/cmake/modules/CGAL_UseBLAS.cmake | 36 -- .../cmake/modules/CGAL_UseLAPACK.cmake | 41 -- .../cmake/modules/CGAL_UseTAUCS.cmake | 31 -- Installation/cmake/modules/FindBLAS.cmake | 498 ------------------ Installation/cmake/modules/FindF2C.cmake | 5 - Installation/cmake/modules/FindLAPACK.cmake | 324 ------------ Installation/cmake/modules/FindTAUCS.cmake | 129 ----- .../modules/config/support/test_ATLAS.cpp | 47 -- .../modules/config/support/test_BLAS.cpp | 88 ---- .../modules/config/support/test_LAPACK.cpp | 83 --- Installation/include/CGAL/auto_link/LAPACK.h | 106 ---- Installation/include/CGAL/auto_link/TAUCS.h | 50 -- 15 files changed, 2 insertions(+), 1569 deletions(-) delete mode 100644 Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake delete mode 100644 Installation/cmake/modules/CGAL_UseBLAS.cmake delete mode 100644 Installation/cmake/modules/CGAL_UseLAPACK.cmake delete mode 100644 Installation/cmake/modules/CGAL_UseTAUCS.cmake delete mode 100644 Installation/cmake/modules/FindBLAS.cmake delete mode 100644 Installation/cmake/modules/FindLAPACK.cmake delete mode 100644 Installation/cmake/modules/FindTAUCS.cmake delete mode 100644 Installation/cmake/modules/config/support/test_ATLAS.cpp delete mode 100644 Installation/cmake/modules/config/support/test_BLAS.cpp delete mode 100644 Installation/cmake/modules/config/support/test_LAPACK.cpp delete mode 100644 Installation/include/CGAL/auto_link/LAPACK.h delete mode 100644 Installation/include/CGAL/auto_link/TAUCS.h diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 0a1e33d64ab..af2c268deca 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -567,8 +567,8 @@ message("== Detect external libraries ==") # Remarks: # External libs configured when Qt5 lib of cgal are required # Coin is used in KDS, but no FindCoin or FindCOIN exists -# There exists FindF2C, FindIPE, FindMKL, but they are only used to support supporting libs -list (INSERT CGAL_SUPPORTING_3RD_PARTY_LIBRARIES 0 GMP MPFR ZLIB OpenGL LEDA MPFI RS RS3 OpenNL Eigen3 BLAS LAPACK ESBTL Coin3D NTL IPE) +# There exists FindIPE, FindMKL, but they are only used to support supporting libs +list (INSERT CGAL_SUPPORTING_3RD_PARTY_LIBRARIES 0 GMP MPFR ZLIB OpenGL LEDA MPFI RS RS3 OpenNL Eigen3 ESBTL Coin3D NTL IPE) if (NOT WIN32) # GMPXX is not supported on WIN32 machines list (INSERT CGAL_SUPPORTING_3RD_PARTY_LIBRARIES 1 GMPXX) diff --git a/Installation/INSTALL.md b/Installation/INSTALL.md index 5161bfe0e2d..2286a6a787f 100644 --- a/Installation/INSTALL.md +++ b/Installation/INSTALL.md @@ -76,14 +76,6 @@ CGAL packages, some are only needed for demos. * Surface Reconstruction from Point Sets http://eigen.tuxfamily.org - - BLAS, LAPACK, ATLAS - Required by the packages (if EIGEN is not available): - * Estimation of Local Differential Properties of Point-Sampled Surfaces - * Approximation of Ridges and Umbilics on Triangulated Surface Meshes - * Planar Parameterization of Triangulated Surface Meshes - http://www.netlib.org/blas/, http://www.netlib.org/lapack/ - or precompiled version that can be downloaded with CGAL-x.y-Setup.exe - - MPFI Required by the package: * Algebraic Kernel diff --git a/Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake b/Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake deleted file mode 100644 index ca4470a2124..00000000000 --- a/Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake +++ /dev/null @@ -1,121 +0,0 @@ -# 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 - -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake) - -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. - # - - #message("DEBUG: CGAL_INSTALLATION_PACKAGE_DIR = ${CGAL_INSTALLATION_PACKAGE_DIR}") - - # VC++ uses auto-link, thus we search for a folder containing the output of - # build_taucs_win32_for_CGAL.bat/build_taucs_win64_for_CGAL.bat, - # ie TAUCS libraries compiled for all Windows runtimes. - if ( MSVC ) - - # Check $CGAL_TAUCS_DIR environment variable - fetch_env_var(CGAL_TAUCS_DIR) - #message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}") - if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR}) - - set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/include") - set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/lib" ) - set( CGAL_TAUCS_FOUND TRUE ) - - # Else, search for TAUCS in CGAL "auxiliary" folder - elseif ( EXISTS "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/include/taucs.h" AND - EXISTS "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/lib" ) - - set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/include") - set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/lib" ) - set( CGAL_TAUCS_FOUND TRUE ) - - endif() - - # On Unix, search for TAUCS "taucs_full" folder - else ( MSVC ) - - # Check $CGAL_TAUCS_DIR environment variable - fetch_env_var(CGAL_TAUCS_DIR) - #message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}") - if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR}) - - 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 ( MSVC ) - - # Add variables to cache - set( CGAL_TAUCS_DIR "${CGAL_TAUCS_DIR}" - CACHE PATH "Directory containing BLAS, LAPACK and TAUCS" ) - - #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 ( NOT CGAL_TAUCS_FOUND ) - diff --git a/Installation/cmake/modules/CGAL_UseBLAS.cmake b/Installation/cmake/modules/CGAL_UseBLAS.cmake deleted file mode 100644 index 941b795ba78..00000000000 --- a/Installation/cmake/modules/CGAL_UseBLAS.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# This module setups the compiler for the BLAS libraries. -# It assumes that find_package(BLAS) was already called. - -if ( BLAS_FOUND AND NOT BLAS_SETUP ) - - message( STATUS "UseBLAS" ) - message( STATUS "BLAS include: ${BLAS_INCLUDE_DIR}" ) - include_directories ( SYSTEM ${BLAS_INCLUDE_DIR} ) - - message( STATUS "BLAS definitions: ${BLAS_DEFINITIONS}" ) - add_definitions( ${BLAS_DEFINITIONS} ) - if ( "${BLAS_DEFINITIONS}" MATCHES ".*BLAS_USE_F2C.*" ) - add_definitions( "-DCGAL_USE_F2C" ) - endif() - - if (BLAS_LIBRARIES_DIR) - message( STATUS "BLAS library directories: ${BLAS_LIBRARIES_DIR}" ) - link_directories( ${BLAS_LIBRARIES_DIR} ) - endif() - if (BLAS_LIBRARIES) - message( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" ) - link_libraries( ${BLAS_LIBRARIES} ) - endif() - - message( STATUS "BLAS link flags: ${BLAS_LINKER_FLAGS}" ) - if ( BUILD_SHARED_LIBS ) - uniquely_add_flags( CMAKE_SHARED_LINKER_FLAGS ${BLAS_LINKER_FLAGS} ) - else() - uniquely_add_flags( CMAKE_MODULE_LINKER_FLAGS ${BLAS_LINKER_FLAGS} ) - endif() - - # Setup is done - set ( BLAS_SETUP TRUE ) - -endif() - diff --git a/Installation/cmake/modules/CGAL_UseLAPACK.cmake b/Installation/cmake/modules/CGAL_UseLAPACK.cmake deleted file mode 100644 index 89790863a72..00000000000 --- a/Installation/cmake/modules/CGAL_UseLAPACK.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# This module setups the compiler for the LAPACK libraries. -# It assumes that find_package(LAPACK) was already called. - -if ( LAPACK_FOUND AND NOT LAPACK_SETUP ) - - message( STATUS "UseLAPACK" ) - message( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIR}" ) - include_directories ( SYSTEM ${LAPACK_INCLUDE_DIR} ) - - message( STATUS "LAPACK definitions: ${LAPACK_DEFINITIONS}" ) - add_definitions( ${LAPACK_DEFINITIONS} ) - if ( "${LAPACK_DEFINITIONS}" MATCHES ".*LAPACK_USE_F2C.*" ) - add_definitions( "-DCGAL_USE_F2C" ) - endif() - - if (LAPACK_LIBRARIES_DIR) - message( STATUS "LAPACK library directories: ${LAPACK_LIBRARIES_DIR}" ) - link_directories( ${LAPACK_LIBRARIES_DIR} ) - endif() - if (LAPACK_LIBRARIES) - message( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" ) - link_libraries( ${LAPACK_LIBRARIES} ) - endif() - - message( STATUS "LAPACK link flags: ${LAPACK_LINKER_FLAGS}" ) - if ( BUILD_SHARED_LIBS ) - uniquely_add_flags( CMAKE_SHARED_LINKER_FLAGS ${LAPACK_LINKER_FLAGS} ) - else() - uniquely_add_flags( CMAKE_MODULE_LINKER_FLAGS ${LAPACK_LINKER_FLAGS} ) - endif() - - # LAPACK requires BLAS - include( ${BLAS_USE_FILE} ) - - # Setup is done - set ( LAPACK_SETUP TRUE ) - - add_definitions(-DCGAL_LAPACK_ENABLED) - -endif() - diff --git a/Installation/cmake/modules/CGAL_UseTAUCS.cmake b/Installation/cmake/modules/CGAL_UseTAUCS.cmake deleted file mode 100644 index b980dee1d31..00000000000 --- a/Installation/cmake/modules/CGAL_UseTAUCS.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# This module setups the compiler for the TAUCS libraries. -# It assumes that find_package(TAUCS) was already called. - -if ( TAUCS_FOUND AND NOT TAUCS_SETUP ) - - message( STATUS "UseTAUCS" ) - message( STATUS "TAUCS include: ${TAUCS_INCLUDE_DIR}" ) - include_directories ( SYSTEM ${TAUCS_INCLUDE_DIR} ) - - message( STATUS "TAUCS definitions: ${TAUCS_DEFINITIONS}" ) - add_definitions( ${TAUCS_DEFINITIONS} "-DCGAL_USE_TAUCS" ) - - if (TAUCS_LIBRARIES_DIR) - message( STATUS "TAUCS library directories: ${TAUCS_LIBRARIES_DIR}" ) - link_directories( ${TAUCS_LIBRARIES_DIR} ) - endif() - if (TAUCS_LIBRARIES) - message( STATUS "TAUCS libraries: ${TAUCS_LIBRARIES}" ) - link_libraries( ${TAUCS_LIBRARIES} ) - endif() - - # TAUCS requires BLAS and LAPACK - include( ${LAPACK_USE_FILE} ) - - # Setup is done - set ( TAUCS_SETUP TRUE ) - - add_definitions(-DCGAL_TAUCS_ENABLED) - -endif() - diff --git a/Installation/cmake/modules/FindBLAS.cmake b/Installation/cmake/modules/FindBLAS.cmake deleted file mode 100644 index 34f5bb5fdf2..00000000000 --- a/Installation/cmake/modules/FindBLAS.cmake +++ /dev/null @@ -1,498 +0,0 @@ -# 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_INCLUDE_DIR - Directories containing the BLAS header files -# 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++). -# BLAS_USE_FILE - The name of the cmake module to include to compile -# applications or libraries using BLAS. -# -# This module was modified by CGAL team: -# - find BLAS library shipped with TAUCS -# - find libraries for a C++ compiler, instead of Fortran -# - added BLAS_INCLUDE_DIR, BLAS_DEFINITIONS and BLAS_LIBRARIES_DIR -# - removed BLAS95_LIBRARIES -# -# TODO (CGAL): -# - find CBLAS (http://www.netlib.org/cblas) on Unix? - - -include(CheckFunctionExists) - -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake) - - -# 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_fortran_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _path) - #message("DEBUG: check_fortran_libraries(${_list} in ${_path})") - - # 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() - #message("DEBUG: find_library(${_library}) = ${${_prefix}_${_library}_LIBRARY}") - mark_as_advanced(${_prefix}_${_library}_LIBRARY) - set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) - set(_libraries_found ${${_prefix}_${_library}_LIBRARY}) - endif(_libraries_found) - endforeach(_library ${_list}) - 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_package( 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}}) - #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) - #message("DEBUG: 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(_libraries_found AND NOT _libraries_work) - - # 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}}) - #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - check_function_exists(${_name} ${_prefix}_${_name}${_combined_name}_WORKS) - #message("DEBUG: 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(_libraries_found AND NOT _libraries_work) - - # on failure - if(NOT _libraries_work) - set(${DEFINITIONS} "") - set(${LIBRARIES} FALSE) - endif() - #message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}") - #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endmacro(check_fortran_libraries) - - -# -# main -# - -# Is it already configured? -if (BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES) - - set(BLAS_FOUND TRUE) - -else() - - # reset variables - set( BLAS_INCLUDE_DIR "" ) - set( BLAS_DEFINITIONS "" ) - set( BLAS_LINKER_FLAGS "" ) - set( BLAS_LIBRARIES "" ) - set( BLAS_LIBRARIES_DIR "" ) - - # Look first for the TAUCS library distributed with CGAL in auxiliary/taucs. - # Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR. - include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake) - - # Search for BLAS in CGAL_TAUCS_INCLUDE_DIR/CGAL_TAUCS_LIBRARIES_DIR (TAUCS shipped with CGAL)... - if(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - # if VC++: done - set( BLAS_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" ) - set( BLAS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" ) - - # ...else search for BLAS in $BLAS_LIB_DIR environment variable - else(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - # - # Search for BLAS in possible libraries - # in $BLAS_LIB_DIR environment variable and in usual places. - # - - # Read environment variables - fetch_env_var(BLAS_LIB_DIR) - fetch_env_var(MKL_LIB_DIR) - - # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "cblas;f77blas;atlas" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "sgemm;dgemm;blas" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in Alpha CXML library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "cxml" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in Alpha DXML library? (now called CXML, see above) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "dxml" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in Sun Performance library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "-xlic_lib=sunperf" - "sunperf;sunmath" - "${BLAS_LIB_DIR}" - ) - if(BLAS_LIBRARIES) - # Extra linker flag - 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_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "scsl" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in SGIMATH library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "complib.sgimath" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in IBM ESSL library? (requires generic BLAS lib, too) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "essl;blas" - "${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl 10 library? - # TODO: add shared variants - if (WIN32) - # intel mkl library? (static, 32bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - SGEMM - "" - "mkl_intel_c;mkl_intel_thread;mkl_core;libiomp5md" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, ia64 and em64t 64 bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - SGEMM - "" - "mkl_intel_lp64;mkl_intel_thread_lp64;mkl_core;libiomp5md" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - else(WIN32) - # intel mkl library? (static, 32bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_intel;mkl_intel_thread;mkl_core;iomp5;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, ia64 and em64t 64 bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_intel_lp64;mkl_intel_thread_lp64;mkl_core;iomp5;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - endif (WIN32) - - # older versions of intel mkl libs - - # intel mkl library? (shared) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl;guide;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, 32bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_ia32;guide;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, ia64 64bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_ipf;guide;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, em64t 64bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_em64t;guide;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - #BLAS in acml library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "acml" - "${BLAS_LIB_DIR}" - ) - endif() - - # Apple BLAS library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "Accelerate" - "${BLAS_LIB_DIR}" - ) - endif() - - if ( NOT BLAS_LIBRARIES ) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "vecLib" - "${BLAS_LIB_DIR}" - ) - 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_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "blas" - "${BLAS_LIB_DIR}" - ) - endif() - - endif(CGAL_TAUCS_FOUND AND CGAL_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) - - # Add variables to cache - set( BLAS_INCLUDE_DIR "${BLAS_INCLUDE_DIR}" - CACHE PATH "Directories containing the BLAS header files" FORCE ) - set( BLAS_DEFINITIONS "${BLAS_DEFINITIONS}" - CACHE STRING "Compilation options to use BLAS" FORCE ) - set( BLAS_LINKER_FLAGS "${BLAS_LINKER_FLAGS}" - CACHE STRING "Linker flags to use BLAS" FORCE ) - set( BLAS_LIBRARIES "${BLAS_LIBRARIES}" - CACHE FILEPATH "BLAS libraries name" FORCE ) - set( BLAS_LIBRARIES_DIR "${BLAS_LIBRARIES_DIR}" - CACHE PATH "Directories containing the BLAS libraries" FORCE ) - - #message("DEBUG: BLAS_INCLUDE_DIR = ${BLAS_INCLUDE_DIR}") - #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) - -if(BLAS_FOUND) - set(BLAS_USE_FILE "CGAL_UseBLAS") -endif(BLAS_FOUND) diff --git a/Installation/cmake/modules/FindF2C.cmake b/Installation/cmake/modules/FindF2C.cmake index 105a31632d2..c7fe3712365 100644 --- a/Installation/cmake/modules/FindF2C.cmake +++ b/Installation/cmake/modules/FindF2C.cmake @@ -13,12 +13,7 @@ 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(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake) - find_library(F2C_LIBRARIES NAMES f2c g2c vcf2c - PATHS ${CGAL_TAUCS_LIBRARIES_DIR} DOC "F2C library" ) diff --git a/Installation/cmake/modules/FindLAPACK.cmake b/Installation/cmake/modules/FindLAPACK.cmake deleted file mode 100644 index 8612095f14e..00000000000 --- a/Installation/cmake/modules/FindLAPACK.cmake +++ /dev/null @@ -1,324 +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 LAPACK library shipped with TAUCS -# - find libraries for a C++ compiler, instead of Fortran -# - added LAPACK_INCLUDE_DIR, LAPACK_DEFINITIONS and LAPACK_LIBRARIES_DIR -# - removed LAPACK95_LIBRARIES -# -# TODO (CGAL): -# - find CLAPACK (http://www.netlib.org/clapack) on Unix? - - -include(CheckFunctionExists) - -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake) - - -# 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() - #message("DEBUG: find_library(${_library}) = ${${_prefix}_${_library}_LIBRARY}") - mark_as_advanced(${_prefix}_${_library}_LIBRARY) - set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) - set(_libraries_found ${${_prefix}_${_library}_LIBRARY}) - endif(_libraries_found) - endforeach(_library ${_list}) - 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_package( 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) - #message("DEBUG: 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(_libraries_found AND NOT _libraries_work) - - # 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) - #message("DEBUG: 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(_libraries_found AND NOT _libraries_work) - - # on failure - if(NOT _libraries_work) - set(${DEFINITIONS} "") - set(${LIBRARIES} FALSE) - endif() - #message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}") - #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endmacro(check_lapack_libraries) - - -# -# main -# - -# LAPACK requires BLAS -if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_package(BLAS) -else() - find_package(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 "" ) - - # Look first for the TAUCS library distributed with CGAL in auxiliary/taucs. - # Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR. - include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake) - - # Search for LAPACK in CGAL_TAUCS_INCLUDE_DIR/CGAL_TAUCS_LIBRARIES_DIR (TAUCS shipped with CGAL)... - if(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - # if VC++: done - set( LAPACK_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" ) - set( LAPACK_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" ) - - # ...else in $LAPACK_LIB_DIR environment variable - else(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - # - # Search for LAPACK in possible libraries - # in $LAPACK_LIB_DIR environment variable and in usual places. - # - - # Read environment variables - fetch_env_var(LAPACK_LIB_DIR) - fetch_env_var(MKL_LIB_DIR) - - #intel mkl 10 lapack? - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "mkl_core" - "${BLAS_LIBRARIES}" - "${MKL_LIB_DIR} ${LAPACK_LIB_DIR}" - ) - endif() - - # older versions of intel mkl lapack? - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "mkl_lapack" - "${BLAS_LIBRARIES}" - "${MKL_LIB_DIR} ${LAPACK_LIB_DIR}" - ) - endif() - - - #acml lapack? - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "acml" - "${BLAS_LIBRARIES}" - "${LAPACK_LIB_DIR}" - ) - endif() - - # Apple LAPACK library? - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "Accelerate" - "${BLAS_LIBRARIES}" - "${LAPACK_LIB_DIR}" - ) - endif() - - if ( NOT LAPACK_LIBRARIES ) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "vecLib" - "${BLAS_LIBRARIES}" - "${LAPACK_LIB_DIR}" - ) - 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_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "lapack" - "${BLAS_LIBRARIES}" - "${LAPACK_LIB_DIR}" - ) - endif() - - endif(CGAL_TAUCS_FOUND AND CGAL_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) - - # 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(NOT BLAS_FOUND) - -if(LAPACK_FOUND) - set(LAPACK_USE_FILE "CGAL_UseLAPACK") -endif(LAPACK_FOUND) diff --git a/Installation/cmake/modules/FindTAUCS.cmake b/Installation/cmake/modules/FindTAUCS.cmake deleted file mode 100644 index f45c51dd9d6..00000000000 --- a/Installation/cmake/modules/FindTAUCS.cmake +++ /dev/null @@ -1,129 +0,0 @@ -# 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++). -# TAUCS_USE_FILE - The name of the cmake module to include to compile -# applications or libraries using TAUCS. - -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake) - -# TAUCS requires LAPACK -if(TAUCS_FIND_QUIETLY OR NOT TAUCS_FIND_REQUIRED) - find_package(LAPACK) -else() - find_package(LAPACK REQUIRED) -endif() - -if (NOT LAPACK_FOUND) - - message(STATUS "TAUCS requires LAPACK and BLAS.") - set(TAUCS_FOUND FALSE) - -# Is it already configured? -elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR) - - set(TAUCS_FOUND TRUE) - -elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES) - - set(TAUCS_FOUND TRUE) - -else() - - # reset variables - set( TAUCS_DEFINITIONS "" ) # unused (yet) - set( TAUCS_LIBRARIES "" ) - set( TAUCS_LIBRARIES_DIR "" ) - - # Look first for the TAUCS library distributed with CGAL in auxiliary/taucs. - # Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR. - include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake) - - # 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}" ) - else() - find_path(TAUCS_INCLUDE_DIR - NAMES taucs.h - HINTS ${CGAL_TAUCS_INCLUDE_DIR} - ENV TAUCS_DIR - ENV TAUCS_INC_DIR - PATH_SUFFIXES taucs include - ) - 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 CGAL_AUTO_LINK_ENABLED ) - # if VC++: done - set( TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" ) - else() - find_library(TAUCS_LIBRARY - NAMES "taucs" - PATHS ${CGAL_TAUCS_LIBRARIES_DIR} - ENV TAUCS_DIR - ENV TAUCS_LIB_DIR - PATH_SUFFIXES taucs lib - DOC "TAUCS library" - ) - find_library(METIS_LIBRARY - NAMES "metis" - PATHS ${CGAL_TAUCS_LIBRARIES_DIR} - ENV TAUCS - ENV TAUCS_LIB_DIR - PATH_SUFFIXES taucs lib - DOC "Metis library" - ) - if(TAUCS_LIBRARY AND METIS_LIBRARY) - set( TAUCS_LIBRARIES "${TAUCS_LIBRARY};${METIS_LIBRARY}" ) - 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) - - # Add variables to cache - set( TAUCS_INCLUDE_DIR "${TAUCS_INCLUDE_DIR}" - CACHE PATH "Directories containing the TAUCS header files" FORCE ) - set( TAUCS_DEFINITIONS "${TAUCS_DEFINITIONS}" - CACHE STRING "Compilation options to use TAUCS" FORCE ) - set( TAUCS_LIBRARIES "${TAUCS_LIBRARIES}" - CACHE FILEPATH "TAUCS libraries name" FORCE ) - set( TAUCS_LIBRARIES_DIR "${TAUCS_LIBRARIES_DIR}" - CACHE PATH "Directories containing the TAUCS libraries" FORCE ) - - #message("DEBUG: TAUCS_INCLUDE_DIR = ${TAUCS_INCLUDE_DIR}") - #message("DEBUG: TAUCS_DEFINITIONS = ${TAUCS_DEFINITIONS}") - #message("DEBUG: TAUCS_LIBRARIES = ${TAUCS_LIBRARIES}") - #message("DEBUG: TAUCS_LIBRARIES_DIR = ${TAUCS_LIBRARIES_DIR}") - #message("DEBUG: TAUCS_FOUND = ${TAUCS_FOUND}") - -endif(NOT LAPACK_FOUND) - -if(TAUCS_FOUND) - set(TAUCS_USE_FILE "CGAL_UseTAUCS") -endif(TAUCS_FOUND) diff --git a/Installation/cmake/modules/config/support/test_ATLAS.cpp b/Installation/cmake/modules/config/support/test_ATLAS.cpp deleted file mode 100644 index ab0a40ee9e1..00000000000 --- a/Installation/cmake/modules/config/support/test_ATLAS.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Laurent Saboret - -// Test if the LAPACK subset in ATLAS is available - - -#include - -extern "C" { - // Fortran interface taken from ATLAS/interfaces/lapack/F77/src/dpotrf.f - extern void dpotrf_(char *uplo, int *n, double *a, int *lda, int *info); -} - - -int main() -{ - // Call dpotrf_() Lapack routine (Cholesky factorization) - int sn_size = 0; - int lda = 1; - int info; - dpotrf_((char*)"LOWER", - &sn_size, - NULL, - &lda, - &info); - - std::cout << "ok for ATLAS" << std::endl; - - return 0; -} diff --git a/Installation/cmake/modules/config/support/test_BLAS.cpp b/Installation/cmake/modules/config/support/test_BLAS.cpp deleted file mode 100644 index bd2d3739bb7..00000000000 --- a/Installation/cmake/modules/config/support/test_BLAS.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $ID$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Laurent Saboret - -// Test if BLAS is available - -// blaswrap.h maps CBLAS function names to BLAS standard Fortran interface. -#ifdef CGAL_USE_CBLASWRAP - #ifndef CGAL_USE_F2C - #define CGAL_USE_F2C - #endif - #include -#endif - -#include - -extern "C" { - // Fortran interface (taken from www.netlib.org/clapack)... - void dgemm_(char* transa, char* transb, int* m, - int* n, int* k, - double* alpha, - double* a, int* lda, double* b, int* ldb, - double* beta, - double* c, int* ldc); - // ... or C interface (taken from AMD Core Math Library) - void dgemm (char transa, char transb, int m, - int n, int k, - double alpha, - double* a, int lda, double* b, int ldb, - double beta, - double* c, int ldc); -} - -namespace CGAL { namespace BLAS { - -inline -void dgemm (char* transa, char* transb, int* m, - int* n, int* k, - double* alpha, - double* a, int* lda, double* b, int* ldb, - double* beta, - double* c, int* ldc) -{ -#ifdef CGAL_USE_F2C - ::dgemm_(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc); -#else - ::dgemm (*transa, *transb, *m, *n, *k, *alpha, a, *lda, b, *ldb, *beta, c, *ldc); -#endif -} - -} } - -int main() -{ - char S[2] = "N"; - double A = 2.0; - double B = 3.0; - double C = 5.0; - double alpha = 7.0; - double beta = 11.0; - int n = 1; - int ld = 1; - - CGAL::BLAS::dgemm(S,S, &n,&n,&n, &alpha, &A,&ld, &B,&ld, &beta, &C,&ld); - if(C == 97.0) { - std::cout << "ok for BLAS" << std::endl; - return 0; - } - else { - return 1; - } -} diff --git a/Installation/cmake/modules/config/support/test_LAPACK.cpp b/Installation/cmake/modules/config/support/test_LAPACK.cpp deleted file mode 100644 index 2580e8eec4d..00000000000 --- a/Installation/cmake/modules/config/support/test_LAPACK.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Marc Pouget - -// Test if LAPACK is available - -#include -#include - -extern "C" { - // taken from acml.h -void dgelss(int m, int n, int nrhs, - double *a, int lda, double *b, int ldb, double *sing, - double rcond, int *irank, int *info); - -void dgelss_(int *m, int *n, int *nrhs, - double *a, int *lda, double *b, int *ldb, double * - s, double *rcond, int *rank, double *work, int *lwork, - int *info); -} - -namespace CGAL { namespace LAPACK { - -inline -void dgelss(int *m, int *n, int *nrhs, - double *a, int *lda, double *b, int *ldb, double * - s, double *rcond, int *rank, double *work, int *lwork, - int *info) -{ -#ifdef CGAL_USE_F2C - ::dgelss_(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info); -#else - ::dgelss(*m, *n, *nrhs, a, *lda, b, *ldb, s, *rcond, rank, info); -#endif -} - -} } - -int main() -{ - double M=1, B=1; - int m = 1, - n = 1, - nrhs = 1, - lda = m, - ldb = m, - rank, - lwork = 5*m, - info; - //c style - double * sing_values = new double[n]; // * sing_values = (double*) malloc(n*sizeof(double)); - double* work = new double[lwork]; // (double*) malloc(lwork*sizeof(double)); - - double rcond = -1; - - CGAL::LAPACK::dgelss(&m, &n, &nrhs, &M, &lda, &B, &ldb, sing_values, - &rcond, &rank, work, &lwork, &info); - assert(info==0); - assert(B==1.); - //clean up - delete sing_values; - delete work; - - std::cout << "ok for lapack" << std::endl; - - return 0; -} diff --git a/Installation/include/CGAL/auto_link/LAPACK.h b/Installation/include/CGAL/auto_link/LAPACK.h deleted file mode 100644 index d3214586555..00000000000 --- a/Installation/include/CGAL/auto_link/LAPACK.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 1997-2004 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Laurent Saboret - -#ifndef CGAL_AUTO_LINK_LAPACK_H -#define CGAL_AUTO_LINK_LAPACK_H - -#include - -// Skip the whole file if auto-link is off -#if !defined(CGAL_NO_AUTOLINK_LAPACK) && !defined(CGAL_NO_AUTOLINK) - - -#if defined(_WIN32) && !defined(_WIN64) // if Windows 32 bits - -// CGAL ships with ATLAS for Windows 32 bits, i.e this set of libraries (e.g. for VC++ 8 /MD): -// liblapack.lib libf77blas.lib libcblas.lib libatlas.lib vcf2c-vc80-mt.lib -// -// Notes: - Order matters. -// - Libraries with no "vc" toolset are compiled by gcc/g77. They are -// compatible with VC++ 7.1, 8.0 and 9.0, and with all VC++ runtimes. -// - Tested with 7.1, 8.0 and 9.0. - -#define CGAL_LIB_NAME liblapack -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME libf77blas -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME libcblas -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME libatlas -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME vcf2c -#define CGAL_AUTO_LINK_NOMANGLE -#include - -// ATLAS provides BLAS and LAPACK standard Fortran interface -#ifndef CGAL_USE_F2C - #define CGAL_USE_F2C -#endif - -#endif // Win32 - - -#ifdef _WIN64 // if Windows 64 bits - -// ATLAS is not compatible with Win64, thus CGAL ships with CLAPACK and CBLAS. -// VC++ >= 8.0 is compatible with Windows 64 bits. -// The set set of libraries is (e.g. for VC++ 8 /MD): -// clapack-vc80-mt.lib blas-vc80-mt.lib vcf2c-vc80-mt.lib -// -// Notes: - Order matters. -// - Tested with VC++ 8.0 and 9.0. - -#define CGAL_LIB_NAME clapack -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME blas -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME vcf2c -#define CGAL_AUTO_LINK_NOMANGLE -#include - -// CLAPACK provides LAPACK standard Fortran interface. -// blaswrap.h maps CBLAS function names to BLAS standard Fortran interface. -#ifndef CGAL_USE_F2C - #define CGAL_USE_F2C -#endif -#include - -#endif // _WIN64 - - -#endif // CGAL_NO_AUTOLINK_LAPACK && CGAL_NO_AUTOLINK - -#endif // CGAL_AUTO_LINK_LAPACK_H diff --git a/Installation/include/CGAL/auto_link/TAUCS.h b/Installation/include/CGAL/auto_link/TAUCS.h deleted file mode 100644 index 9896f412ef9..00000000000 --- a/Installation/include/CGAL/auto_link/TAUCS.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 1997-2004 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Laurent Saboret - -#ifndef CGAL_AUTO_LINK_TAUCS_H -#define CGAL_AUTO_LINK_TAUCS_H - -#include - -// Skip the whole file if auto-link is off -#if !defined(CGAL_NO_AUTOLINK_TAUCS) && !defined(CGAL_NO_AUTOLINK) - -# if defined(_WIN32) || defined(_WIN64) - -# define CGAL_LIB_NAME libtaucs -# define CGAL_AUTO_LINK_NOMANGLE -# include - -# define CGAL_LIB_NAME libmetis -# define CGAL_AUTO_LINK_NOMANGLE -# include - -// Link with LAPACK, BLAS and F2C -# include - -# endif // Win32|Win64 - -#endif // CGAL_NO_AUTOLINK_TAUCS && CGAL_NO_AUTOLINK - -#endif // CGAL_AUTO_LINK_TAUCS_H