From: Navarrop Date: Tue, 20 Sep 2011 12:07:45 +0000 (+0200) Subject: Remove option for pcre from cmake files and from sources. X-Git-Tag: v3_6_2~76 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6aac8bb90869cf0dccc9caf03be425af62ee2813?hp=95689b491f0fa08b65fbce516d591a9e44179796 Remove option for pcre from cmake files and from sources. Now we need pcre to compile SimGrid. --- diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index 4179edfbc5..465e61b645 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -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) diff --git a/buildtools/Cmake/MakeLib.cmake b/buildtools/Cmake/MakeLib.cmake index 146444f441..9640ac49b6 100644 --- a/buildtools/Cmake/MakeLib.cmake +++ b/buildtools/Cmake/MakeLib.cmake @@ -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}) diff --git a/buildtools/Cmake/MakeLibWin.cmake b/buildtools/Cmake/MakeLibWin.cmake index fea8907d32..0047b48781 100644 --- a/buildtools/Cmake/MakeLibWin.cmake +++ b/buildtools/Cmake/MakeLibWin.cmake @@ -20,11 +20,7 @@ else(MSVC) endif(MSVC) set(GRAS_DEP "ws2_32") -set(SIMGRID_DEP "ws2_32") - -if(HAVE_PCRE_LIB) - SET(SIMGRID_DEP "${SIMGRID_DEP} -lpcre") -endif(HAVE_PCRE_LIB) +set(SIMGRID_DEP "ws2_32 -lpcre") target_link_libraries(simgrid ${SIMGRID_DEP}) target_link_libraries(gras ${GRAS_DEP}) diff --git a/buildtools/Cmake/Modules/FindPCRE.cmake b/buildtools/Cmake/Modules/FindPCRE.cmake index 5f22069aed..0b3db37a89 100644 --- a/buildtools/Cmake/Modules/FindPCRE.cmake +++ b/buildtools/Cmake/Modules/FindPCRE.cmake @@ -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) diff --git a/buildtools/Cmake/Option.cmake b/buildtools/Cmake/Option.cmake index d636828df6..bd2b3a80a1 100644 --- a/buildtools/Cmake/Option.cmake +++ b/buildtools/Cmake/Option.cmake @@ -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) diff --git a/buildtools/Cmake/PrintArgs.cmake b/buildtools/Cmake/PrintArgs.cmake index d39ef8db5b..2ed1608ef6 100644 --- a/buildtools/Cmake/PrintArgs.cmake +++ b/buildtools/Cmake/PrintArgs.cmake @@ -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}") diff --git a/buildtools/Cmake/gras_config.h.in b/buildtools/Cmake/gras_config.h.in index c58ef93b74..9fa4ca4ea5 100644 --- a/buildtools/Cmake/gras_config.h.in +++ b/buildtools/Cmake/gras_config.h.in @@ -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@ diff --git a/doc/HelloWorld/FindPCRE.cmake b/doc/HelloWorld/FindPCRE.cmake index e6f382b41e..858e0e2dbe 100644 --- a/doc/HelloWorld/FindPCRE.cmake +++ b/doc/HelloWorld/FindPCRE.cmake @@ -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) diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 8794bbcc30..e32d928ac0 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -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 /* 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("", cluster_id); -#else - SURFXML_BUFFER_SET(AS_routing, "Full"); - XBT_DEBUG("", 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(""); - 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("", 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("", 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("", 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(""); - SURFXML_END_TAG(route); - } - } - xbt_dynar_free(&tab_elements_num); - -#endif - free(router_id); xbt_dict_free(&patterns); free(availability_file); diff --git a/src/surf/surf_routing_private.h b/src/surf/surf_routing_private.h index 7b90eb8b8f..91923c8ac3 100644 --- a/src/surf/surf_routing_private.h +++ b/src/surf/surf_routing_private.h @@ -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 **************************** */ diff --git a/src/surf/surf_routing_rulebased.c b/src/surf/surf_routing_rulebased.c index fad6426864..8a57a5d0b7 100644 --- a/src/surf/surf_routing_rulebased.c +++ b/src/surf/surf_routing_rulebased.c @@ -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 /* regular expression library */ /* Global vars */ @@ -436,5 +434,3 @@ void model_rulebased_unload(void) void model_rulebased_end(void) { } - -#endif /* HAVE_PCRE_LIB */