Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove option for pcre from cmake files and from sources.
authorNavarrop <Pierre.Navarro@imag.fr>
Tue, 20 Sep 2011 12:07:45 +0000 (14:07 +0200)
committerNavarrop <Pierre.Navarro@imag.fr>
Tue, 20 Sep 2011 12:07:45 +0000 (14:07 +0200)
Now we need pcre to compile SimGrid.

buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/MakeLib.cmake
buildtools/Cmake/MakeLibWin.cmake
buildtools/Cmake/Modules/FindPCRE.cmake
buildtools/Cmake/Option.cmake
buildtools/Cmake/PrintArgs.cmake
buildtools/Cmake/gras_config.h.in
doc/HelloWorld/FindPCRE.cmake
src/surf/surf_routing.c
src/surf/surf_routing_private.h
src/surf/surf_routing_rulebased.c

index 4179edf..465e61b 100644 (file)
@@ -67,11 +67,8 @@ include(TestBigEndian)
 TEST_BIG_ENDIAN(BIGENDIAN)
 
 include(FindGraphviz)
-
-string(TOUPPER ${enable_pcre} enable_pcre)
-if(enable_pcre STREQUAL "AUTO" OR enable_pcre STREQUAL "ON")
 include(FindPCRE)
-endif(enable_pcre STREQUAL "AUTO" OR enable_pcre STREQUAL "ON")
+
 set(HAVE_GTNETS 0)
 if(enable_gtnets)      
        include(FindGTnets)
index 146444f..9640ac4 100644 (file)
@@ -66,10 +66,7 @@ target_link_libraries(gras   ${GRAS_DEP})
 
 # Compute the dependencies of SimGrid
 #####################################
-set(SIMGRID_DEP "-lm")
-if(HAVE_PCRE_LIB)
-       SET(SIMGRID_DEP "${SIMGRID_DEP} -lpcre")
-endif(HAVE_PCRE_LIB)
+set(SIMGRID_DEP "-lm -lpcre")
 
 if(pthread)
        if(${CONTEXT_THREADS})
index fea8907..0047b48 100644 (file)
@@ -20,11 +20,7 @@ else(MSVC)
 endif(MSVC)\r
 \r
 set(GRAS_DEP "ws2_32")\r
-set(SIMGRID_DEP "ws2_32")\r
-\r
-if(HAVE_PCRE_LIB)\r
-       SET(SIMGRID_DEP "${SIMGRID_DEP} -lpcre")\r
-endif(HAVE_PCRE_LIB)\r
+set(SIMGRID_DEP "ws2_32 -lpcre")\r
 \r
 target_link_libraries(simgrid  ${SIMGRID_DEP})\r
 target_link_libraries(gras     ${GRAS_DEP})\r
index 5f22069..0b3db37 100644 (file)
@@ -33,8 +33,6 @@ find_path(PATH_PCRE_H "pcre.h"
     /opt/csw
     /sw
     /usr)
-       
-set(HAVE_PCRE_LIB 0)
 
 message(STATUS "Looking for pcre.h")
 if(PATH_PCRE_H)
@@ -82,13 +80,8 @@ if(PATH_PCRE_LIB AND PATH_PCRE_H)
           if(NOT operation)
                        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${PATH_PCRE_H} ")
           endif(NOT operation)    
-       set(HAVE_PCRE_LIB 1)
 else(PATH_PCRE_LIB)
-               if(enable_pcre STREQUAL "ON")
-                       message(FATAL_ERROR "Please install the libpcre3-dev package or equivalent before using it.")
-               else(enable_pcre STREQUAL "ON")
-                       message(STATUS "Warning: You should install libpcre (please install the libpcre3-dev package or equivalent).")
-               endif(enable_pcre STREQUAL "ON")
+          message(FATAL_ERROR "Please install the libpcre3-dev package or equivalent before using SimGrid.")
 endif(PATH_PCRE_LIB AND PATH_PCRE_H)
     
 mark_as_advanced(PATH_PCRE_H)
index d636828..bd2b3a8 100644 (file)
@@ -1,8 +1,6 @@
 ### ARGs use -D[var]=[ON/OFF] or [1/0] or [true/false](see after)
 ### ex: cmake -Denable_java=ON -Denable_gtnets=ON ./
 
-
-
 set(BIBTEX2HTML ${BIBTEX2HTML} CACHE PATH "Path to bibtex2html")
 set(gtnets_path ${gtnets_path} CACHE PATH "Path to gtnets lib and include")
 set(ns3_path ${ns3_path} CACHE PATH "Path to ns3 lib and include")
@@ -22,10 +20,6 @@ option(enable_gtnets "Whether gtnets model is activated." on)
 option(enable_ns3    "Whether ns3 model is activated." on)
 option(enable_smpi "This variable set smpi lib." off)
 option(enable_lua "Whether the lua bindings are activated." on)
-set(enable_pcre ${enable_pcre} CACHE FORCE "Whether the pcre lib is activated.")
-if(enable_pcre STREQUAL "")
-       set(enable_pcre "AUTO")
-endif(enable_pcre STREQUAL "")
 
 if(WIN32 OR APPLE) 
 set(enable_smpi off CACHE TYPE INTERNAL FORCE)
index d39ef8d..2ed1608 100644 (file)
@@ -96,7 +96,6 @@ endif(NOT APPLE AND NOT WIN32)
 message("      Compile Lua    :        ${HAVE_LUA}")
 message("      Compile Smpi   :        ${enable_smpi}")
 message("      Compile Static :        ${enable_lib_static}")
-message("      Compile pcre   :        ${enable_pcre}")
 message("")
 message("      Maintainer mode:        ${enable_maintainer_mode}")
 message("      Supernovae mode:        ${enable_supernovae}")
index c58ef93..9fa4ca4 100644 (file)
@@ -46,9 +46,6 @@
 /* Set to true if have the mergesort function */
 #cmakedefine HAVE_MERGESORT @HAVE_MERGESORT@
 
-/* Set to true if lib pcre is present */
-#cmakedefine HAVE_PCRE_LIB @HAVE_PCRE_LIB@
-
 /* If have linux_futex.h */
 #cmakedefine HAVE_FUTEX_H @HAVE_FUTEX_H@
 
index e6f382b..858e0e2 100644 (file)
@@ -44,8 +44,6 @@ find_path(PATH_PCRE_H "pcre.h"
     /opt/csw
     /sw
     /usr)
-    
-set(HAVE_PCRE_LIB 0)
 
 message(STATUS "Looking for pcre.h")
 if(PATH_PCRE_H)
@@ -93,9 +91,8 @@ if(PATH_PCRE_LIB AND PATH_PCRE_H)
        if(NOT operation)
            SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${PATH_PCRE_H} ")
        endif(NOT operation)       
-    set(HAVE_PCRE_LIB 1)
 else(PATH_PCRE_LIB)
-    message(FATAL_ERROR "Please install the libpcre3-dev package or equivalent before using it.")
+    message(FATAL_ERROR "Please install the libpcre3-dev package or equivalent before using SimGrid.")
 endif(PATH_PCRE_LIB AND PATH_PCRE_H)
     
 mark_as_advanced(PATH_PCRE_H)
index 8794bbc..e32d928 100644 (file)
@@ -4,9 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifdef HAVE_PCRE_LIB
 #include <pcre.h>               /* regular expression library */
-#endif
 #include "surf_routing_private.h"
 #include "surf/surf_routing.h"
 
