Ignore:
Timestamp:
May 31, 2017, 4:25:33 PM (23 months ago)
Author:
nmedfort
Message:

Initial attempt to improve debugging capabilities with compilation stack traces on error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5476 r5486  
    88set (icgrep_VERSION_MINOR 6)
    99
    10 
    11 
    1210option(ENABLE_MULTIPLEXING "Compiling the Multiplexing Module")
    13 option(PRINT_TIMING_INFORMATION "Write compilation and execution timing information to standard error stream")
    1411option(DISABLE_DUAL_ABI "Disable GCC Dual ABI support" OFF)
    1512find_package(LLVM REQUIRED CONFIG)
     
    2926link_directories( ${LLVM_LIBRARY_DIRS} )
    3027add_definitions( ${LLVM_DEFINITIONS} )
     28
     29# include(FindCUDA) # https://cmake.org/cmake/help/v3.0/module/FindCUDA.html
    3130
    3231option(ENABLE_CUDA_COMPILE "Compiling with CUDA")
     
    104103add_executable(array-test array-test.cpp kernels/alignedprint.cpp)
    105104add_executable(lz4d lz4d.cpp lz4FrameDecoder.cpp kernels/cc_kernel.cpp kernels/lz4_index_decoder.cpp kernels/lz4_bytestream_decoder.cpp)
    106 
    107 ## IWYU detects superfluous includes and when the include can be replaced with a forward declaration.
    108 ## It can be obtained using "apt-get install iwyu" or from "github.com/include-what-you-use".
    109 
    110 #find_program(IWYU_PATH NAMES include-what-you-use iwyu)
    111 #if(IWYU_PATH)
    112 #cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
    113 #execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE LIBGCC_FILE)
    114 #get_filename_component(LIBGCC_PATH ${LIBGCC_FILE} DIRECTORY)
    115 #include_directories("${LIBGCC_PATH}/include")
    116 #set_property(TARGET CodeGen PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    117 #set_property(TARGET PabloADT PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    118 #set_property(TARGET RegExpADT PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    119 #set_property(TARGET RegExpCompiler PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    120 #set_property(TARGET CCADT PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    121 #set_property(TARGET UCDlib PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    122 #set_property(TARGET icgrep PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    123 #set_property(TARGET u8u16 PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    124 #set_property(TARGET base64 PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    125 #set_property(TARGET wc PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    126 #set_property(TARGET editd PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    127 #set_property(TARGET array-test PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    128 #endif()
    129 
    130 IF (PRINT_TIMING_INFORMATION)
    131     find_package(PAPI REQUIRED)
    132     include_directories(${PAPI_INCLUDE_DIRS})
    133     target_link_libraries(icgrep ${PAPI_LIBRARIES})
    134 ENDIF()
    135105
    136106target_link_libraries (icgrep UCDlib PabloADT RegExpCompiler CCADT CodeGen ${REQ_LLVM_LIBRARIES} ${Boost_LIBRARIES} ${CUDA_LIB})
     
    200170ENDIF()
    201171
     172include(CheckIncludeFileCXX)
     173CHECK_INCLUDE_FILE_CXX(sanitizer/asan_interface.h HAS_ADDRESS_SANITIZER)
     174
     175find_package(Libunwind)
     176IF (LIBUNWIND_FOUND)
     177SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_LIBUNWIND")
     178include_directories(${LIBUNWIND_INCLUDE_DIR})
     179target_link_libraries(CodeGen ${LIBUNWIND_LIBRARIES})
     180ENDIF()
    202181
    203182SET(CMAKE_REQUIRED_FLAGS)
     
    216195SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPARABIX_VERSION='\"${Parabix_REVISION}\"'")
    217196
    218 IF (PRINT_TIMING_INFORMATION)
    219     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPRINT_TIMING_INFORMATION")
    220 ENDIF()
    221 
    222 SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG")
    223 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address")
     197SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
     198
     199SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls")
     200IF (HAS_ADDRESS_SANITIZER)
     201SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DHAS_ADDRESS_SANITIZER -fsanitize=address")
     202ENDIF()
     203
    224204
    225205add_test(
Note: See TracChangeset for help on using the changeset viewer.