Commit 6c7a59ed authored by Radu Popescu's avatar Radu Popescu
Browse files

Removing old cmake folder

parent ae1463a0
#
# Find the PARMETIS includes and libraries
#
# ParMETIS is an MPI-based parallel library that implements a variety of algorithms for
# partitioning unstructured graphs, meshes, and for computing fill-reducing orderings of
# sparse matrices. It can be found at:
# http://www-users.cs.umn.edu/~karypis/metis/parmetis/index.html
#
# PARMETIS_INCLUDE_DIR - where to find autopack.h
# PARMETIS_LIBRARIES - List of fully qualified libraries to link against.
# PARMETIS_FOUND - Do not attempt to use if "no" or undefined.
FIND_PATH(PARMETIS_INCLUDE_DIR parmetis.h
${PARMETIS_ROOT}/include
/usr/local/include
/usr/include
)
FIND_LIBRARY(PARMETIS_LIBRARY parmetis
${PARMETIS_ROOT}/lib
/usr/local/lib
/usr/lib
)
FIND_LIBRARY(METIS_LIBRARY metis
${PARMETIS_ROOT}/lib
/usr/local/lib
/usr/lib
)
IF(PARMETIS_INCLUDE_DIR)
IF(PARMETIS_LIBRARY)
SET( PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARY})
SET( PARMETIS_FOUND "YES" )
ENDIF(PARMETIS_LIBRARY)
ENDIF(PARMETIS_INCLUDE_DIR)
\ No newline at end of file
# Find qhull header and library.
#
# This module defines the following uncached variables:
# QHULL_FOUND, if false, do not try to use qhull.
# QHULL_INCLUDE_DIRS, where to find qhull/qhull_a.h.
# QHULL_LIBRARIES, the libraries to link against to use the qhull library
# QHULL_LIBRARY_DIRS, the directory where the qhull library is found.
find_path(
QHULL_INCLUDE_DIR
qhull/qhull_a.h
/usr/local/include
/usr/include
${QHULL_ROOT}/include
)
if( QHULL_INCLUDE_DIR )
find_library(
QHULL_LIBRARY
NAMES qhull
PATHS /usr/local/lib /usr/lib ${QHULL_ROOT}/lib
)
if( QHULL_LIBRARY )
set(QHULL_LIBRARY_DIR "")
get_filename_component(QHULL_LIBRARY_DIRS ${QHULL_LIBRARY} PATH)
# Set uncached variables as per standard.
set(QHULL_FOUND ON)
set(QHULL_INCLUDE_DIRS ${QHULL_INCLUDE_DIR})
set(QHULL_LIBRARIES ${QHULL_LIBRARY})
endif(QHULL_LIBRARY)
endif(QHULL_INCLUDE_DIR)
if(QHULL_FOUND)
if(NOT QHULL_FIND_QUIETLY)
message(STATUS "FindQHull: Found both qhull_a.h and libqhull.a")
endif(NOT QHULL_FIND_QUIETLY)
else(QHULL_FOUND)
if(QHULL_FIND_REQUIRED)
message(FATAL_ERROR "FindQHull: Could not find qhull_a.h and/or libqhull.a")
endif(QHULL_FIND_REQUIRED)
endif(QHULL_FOUND)
# Find SuperLU headers and library.
#
# This module defines the following uncached variables:
# SuperLU_FOUND, if false, do not try to use SuperLU.
# SuperLU_INCLUDE_DIRS, where to find the headers.
# SuperLU_LIBRARIES, the libraries to link against to use the SuperLU library
# SuperLU_LIBRARY_DIRS, the directory where the SuperLU library is found.
find_path(
SuperLU_INCLUDE_DIR
supermatrix.h
/usr/local/include
/usr/include
${SuperLU_ROOT}/include
)
if( SuperLU_INCLUDE_DIR )
find_library(
SuperLU_LIBRARY
NAMES superlu
PATHS /usr/local/lib /usr/lib ${SuperLU_ROOT}/lib
)
if( SuperLU_LIBRARY )
set(SuperLU_LIBRARY_DIR "")
get_filename_component(SuperLU_LIBRARY_DIRS ${SuperLU_LIBRARY} PATH)
# Set uncached variables as per standard.
set(SuperLU_FOUND ON)
set(SuperLU_INCLUDE_DIRS ${SuperLU_INCLUDE_DIR})
set(SuperLU_LIBRARIES ${SuperLU_LIBRARY} -lgfortran)
endif(SuperLU_LIBRARY)
endif(SuperLU_INCLUDE_DIR)
if(SuperLU_FOUND)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "FindSuperLU: Found both headers and library")
endif(NOT SuperLU_FIND_QUIETLY)
else(SuperLU_FOUND)
if(SuperLU_FIND_REQUIRED)
message(FATAL_ERROR "FindSuperLU: Could not find headers and/or library")
endif(SuperLU_FIND_REQUIRED)
endif(SuperLU_FOUND)
# Find SuperLUDist headers and library.
#
# This module defines the following uncached variables:
# SuperLUDist_FOUND, if false, do not try to use SuperLUDist.
# SuperLUDist_INCLUDE_DIRS, where to find the headers.
# SuperLUDist_LIBRARIES, the libraries to link against to use the SuperLUDist library
# SuperLUDist_LIBRARY_DIRS, the directory where the SuperLUDist library is found.
find_path(
SuperLUDist_INCLUDE_DIR
supermatrix.h
/usr/local/include
/usr/include
${SuperLUDist_ROOT}/include
)
if( SuperLUDist_INCLUDE_DIR )
find_library(
SuperLUDist_LIBRARY
NAMES superlu_dist
PATHS /usr/local/lib /usr/lib ${SuperLUDist_ROOT}/lib
)
if( SuperLUDist_LIBRARY )
set(SuperLUDist_LIBRARY_DIR "")
get_filename_component(SuperLUDist_LIBRARY_DIRS ${SuperLUDist_LIBRARY} PATH)
# Set uncached variables as per standard.
set(SuperLUDist_FOUND ON)
set(SuperLUDist_INCLUDE_DIRS ${SuperLUDist_INCLUDE_DIR})
set(SuperLUDist_LIBRARIES ${SuperLUDist_LIBRARY} -lgfortran)
endif(SuperLUDist_LIBRARY)
endif(SuperLUDist_INCLUDE_DIR)
if(SuperLUDist_FOUND)
if(NOT SuperLUDist_FIND_QUIETLY)
message(STATUS "FindSuperLUDist: Found both headers and library")
endif(NOT SuperLUDist_FIND_QUIETLY)
else(SuperLUDist_FOUND)
if(SuperLUDist_FIND_REQUIRED)
message(FATAL_ERROR "FindSuperLUDist: Could not find headers and/or library")
endif(SuperLUDist_FIND_REQUIRED)
endif(SuperLUDist_FOUND)
# Find SuperLUMT headers and library.
#
# This module defines the following uncached variables:
# SuperLUMT_FOUND, if false, do not try to use SuperLUMT.
# SuperLUMT_INCLUDE_DIRS, where to find the headers.
# SuperLUMT_LIBRARIES, the libraries to link against to use the SuperLUMT library
# SuperLUMT_LIBRARY_DIRS, the directory where the SuperLUMT library is found.
find_path(
SuperLUMT_INCLUDE_DIR
supermatrix.h
/usr/local/include
/usr/include
${SuperLUMT_ROOT}/include
)
if( SuperLUMT_INCLUDE_DIR )
find_library(
SuperLUMT_LIBRARY
NAMES superlu_mt
PATHS /usr/local/lib /usr/lib ${SuperLUMT_ROOT}/lib
)
if( SuperLUMT_LIBRARY )
set(SuperLUMT_LIBRARY_DIR "")
get_filename_component(SuperLUMT_LIBRARY_DIRS ${SuperLUMT_LIBRARY} PATH)
# Set uncached variables as per standard.
set(SuperLUMT_FOUND ON)
set(SuperLUMT_INCLUDE_DIRS ${SuperLUMT_INCLUDE_DIR})
set(SuperLUMT_LIBRARIES ${SuperLUMT_LIBRARY} -lpthread -lgfortran)
endif(SuperLUMT_LIBRARY)
endif(SuperLUMT_INCLUDE_DIR)
if(SuperLUMT_FOUND)
if(NOT SuperLUMT_FIND_QUIETLY)
message(STATUS "FindSuperLUMT: Found both headers and library")
endif(NOT SuperLUMT_FIND_QUIETLY)
else(SuperLUMT_FOUND)
if(SuperLUMT_FIND_REQUIRED)
message(FATAL_ERROR "FindSuperLUMT: Could not find headers and/or library")
endif(SuperLUMT_FIND_REQUIRED)
endif(SuperLUMT_FOUND)
# This three lines are left to be similar to Radu, but I do not understand what they do.
set(Trilinos_FOUND TRUE)
set(Trilinos_ERROR_REASONS)
set(Trilinos_ALREADY_CACHED FALSE)
# Here I am looking for TrilinosConfig.cmake and I will import it.
FIND_PACKAGE(Trilinos PATHS ${Trilinos_ROOT}/include)
# Stop cmake if Trilinos is not found.
IF(NOT Trilinos_FOUND)
MESSAGE(FATAL_ERROR "Could not find Trilinos!")
ENDIF()
# Here it will be better just to raise a warning or have if(USE_TRILINOS_COMPILERS)
# Make sure to use same compilers and flags as Trilinos
SET(CMAKE_CXX_COMPILER ${Trilinos_CXX_COMPILER} )
SET(CMAKE_C_COMPILER ${Trilinos_C_COMPILER} )
SET(CMAKE_Fortran_COMPILER ${Trilinos_Fortran_COMPILER} )
# Set all the include directories to compile against Trilinos and its dependencies
SET (Trilinos_INCLUDE_DIR ${Trilinos_INCLUDE_DIRS} ${Trilinos_TPL_INCLUDE_DIRS})
# Now we created the list of all the Trilinos libraries and TPL we need to link agaist to
#First I define the directory where Trilinos libs are
SET( tmp "-L${Trilinos_ROOT}/lib")
# Then I concatenate all the Trilinos libraries -lXXXX
FOREACH(LIB_FILE ${Trilinos_LIBRARIES})
SET (tmp "${tmp} -l${LIB_FILE}")
ENDFOREACH(LIB_FILE ${Trilinos_LIBRARIES})
#Finally I set Trilinos_LIBRARIES to be the set of Trilinos libraries plus the other TPL of Trilinos
SET (Trilinos_LIBRARIES ${tmp} ${Trilinos_TPL_LIBRARIES})
#Finally I check that all the Trilinos package we need are present.
#I define all the needed packages
SET( REQUIRED_PACKAGES "amesos;anasazi;aztecoo;belos;epetra;epetraext;ifpack;ml;teuchos;zoltan")
#Now I check if all the required packages are in the list of Trilinos Packages. (This might be done better with a find...)
FOREACH( PACKAGE ${REQUIRED_PACKAGES})
STRING(TOUPPER ${PACKAGE} UPACK)
FOREACH(Tpack ${Trilinos_PACKAGE_LIST})
STRING(TOUPPER ${Tpack} TPACK)
IF(${UPACK} STREQUAL ${TPACK})
SET(${UPACK}_FOUND TRUE)
ENDIF()
ENDFOREACH(Tpack ${Trilinos_PACKAGE_LIST})
IF(${UPACK}_FOUND)
set( HAVE_TRILINOS_${UPACK} TRUE)
ELSE()
MESSAGE( FATAL_ERROR "Could not find ${PACKAGE}")
ENDIF()
ENDFOREACH(PACKAGE ${REQUIRED_PACKAGES})
#optional packages
SET( OPTIONAL_PACKAGES "rythmos")
#Now I check if all the required packages are in the list of Trilinos Packages. (This might be done better with a find...)
FOREACH( PACKAGE ${OPTIONAL_PACKAGES})
STRING(TOUPPER ${PACKAGE} UPACK)
FOREACH(Tpack ${Trilinos_PACKAGE_LIST})
STRING(TOUPPER ${Tpack} TPACK)
IF(${UPACK} STREQUAL ${TPACK})
SET(${UPACK}_FOUND TRUE)
ENDIF()
ENDFOREACH(Tpack ${Trilinos_PACKAGE_LIST})
IF(${UPACK}_FOUND)
set( HAVE_TRILINOS_${UPACK} TRUE)
ELSE()
MESSAGE( STATUS "Could not find ${PACKAGE}")
ENDIF()
ENDFOREACH(PACKAGE ${REQUIRED_PACKAGES})
#temporary hack to properly set HAVE_NOX_THYRA
FOREACH(Tpack ${NOX_LIBRARIES})
IF(${Tpack} STREQUAL "noxthyra")
SET(HAVE_NOX_THYRA TRUE)
ENDIF()
ENDFOREACH(Tpack ${NOX_LIBRARIES})
#If XXX is already linked through Trilinos. If so I set the variable XXX_IS_IN_TRILINOS to true
FOREACH(tpl ${Trilinos_TPL_LIST})
STRING(TOUPPER ${tpl} TPL)
SET(${TPL}_IS_IN_TRILINOS TRUE)
set (HAVE_${TPL} TRUE)
MESSAGE( STATUS "Library ${TPL} already included through Trilinos" )
ENDFOREACH(tpl ${Trilinos_TPL_LIST})
#
# Find the UMFPACK includes and libraries
#
FIND_PATH(UMFPACK_INCLUDE_DIR umfpack.h amd.h UFconfig.h
/usr/local/include
/usr/include
${UMFPACK_ROOT}
${UMFPACK_ROOT}/include
)
find_library(UMFPACK_LIBRARY
NAMES umfpack
HINTS "/usr/local/lib"
"/usr/lib"
"${UMFPACK_ROOT}"
"${UMFPACK_ROOT}/lib"
)
find_library(AMD_LIBRARY
NAMES amd
HINTS "/usr/local/lib"
"/usr/lib"
"${UMFPACK_ROOT}"
"${UMFPACK_ROOT}/lib"
)
IF(UMFPACK_INCLUDE_DIR)
IF(UMFPACK_LIBRARY)
SET( UMFPACK_LIBRARIES ${UMFPACK_LIBRARY} ${AMD_LIBRARY})
SET( UMFPACK_FOUND "YES" )
MESSAGE ("-- Found UMFPACK")
ENDIF(UMFPACK_LIBRARY)
ENDIF(UMFPACK_INCLUDE_DIR)
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment