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

Merge branch 'develop' into euler

parents f1e6c835 7db5e8a0
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ option(WITH_GMP "Build with GMP support" OFF)
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_TOOLS "Compile the 'src/Tools' directory" ON)
option(WITH_PYTHON "Compile the Python bindings" ON)
option(WITH_TEMPLATES_INSTANTIATION "Enable explicit template instantiation" OFF)

# install paths relative to the cmake's prefix
@@ -111,7 +113,6 @@ if( ${CXX_COMPILER_NAME} STREQUAL "mpic++" )
   message( "MPI compiler detected."    )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_MPI" )
   set( CUDA_HOST_COMPILER "mpic++" )

endif()

####
@@ -148,6 +149,22 @@ if( ${WITH_CUDA} )
               set( CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} )
            endif()
        endif()
        # An extra CUDA_ARCH_HOST_COMPILER variable for compiling tnl-cuda-arch alone,
        # because it SHOULD NOT be compiled using mpic++, which would cause weird
        # RPATH_CHANGE error in cmake.
        # FIXME: find better solution to switch between MPI-enabled and MPI-disabled binaries in cmake
        if( NOT $ENV{CUDA_ARCH_HOST_COMPILER} STREQUAL "" )
           message( "-- Setting CUDA_ARCH_HOST_COMPILER to '$ENV{CUDA_ARCH_HOST_COMPILER}'" )
           set( CUDA_ARCH_HOST_COMPILER $ENV{CUDA_ARCH_HOST_COMPILER} )
        else()
            if( EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/bin/g++" )
               message( "-- Setting CUDA_ARCH_HOST_COMPILER to '${CUDA_TOOLKIT_ROOT_DIR}/bin/g++'" )
               set( CUDA_ARCH_HOST_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/g++" )
            else()
               message( "-- Setting CUDA_ARCH_HOST_COMPILER to '${CMAKE_CXX_COMPILER}'" )
               set( CUDA_ARCH_HOST_COMPILER ${CMAKE_CXX_COMPILER} )
            endif()
        endif()
        set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ;-DHAVE_CUDA)
        # disable false compiler warnings
        #   reference for the -Xcudafe flag: http://stackoverflow.com/questions/14831051/how-to-disable-compiler-warnings-with-nvcc/17095910#17095910
@@ -171,7 +188,7 @@ if( ${WITH_CUDA} )
                set( CUDA_ARCH_SOURCE ${PROJECT_SOURCE_DIR}/src/Tools/tnl-cuda-arch.cu)
                message( "Compiling tnl-cuda-arch ..." )
                file( MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} )
                execute_process( COMMAND nvcc --compiler-bindir ${CUDA_HOST_COMPILER} --std=c++11 ${CUDA_ARCH_SOURCE} -o ${CUDA_ARCH_EXECUTABLE}
                execute_process( COMMAND nvcc --compiler-bindir ${CUDA_ARCH_HOST_COMPILER} --std=c++11 ${CUDA_ARCH_SOURCE} -o ${CUDA_ARCH_EXECUTABLE}
                                 RESULT_VARIABLE CUDA_ARCH_RESULT
                                 OUTPUT_VARIABLE CUDA_ARCH_OUTPUT
                                 ERROR_VARIABLE CUDA_ARCH_OUTPUT )
@@ -437,6 +454,8 @@ message( " WITH_GMP=${WITH_GMP}" )
message( "   WITH_TESTS=${WITH_TESTS}" )
message( "   WITH_COVERAGE=${WITH_COVERAGE}" )
message( "   WITH_EXAMPLES=${WITH_EXAMPLES}" )
message( "   WITH_TOOLS=${WITH_TOOLS}" )
message( "   WITH_PYTHON=${WITH_PYTHON}" )
message( "   WITH_TEMPLATES_INSTANTIATION=${WITH_TEMPLATES_INSTANTIATION}" )
# Print compiler options
message( "-- Compiler options:" )
+3 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ WITH_GMP="no"
WITH_TESTS="yes"
WITH_COVERAGE="no"
WITH_EXAMPLES="yes"
WITH_PYTHON="yes"
WITH_TOOLS="yes"

WITH_TEMPLATE_INSTANTIATION="no"
@@ -94,8 +95,8 @@ then
    echo "   --with-tests=yes/no                   Enables unit tests. 'yes' by default."
    echo "   --with-coverage=yes/no                Enables code coverage reports for unit tests. 'no' by default (lcov is required)."
    echo "   --with-examples=yes/no                Compile the 'examples' directory. 'yes' by default."
    echo "   --with-tools=yes/no                   Compile the 'tools' directory. 'yes' by default."
    echo "   --with-python=yes/no                  Compile with the python bindings. 'yes' by default."
    echo "   --with-tools=yes/no                   Compile the 'src/Tools' directory. 'yes' by default."
    echo "   --with-python=yes/no                  Compile the Python bindings. 'yes' by default."
    echo "   --with-templates-instantiation=yes/no Precompiles some TNL templates during the build. 'no' by default."
    echo "   --cmake=CMAKE                         Path to cmake. 'cmake' by default."
    echo "   --verbose                             It enables verbose build."
+4 −4
Original line number Diff line number Diff line
@@ -4,10 +4,10 @@ endif( WITH_PYTHON STREQUAL "yes" )

ADD_SUBDIRECTORY( TNL )

if( WITH_TOOLS STREQUAL "yes" )
if( ${WITH_TOOLS} )
   ADD_SUBDIRECTORY( Tools )
endif( WITH_TOOLS STREQUAL "yes" )
endif()

if( WITH_TESTS STREQUAL "yes" )
if( ${WITH_TESTS} )
   ADD_SUBDIRECTORY( UnitTests )
endif( WITH_TESTS STREQUAL "yes" )
endif()
+3 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@

namespace TNL {
namespace Communicators {
namespace {

class MpiCommunicator
{
@@ -526,6 +527,7 @@ template<> class MPITypeResolver<long double>
};
#endif

} // namespace <unnamed>
} // namespace Communicators
} // namespace TNL

+7 −2
Original line number Diff line number Diff line
@@ -10,8 +10,13 @@ set( tnl_hamilton_jacobi_SOURCES
#ADD_EXECUTABLE(tnl-hamilton-jacobi main.cpp)
#target_link_libraries (tnl-hamilton-jacobi tnl )

IF( BUILD_CUDA )
    CUDA_ADD_EXECUTABLE(tnl-direct-eikonal-solver tnl-direct-eikonal-solver.cu )
    target_link_libraries (tnl-direct-eikonal-solver tnl )
ELSE(  BUILD_CUDA )               
    ADD_EXECUTABLE(tnl-direct-eikonal-solver tnl-direct-eikonal-solver.cpp )
    target_link_libraries (tnl-direct-eikonal-solver tnl )
ENDIF( BUILD_CUDA )


INSTALL( TARGETS #tnl-hamilton-jacobi 
Loading