Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Trilinos with ParMETIS TPL #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 102 additions & 95 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -530,101 +530,6 @@ ExternalProject_Add( pugixml

list(APPEND build_list pugixml )

################################
# TRILINOS
################################
if (ENABLE_TRILINOS)
set(TRILINOS_DIR "${CMAKE_INSTALL_PREFIX}/trilinos")
set(TRILINOS_URL "${TPL_MIRROR_DIR}/Trilinos-trilinos-release-13-4-1.tar.gz")

message(STATUS "Building TRILINOS found at ${TRILINOS_URL}")

set(TRILINOS_C_FLAGS "-fPIC ${C_FLAGS_NO_WARNINGS}")
set(TRILINOS_CXX_FLAGS "-fPIC ${CXX_FLAGS_NO_WARNINGS}")

if( ENABLE_MKL )
set( TRILINOS_EXTRA_ARGS ${TRILINOS_EXTRA_ARGS}
-D TPL_ENABLE_MKL:BOOL=ON
-D TPL_MKL_INCLUDE_DIRS:PATH=${MKL_INCLUDE_DIRS}
-D TPL_MKL_LIBRARIES:STRING=${MKL_LIBRARIES})
endif()

if ( ENABLE_ESSL )
set( TRILINOS_EXTRA_ARGS ${TRILINOS_EXTRA_ARGS}
-D HAVE_dggsvd3:BOOL=ON)
endif()

if ( DEFINED OpenMP_Fortran_FLAGS )
set( TRILINOS_EXTRA_ARGS ${TRILINOS_EXTRA_ARGS}
-D OpenMP_Fortran_FLAGS:STRING=${OpenMP_Fortran_FLAGS})
endif()

if ( DEFINED OpenMP_Fortran_LIB_NAMES )
set( TRILINOS_EXTRA_ARGS ${TRILINOS_EXTRA_ARGS}
-D OpenMP_Fortran_LIB_NAMES:STRING=${OpenMP_Fortran_LIB_NAMES})
endif()

if( ${ENABLE_MPI} )
set( TRILINOS_C_COMPILER ${MPI_C_COMPILER} )
set( TRILINOS_CXX_COMPILER ${MPI_CXX_COMPILER} )
set( TRILINOS_Fortran_COMPILER ${MPI_Fortran_COMPILER} )
else()
set( TRILINOS_C_COMPILER ${CMAKE_C_COMPILER} )
set( TRILINOS_CXX_COMPILER ${CMAKE_CXX_COMPILER} )
set( TRILINOS_Fortran_COMPILER ${CMAKE_Fortran_COMPILER} )
endif()