@@ -65,9 +63,7 @@ typedef enum {
   SURF_MODEL_DIJKSTRA,
   SURF_MODEL_DIJKSTRACACHE,
   SURF_MODEL_NONE,
-#ifdef HAVE_PCRE_LIB
   SURF_MODEL_RULEBASED
-#endif
 } e_routing_types;
 
 struct s_model_type routing_models[] = { {"Full",
@@ -90,12 +86,10 @@ struct s_model_type routing_models[] = { {"Full",
  model_dijkstra_both_unload, model_dijkstra_both_end},
 {"none", "No routing (usable with Constant network only)",
  model_none_create, model_none_load, model_none_unload, model_none_end},
-#ifdef HAVE_PCRE_LIB
 {"RuleBased", "Rule-Based routing data (...)", model_rulebased_create,
  model_rulebased_load, model_rulebased_unload, model_rulebased_end},
 {"Vivaldi", "Vivaldi routing", model_rulebased_create,
   model_rulebased_load, model_rulebased_unload, model_rulebased_end},
-#endif
 {NULL, NULL, NULL, NULL, NULL, NULL}
 };
 
@@ -1539,9 +1533,7 @@ void routing_parse_Scluster(void)
   xbt_dict_set(patterns,"prefix",cluster_prefix,NULL);
   xbt_dict_set(patterns,"suffix",cluster_suffix,NULL);
 
-#ifdef HAVE_PCRE_LIB
   char *route_src_dst;
-#endif
   unsigned int iter;
   int start, end, i;
   xbt_dynar_t radical_elements;
@@ -1549,12 +1541,6 @@ void routing_parse_Scluster(void)
   int cluster_sharing_policy = AX_surfxml_cluster_sharing_policy;
   int cluster_bb_sharing_policy = AX_surfxml_cluster_bb_sharing_policy;
 
-#ifndef HAVE_PCRE_LIB
-  xbt_dynar_t tab_elements_num = xbt_dynar_new(sizeof(int), NULL);
-  char *route_src, *route_dst;
-  int j;
-#endif
-
   static unsigned int surfxml_buffer_stack_stack_ptr = 1;
   static unsigned int surfxml_buffer_stack_stack[1024];
 
@@ -1563,13 +1549,8 @@ void routing_parse_Scluster(void)
   surfxml_bufferstack_push(1);
 
   SURFXML_BUFFER_SET(AS_id, cluster_id);
-#ifdef HAVE_PCRE_LIB
   SURFXML_BUFFER_SET(AS_routing, "RuleBased");
   XBT_DEBUG("<AS id=\"%s\"\trouting=\"RuleBased\">", cluster_id);
-#else
-  SURFXML_BUFFER_SET(AS_routing, "Full");
-  XBT_DEBUG("<AS id=\"%s\"\trouting=\"Full\">", cluster_id);
-#endif
   SURFXML_START_TAG(AS);
 
   radical_elements = xbt_str_split(cluster_radical, ",");
@@ -1580,9 +1561,6 @@ void routing_parse_Scluster(void)
       surf_parse_get_int(&start,
                          xbt_dynar_get_as(radical_ends, 0, char *));
       host_id = bprintf("%s%d%s", cluster_prefix, start, cluster_suffix);
-#ifndef HAVE_PCRE_LIB
-      xbt_dynar_push_as(tab_elements_num, int, start);
-#endif
       link_id = bprintf("%s_link_%d", cluster_id, start);
 
       xbt_dict_set(patterns, "radical", bprintf("%d", start), xbt_free);
@@ -1642,9 +1620,6 @@ void routing_parse_Scluster(void)
       surf_parse_get_int(&end, xbt_dynar_get_as(radical_ends, 1, char *));
       for (i = start; i <= end; i++) {
         host_id = bprintf("%s%d%s", cluster_prefix, i, cluster_suffix);
-#ifndef HAVE_PCRE_LIB
-        xbt_dynar_push_as(tab_elements_num, int, i);
-#endif
         link_id = bprintf("%s_link_%d", cluster_id, i);
 
         xbt_dict_set(patterns, "radical", bprintf("%d", i), xbt_free);
@@ -1736,7 +1711,6 @@ void routing_parse_Scluster(void)
 
   XBT_DEBUG(" ");
 
-#ifdef HAVE_PCRE_LIB
   char *new_suffix = xbt_strdup("");
 
   radical_elements = xbt_str_split(cluster_suffix, ".");
@@ -1868,78 +1842,6 @@ void routing_parse_Scluster(void)
   free(pcre_link_src);
   free(route_src_dst);
 
-#else
-  for (i = 0; i <= xbt_dynar_length(tab_elements_num); i++) {
-    for (j = 0; j <= xbt_dynar_length(tab_elements_num); j++) {
-      if (i == xbt_dynar_length(tab_elements_num)) {
-        route_src = router_id;
-      } else {
-        route_src =
-            bprintf("%s%d%s", cluster_prefix,
-                    xbt_dynar_get_as(tab_elements_num, i, int),
-                    cluster_suffix);
-      }
-
-      if (j == xbt_dynar_length(tab_elements_num)) {
-        route_dst = router_id;
-      } else {
-        route_dst =
-            bprintf("%s%d%s", cluster_prefix,
-                    xbt_dynar_get_as(tab_elements_num, j, int),
-                    cluster_suffix);
-      }
-
-      XBT_DEBUG("<route\tsrc=\"%s\"\tdst=\"%s\"", route_src, route_dst);
-      XBT_DEBUG("symmetrical=\"NO\">");
-      SURFXML_BUFFER_SET(route_src, route_src);
-      SURFXML_BUFFER_SET(route_dst, route_dst);
-      A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
-      SURFXML_START_TAG(route);
-
-      if (i != xbt_dynar_length(tab_elements_num)){
-          route_src =
-                bprintf("%s_link_%d", cluster_id,
-                        xbt_dynar_get_as(tab_elements_num, i, int));
-                 XBT_DEBUG("<link_ctn\tid=\"%s\"/>", route_src);
-                 SURFXML_BUFFER_SET(link_ctn_id, route_src);
-                 A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
-                 if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
-                 {A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_UP;}
-                 SURFXML_START_TAG(link_ctn);
-                 SURFXML_END_TAG(link_ctn);
-                 free(route_src);
-      }
-
-      if(strcmp(cluster_bb_bw,"") && strcmp(cluster_bb_lat,"")){
-      XBT_DEBUG("<link_ctn\tid=\"%s_backbone\"/>", cluster_id);
-      SURFXML_BUFFER_SET(link_ctn_id, bprintf("%s_backbone", cluster_id));
-      A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
-      SURFXML_START_TAG(link_ctn);
-      SURFXML_END_TAG(link_ctn);
-      }
-
-      if (j != xbt_dynar_length(tab_elements_num)) {
-          route_dst =
-                bprintf("%s_link_%d", cluster_id,
-                        xbt_dynar_get_as(tab_elements_num, j, int));
-                 XBT_DEBUG("<link_ctn\tid=\"%s\"/>", route_dst);
-                 SURFXML_BUFFER_SET(link_ctn_id, route_dst);
-                 A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
-                 if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
-                 {A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_DOWN;}
-                 SURFXML_START_TAG(link_ctn);
-                 SURFXML_END_TAG(link_ctn);
-                 free(route_dst);
-      }
-
-      XBT_DEBUG("</route>");
-      SURFXML_END_TAG(route);
-    }
-  }
-  xbt_dynar_free(&tab_elements_num);
-
-#endif
-
   free(router_id);
   xbt_dict_free(&patterns);
   free(availability_file);
index 7b90eb8..91923c8 100644 (file)
@@ -71,15 +71,12 @@ void model_floyd_end(void);      /* finalize the creation of floyd routing model
 void model_floyd_set_route(routing_component_t rc, const char *src,
         const char *dst, name_route_extended_t route);
 
-
-#ifdef HAVE_PCRE_LIB
 /* ************************************************** */
 /* ************** RULE-BASED ROUTING **************** */
 void *model_rulebased_create(void);      /* create structures for rulebased routing model */
 void model_rulebased_load(void);         /* load parse functions for rulebased routing model */
 void model_rulebased_unload(void);       /* unload parse functions for rulebased routing model */
 void model_rulebased_end(void);          /* finalize the creation of rulebased routing model */
-#endif
 
 /* ************************************************************************** */
 /* ********** Dijkstra & Dijkstra Cached ROUTING **************************** */
index fad6426..8a57a5d 100644 (file)
@@ -4,8 +4,6 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 #include "surf_routing_private.h"
-
-#ifdef HAVE_PCRE_LIB
 #include <pcre.h>               /* regular expression library */
 
 /* Global vars */
@@ -436,5 +434,3 @@ void model_rulebased_unload(void)
 void model_rulebased_end(void)
 {
 }
-
-#endif                          /* HAVE_PCRE_LIB */