Commit b09a2585 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Merge remote-tracking branch 'origin/master' into mhfem

* origin/master:
  Fixing build script.
  Adding OpenMP to vector operations.
  Fixing a bug in host and device arrays comparison.
  Fixing the DICOM reader.
  Fixing DCMTK code to work when DICOM support is not enabled.
  Fixing #1 - tnl-dicom-reader, tnl-image-converter
  Implementing the DICOM reader.
  Implementing the DICOM reader.
  Refactoring code for the DICOM format support.
  Addign DICOM support - TNL can be succesfully build now.
  JPEG format is working.
  Implementing JPEG image write.
  Implementing JPEG image.
  Adding JPEG format support.
  Adding PNG format support.
  Adding conversion from .tnl file to image.
  Implementing image converter.
  Implementing image converter.
  Implementing the image converter.
  Adding image converter.
parents 27622109 e8e4ae6e
Loading
Loading
Loading
Loading
+43 −11
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ if( WITH_CUDA STREQUAL "yes" )
        if( WITH_CUBLAS STREQUAL "yes" ) 
            message( "Enabling CUBLAS." )
            set( HAVE_CUBLAS TRUE)
            set( HAVE_CUBLAS "#define HAVE_CUBLAS" )
            set( HAVE_CUBLAS "#define HAVE_CUBLAS 1" )
        endif( WITH_CUBLAS STREQUAL "yes" )       

        ####
@@ -116,10 +116,10 @@ if( WITH_CUDA STREQUAL "yes" )
                   DOC "CUSP headers." )
        if( ${CUSP_INCLUDE_DIR} STREQUAL "CUSP_INCLUDE_DIR-NOTFOUND" )
            message( "CUSP not found." )
            set( HAVE_CUSP "//#define HAVE_CUSP" )
            set( HAVE_CUSP "//#define HAVE_CUSP 1" )
        else()      
            message( "CUSP found. -- ${CUSP_INCLUDE_DIR}" )
            set( HAVE_CUSP "#define HAVE_CUSP" )
            set( HAVE_CUSP "#define HAVE_CUSP 1" )
            cuda_include_directories( ${CUSP_INCLUDE_DIR} )
        endif()
        
@@ -134,10 +134,10 @@ if( WITH_CUDA STREQUAL "yes" )
                      DOC "CUSPARSE headers." )
           if( ${CUSPARSE_INCLUDE_DIR} STREQUAL "CUSPARSE_INCLUDE_DIR-NOTFOUND" )
               message( "CUSPARSE not found." )
               set( HAVE_CUSPARSE "//#define HAVE_CUSPARSE" )
               set( HAVE_CUSPARSE "//#define HAVE_CUSPARSE 1" )
           else()      
               message( "CUSPARSE found. -- ${CUSPARSE_INCLUDE_DIR}" )
               set( HAVE_CUSPARSE "#define HAVE_CUSPARSE" )
               set( HAVE_CUSPARSE "#define HAVE_CUSPARSE 1" )
               cuda_include_directories( ${CUSPARSE_INCLUDE_DIR} )
               set( CUSPARSE_LIBRARY "${CUDA_cusparse_LIBRARY}" )
           endif()            
@@ -169,6 +169,38 @@ endif()
#    message( "MPI headers found -- ${MPI_CXX_INCLUDE_PATH}")
#endif()

find_package( DCMTK )
if( DCMTK_FOUND )
   set( HAVE_DCMTK_H "#define HAVE_DCMTK_H 1" )
   include_directories( ${DCMTK_INCLUDE_DIRS} )
   set( HAVE_DCMTK TRUE)
   set( DCMTK_LD_FLAGS "" )
   foreach( arg ${DCMTK_LIBRARIES} )
      set( DCMTK_LD_FLAGS "${DCMTK_LD_FLAGS} ${arg}" )
   endforeach( arg ${DCMTK_LIBRARIES} )
else()
   set( HAVE_DCMTK_H "//#define HAVE_DCMTK_H 1" )
endif()

find_package( PNG )
if( PNG_FOUND )      
   set( HAVE_PNG_H "#define HAVE_PNG_H 1" )
   include_directories( ${PNG_INCLUDE_DIRS} )
else()
   set( HAVE_PNG_H "//#define HAVE_PNG_H 1" )
   set( PNG_LIBRARIES "" )
endif()

find_package( JPEG )
if( JPEG_FOUND )      
   set( HAVE_JPEG_H "#define HAVE_JPEG_H 1" )
   include_directories( ${JPEG_INCLUDE_DIRS} )
