Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a new arch to gras. WIN64
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index 910082a..e995279 100644 (file)
@@ -352,36 +352,18 @@ endif(pthread)
 ###############
 ## SVN version check
 ##
-if(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.svn)
-       find_file(SVN ".svn" ${CMAKE_HOME_DIRECTORY})
-       exec_program("svnversion ${CMAKE_HOME_DIRECTORY}" OUTPUT_VARIABLE "SVN_VERSION")
-       message(STATUS "svn version ${SVN_VERSION}")
-else(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.svn)
-       exec_program("git config --get svn-remote.svn.url"
-               OUTPUT_VARIABLE url
-               RETURN_VALUE ret)
-endif(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.svn)
+exec_program("git remote" OUTPUT_VARIABLE remote RETURN_VALUE ret)
+exec_program("git config --get remote.${remote}.url" OUTPUT_VARIABLE url RETURN_VALUE ret)
 
 if(url)
        exec_program("git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --oneline -1" OUTPUT_VARIABLE "GIT_VERSION")
+       message(STATUS "Git version: ${GIT_VERSION}")
        exec_program("git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log -n 1 --format=%ai ." OUTPUT_VARIABLE "GIT_DATE")
-       
+       message(STATUS "Git date: ${GIT_DATE}")
        string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}")
        STRING(REPLACE " +0000" "" GIT_DATE ${GIT_DATE})
        STRING(REPLACE " " "~" GIT_DATE ${GIT_DATE})
        STRING(REPLACE ":" "-" GIT_DATE ${GIT_DATE})
-       
-       exec_program("git svn info" ${CMAKE_HOME_DIRECTORY}
-               OUTPUT_VARIABLE "GIT_SVN_VERSION")
-       string(REPLACE "\n" ";" GIT_SVN_VERSION ${GIT_SVN_VERSION})
-       foreach(line ${GIT_SVN_VERSION})
-               string(REGEX MATCH "^Revision:.*" line_good ${line})
-               if(line_good)
-                       string(REPLACE "Revision: " ""
-                               line_good ${line_good})
-                       set(SVN_VERSION ${line_good})
-               endif(line_good)
-       endforeach(line ${GIT_SVN_VERSION})
 endif(url)
 
 
@@ -404,6 +386,36 @@ else(BIGENDIAN)
   set(GRAS_BIGENDIAN 0)
 endif(BIGENDIAN)
 
+# The syntax of this magic string is given in src/gras/DataDesc/ddt_convert.c
+# It kinda matches the values that the gras_arch_desc_t structure can take
+
+# Basically, the syntax is one char l or B for endianness (little or Big)
+#   then there is a bunch of blocks separated by _.  
+# C block is for char, I block for integers, P block for pointers and
+#   D block for floating points
+# For each block there is an amount of chuncks separated by :, each of
+#   them describing a data size. For example there is only one chunk
+#   in the char block, because no architecture provide several sizes
+#   of chars. In integer block, there is 4 chunks: "short int", "int",
+#   "long int", "long long int". There is 2 pointer chunks for data
+#   pointers and pointers on functions (thanks to the AMD64 madness).
+#   Thee two floating points chuncks are for "float" and "double".
+# Each chunk is of the form datasize/minimal_alignment_size
+
+# These informations are used to convert a data stream from one
+#    formalism to another. Only the GRAS_ARCH is transfered in the
+#    stream, and it it of cruxial importance to keep these detection
+#    information here synchronized with the data hardcoded in the
+#    source in src/gras/DataDesc/ddt_convert.c 
+
+# If you add something here (like a previously unknown architecture),
+#    please add it to the source code too. 
+# Please do not modify stuff here since it'd break the GRAS protocol.
+#     If you really need to change stuff, please also bump
+#    GRAS_PROTOCOL_VERSION in src/gras/Msg/msg_interface.h
+
+SET(GRAS_THISARCH "none")
+
 if(val_big MATCHES "l_C:1/1:_I:2/1:4/1:4/1:8/1:_P:4/1:4/1:_D:4/1:8/1:")
        #gras_arch=0; gras_size=32; gras_arch_name=little32_1;
        SET(GRAS_ARCH_32_BITS 1)
@@ -429,38 +441,47 @@ if(val_big MATCHES "l_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:")
        SET(GRAS_ARCH_32_BITS 0)
        SET(GRAS_THISARCH 4)
 endif(val_big MATCHES "l_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:")
+if(val_big MATCHES "l_C:1/1:_I:2/2:4/4:4/4:8/8:_P:8/8:8/8:_D:4/4:8/8:") 
+       #gras_arch=11; gras_size=64; gras_arch_name=little64_2;
+       SET(GRAS_ARCH_32_BITS 0)
+       SET(GRAS_THISARCH 5)
+endif(val_big MATCHES "l_C:1/1:_I:2/2:4/4:4/4:8/8:_P:8/8:8/8:_D:4/4:8/8:")
 
 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:") 
        #gras_arch=5; gras_size=32; gras_arch_name=big32;
        SET(GRAS_ARCH_32_BITS 1)
-       SET(GRAS_THISARCH 5)
+       SET(GRAS_THISARCH 6)
 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:")
 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/4:") 
        #gras_arch=6; gras_size=32; gras_arch_name=big32_8_4;
        SET(GRAS_ARCH_32_BITS 1)
-       SET(GRAS_THISARCH 6)
+       SET(GRAS_THISARCH 7)
 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/4:")
 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:") 
        #gras_arch=7; gras_size=32; gras_arch_name=big32_4;
        SET(GRAS_ARCH_32_BITS 1)
-       SET(GRAS_THISARCH 7)
+       SET(GRAS_THISARCH 8)
 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:")
 if(val_big MATCHES "B_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2:") 
        #gras_arch=8; gras_size=32; gras_arch_name=big32_2;
        SET(GRAS_ARCH_32_BITS 1)
-       SET(GRAS_THISARCH 8)
+       SET(GRAS_THISARCH 9)
 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2:") 
 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:") 
        #gras_arch=9; gras_size=64; gras_arch_name=big64;
        SET(GRAS_ARCH_32_BITS 0)
-       SET(GRAS_THISARCH 9)
+       SET(GRAS_THISARCH 10)
 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:")
 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/4:") 
        #gras_arch=10;gras_size=64; gras_arch_name=big64_8_4;
        SET(GRAS_ARCH_32_BITS 0)
-       SET(GRAS_THISARCH 10)
+       SET(GRAS_THISARCH 11)
 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/4:") 
 
+if(GRAS_THISARCH MATCHES "none")
+    message(STATUS "architecture: ${val_big}")
+    message(FATAL_ERROR "GRAS_THISARCH is empty: '${GRAS_THISARCH}'")  
+endif(GRAS_THISARCH MATCHES "none")
 
 # Check architecture signature end
 try_run(RUN_GRAS_VAR COMPILE_GRAS_VAR