Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Looking for libelf (required by MC).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 20 Jul 2017 14:32:05 +0000 (16:32 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 20 Jul 2017 14:36:14 +0000 (16:36 +0200)
CMakeLists.txt
tools/cmake/Modules/FindLibelf.cmake [new file with mode: 0644]

index 19a9267..8c2ea59 100644 (file)
@@ -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 (file)
index 0000000..1e1af81
--- /dev/null
@@ -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)