else()
   set( HAVE_JPEG_H "//#define HAVE_JPEG_H 1" )
   set( JPEG_LIBRARIES "" )
endif()


####
# Check for some system header
#
@@ -178,10 +210,10 @@ find_path( SYS_TIME_INCLUDE_DIR sys/time.h
           DOC "System timer headers." )
if( ${SYS_TIME_INCLUDE_DIR} STREQUAL "SYS_TIME_INCLUDE_DIR-NOTFOUND" )
    message(  "Missing header file sys/time.h" )
    set( HAVE_SYS_TIME_H "//#define HAVE_SYS_TIME_H" )
    set( HAVE_SYS_TIME_H "//#define HAVE_SYS_TIME_H 1" )
else()
    include_directories( ${SYS_TIME_INCLUDE_DIR}/tnl-${tnlVersion} )
    set( HAVE_SYS_TIME_H "#define HAVE_SYS_TIME_H" )
    set( HAVE_SYS_TIME_H "#define HAVE_SYS_TIME_H 1" )
endif()

find_path( SYS_RESOURCE_INCLUDE_DIR sys/resource.h
@@ -190,10 +222,10 @@ find_path( SYS_RESOURCE_INCLUDE_DIR sys/resource.h
           DOC "System resources headers." )
if( ${SYS_RESOURCE_INCLUDE_DIR} STREQUAL "SYS_RESOURCE_INCLUDE_DIR-NOTFOUND" )
    message( "Missing header file sys/time.h" )
    set( HAVE_SYS_RESOURCE_H "//#define HAVE_SYS_RESOURCE_H" )
    set( HAVE_SYS_RESOURCE_H "//#define HAVE_SYS_RESOURCE_H 1" )
else()
    include_directories( ${SYS_RESOURCE_INCLUDE_DIR}/tnl-${tnlVersion} )
    set( HAVE_SYS_RESOURCE_H "#define HAVE_SYS_RESOURCE_H" )
    set( HAVE_SYS_RESOURCE_H "#define HAVE_SYS_RESOURCE_H 1" )
endif()

####
@@ -233,7 +265,7 @@ if( WITH_TESTS STREQUAL "yes" )

    if( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" )
          message( "CPPUNIT not found." )
          set( HAVE_CPPUNIT "//#define HAVE_CPPUNIT" )
          set( HAVE_CPPUNIT "//#define HAVE_CPPUNIT 1" )
    else( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" )
      message( "CPPUNIT headers found -- ${CPPUNIT_INCLUDE_DIR}" )
      if(CPPUNIT_LIBRARY)
@@ -242,7 +274,7 @@ if( WITH_TESTS STREQUAL "yes" )
        set(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
        set(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY}
                                    ${CMAKE_DL_LIBS})
       set( HAVE_CPPUNIT "#define HAVE_CPPUNIT" )
       set( HAVE_CPPUNIT "#define HAVE_CPPUNIT 1" )
      endif(CPPUNIT_LIBRARY)
    endif( ${CPPUNIT_INCLUDE_DIR} STREQUAL "CPPUNIT_INCLUDE_DIR-NOTFOUND" )
    ENABLE_TESTING()
+30 −26
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ CMAKE_ONLY="no"
HELP="no"
VERBOSE=""
ROOT_DIR="."
DCMTK_DIR="/usr/include/dcmtk"
BUILD_JOBS=`grep -c processor /proc/cpuinfo`

for option in "$@"
@@ -29,7 +30,7 @@ do
        --with-cuda=*                    ) WITH_CUDA="${option#*=}" ;;
        --with-cublas=*                  ) WITH_CUBLAS="${option#*=}" ;;
        --with-cuda-arch=*               ) WITH_CUDA_ARCH="${option#*=}";;
        --with-templates-instantiation ) WITH_TEMPLATE_INSTANTIATION="${option#*=}" ;;
        --with-templates-instantiation=* ) WITH_TEMPLATE_INSTANTIATION="${option#*=}" ;;
        --instantiate-long-int=*         ) INSTANTIATE_LONG_INT="${option#*=}" ;;
        --instantiate-int=*              ) INSTANTIATE_INT="${option#*=}" ;;
        --instantiate-long-double=*      ) INSTANTIATE_LONG_DOUBLE="${option#*=}" ;;