ExternalProject_Add( trilinos
PREFIX ${PROJECT_BINARY_DIR}/trilinos
URL ${TRILINOS_URL}
INSTALL_DIR ${TRILINOS_DIR}
BUILD_COMMAND ${TPL_BUILD_COMMAND}
INSTALL_COMMAND ${TPL_INSTALL_COMMAND}
CMAKE_GENERATOR ${TPL_GENERATOR}
CMAKE_CACHE_ARGS -DTPL_BLAS_LIBRARIES:STRING=${BLAS_LIBRARIES}
-DTPL_LAPACK_LIBRARIES:STRING=${LAPACK_LIBRARIES}
CMAKE_ARGS -D CMAKE_C_COMPILER:PATH=${TRILINOS_C_COMPILER}
-D CMAKE_C_FLAGS:STRING=${TRILINOS_C_FLAGS}
-D CMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
-D CMAKE_CXX_COMPILER:PATH=${TRILINOS_CXX_COMPILER}
-D CMAKE_CXX_FLAGS:STRING=${TRILINOS_CXX_FLAGS}
-D CMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
-D CMAKE_Fortran_COMPILER:PATH=${TRILINOS_Fortran_COMPILER}
-D CMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}
-D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-D CMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-D TPL_ENABLE_MPI:BOOL=${ENABLE_MPI}
-D BUILD_SHARED_LIBS:BOOL=ON
-D CMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}
-D Trilinos_ENABLE_OpenMP:BOOL=${ENABLE_OPENMP}
-D Trilinos_ENABLE_Fortran:BOOL=ON
-D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=""
-D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}
-D Trilinos_ENABLE_TESTS:BOOL=OFF
-D Trilinos_ENABLE_Gtest:BOOL=OFF
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF
-D Trilinos_ENABLE_Epetra:BOOL=ON
-D Trilinos_ENABLE_EpetraExt:BOOL=ON
-D Trilinos_ENABLE_Tpetra:BOOL=ON
-D Trilinos_ENABLE_Kokkos:BOOL=ON
-D Trilinos_ENABLE_Stratimikos:BOOL=ON
-D Trilinos_ENABLE_Amesos:BOOL=ON
-D Trilinos_ENABLE_AztecOO:BOOL=ON
-D Trilinos_ENABLE_Ifpack:BOOL=ON
-D Trilinos_ENABLE_Teuchos:BOOL=ON
-D Trilinos_ENABLE_ML:BOOL=ON
-D Trilinos_ENABLE_Thyra:BOOL=ON
-D Trilinos_ENABLE_STK:BOOL=OFF
-D Trilinos_ENABLE_TrilinosCouplings:BOOL=ON
-D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON
${TRILINOS_EXTRA_ARGS}
)

list(APPEND build_list trilinos )
endif()


################################
# PARMETIS
# (also METIS is built; note that the idx_t data type is defined to be
Expand Down Expand Up @@ -731,6 +636,108 @@ if( ENABLE_MPI )
list(APPEND build_list superlu_dist )
endif()

################################
# TRILINOS
################################
if (ENABLE_TRILINOS)
set(TRILINOS_DIR "${CMAKE_INSTALL_PREFIX}/trilinos")
set(TRILINOS_URL "${TPL_MIRROR_DIR}/Trilinos-trilinos-release-13-4-1.tar.gz")

message(STATUS "Building TRILINOS found at ${TRILINOS_URL}")

set(TRILINOS_C_FLAGS "-fPIC ${C_FLAGS_NO_WARNINGS}")
set(TRILINOS_CXX_FLAGS "-fPIC ${CXX_FLAGS_NO_WARNINGS}")

if( ENABLE_MKL )
set( TRILINOS_EXTRA_ARGS ${TRILINOS_EXTRA_ARGS}
-D TPL_ENABLE_MKL:BOOL=ON
-D TPL_MKL_INCLUDE_DIRS:PATH=${MKL_INCLUDE_DIRS}
-D TPL_MKL_LIBRARIES:STRING=${MKL_LIBRARIES})
endif()

if ( ENABLE_ESSL )
set( TRILINOS_EXTRA_ARGS ${TRILINOS_EXTRA_ARGS}
-D HAVE_dggsvd3:BOOL=ON)
endif()

if ( DEFINED OpenMP_Fortran_FLAGS )
set( TRILINOS_EXTRA_ARGS ${TRILINOS_EXTRA_ARGS}
-D OpenMP_Fortran_FLAGS:STRING=${OpenMP_Fortran_FLAGS})
endif()

if ( DEFINED OpenMP_Fortran_LIB_NAMES )
set( TRILINOS_EXTRA_ARGS ${TRILINOS_EXTRA_ARGS}
-D OpenMP_Fortran_LIB_NAMES:STRING=${OpenMP_Fortran_LIB_NAMES})
endif()

if( ${ENABLE_MPI} )
set( TRILINOS_C_COMPILER ${MPI_C_COMPILER} )
set( TRILINOS_CXX_COMPILER ${MPI_CXX_COMPILER} )
set( TRILINOS_Fortran_COMPILER ${MPI_Fortran_COMPILER} )
else()
set( TRILINOS_C_COMPILER ${CMAKE_C_COMPILER} )
set( TRILINOS_CXX_COMPILER ${CMAKE_CXX_COMPILER} )
set( TRILINOS_Fortran_COMPILER ${CMAKE_Fortran_COMPILER} )
endif()

