From 671132ab07e9adef92ac1ffc7f9527e504187084 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 20 Jul 2017 16:32:05 +0200 Subject: [PATCH] Looking for libelf (required by MC). --- CMakeLists.txt | 7 +++--- tools/cmake/Modules/FindLibelf.cmake | 34 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 tools/cmake/Modules/FindLibelf.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 19a9267fe4..8c2ea590b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -403,15 +403,16 @@ if(HAVE_LIBUNWIND) endif() else() if(enable_model-checking) - message(FATAL_ERROR "Please install libunwind-dev libdw-dev libevent-dev if you want to compile the SimGrid model checker.") + message(FATAL_ERROR "Please install libunwind-dev libdw-dev libelf-dev libevent-dev if you want to compile the SimGrid model checker.") endif() endif() if(enable_model-checking) find_package(Libdw REQUIRED) + find_package(Libelf REQUIRED) find_package(Libevent REQUIRED) - include_directories(${LIBDW_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR}) - set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBDW_LIBRARIES}") + include_directories(${LIBDW_INCLUDE_DIR} ${LIBELF_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR}) + set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBELF_LIBRARIES} ${LIBDW_LIBRARIES}") set(SIMGRID_HAVE_MC 1) if("${CMAKE_SYSTEM}" MATCHES "FreeBSD" AND enable_java) message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling java") diff --git a/tools/cmake/Modules/FindLibelf.cmake b/tools/cmake/Modules/FindLibelf.cmake new file mode 100644 index 0000000000..1e1af815ad --- /dev/null +++ b/tools/cmake/Modules/FindLibelf.cmake @@ -0,0 +1,34 @@ +find_path(LIBELF_INCLUDE_DIR "libelf.h" + HINTS + $ENV{SIMGRID_LIBELF_LIBRARY_PATH} + $ENV{LD_LIBRARY_PATH} + $ENV{LIBELF_LIBRARY_PATH} + PATH_SUFFIXES include/ GnuWin32/include + PATHS + /opt + /opt/local + /opt/csw + /sw + /usr) +find_library(LIBELF_LIBRARY + NAMES elf + HINTS + $ENV{SIMGRID_LIBELF_LIBRARY_PATH} + $ENV{LD_LIBRARY_PATH} + $ENV{LIBELF_LIBRARY_PATH} + PATH_SUFFIXES lib/ GnuWin32/lib + PATHS + /opt + /opt/local + /opt/csw + /sw + /usr) +set(LIBELF_LIBRARIES "${LIBELF_LIBRARY}") + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + Libelf + DEFAULT_MSG + LIBELF_LIBRARIES + LIBELF_INCLUDE_DIR) +mark_as_advanced(LIBELF_INCLUDE_DIR LIBELF_LIBRARIES) -- 2.20.1