@@ -46,6 +47,7 @@ do
        --cmake-only=*                   ) CMAKE_ONLY="${option#*=}" ;;
        --verbose                        ) VERBOSE="VERBOSE=1" ;;
        --root-dir=*                     ) ROOT_DIR="${option#*=}" ;;
        --dcmtk-dir=*                    ) DCMTK_DIR="${option#*=}" ;;
        --help                           ) HELP="yes" ;;
        *                                ) 
           echo "Unknown option ${option}. Use --help for more information."
@@ -67,6 +69,7 @@ then
    echo "   --build-jobs=NUM                      Number of processes to be used for the build. It is set to a number of CPU cores by default."
    echo "   --verbose                             It enables verbose build."
    echo "   --root-dir=PATH                       Path to the TNL source code root dir."
    echo "   --dcmtk-dir=PATH                      Path to the DCMTK (Dicom Toolkit) root dir."
    echo "   --help                                Write this help."
    exit 1
fi
@@ -81,6 +84,7 @@ ${CMAKE} ${ROOT_DIR} \
         -DWITH_CUBLAS=${WITH_CUBLAS} \
         -DWITH_TESTS=${WITH_TESTS} \
         -DPETSC_DIR=${PETSC_DIR} \
         -DDCMTK_DIR=${DCMTK_DIR} \
         -DWITH_TEMPLATE_INSTANTIATION=${WITH_TEMPLATE_INSTANTIATION} \
         -DINSTANTIATE_FLOAT=${INSTANTIATE_FLOAT} \
         -DINSTANTIATE_DOUBLE=${INSTANTIATE_DOUBLE} \
+7 −2
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@ endif( BUILD_CUDA )
SET_TARGET_PROPERTIES( tnl${debugExt}-${tnlVersion} PROPERTIES 
                       SOVERSION 0 
                       VERSION ${tnlVersion} )
TARGET_LINK_LIBRARIES( tnl${debugExt}-${tnlVersion} 
                       ${DCMTK_LIBRARIES})


INSTALL( TARGETS tnl${debugExt}-${tnlVersion} DESTINATION lib )

@@ -65,10 +68,12 @@ IF( BUILD_MPI )
   SET_TARGET_PROPERTIES( tnl-mpi${debugExt}-${tnlVersion} PROPERTIES
                          SOVERSION 0 
                          VERSION ${tnlVersion} ) 
#   SET_TARGET_PROPERTIES( tnl-mpi${debugExt}-${tnlVersion} 
#                          LINK_INTERFACE_LIBRARIES "")

   
   TARGET_LINK_LIBRARIES( tnl-mpi${debugExt}-${tnlVersion} 
                          ${MPI_LIBRARIES} )
   
   INSTALL( TARGETS tnl-mpi${debugExt}-${tnlVersion} DESTINATION lib )
                                                                
ENDIF()
+5 −1
Original line number Diff line number Diff line
@@ -183,7 +183,11 @@ parseCommandLine( int argc, char* argv[],
         parse_error = true;
         continue;
      }
      
      if( strcmp( _option, "--help" ) == 0 )
      {
          config_description.printUsage( argv[ 0 ] );
          return true;
      }
      const char* option = _option + 2;
      const tnlConfigEntryBase* entry;
      if( ( entry = config_description.getEntry( option ) ) == NULL )
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ ADD_SUBDIRECTORY( arrays )
ADD_SUBDIRECTORY( containers )
ADD_SUBDIRECTORY( cuda )
ADD_SUBDIRECTORY( vectors )
ADD_SUBDIRECTORY( images )
ADD_SUBDIRECTORY( multimaps )

set (headers tnlAssert.h               
@@ -56,6 +57,7 @@ IF( BUILD_CUDA )
        ${tnl_core_containers_CUDA__SOURCES}
        ${tnl_core_cuda_CUDA__SOURCES}
        ${tnl_core_vectors_CUDA__SOURCES}
        ${tnl_core_images_CUDA__SOURCES}
        ${common_SOURCES} 
        ${CURRENT_DIR}/tnlCuda.cu
        ${CURRENT_DIR}/tnlCudaDeviceInfo.cu
@@ -67,6 +69,7 @@ set( tnl_core_SOURCES
     ${tnl_core_containers_SOURCES}
     ${tnl_core_cuda_SOURCES}
     ${tnl_core_vectors_SOURCES}
     ${tnl_core_images_SOURCES}
     ${common_SOURCES}
     ${CURRENT_DIR}/tnlCudaDeviceInfo.cpp
     PARENT_SCOPE )
Loading