ExternalProject_Add( trilinos
PREFIX ${PROJECT_BINARY_DIR}/trilinos
URL ${TRILINOS_URL}
INSTALL_DIR ${TRILINOS_DIR}
BUILD_COMMAND ${TPL_BUILD_COMMAND}
INSTALL_COMMAND ${TPL_INSTALL_COMMAND}
DEPENDS parmetis metis
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change 1

CMAKE_GENERATOR ${TPL_GENERATOR}
CMAKE_CACHE_ARGS -DTPL_BLAS_LIBRARIES:STRING=${BLAS_LIBRARIES}
-DTPL_LAPACK_LIBRARIES:STRING=${LAPACK_LIBRARIES}
-DTPL_METIS_INCLUDE_DIRS:PATH=${METIS_DIR}/include
-DTPL_METIS_LIBRARIES:PATH=${METIS_DIR}/lib/libmetis.a
-DTPL_ParMETIS_INCLUDE_DIRS:PATH=${PARMETIS_DIR}/include
-DTPL_ParMETIS_LIBRARIES:PATH=${PARMETIS_DIR}/lib/libparmetis.a;${METIS_DIR}/lib/libmetis.a
Comment on lines +693 to +696
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change 2

CMAKE_ARGS -D CMAKE_C_COMPILER:PATH=${TRILINOS_C_COMPILER}
-D CMAKE_C_FLAGS:STRING=${TRILINOS_C_FLAGS}
-D CMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
-D CMAKE_CXX_COMPILER:PATH=${TRILINOS_CXX_COMPILER}
-D CMAKE_CXX_FLAGS:STRING=${TRILINOS_CXX_FLAGS}
-D CMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
-D CMAKE_Fortran_COMPILER:PATH=${TRILINOS_Fortran_COMPILER}
-D CMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}
-D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-D CMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-D TPL_ENABLE_MPI:BOOL=${ENABLE_MPI}
-D TPL_ENABLE_METIS:BOOL=ON
-D TPL_ENABLE_ParMETIS:BOOL=ON
Comment on lines +708 to +709
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change 3

-D BUILD_SHARED_LIBS:BOOL=ON
-D CMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}
-D Trilinos_ENABLE_OpenMP:BOOL=${ENABLE_OPENMP}
-D Trilinos_ENABLE_Fortran:BOOL=ON
-D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=""
-D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}
-D Trilinos_ENABLE_TESTS:BOOL=OFF
-D Trilinos_ENABLE_Gtest:BOOL=OFF
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF
-D Trilinos_ENABLE_Epetra:BOOL=ON
-D Trilinos_ENABLE_EpetraExt:BOOL=ON
-D Trilinos_ENABLE_Tpetra:BOOL=ON
-D Trilinos_ENABLE_Kokkos:BOOL=ON
-D Trilinos_ENABLE_Stratimikos:BOOL=ON
-D Trilinos_ENABLE_Amesos:BOOL=ON
-D Trilinos_ENABLE_AztecOO:BOOL=ON
-D Trilinos_ENABLE_Ifpack:BOOL=ON
-D Trilinos_ENABLE_Teuchos:BOOL=ON
-D Trilinos_ENABLE_ML:BOOL=ON
-D Trilinos_ENABLE_Thyra:BOOL=ON
-D Trilinos_ENABLE_STK:BOOL=OFF
-D Trilinos_ENABLE_TrilinosCouplings:BOOL=ON
-D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON
${TRILINOS_EXTRA_ARGS}
)

list(APPEND build_list trilinos )
endif()


################################
# HYPRE
################################
Expand Down