Skip to content

Commit

Permalink
Adding USE_OpenMP to cmake files;
Browse files Browse the repository at this point in the history
Adding MD5 to verify downloaded file;
Removing compiler restriction.
  • Loading branch information
Sasha Nicolas committed Oct 25, 2018
1 parent 896144c commit 054ddeb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmake/options.cmake
@@ -1,3 +1,6 @@
# Use OpenMP?
option (USE_OpenMP "Use OpenMP for parallel parsing" ON)

# Use SymtabAPI or SymLite?
option (LIGHTWEIGHT_SYMTAB "Use lightweight symtab interface for ParseAPI, ProcControl, and Stackwalker; disables DyninstAPI build" OFF)

Expand Down
5 changes: 3 additions & 2 deletions cmake/packages.cmake
Expand Up @@ -29,16 +29,17 @@ if (UNIX)
PREFIX ${CMAKE_BINARY_DIR}/tbb
STAMP_DIR ${CMAKE_BINARY_DIR}/tbb/src/TBB-stamp
URL https://github.com/01org/tbb/archive/2018_U6.tar.gz
URL_MD5 9a0f78db4f72356068b00f29f54ee6bc
SOURCE_DIR ${CMAKE_BINARY_DIR}/tbb/src/TBB/src
CONFIGURE_COMMAND ""
BINARY_DIR ${CMAKE_BINARY_DIR}/tbb/src/TBB/src
BUILD_COMMAND make -j${NCPU} tbb tbbmalloc compiler=gcc tbb_build_dir=${CMAKE_BINARY_DIR}/tbb/src/TBB-build tbb_build_prefix=tbb
BUILD_COMMAND make -j${NCPU} tbb tbbmalloc tbb_build_dir=${CMAKE_BINARY_DIR}/tbb/src/TBB-build tbb_build_prefix=tbb
INSTALL_COMMAND sh -c "mkdir -p ${CMAKE_BINARY_DIR}/tbb/include && mkdir -p ${CMAKE_BINARY_DIR}/tbb/lib \
&& cp ${CMAKE_BINARY_DIR}/tbb/src/TBB-build/tbb_release/*.so* ${CMAKE_BINARY_DIR}/tbb/lib \
&& cp -r ${CMAKE_BINARY_DIR}/tbb/src/TBB/src/include/* ${CMAKE_BINARY_DIR}/tbb/include"
)
set(TBB_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/tbb/include)
set(TBB_LIBRARIES ${CMAKE_BINARY_DIR}/tbb/libtbb.so ${CMAKE_BINARY_DIR}/tbb/libtbbmalloc_proxy.so)
set(TBB_LIBRARIES ${CMAKE_BINARY_DIR}/tbb/lib/libtbb.so ${CMAKE_BINARY_DIR}/tbb/lib/libtbbmalloc_proxy.so)
set(TBB_FOUND 1)
endif()
add_library(libelf_imp SHARED IMPORTED)
Expand Down
5 changes: 5 additions & 0 deletions parseAPI/CMakeLists.txt
Expand Up @@ -124,6 +124,11 @@ message(STATUS "Architecture is: ${CMAKE_LIBRARY_ARCHITECTURE}")
FILE (GLOB headers "h/*.h")
FILE (GLOB dataflowheaders "../dataflowAPI/h/*.h")
set_target_properties (parseAPI PROPERTIES PUBLIC_HEADER "${headers};${dataflowheaders}")

if (USE_OpenMP MATCHES "ON")
set_target_properties (parseAPI PROPERTIES COMPILE_FLAGS "-fopenmp" LINK_FLAGS "-fopenmp")
endif()

if (USE_COTIRE)
cotire(parseAPI)
endif()
Expand Down
5 changes: 5 additions & 0 deletions parseAPI/src/debug_parse.C
Expand Up @@ -62,7 +62,12 @@ int Dyninst::ParseAPI::parsing_printf_int(const char *format, ...)
if(NULL == format) return -1;
if (log_file == NULL) {
char filename[128];
#if defined(_OPENMP)
snprintf(filename, 128, "%s-%d.txt", getenv("DYNINST_DEBUG_PARSING"), omp_get_thread_num());
#else
snprintf(filename, 128, "%s-%d.txt", getenv("DYNINST_DEBUG_PARSING"), 0);
#endif

log_file = fopen(filename, "w");
}

Expand Down

0 comments on commit 054ddeb

Please sign in to comment.