]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
cmake on 64 bits
authoradam <adam>
Fri, 11 Jun 2010 13:06:47 +0000 (13:06 +0000)
committeradam <adam>
Fri, 11 Jun 2010 13:06:47 +0000 (13:06 +0000)
salome_adm/cmake_files/FindPLATFORM.cmake
salome_adm/cmake_files/am2cmake.py

index 01f1e1512618a7af4019eb07155f99a11f74ada6..f467aae1a3477ea126a63e2260bf04af666af4a4 100644 (file)
@@ -69,7 +69,7 @@ ELSE(WINDOWS)
   SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} -ldl)
 ENDIF(WINDOWS)
 
-SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4)
+SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4)
 
 #  SET(PLATFORM_CPPFLAGS)
 #  #  #  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT -D_CRT_SECURE_NO_WARNINGS)
index 8e0774b1542b157557921752a3344e37889acdd3..8dafe3ee71e610b4ba2091da662805ac77d0a27b 100644 (file)
@@ -1386,6 +1386,13 @@ class CMakeFile(object):
         SET(var ${var} ${AM_CPPFLAGS})
         SET(var ${var} ${AM_CXXFLAGS})
         ''')
+        # --
+        newlines.append(r'''
+        IF(type STREQUAL STATIC)
+        SET(var ${var} -fPIC)
+        ENDIF(type STREQUAL STATIC)
+        ''')
+        # --
         if self.module == "yacs":
             newlines.append(r'''
             SET(var ${var} -DYACS_PTHREAD)
@@ -1493,9 +1500,15 @@ class CMakeFile(object):
         STRING(REPLACE ".f" ".c" src ${src})
         SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src})
         SET(output ${src})
+        SET(cmd f2c)
+        IF(NOT WINDOWS)
+        IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
+        SET(cmd valgrind f2c)  # f2c seems to be buggy on 64 bits ... but with valgrind, it works :)
+        ENDIF()
+        ENDIF(NOT WINDOWS)
         ADD_CUSTOM_COMMAND(
         OUTPUT ${output}
-        COMMAND f2c ${input}
+        COMMAND ${cmd} ${input}
         MAIN_DEPENDENCY ${input}
         )
         ELSE(src STREQUAL trte.f)