Ignore:
Timestamp:
Oct 4, 2014, 1:14:35 PM (5 years ago)
Author:
nmedfort
Message:

First stage of code generator revamp

File:
1 edited

Legend:

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

    r4209 r4210  
    4848
    4949# Check if boost has been installed on this system.
    50 set(Boost_USE_STATIC_LIBS ON)
    51 set(Boost_USE_MULTITHREADED OFF) 
    52 set(Boost_USE_STATIC_RUNTIME OFF)
    53 include(FindBoost)
    54 
    55 add_library(PabloADT pablo/pe_advance.cpp pablo/pe_all.cpp pablo/pe_and.cpp pablo/pe_call.cpp pablo/pe_charclass.cpp  pablo/pe_matchstar.cpp pablo/pe_scanthru.cpp pablo/pe_not.cpp  pablo/pe_or.cpp  pablo/pe_pabloe.cpp  pablo/pe_sel.cpp  pablo/pe_var.cpp  pablo/pe_xor.cpp pablo/ps_assign.cpp  pablo/ps_if.cpp  pablo/codegenstate.cpp  pablo/ps_while.cpp pablo/printer_pablos.cpp)
    56 
    57 add_library(RegExpADT re/re_alt.cpp re/re_cc.cpp re/re_end.cpp re/re_name.cpp re/re_parser.cpp re/re_re.cpp re/re_rep.cpp re/re_seq.cpp re/re_start.cpp re/parsefailure.cpp re/re_reducer.cpp re/re_nullable.cpp re/re_simplifier.cpp re/re_compiler.cpp re/symbol_generator.cpp re/printer_re.cpp)
    58 
     50set(Boost_USE_STATIC_LIBS ON)
     51set(Boost_USE_MULTITHREADED OFF)
     52set(Boost_USE_STATIC_RUNTIME OFF)
     53find_package(Boost 1.21 COMPONENTS system)
     54include_directories("${Boost_INCLUDE_DIRS}")
     55link_directories(${Boost_LIBRARY_DIR})
     56add_library(PabloADT pablo/pe_advance.cpp pablo/pe_all.cpp pablo/pe_and.cpp pablo/pe_call.cpp pablo/pe_charclass.cpp  pablo/pe_matchstar.cpp pablo/pe_scanthru.cpp pablo/pe_not.cpp  pablo/pe_or.cpp  pablo/pe_pabloe.cpp  pablo/pe_sel.cpp  pablo/pe_var.cpp  pablo/pe_xor.cpp pablo/ps_assign.cpp  pablo/ps_if.cpp  pablo/codegenstate.cpp  pablo/symbol_generator.cpp pablo/ps_while.cpp pablo/printer_pablos.cpp)
     57add_library(RegExpADT re/re_alt.cpp re/re_cc.cpp re/re_end.cpp re/re_name.cpp re/re_parser.cpp re/re_re.cpp re/re_rep.cpp re/re_seq.cpp re/re_start.cpp re/parsefailure.cpp re/re_reducer.cpp re/re_nullable.cpp re/re_simplifier.cpp re/re_compiler.cpp re/printer_re.cpp)
    5958add_library(CCADT cc/cc_compiler.cpp utf_encoding.cpp utf8_encoder.cpp unicode_categories.h unicode_categories-flat.h unicode_categories-simple.h)
    6059
     
    6766include_directories("${PROJECT_SOURCE_DIR}/include/simd-lib/idisa_cpp")
    6867
    69 if (Boost_FOUND)
    70     include_directories(${Boost_INCLUDE_DIRS})
    71 endif()
    72 
    7368# add the executable
    7469add_executable(icgrep icgrep.cpp llvm_gen.cpp llvm_gen_helper.cpp compiler.cpp)
     
    7671target_link_libraries (CCADT PabloADT)
    7772target_link_libraries (icgrep PabloADT RegExpADT CCADT ${REQ_LLVM_LIBRARIES})
    78 if (Boost_FOUND)
    79     target_link_libraries (icgrep ${Boost_LIBRARIES})
    80 endif()
    81 
     73IF (Boost_FOUND)
     74    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BOOST")
     75    target_link_libraries (CCADT ${Boost_LIBRARIES})
     76    target_link_libraries (PabloADT ${Boost_LIBRARIES})
     77    target_link_libraries (RegExpADT ${Boost_LIBRARIES})
     78ENDIF()
    8279
    8380#Check compiler support for 0x / 11
     
    103100endif()
    104101
     102
    105103#Disable RunTime Type Information
    106 
    107104IF (MSVC) # using Visual Studio C++
    108105  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
     
    210207set(CMAKE_REQUIRED_FLAGS)
    211208set(SIMD_SUPPORT_FOUND)
    212 
    213 MACRO(CHECK_SIMD_SUPPORT type) 
     209set(SIMD_MAX_BLOCK_SIZE)
     210
     211MACRO(CHECK_SIMD_SUPPORT type maxBlockSize)
    214212  IF(NOT SIMD_SUPPORT_FOUND) 
    215213    set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
     
    218216    IF(${type})
    219217      SET(SIMD_SUPPORT_FOUND ${CMAKE_REQUIRED_FLAGS})
     218      SET(SIMD_MAX_BLOCK_SIZE, ${maxBlockSize})
    220219    ENDIF()
    221220    SET(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
     
    223222ENDMACRO()
    224223
    225 CHECK_SIMD_SUPPORT("AVX_2")
    226 CHECK_SIMD_SUPPORT("AVX_1")
    227 CHECK_SIMD_SUPPORT("SSE4_2")
    228 CHECK_SIMD_SUPPORT("SSE4_1")
    229 CHECK_SIMD_SUPPORT("SSE3")
    230 CHECK_SIMD_SUPPORT("SSE2")
    231 CHECK_SIMD_SUPPORT("SSE1")
     224CHECK_SIMD_SUPPORT("AVX_2" 256)
     225CHECK_SIMD_SUPPORT("AVX_1" 128)
     226CHECK_SIMD_SUPPORT("SSE4_2" 128)
     227CHECK_SIMD_SUPPORT("SSE4_1" 128)
     228CHECK_SIMD_SUPPORT("SSE3" 128)
     229CHECK_SIMD_SUPPORT("SSE2" 128)
     230CHECK_SIMD_SUPPORT("SSE1" 128)
    232231
    233232SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SIMD_SUPPORT_FOUND}")
     
    241240
    242241IF (BLOCK_SIZE_256)
    243   IF("${SIMD_SUPPORT_FOUND}" STREQUAL "${ENABLE_AVX_2}")
     242  IF(${SIMD_MAX_BLOCK_SIZE} >= 256)
    244243    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_S2P_AVX2 -DBLOCK_SIZE=256 -march=core-avx2 -m64")
    245244  ELSE()
    246     MESSAGE(FATAL_ERROR "AVX2 is required for BLOCK_SIZE=256")
     245    MESSAGE(FATAL_ERROR "AVX2 or better is required for BLOCK_SIZE=256")
    247246  ENDIF()
    248247ENDIF()
Note: See TracChangeset for help on using the changeset viewer.