<commit_before>### CMakeLists.txt ---
## 
## Author: <NAME> 
## Copyright (C) 2016 - RICAM-Linz.
######################################################################

cmake_minimum_required(VERSION 2.8.10.2)

if(POLICY CMP0048)# CMake 3.0
cmake_policy(SET CMP0011 OLD)
cmake_policy(SET CMP0042 OLD)
cmake_policy(SET CMP0048 OLD)
endif()

if(POLICY CMP0054)# CMake 3.1
cmake_policy(SET CMP0054 OLD)
endif()

if(POLICY CMP0053)# CMake 3.1.3
cmake_policy(SET CMP0053 OLD)
endif()

if(POLICY CMP0063)# CMake 3.3
cmake_policy(SET CMP0063 NEW)
endif()

## Trilinos extension
project(gsTrilinosExtension)

# Collect file names
aux_header_directory(${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_NAME}_HEADERS)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_NAME}_SOURCES)
aux_tmpl_header_directory(${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_NAME}_HPPFILES)

# Apply same configuration as G+Smo
include( gsConfig)

# Look for MPI (now: handled by GISMO_WITH_MPI)
#find_package(MPI REQUIRED)
#include_directories(SYSTEM ${MPI_INCLUDE_PATH})

# Look for trilinos library
#find_package(TRILINOS REQUIRED) # for testing user-provided mode
find_package(TRILINOS QUIET)
#find_package(BLAS REQUIRED)   # needs .._DIR on MS windows
#find_package(LAPACK REQUIRED) # needs LAPACK_DIR on MS windows

if (NOT GISMO_BUILD_CPP11)
message(WARNING "GISMO_BUILD_CPP11 must be ON for Trilinos extensions to compile ?.")
endif()

# Note: might need export FC=/usr/bin/gfortran
#enable_language(Fortran)

if (NOT TRILINOS_FOUND)
set(TRILINOS_VER "12-8-1")
set(TRILINOS_MD5 "01c0026f1e2050842857db941060ecd5")
message(STATUS "CMake Will attempt to download and compile Trilinos ${TRILINOS_VER}.")
include(ExternalProject)
ExternalProject_Add(Trilinos
          SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/Trilinos
          URL_MD5 ${TRILINOS_MD5}
          URL https://github.com/trilinos/Trilinos/archive/trilinos-release-${TRILINOS_VER}.tar.gz
          CMAKE_ARGS   -DCMAKE_BUILD_TYPE=Release   
                       -DTrilinos_ENABLE_TESTS=OFF  
                       -DTrilinos_ENABLE_Epetra=ON
                       -DTrilinos_ENABLE_Amesos=ON
                       -DTrilinos_ENABLE_AztecOO=ON
                       -DTrilinos_ENABLE_Anasazi=ON  
                       -DTrilinos_ENABLE_Belos=${GISMO_BUILD_CPP11}
                       -DTrilinos_ENABLE_NOX=ON
                       #-DTPL_ENABLE_Pthread=OFF # Note: MS Win might not have Pthread
		       #-DTrilinos_ENABLE_ML=ON # multigrid
                       -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
                       -DBUILD_SHARED_LIBS:BOOL=ON
                       -DTPL_ENABLE_MPI=${GISMO_WITH_MPI}
                       -DTrilinos_ENABLE_CXX11=${GISMO_BUILD_CPP11} # Note: this must be ON, otherwise Trilinos compilation fails. Must be OFF on MS Windows
		       -DTPL_ENABLE_SuperLU=${GISMO_WITH_SUPERLU}
	 	       ## Point to specific paths (! no space after "=")
		       -DTPL_LAPACK_LIBRARIES=${LAPACK_LIBRARIES}
      		       -DTPL_BLAS_LIBRARIES=${LAPACK_LIBRARIES}
		       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
		       -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
		       #-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
          UPDATE_COMMAND ""
	  #DOWNLOAD_NO_PROGRESS 0
)
      set(TRILINOS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/Trilinos-prefix/include CACHE INTERNAL "")
      set(TRILINOS_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/Trilinos-prefix/lib/${CMAKE_SHARED_LIBRARY_PREFIX}epetra${CMAKE_SHARED_LIBRARY_SUFFIX};
      ${CMAKE_CURRENT_BINARY_DIR}/Trilinos-prefix/lib/${CMAKE_SHARED_LIBRARY_PREFIX}teuchoscore${CMAKE_SHARED_LIBRARY_SUFFIX};<commit_msg>trilinos fix<commit_after>### CMakeLists.txt ---
## 
## Author: <NAME> 
## Copyright (C) 2016 - RICAM-Linz.
######################################################################

cmake_minimum_required(VERSION 2.8.10.2)

if(POLICY CMP0048)# CMake 3.0
cmake_policy(SET CMP0011 OLD)
cmake_policy(SET CMP0042 OLD)
cmake_policy(SET CMP0048 OLD)
endif()

if(POLICY CMP0054)# CMake 3.1
cmake_policy(SET CMP0054 OLD)
endif()

if(POLICY CMP0053)# CMake 3.1.3
cmake_policy(SET CMP0053 OLD)
endif()

if(POLICY CMP0063)# CMake 3.3
cmake_policy(SET CMP0063 NEW)
endif()

## Trilinos extension
project(gsTrilinosExtension)

# Collect file names
aux_header_directory(${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_NAME}_HEADERS)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_NAME}_SOURCES)
aux_tmpl_header_directory(${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_NAME}_HPPFILES)

