Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot//simgrid/simgrid
authorChristophe Thiéry <christopho128@gmail.com>
Wed, 27 Jul 2011 08:27:31 +0000 (10:27 +0200)
committerChristophe Thiéry <christopho128@gmail.com>
Wed, 27 Jul 2011 08:27:31 +0000 (10:27 +0200)
CMakeLists.txt
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/Flags.cmake
buildtools/Cmake/MakeLibWin.cmake
buildtools/Cmake/Modules/FindPCRE.cmake
buildtools/Cmake/simgrid.nsi.in
doc/HelloWorld/README
src/xbt/win32_ucontext.c
teshsuite/simdag/platforms/CMakeLists.txt

index bb28602..02e569b 100644 (file)
@@ -119,12 +119,12 @@ endif(NOT CMAKE_CROSSCOMPILING AND EXISTS /usr/include/)
 
 ### Check 32bits or 64bits
 INCLUDE (CheckTypeSize)
-CHECK_TYPE_SIZE("long" SIZEOF_LONG)
-IF(SIZEOF_LONG EQUAL 4)
+CHECK_TYPE_SIZE("void*" SIZEOF_VOIDSTAR)
+IF(SIZEOF_VOIDSTAR EQUAL 4)
   SET(ARCH_32_BITS 1)
-ELSE(SIZEOF_LONG EQUAL 4)
+ELSE(SIZEOF_VOIDSTAR EQUAL 4)
   SET(ARCH_32_BITS 0)
-ENDIF(SIZEOF_LONG EQUAL 4)
+ENDIF(SIZEOF_VOIDSTAR EQUAL 4)
 
 if(WIN32)
 
index 30c3610..d251d51 100644 (file)
@@ -3,21 +3,17 @@ ${CMAKE_MODULE_PATH}
 ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Modules
 )
 
-IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") #Intel processor 64 bits
-   message(STATUS "System processor: amd64")
-   set(HAVE_RAWCTX 1)
-   
-ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86") #Intel processor 32 bits
-   message(STATUS "System processor: x86")
-   set(PROCESSOR_i686 1)
-   set(HAVE_RAWCTX 1)
-   
-ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
+# x86_64
+# x86
+# i.86
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86")
     IF(${ARCH_32_BITS})
         set(PROCESSOR_i686 1)
