Commit c4a95305 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Merge branch 'develop' into mpi

parents acf5333f 3230ca63
Loading
Loading
Loading
Loading
+67 −16
Original line number Diff line number Diff line
@@ -18,6 +18,17 @@ project( tnl )

set( tnlVersion "0.1" )

# declare all custom build options
option(OFFLINE_BUILD "Offline build (i.e. without downloading libraries such as pybind11)" OFF)
option(WITH_MIC "Build with MIC support" OFF)
option(WITH_CUDA "Build with CUDA support" ON)
set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures")
option(WITH_OPENMP "Build with OpenMP support" ON)
option(WITH_TESTS "Build tests" ON)
option(WITH_COVERAGE "Enable code coverage reports from unit tests" OFF)
option(WITH_EXAMPLES "Compile the 'examples' directory" ON)
option(WITH_TEMPLATES_INSTANTIATION "Enable explicit template instantiation" OFF)

# install paths relative to the cmake's prefix
set( TNL_TARGET_INCLUDE_DIRECTORY "include/TNL" )
set( TNL_TARGET_DATA_DIRECTORY "share/TNL" )
@@ -65,12 +76,12 @@ if( CXX_COMPILER_NAME MATCHES "icpc" )
   #####
   #  Check for MIC 
   #
   if( WITH_MIC STREQUAL "yes" )
       message( "Compile MIC support..."    )
   if( ${WITH_MIC} )
      message( "Enabled MIC support." )
      set( MIC_CXX_FLAGS "-DHAVE_MIC")
      # build all tests with MIC support
      set( CXX_TESTS_FLAGS ${CXX_TESTS_FLAGS} -DHAVE_MIC )
       set( WITH_CUDA "no")
      set( WITH_CUDA OFF CACHE BOOL "Build with CUDA support" )
   else()
      set( MIC_CXX_FLAGS "")
   endif()
@@ -221,8 +232,8 @@ endif( WITH_CUDA STREQUAL "yes" )
####
# Check for OpenMP
#
if( OPENMP_FOUND AND WITH_OPENMP STREQUAL "yes" )
   message( "Compiler supports OpenMP." )
if( OPENMP_FOUND AND ${WITH_OPENMP} )
   message( "Enabled OpenMP support." )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_OPENMP ${OpenMP_CXX_FLAGS}" )
endif()

@@ -257,6 +268,34 @@ else()
   set( JPEG_LIBRARIES "" )
endif()

####
# Test for GMP 
#
if (GMP_INCLUDES AND GMP_LIBRARIES)
   set(GMP_FIND_QUIETLY TRUE)
endif (GMP_INCLUDES AND GMP_LIBRARIES)

find_path(GMP_INCLUDES
   NAMES
   gmp.h
   PATHS
   $ENV{GMPDIR}
   ${INCLUDE_INSTALL_DIR}
)

find_library(GMP_LIBRARIES gmp PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GMP DEFAULT_MSG
                                   GMP_INCLUDES GMP_LIBRARIES)
if( ${GMP_INCLUDES} STREQUAL "GMP_INCLUDES-NOTFOUND" OR ${GMP_LIBRARIES} STREQUAL "GMP_LIBRARIES-NOTFOUND" )
   message( "GMP was not found. Some tests for higher precision arithmetics will not be passed." )
else()
   set( HAVE_GMP )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${GMP_INCLUDES} -DHAVE_GMP" )
   set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GMP_LIBRARIES}" )
   mark_as_advanced(GMP_INCLUDES GMP_LIBRARIES)
endif()

####
# Check for some system header
@@ -297,17 +336,17 @@ else()
    set( HAVE_SYS_IOCTL_H "#define HAVE_SYS_IOCTL_H 1" )
endif()

if( WITH_TESTS STREQUAL "yes" )
if( ${WITH_TESTS} )
   enable_testing()

   # build gtest libs
   include( BuildGtest )

   if( WITH_COVERAGE STREQUAL "yes" AND CMAKE_BUILD_TYPE STREQUAL "Debug" )
   if( ${WITH_COVERAGE} AND CMAKE_BUILD_TYPE STREQUAL "Debug" )
      # enable code coverage reports
      include( UseCodeCoverage )
   endif()
endif( WITH_TESTS STREQUAL "yes" )
endif()

#if( BUILD_MPI )
#   FIND_PATH( PETSC_INCLUDE_DIR petsc.h
@@ -337,7 +376,7 @@ endif( WITH_TESTS STREQUAL "yes" )
####
# Explicit template instantiation
#
#if( WITH_TEMPLATE_INSTANTIATION STREQUAL "yes" )
#if( ${WITH_TEMPLATE_INSTANTIATION} )
#   AddCompilerFlag( "-DTEMPLATE_EXPLICIT_INSTANTIATION " )
#
#   if( INSTANTIATE_INT STREQUAL "yes" )
@@ -378,7 +417,7 @@ add_subdirectory( src )
add_subdirectory( share )
add_subdirectory( tests )

if( WITH_EXAMPLES STREQUAL "yes" )
if( ${WITH_EXAMPLES} )
   add_subdirectory( examples )
endif()