# Apply same configuration as G+Smo
include( gsConfig)

# Look for MPI (now: handled by GISMO_WITH_MPI)
#find_package(MPI REQUIRED)
#include_directories(SYSTEM ${MPI_INCLUDE_PATH})

# Look for trilinos library
#find_package(TRILINOS REQUIRED) # for testing user-provided mode
find_package(TRILINOS QUIET)
#find_package(BLAS REQUIRED)   # needs .._DIR on MS windows
#find_package(LAPACK REQUIRED) # needs LAPACK_DIR on MS windows

#
find_path(TPL_MPI_INCLUDE_DIRS mpi.h ${MPI_INCLUDE_PATH})
list(GET MPI_CXX_LIBRARIES 0 TPL_MPI_LIBRARY_DIRS)
get_filename_component(TPL_MPI_LIBRARY_DIRS ${TPL_MPI_LIBRARY_DIRS} DIRECTORY)
get_filename_component(TPL_MPI_BASE_DIR ${TPL_MPI_LIBRARY_DIRS} DIRECTORY)

if (NOT GISMO_BUILD_CPP11)
message(WARNING "GISMO_BUILD_CPP11 must be ON for Trilinos extensions to compile ?.")
endif()

# Note: might need export FC=/usr/bin/gfortran
#enable_language(Fortran)

if (NOT TRILINOS_FOUND)
set(TRILINOS_VER "12-8-1")
set(TRILINOS_MD5 "01c0026f1e2050842857db941060ecd5")
message(STATUS "CMake Will attempt to download and compile Trilinos ${TRILINOS_VER}.")
include(ExternalProject)
ExternalProject_Add(Trilinos
          SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/Trilinos
          URL_MD5 ${TRILINOS_MD5}
          URL https://github.com/trilinos/Trilinos/archive/trilinos-release-${TRILINOS_VER}.tar.gz
          CMAKE_ARGS   -DCMAKE_BUILD_TYPE=Release   
                       -DTrilinos_ENABLE_TESTS=OFF  
                       -DTrilinos_ENABLE_Epetra=ON
                       -DTrilinos_ENABLE_Amesos=ON
                       -DTrilinos_ENABLE_AztecOO=ON
                       -DTrilinos_ENABLE_Anasazi=ON  
                       -DTrilinos_ENABLE_Belos=${GISMO_BUILD_CPP11}
                       -DTrilinos_ENABLE_NOX=OFF
                       #-DTrilinos_ENABLE_ML=ON # multigrid
                       #-DTPL_ENABLE_Pthread=OFF # Note: MS Win might not have Pthread
                       -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
                       -DBUILD_SHARED_LIBS:BOOL=ON
                       -DTPL_ENABLE_MPI=${GISMO_WITH_MPI}
                       -DTPL_MPI_INCLUDE_DIRS=${TPL_MPI_INCLUDE_DIRS}
                       -DTPL_MPI_LIBRARY_DIRS=${TPL_MPI_LIBRARY_DIRS}
                       #-DMPI_BASE_DIR=${TPL_MPI_BASE_DIR}
                       #-DTPL_MPI_LIBRARIES=${MPI_CXX_LIBRARIES} # bug ? 2 elements
                       -DTrilinos_ENABLE_CXX11=${GISMO_BUILD_CPP11} # Note: this must be ON, otherwise Trilinos compilation fails. Must be OFF on MS Windows
		       -DTPL_ENABLE_SuperLU=${GISMO_WITH_SUPERLU}
	 	       ## Point to specific paths (! no space after "=")
		       -DTPL_LAPACK_LIBRARIES=${LAPACK_LIBRARIES}
      		       -DTPL_BLAS_LIBRARIES=${LAPACK_LIBRARIES}
		       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
		       -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
		       #-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
          UPDATE_COMMAND ""
	  #DOWNLOAD_NO_PROGRESS 0
)
      set(TRILINOS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/Trilinos-prefix/include CACHE INTERNAL "")
      set(TRILINOS_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/Trilinos-prefix/lib/${CMAKE_SHARED_LIBRARY_PREFIX}epetra${CMAKE_SHARED_LIBRARY_SUFFIX};
      ${CMAKE_CURRENT_BINARY_DIR}/Trilinos-prefix/lib/${CMAKE_SHARED_LIBRARY_PREFIX}teuchoscore${CMAKE_SHARED_LIBRARY_SUFFIX};
{'fraction_non_alphanumeric': 0.10661717650070396, 'fraction_numerical': 0.025854345321899397, 'mean_word_length': 3.7443837279902854, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1064266', 'n_tokens_mistral': 3143, 'n_tokens_neox': 2823, 'n_words': 440}