+        set(SIMGRID_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
         message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")
     ELSE(${ARCH_32_BITS})
         message(STATUS "System processor: amd64")
+        set(SIMGRID_SYSTEM_PROCESSOR "amd64")
         set(PROCESSOR_x86_64 1)
         set(PROCESSOR_i686 0)
     ENDIF(${ARCH_32_BITS})          
@@ -58,7 +54,7 @@ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
 ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") #PROCESSOR NOT fIND
     message(STATUS "PROCESSOR NOT FOUND: ${CMAKE_SYSTEM_PROCESSOR}")
     
-ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86")
 
 message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
 
index 278388c..95b1ae5 100644 (file)
@@ -30,6 +30,10 @@ set(CMAKE_C_FLAGS "${optCFLAGS}${warnCFLAGS}${CMAKE_C_FLAGS}")
 
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${custom_flags}")
 
+if(HAVE_PCRE_LIB AND WIN32)
+       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPCRE_STATIC")
+endif(HAVE_PCRE_LIB AND WIN32)
+
 # Try to make Mac a bit more complient to open source standards
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE")
index 733f6ca..fea8907 100644 (file)
@@ -19,8 +19,8 @@ else(MSVC)
     endif(CMAKE_COMPILER_IS_GNUCC)\r
 endif(MSVC)\r
 \r
-set(GRAS_DEP "wsock32")\r
-set(SIMGRID_DEP "wsock32")\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
index d57c59e..93fd14d 100644 (file)
@@ -1,6 +1,7 @@
 find_library(PATH_PCRE_LIB 
        NAMES pcre
     HINTS
+    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
     $ENV{LD_LIBRARY_PATH}
     $ENV{PCRE_LIBRARY_PATH}
     PATH_SUFFIXES lib/ GnuWin32/lib
@@ -13,6 +14,7 @@ find_library(PATH_PCRE_LIB
     
 find_path(PATH_PCRE_H "pcre.h"
     HINTS
+    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
     $ENV{LD_LIBRARY_PATH}
     $ENV{PCRE_LIBRARY_PATH}
     PATH_SUFFIXES include/ GnuWin32/include
@@ -22,7 +24,7 @@ find_path(PATH_PCRE_H "pcre.h"
     /opt/csw
     /sw
     /usr)
-    
+       
 set(HAVE_PCRE_LIB 0)
 
 message(STATUS "Looking for pcre.h")
@@ -39,6 +41,27 @@ else(PATH_PCRE_LIB)
 message(STATUS "Looking for lib pcre - not found")
 endif(PATH_PCRE_LIB)
 
+if(WIN32)
+    find_path(PATH_PCRE_LICENCE "LICENCE"
+        HINTS
+        $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+        $ENV{LD_LIBRARY_PATH}
+        $ENV{PCRE_LIBRARY_PATH}
+        PATH_SUFFIXES GnuWin32
+        PATHS
+        /opt
+        /opt/local
+        /opt/csw
+        /sw
+        /usr)
+    message(STATUS "Looking for pcre licence")
+    if(PATH_PCRE_LICENCE)
+    message(STATUS "Looking for pcre licence - found")
+    else(PATH_PCRE_LICENCE)
+    message(STATUS "Looking for pcre licence - not found")
+    endif(PATH_PCRE_LICENCE)
+endif(WIN32)
+
 if(PATH_PCRE_LIB AND PATH_PCRE_H)
        string(REGEX REPLACE "/libpcre.*[.]${LIB_EXE}$" "" PATHLIBPCRE "${PATH_PCRE_LIB}")
        string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
index c6b2f4d..e2f6151 100644 (file)
@@ -27,7 +27,7 @@
 ;--------------------------------\r
 \r
 Name "Simgrid"\r
-outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_@CMAKE_SYSTEM_PROCESSOR@@BIN_EXE@"\r
+outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_@SIMGRID_SYSTEM_PROCESSOR@@BIN_EXE@"\r
 Icon "@CMAKE_HOME_DIRECTORY@\doc\webcruft\SimGrid.ico"\r
 \r
 # set the default installation directory\r
@@ -178,6 +178,22 @@ Section "Examples" ExamplesSection
        createShortCut  "$SMPROGRAMS\SimGrid\HelloWorld project.lnk"    "$INSTDIR\examples\HelloWorld"  \r
        \r
 SectionEnd\r
+Section "Pcre library" PCRESection     \r
+       # install pcre library\r
+       CreateDirectory $INSTDIR\GnuWin32\r
+       setOutPath $INSTDIR\GnuWin32\r
+       file "@PATH_PCRE_LICENCE@\LICENCE"\r
+\r
+       CreateDirectory $INSTDIR\GnuWin32\lib\r
+       setOutPath $INSTDIR\GnuWin32\lib\r
+       file @PATHLIBPCRE@\libpcre.a\r
+       file @PATHLIBPCRE@\libpcreposix.a\r
+       \r
+       CreateDirectory $INSTDIR\GnuWin32\include\r
+       setOutPath $INSTDIR\GnuWin32\include\r
+       file @PATH_PCRE_H@\pcre.h\r
+       file @PATH_PCRE_H@\pcreposix.h\r
+SectionEnd\r
 \r
 # default section start\r
 section        \r
@@ -197,6 +213,9 @@ section
        WriteRegExpandStr ${env_hklm} SIMGRID_ROOT $INSTDIR\r
        WriteRegExpandStr ${env_hklm} SIMGRID_VERSION @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\r
 \r
+       WriteRegExpandStr ${env_hklm} SIMGRID_PCRE_LIBRARY_PATH $INSTDIR\GnuWin32\r
+       WriteRegExpandStr ${env_hklm} SIMGRID_PCRE_LIBRARY_VERSION "8.12"\r
+\r
        WriteRegStr HKCU "SOFTWARE\SimGrid" "Version" "@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@"\r
        WriteRegStr HKCU "SOFTWARE\SimGrid" "InstallPath" "$INSTDIR"\r
        \r
@@ -209,17 +228,20 @@ LangString DESC_LibSection                ${LANG_ENGLISH} "Install Simgrid and gras libraries
 LangString DESC_BinSection             ${LANG_ENGLISH} "Install some useful tools for Simgrid."\r
 LangString DESC_DocSection             ${LANG_ENGLISH} "Generated (doxygen) documentation."\r
 LangString DESC_ExamplesSection ${LANG_ENGLISH} "Simgrid's HelloWorld example and some classical platforms."\r
+LangString DESC_PCRESection    ${LANG_ENGLISH} "Install the PCRE and PCREPOSIX libraries for SimGrid."\r
 \r
 LangString DESC_LibSection             ${LANG_FRENCH}  "Installer les librairies Simgrid et Gras et leurs Entêtes."\r
 LangString DESC_BinSection             ${LANG_FRENCH}  "Installer les outils optionnels."\r
 LangString DESC_DocSection             ${LANG_FRENCH}  "Installer la documentation."\r
 LangString DESC_ExamplesSection ${LANG_FRENCH}         "Installer un exemple 'HelloWorld' et des fichiers de plate-formes types."\r
+LangString DESC_PCRESection    ${LANG_FRENCH}  "Installer les librairies PCRE et PCREPOSIX for SimGrid."\r
 \r
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\r
   !insertmacro MUI_DESCRIPTION_TEXT ${LibSection}              $(DESC_LibSection)\r
   !insertmacro MUI_DESCRIPTION_TEXT ${BinSection}              $(DESC_BinSection)\r
   !insertmacro MUI_DESCRIPTION_TEXT ${DocSection}              $(DESC_DocSection)\r
   !insertmacro MUI_DESCRIPTION_TEXT ${ExamplesSection}         $(DESC_ExamplesSection)\r
+  !insertmacro MUI_DESCRIPTION_TEXT ${PCRESection}             $(DESC_PCRESection)\r
 !insertmacro MUI_FUNCTION_DESCRIPTION_END\r
 \r
 # create a section to define what the uninstaller does.\r
@@ -333,9 +355,14 @@ section "Uninstall"
        RMDir  /r "$INSTDIR\examples"\r
        RMDir  "$SMPROGRAMS\SimGrid"\r
        \r
+       # delete PCRE\r
+       RMDir   "$INSTDIR\GnuWin32"\r
+       \r
        # Delete variable\r
        DeleteRegValue ${env_hklm} SIMGRID_ROOT\r
        DeleteRegValue ${env_hklm} SIMGRID_VERSION\r
+       DeleteRegValue ${env_hklm} SIMGRID_PCRE_LIBRARY_PATH\r
+       DeleteRegValue ${env_hklm} SIMGRID_PCRE_LIBRARY_VERSION\r
       DeleteRegKey HKCU "SOFTWARE\SimGrid"\r
     \r
 # uninstall section end\r
index 2fcbf69..4a6a71c 100644 (file)
@@ -2,7 +2,7 @@ This is a very simple example to explain how to compile with simgrid.
 
 1) How to compile an example: (HelloWorld)
 
-- Run "Git bash" (installed with git).
+- Run "Git bash" (installed with git) or windows shell "cmd".
 - Open HelloWorld Directory ('cd' command line).
 - Create a build directory and change directory. (optional)
 - Type 'cmake -G"Unix Makefiles" <path_to_HelloWorld_project>'
@@ -17,7 +17,7 @@ This is a very simple example to explain how to compile with simgrid.
        It allows to configure the project.
 - FindPCRE.cmake
        Simgrid needs pcre regular expression.
-       This finds and links to the pcre library.
+       This finds and links to the pcre library (Normally included into Simgrid directory "GnuWin32").
 - README
        This explaination.
        
index 5dc8959..757eb43 100644 (file)
@@ -57,10 +57,19 @@ int makecontext(ucontext_t * ucp, void (*func) (), int argc, ...)
         return -1;\r
   }\r
   \r
-      /* Set the instruction and the stack pointer */ \r
-      ucp->uc_mcontext.Eip = (unsigned long) func;\r
+      /* Set the instruction and the stack pointer */\r
+  #ifdef I_X86_\r
+  ucp->uc_mcontext.Eip = (unsigned long) func;\r
   ucp->uc_mcontext.Esp = (unsigned long) sp - 4;\r
-  \r
+  #endif\r
+  #ifdef _IA64_\r
+  #  error "_IA64_"\r
+  #endif\r
+  #ifdef _AMD64_\r
+  ucp->uc_mcontext.Rip = (unsigned long long) func;\r
+  ucp->uc_mcontext.Rsp = (unsigned long long) sp - 8;\r
+  #endif\r
+\r
       /* Save/Restore the full machine context */ \r
       ucp->uc_mcontext.ContextFlags = CONTEXT_FULL;\r
   \r
index 5c1d5d4..29421a9 100644 (file)
@@ -5,8 +5,10 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
 add_executable(basic_parsing_test basic_parsing_test.c)
 add_executable(is_router_test is_router_test.c)
 add_executable(flatifier flatifier.c)
+if(NOT WIN32)
 add_executable(evaluate_parse_time Evaluate_parse_time.c)
 add_executable(evaluate_get_route_time Evaluate_get_route_time.c)
+endif(NOT WIN32)
 
 ### Add definitions for compile
 if(NOT WIN32)
@@ -16,10 +18,7 @@ target_link_libraries(basic_parsing_test simgrid m)
 target_link_libraries(is_router_test simgrid m)
 target_link_libraries(flatifier simgrid m)
 else(NOT WIN32)
-target_link_libraries(evaluate_get_route_time simgrid)
-target_link_libraries(evaluate_parse_time simgrid)
 target_link_libraries(basic_parsing_test simgrid)
 target_link_libraries(is_router_test simgrid)
 target_link_libraries(flatifier simgrid)
-endif(NOT WIN32)
-
+endif(NOT WIN32)
\ No newline at end of file