@@ -410,6 +449,17 @@ set(CPACK_SOURCE_STRIP_FILES "Release")
#set(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable")
INCLUDE( CPack )

# Print custom build options
message( "-- Build options:" )
message( "   OFFLINE_BUILD=${OFFLINE_BUILD}" )
message( "   WITH_MIC=${WITH_MIC}" )
message( "   WITH_CUDA=${WITH_CUDA}" )
message( "   WITH_CUDA_ARCH=${WITH_CUDA_ARCH}" )
message( "   WITH_OPENMP=${WITH_OPENMP}" )
message( "   WITH_TESTS=${WITH_TESTS}" )
message( "   WITH_COVERAGE=${WITH_COVERAGE}" )
message( "   WITH_EXAMPLES=${WITH_EXAMPLES}" )
message( "   WITH_TEMPLATES_INSTANTIATION=${WITH_TEMPLATES_INSTANTIATION}" )
# Print compiler options
message( "-- Compiler options:" )
message( "   CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}" )
@@ -419,3 +469,4 @@ message( " CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = ${CMAKE_SHARED_LIBRARY_LINK_C_F
message( "   CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_DEBUG = ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_DEBUG}" )
message( "   CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_RELEASE = ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_RELEASE}" )
message( "   CUDA_NVCC_FLAGS = ${CUDA_NVCC_FLAGS}" )
message( "   GMP_LIBRARIES = ${GMP_LIBRARIES}" )

Config.py.in

deleted100644 → 0
+0 −2
Original line number Diff line number Diff line
tnl_install_prefix = "@CMAKE_INSTALL_PREFIX@"
tnl_version = "@tnlVersion@"
+0 −15
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ TODO:

TODO:
- pridat execution policy https://github.com/harrism/hemi/blob/master/hemi/execution_policy.h
- odstranit parametr lazy ze smart pointeru

TODO:
 - implementovat tnlMixedGridBoundaryConditions, kde by se pro kazdou stranu gridu definoval jiny zvlastni typ
@@ -32,13 +31,6 @@ TODO: CUDA unified memory
se s nimi pracovat postaru
 - bylo by dobre to obalit unique poinetry, aby se nemusela delat dealokace rucne

TODO: Mesh
 * vsechny traits zkusit presunout do jednotneho MeshTraits, tj. temer MeshConfigTraits ale pojmenovat jako MeshTraits
 * omezit tnlDimesnionsTag - asi to ale nepujde
   - ale pozor na konstrukce jako BaseType::superentityIdsArray< SuperDimensionTag >( DimensionsTag ); ( v tnlMesh.h)
 * prejmenovat Tagy v topologies na Topology zrejme
 * zrusit tnlStorageTraits


TODO: implementace maticovych resicu
      * Gaussova eliminace
@@ -53,12 +45,5 @@ TODO: Nahradit sablonovy parametr dimenze sitove entity za typ entity. Pak by se
      objemy nebo delky entyt apod.
      za tim ucelem nahradit setIndex v grdi entity za update(), aby to bylo obecnejsi

TODO: implementovat tridu tnlFileName pro generovani jmen souboru

TODO: metodu pro tnlString pro nahrazeni napr. podretezce XXXXX indexem 00001 tj. uXXXXX.bin -> u00001.bin
      to by melo byt robustnejsi, nez doposavadni pristup 

TODO: vyjimky 

TODO: prubezne ukladani vysledku behem vypoctu 
                 
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ CMAKE="cmake"
CMAKE_ONLY="no"
HELP="no"
VERBOSE=""
OFFLINE_BUILD="no"

WITH_CLANG="no"
WITH_CUDA="yes"
@@ -40,6 +41,7 @@ do
        --cmake=*                        ) CMAKE="${option#*=}" ;;
        --cmake-only=*                   ) CMAKE_ONLY="${option#*=}" ;;
        --verbose                        ) VERBOSE="VERBOSE=1" ;;
        --offline-build                  ) OFFLINE_BUILD="yes" ;;
        --help                           ) HELP="yes" ;;
        --with-clang=*                   ) WITH_CLANG="${option#*=}" ;;
        --with-mic=*                     ) WITH_MIC="${option#*=}" ;;
@@ -104,6 +106,7 @@ echo "Configuring ${BUILD} $TARGET ..."
${CMAKE} ${ROOT_DIR} \
         -DCMAKE_BUILD_TYPE=${BUILD} \
         -DCMAKE_INSTALL_PREFIX=${PREFIX} \
         -DOFFLINE_BUILD=${OFFLINE_BUILD} \
         -DWITH_MIC=${WITH_MIC} \
         -DWITH_CUDA=${WITH_CUDA} \
         -DWITH_CUDA_ARCH=${WITH_CUDA_ARCH} \
+3 −0
Original line number Diff line number Diff line
@@ -19,4 +19,7 @@ ExternalProject_Add(googletest
  BUILD_COMMAND     ""
  INSTALL_COMMAND   ""
  TEST_COMMAND      ""
  # Disable update of the external project in an offline build
  # reference: https://stackoverflow.com/a/40423683
  UPDATE_DISCONNECTED ${OFFLINE_BUILD}
)
Loading