Commits

Abhishek Kulkarni committed 47b18fd Draft

svn up to r23599

Comments (0)

Files changed (331)

config/ompi_check_package.m4

 #                         University of Stuttgart.  All rights reserved.
 # Copyright (c) 2004-2005 The Regents of the University of California.
 #                         All rights reserved.
+# Copyright (c) 2012      Cisco Systems, Inc.  All rights reserved.
+# Copyright (c) 2012      Oracle and/or its affiliates.  All rights reserved.
 # $COPYRIGHT$
 # 
 # Additional copyrights may follow
 # $HEADER$
 #
 
-# _OMPI_CHECK_PACKAGE_HEADER(prefix, header, dir-prefix,
-#                            [action-if-found], [action-if-not-found])
+# _OMPI_CHECK_PACKAGE_HEADER(prefix, header, dir-prefix, 
+#                            [action-if-found], [action-if-not-found],
+*                            includes)
 # --------------------------------------------------------------------
 AC_DEFUN([_OMPI_CHECK_PACKAGE_HEADER], [
     # This is stolen from autoconf to peek under the covers to get the
           [AS_IF([test "$3" != ""],
                  [$1_CPPFLAGS="$$1_CPPFLAGS -I$3/include"
                   CPPFLAGS="$CPPFLAGS -I$3/include"])
-           AC_CHECK_HEADER([$2], [$4], [$5])],
+          AC_CHECK_HEADER([$2], [$4], [$5], [$6])],
           [$4])
-    unset ompi_check_package_header_happy])
+    unset ompi_check_package_header_happy
     
-    dnl AS_VAR_POPDEF([ompi_Header])dnl
+    AS_VAR_POPDEF([ompi_Header])dnl
 ])
 
 
 #                    extra-libraries, 
 #                    dir-prefix,
 #                    libdir-prefix,
-#                    [action-if-found], [action-if-not-found]
+#                    [action-if-found], [action-if-not-found],
+#                    includes)
 # -----------------------------------------------------------
 # check for package defined by header and libs, and probably
 # located in dir-prefix, possibly with libs in libdir-prefix.
     ompi_check_package_$1_orig_LDFLAGS="$$1_LDFLAGS"
     ompi_check_package_$1_orig_LIBS="$$1_LIBS"
 
-    _OMPI_CHECK_PACKAGE_HEADER([$1], [$2], [$6],
+    _OMPI_CHECK_PACKAGE_HEADER([$1], [$2], [$6], 
           [_OMPI_CHECK_PACKAGE_LIB([$1], [$3], [$4], [$5], [$6], [$7],
                 [ompi_check_package_happy="yes"],
                 [ompi_check_package_happy="no"])],
-          [ompi_check_package_happy="no"])
+          [ompi_check_package_happy="no"],
+          [$10])
 
     AS_IF([test "$ompi_check_package_happy" = "yes"],
           [$8],
 #                         University of Stuttgart.  All rights reserved.
 # Copyright (c) 2004-2005 The Regents of the University of California.
 #                         All rights reserved.
- * Copyright (c) 2006-2012 Cisco Systems, Inc.  All rights reserved.
+# * Copyright (c) 2006-2012 Cisco Systems, Inc.  All rights reserved.
 # Copyright (c) 2006-2008 Sun Microsystems, Inc.  All rights reserved.
 # Copyright (c) 2006-2011 Los Alamos National Security, LLC.  All rights
 #                         reserved.
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(config)
 
+# Get our platform support file.  This has to be done very, very early
+# because it twiddles random bits of autoconf
+OMPI_LOAD_PLATFORM
+
 #
 # Start it up
 #
 AS_IF([test -z "$CFLAGS_save"], [CFLAGS=])
 CFLAGS_save=
 
-# Get our platform support file.  This has to be done very, very early
-# because it twiddles random bits of autoconf
-OMPI_LOAD_PLATFORM
-
 #
 # Init automake
 #

contrib/Makefile.am

         platform/win32/CMakeModules/ompi_base_checks.cmake \
         platform/win32/CMakeModules/ompi_define.cmake \
         platform/win32/CMakeModules/ompi_ext_config.cmake \
-        platform/win32/CMakeModules/f77_check.cmake \
-        platform/win32/CMakeModules/f77_check_real16_c_equiv.cmake \
-        platform/win32/CMakeModules/f77_check_type.cmake \
-        platform/win32/CMakeModules/f77_find_ext_symbol_convention.cmake \
-        platform/win32/CMakeModules/f77_get_alignment.cmake \
-        platform/win32/CMakeModules/f77_get_fortran_handle_max.cmake \
-        platform/win32/CMakeModules/f77_get_sizeof.cmake \
-        platform/win32/CMakeModules/f77_get_value_true.cmake \
         platform/win32/CMakeModules/find_ccp.cmake \
         platform/win32/CMakeModules/find_flex.cmake \
         platform/win32/CMakeModules/find_libltdl.cmake \
         platform/win32/CMakeModules/opal_event_config.cmake \
         platform/win32/CMakeModules/opal_get_version.cmake \
         platform/win32/CMakeModules/opal_functions.cmake \
-        platform/win32/CMakeModules/setup_f77.cmake \
         platform/win32/ConfigFiles/revision.in \
+        platform/win32/CMakeModules/fortran_get_value_true.cmake \
+        platform/win32/CMakeModules/fortran_check.cmake \
+        platform/win32/CMakeModules/fortran_get_alignment.cmake \
+        platform/win32/CMakeModules/fortran_check_type.cmake \
+        platform/win32/CMakeModules/fortran_find_ext_symbol_convention.cmake \
+        platform/win32/CMakeModules/fortran_get_fortran_handle_max.cmake \
+        platform/win32/CMakeModules/fortran_get_sizeof.cmake \
+        platform/win32/CMakeModules/setup_fortran.cmake \
+        platform/win32/CMakeModules/fortran_check_real16_c_equiv.cmake \
 	platform/cisco/macosx-dynamic \
 	platform/cisco/macosx-dynamic.conf \
 	platform/cisco/linux \

contrib/dist/linux/buildrpm.sh

 
 specfile="openmpi.spec"
 prefix=${prefix:-"/opt/openmpi"}
-rpmbuild_options=${rpmbuild_options:-"--define 'mflags -j4'"}
+rpmbuild_options=${rpmbuild_options:-"--define 'mflags -j4' --define '_source_filedigest_algorithm md5'  --define '_binary_filedigest_algorithm md5'"}
 configure_options=${configure_options:-""}
 
 # Helpful when debugging

contrib/platform/iu/odin/debug

 enable_dlopen=no
 enable_pty_support=no
 with_blcr=no
-with_openib=no
+with_openib=yes
 with_memory_manager=no
 enable_mem_debug=yes
 enable_mem_profile=no
 enable_picky=yes
 enable_debug=yes
 enable_shared=yes
-enable_static=no
+enable_static=yes
 with_slurm=yes
 with_pmi=yes
 enable_contrib_no_build=libnbc,vt

contrib/platform/win32/CMakeModules/f77_check.cmake

-# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, 
-#                         University of Stuttgart.  All rights reserved.
-#
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-
-# OMPI_F77_CHECK(Fortran type, c type required, 
-#                types to search, expected size)
-#----------------------------------------------------------
-# Check Fortran type, including:
-# - whether compiler supports or not
-# - size of type
-# - equal to expected size
-# - alignment
-# - associated C type
-#
-# types to search is a list of values
-
-MACRO(OMPI_F77_CHECK FORTRAN_TYPE C_TYPE TYPE_LIST EXPECTED_SIZE)
-
-  STRING(REPLACE "*" "" TYPE_NAME ${FORTRAN_TYPE})
-  STRING(REPLACE " " "_" TYPE_NAME ${TYPE_NAME})
-  STRING(TOLOWER ${TYPE_NAME} TYPE_NAME_L)
-
-  INCLUDE(F77_check_type)
-  INCLUDE(F77_get_alignment)
-  INCLUDE(F77_get_sizeof)
-  INCLUDE(ompi_find_type)
-
-  SET(ofc_expected_size ${EXPECTED_SIZE})
-  SET(ofc_have_type 0)
-  SET(ofc_type_size ${SIZEOF_INT})
-  SET(ofc_type_alignment ${SIZEOF_INT})
-  SET(ofc_c_type ${ompi_fortran_bogus_type_t})
-
-  IF(OMPI_WANT_F77_BINDINGS)
-    IF(NOT DEFINED F77_SETUP_${TYPE_NAME}_DONE)
-
-    OMPI_F77_CHECK_TYPE(${FORTRAN_TYPE} ofc_have_type)
-
-    IF(ofc_have_type)
-      # What is the size of this type?
-
-      # NOTE: Some Fortran compilers actually will return that a
-      # type exists even if it doesn't support it -- the compiler
-      # will automatically convert the unsupported type to a type
-      # that it *does* support.  For example, if you try to use
-      # INTEGER*16 and the compiler doesn't support it, it may well
-      # automatically convert it to INTEGER*8 for you (!).  So we
-      # have to check the actual size of the type once we determine
-      # that the compiler doesn't error if we try to use it
-      # (i.e,. the compiler *might* support that type).  If the size
-      # doesn't match the expected size, then the compiler doesn't
-      # really support it.
-      OMPI_F77_GET_SIZEOF(${FORTRAN_TYPE} ofc_type_size)
-
-      IF(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}")
-        MESSAGE(STATUS "*** Fortran 77 ${FORTRAN_TYPE} does not have expected size!")
-        MESSAGE(STATUS "*** Expected ${ofc_expected_size}, got ${ofc_type_size}")
-        MESSAGE(STATUS "*** Disabling MPI support for Fortran 77 ${FORTRAN_TYPE}")
-        SET(ofc_have_type 0)
-      ELSE(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}")
-        # Look for a corresponding C type (will abort by itself if the
-        # type isn't found and we need it)
-        IF(NOT "${TYPE_LIST}" STREQUAL "")
-          OMPI_FIND_TYPE(${FORTRAN_TYPE} "${TYPE_LIST}" ${C_TYPE} ${ofc_type_size} ofc_c_type)
-        ENDIF(NOT "${TYPE_LIST}" STREQUAL "")
-
-        OMPI_F77_GET_ALIGNMENT(${FORTRAN_TYPE} ofc_type_alignment)
-
-      ENDIF(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}")
-      SET(F77_SETUP_${TYPE_NAME}_DONE TRUE CACHE INTERNAL "F77 ${TYPE_NAME} check done or not.")
-     ENDIF(ofc_have_type)
-
-    SET(OMPI_HAVE_FORTRAN_${TYPE_NAME}_C ${ofc_have_type} CACHE INTERNAL "OMPI_HAVE_FORTRAN_${TYPE_NAME}")
-    SET(OMPI_SIZEOF_FORTRAN_${TYPE_NAME}_C ${ofc_type_size} CACHE INTERNAL "OMPI_SIZEOF_FORTRAN_${TYPE_NAME}")
-    SET(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}_C ${ofc_type_alignment} CACHE INTERNAL "OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}")
-
-    ENDIF(NOT DEFINED F77_SETUP_${TYPE_NAME}_DONE)
-
-    SET(OMPI_HAVE_FORTRAN_${TYPE_NAME} ${OMPI_HAVE_FORTRAN_${TYPE_NAME}_C}
-        CACHE INTERNAL "OMPI_HAVE_FORTRAN_${TYPE_NAME}")
-    SET(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} ${OMPI_SIZEOF_FORTRAN_${TYPE_NAME}_C}
-        CACHE INTERNAL "OMPI_SIZEOF_FORTRAN_${TYPE_NAME}")
-    SET(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} ${OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}_C}
-        CACHE INTERNAL "OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}")
-
-  ELSEIF(NOT OMPI_WANT_F77_BINDINGS)
-    UNSET(F77_SETUP_${TYPE_NAME}_DONE)
-    SET(OMPI_HAVE_FORTRAN_${TYPE_NAME} ${ofc_have_type} CACHE INTERNAL "OMPI_HAVE_FORTRAN_${TYPE_NAME}")
-    SET(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} ${ofc_type_size} CACHE INTERNAL "OMPI_SIZEOF_FORTRAN_${TYPE_NAME}")
-    SET(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} ${ofc_type_alignment} CACHE INTERNAL "OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}")
-  ENDIF(OMPI_WANT_F77_BINDINGS)
-
-  IF(NOT "${TYPE_LIST}" STREQUAL "")
-    SET(ompi_fortran_${TYPE_NAME_L}_t ${ofc_c_type} CACHE INTERNAL "ompi_fortran_${TYPE_NAME_L}_t")
-  ENDIF(NOT "${TYPE_LIST}" STREQUAL "")
-
-  #MESSAGE("OMPI_HAVE_FORTRAN_${TYPE_NAME}:${OMPI_HAVE_FORTRAN_${TYPE_NAME}}")
-  #MESSAGE("OMPI_SIZEOF_FORTRAN_${TYPE_NAME}:${OMPI_SIZEOF_FORTRAN_${TYPE_NAME}}")
-  #MESSAGE("OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}:${OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}}")
-  #MESSAGE("ompi_fortran_${TYPE_NAME_L}_t:${ompi_fortran_${TYPE_NAME_L}_t}")
-
-  OMPI_DEF_VAR(OMPI_HAVE_FORTRAN_${TYPE_NAME} "Whether we have Fortran 77 `${FORTRAN_TYPE}' or not." 0 1)
-  OMPI_DEF_VAR(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} "Size of Fortran 77 `${FORTRAN_TYPE}'." 0 1)
-  OMPI_DEF_VAR(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} "Alignment of Fortran 77 `${FORTRAN_TYPE}'." 0 1)
-  OMPI_DEF_VAR(ompi_fortran_${TYPE_NAME_L}_t "C type corresponding to Fortran 77 `${FORTRAN_TYPE}'." 0 0)
-
-ENDMACRO(OMPI_F77_CHECK FORTRAN_TYPE C_TYPE TYPE_LIST EXPECTED_SIZE)

contrib/platform/win32/CMakeModules/f77_check_real16_c_equiv.cmake

-# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, 
-#                         University of Stuttgart.  All rights reserved.
-#
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-
-# OMPI_F77_CHECK_REAL16_C_EQUIV
-# ----------------------------------------------------
-MACRO(OMPI_F77_CHECK_REAL16_C_EQUIV)
-  SET(OMPI_REAL16_MATCHES_C 0)
-
-  IF(OMPI_WANT_F77_BINDINGS AND OMPI_HAVE_FORTRAN_REAL16 AND NOT DEFINED REAL16_MATCHES_CHECK_DONE)
-    IF(NOT ${ompi_fortran_real16_t} STREQUAL "")
-      STRING(TOUPPER ${ompi_fortran_real16_t} REAL16_C_TYPE)
-
-      IF(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE})
-        OMPI_F77_MAKE_C_FUNCTION(ompi_ac_c_fn c)
-        FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c
-          "#include <stdio.h>\n"
-          "#include <stdlib.h>\n"
-          "\n"
-          "#ifdef __cplusplus\n"
-          "extern \"C\" {\n"
-          "#endif\n"
-          "void ${ompi_ac_c_fn}(${ompi_fortran_real16_t} *a) {\n"
-          "    FILE *fp = fopen(\"conftestval\", \"w\");\n"
-          "    if (NULL == fp) exit(1);\n"
-          "    fprintf(fp, \"%s\n\", (1.1L == *a) ? \"yes\" : \"no\");\n"
-          "    fclose(fp);\n"
-          "}\n"
-          "#ifdef __cplusplus\n"
-          "}\n"
-          "#endif\n")
-
-        FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_f.f 
-          "\tprogram bogus\n"
-          "\tREAL*16 :: foo\n"
-          "\tfoo = 1.1\n"
-          "\tcall c(foo)\n"
-          "\tend program bogus\n")
-
-        EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest_c.c ${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE}
-          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-          OUTPUT_VARIABLE OUTPUT
-          RESULT_VARIABLE RESULT
-          ERROR_VARIABLE ERROR)
-      
-        EXECUTE_PROCESS(COMMAND ${F77} conftest_f.f conftest_c.obj ${F77_OUTPUT_OBJ}conftest
-          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-          OUTPUT_VARIABLE OUTPUT
-          RESULT_VARIABLE RESULT
-          ERROR_VARIABLE ERROR)
-
-        EXECUTE_PROCESS(COMMAND conftest.exe
-          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-          OUTPUT_VARIABLE OUTPUT
-          RESULT_VARIABLE RESULT
-          ERROR_VARIABLE ERROR)
-
-        IF(RESULT)
-          UNSET(REAL16_MATCHES_CHECK_DONE CACHE)
-          MESSAGE(FATAL_ERROR "Can not determine if REAL*16 bit-matches C.")
-        ELSE(RESULT)
-          IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
-            # read out type size value from the file, and write back to the output variable
-            FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE})
-            MESSAGE(STATUS "Check if REAL*16 bit-matches C...${OUTPUT_VARIABLE}")
-            SET(OMPI_REAL16_MATCHES_C 1)
-            SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.")
-          ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
-            UNSET(REAL16_MATCHES_CHECK_DONE CACHE)
-            MESSAGE(STATUS "Check if REAL*16 bit-matches C...failed")
-          ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
-        ENDIF(RESULT)
-
-      ELSE(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE})
-        SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.")
-        MESSAGE(STATUS "Check if REAL*16 bit-matches C...skipped. (no corresponding C type)")
-      ENDIF(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE})
-
-    ELSE(NOT ${ompi_fortran_real16_t} STREQUAL "")
-      SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.")
-      MESSAGE(STATUS "Check if REAL*16 bit-matches C...skipped. (no REAL*16)")
-    ENDIF(NOT ${ompi_fortran_real16_t} STREQUAL "")
-
-  ELSEIF(NOT OMPI_WANT_F77_BINDINGS)
-    UNSET(REAL16_MATCHES_CHECK_DONE CACHE)
-  ENDIF(OMPI_WANT_F77_BINDINGS AND OMPI_HAVE_FORTRAN_REAL16  AND NOT DEFINED REAL16_MATCHES_CHECK_DONE)
-
-  OMPI_DEF_VAR(OMPI_REAL16_MATCHES_C "if REAL*16 bit-matches C." 0 1)
-
-ENDMACRO(OMPI_F77_CHECK_REAL16_C_EQUIV)

contrib/platform/win32/CMakeModules/f77_check_type.cmake

-# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, 
-#                         University of Stuttgart.  All rights reserved.
-#
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-# OMPI_F77_CHECK_TYPE
-#         in: TYPE         - fortran type to check.
-#        out: HAVE_TYPE    - 0/1 whether we have that type.
-# -----------------------------------------------------------------
-
-MACRO(OMPI_F77_CHECK_TYPE TYPE HAVE_TYPE)
-
-  IF(NOT DEFINED ${TYPE_NAME}_CHECK_DONE)
-
-    MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...")
-
-    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_fortran_type.f
-      "\t program main \n"
-      "\t ${TYPE} bogus_variable \n"
-      "\t END \n")
-
-    EXECUTE_PROCESS(COMMAND ${F77} check_fortran_type.f
-      WORKING_DIRECTORY  ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-      OUTPUT_VARIABLE    OUTPUT
-      RESULT_VARIABLE    RESULT
-      ERROR_VARIABLE     ERROR)
-
-    IF(RESULT)
-      SET(${HAVE_TYPE} 0 CACHE INTERNAL "have Fortran ${TYPE}")
-      MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...no")
-    ELSE(RESULT)
-      SET(${HAVE_TYPE} 1 CACHE INTERNAL "have Fortran ${TYPE}")
-      MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...yes")
-    ENDIF(RESULT)
-
-    SET(${TYPE_NAME}_CHECK_DONE TRUE CACHE INTERNAL "${TYPE_NAME} check done")
-
-  ENDIF(NOT DEFINED ${TYPE_NAME}_CHECK_DONE)
-
-ENDMACRO(OMPI_F77_CHECK_TYPE TYPE HAVE_TYPE)

contrib/platform/win32/CMakeModules/f77_find_ext_symbol_convention.cmake

-# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, 
-#                         University of Stuttgart.  All rights reserved.
-#
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-
-MACRO(OMPI_F77_FIND_EXT_SYMBOL_CONVENTION)
-  IF(NOT SYMBOL_CONVENTION_CHECK_DONE)
-    SET(OMPI_F77_DOUBLE_UNDERSCORE 0
-      CACHE INTERNAL "external symbol convention - double underscore")
-    SET(OMPI_F77_SINGLE_UNDERSCORE 0
-      CACHE INTERNAL "external symbol convention - single underscore")
-    SET(OMPI_F77_CAPS 0
-      CACHE INTERNAL "external symbol convention - captital")
-    SET(OMPI_F77_PLAIN 0
-      CACHE INTERNAL "external symbol convention - plain")
-
-    # make sure we know our linking convention...
-    MESSAGE(STATUS "Check ${F77} external symbol convention...")
-    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f
-      "\t subroutine FOO_bar(a) \n"
-      "\t integer a \n"
-      "\t a = 1 \n"
-      "\t return \n"
-      "\t end \n")
-
-    EXECUTE_PROCESS(COMMAND ${F77} ${F77_OPTION_COMPILE} conftest.f ${F77_OUTPUT_OBJ}conftest.lib
-      WORKING_DIRECTORY  ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-      OUTPUT_VARIABLE    OUTPUT
-      RESULT_VARIABLE    RESULT
-      ERROR_VARIABLE     ERROR)
-
-    SET(OUTPUT_OBJ_FILE "conftest.lib")
-
-    # now run dumpbin to generate an output file
-    EXECUTE_PROCESS(COMMAND ${DUMP_UTIL} ${OUTPUT_OBJ_FILE} ${DUMP_UTIL_OPT}
-      WORKING_DIRECTORY  ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-      OUTPUT_VARIABLE    DUMP_OUTPUT
-      RESULT_VARIABLE    RESULT
-      ERROR_VARIABLE     ERROR)
-
-    STRING(REGEX MATCH foo_bar__\n DOUBLE_UNDERSCORE ${DUMP_OUTPUT})
-    STRING(REGEX MATCH foo_bar_\n SINGLE_UNDERSCORE ${DUMP_OUTPUT})
-    STRING(REGEX MATCH FOO_bar\n MIXED_CASE ${DUMP_OUTPUT})
-    STRING(REGEX MATCH foo_bar\n NO_UNDERSCORE ${DUMP_OUTPUT})
-    STRING(REGEX MATCH FOO_BAR\n UPPER_CASE ${DUMP_OUTPUT})
-
-    # set up the corresponding values
-    IF(NOT DOUBLE_UNDERSCORE STREQUAL "")
-      SET(OMPI_F77_DOUBLE_UNDERSCORE 1
-        CACHE INTERNAL "external symbol convention - double underscore")
-      SET(FUNC_NAME "foo_bar__")
-      SET(ompi_cv_f77_external_symbol "double underscore"
-        CACHE INTERNAL "F77 external symbol convention")
-    ELSEIF(NOT SINGLE_UNDERSCORE STREQUAL "")
-      SET(OMPI_F77_SINGLE_UNDERSCORE 1
-        CACHE INTERNAL "external symbol convention - single underscore")
-      SET(FUNC_NAME "foo_bar_")
-      SET(ompi_cv_f77_external_symbol "single underscore"
-        CACHE INTERNAL "F77 external symbol convention")
-    ELSEIF(NOT MIXED_CASE STREQUAL "")
-      SET(OMPI_F77_CAPS 1
-        CACHE INTERNAL "external symbol convention - captital")
-      SET(FUNC_NAME "FOO_bar")
-      SET(ompi_cv_f77_external_symbol "mixed case"
-        CACHE INTERNAL "F77 external symbol convention")
-    ELSEIF(NOT NO_UNDERSCORE STREQUAL "")
-      SET(OMPI_F77_PLAIN 1
-        CACHE INTERNAL "external symbol convention - plain")
-      SET(FUNC_NAME "foo_bar")
-      SET(ompi_cv_f77_external_symbol "no underscore"
-        CACHE INTERNAL "F77 external symbol convention")
-    ELSEIF(NOT UPPER_CASE STREQUAL "")
-      SET(OMPI_F77_CAPS 1
-        CACHE INTERNAL "external symbol convention - captital")
-      SET(FUNC_NAME "FOO_BAR")
-      SET(ompi_cv_f77_external_symbol "upper case"
-        CACHE INTERNAL "F77 external symbol convention")
-    ELSE(NOT UPPER_CASE STREQUAL "")
-      MESSAGE(FATAL_ERROR "unknow Fortran naming convertion.")
-      SET(ompi_cv_f77_external_symbol "unknow")
-    ENDIF(NOT DOUBLE_UNDERSCORE STREQUAL "")
-
-    MESSAGE(STATUS "Check ${F77} external symbol convention...${ompi_cv_f77_external_symbol}")
-
-    # now test if we can link the library with c program
-    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c 
-      "int main(){${FUNC_NAME}();return(0);}")
-
-    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CMakeLists.txt
-      "CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)\n"
-      "PROJECT(conftest_c C)\n"
-      "IF(NOT \"${F77_LIB_PATH}\" STREQUAL \"\")\n"
-      "  LINK_DIRECTORIES(\"${F77_LIB_PATH}\")\n"
-      "ENDIF(NOT \"${F77_LIB_PATH}\" STREQUAL \"\")\n"
-      "LINK_DIRECTORIES(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/)\n"
-      "ADD_EXECUTABLE(conftest_c conftest_c.c)\n"
-      "TARGET_LINK_LIBRARIES(conftest_c ${OUTPUT_OBJ_FILE})\n")
-
-    TRY_COMPILE(
-      TEST_OK
-      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-      conftest_c
-      OUTPUT_VARIABLE MY_OUTPUT)
-
-    #MESSAGE("MY_OUTPUT:${MY_OUTPUT}")
-
-    IF(TEST_OK)
-      SET(SYMBOL_CONVENTION_CHECK_DONE TRUE CACHE INTERNAL "Symbol convention check done.")
-    ELSE(TEST_OK)
-      UNSET(SYMBOL_CONVENTION_CHECK_DONE CACHE)
-      MESSAGE(STATUS "${MY_OUTPUT}")
-      MESSAGE(STATUS "*** Probably you have to setup the library path of the Fortran compiler.")
-      MESSAGE(FATAL_ERROR "C and Fortran 77 compilers are not link compatible.  Cannot continue.")
-    ENDIF(TEST_OK)
-
-  ENDIF(NOT SYMBOL_CONVENTION_CHECK_DONE)
-
-ENDMACRO(OMPI_F77_FIND_EXT_SYMBOL_CONVENTION)
-
-
-# return the corresponding C function name
-# OMPI_F77_MAKE_C_FUNCTION
-#             in: FUNCTION_NAME     -Fortran function name
-#            out: OUTPUT_VARIABLE   -C function name
-MACRO(OMPI_F77_MAKE_C_FUNCTION OUTPUT_VARIABLE FUNCTION_NAME)
-  IF("${ompi_cv_f77_external_symbol}" STREQUAL "double underscore")
-    # so the general rule is that if there is an _ in the function
-    # name, then there are two trailing underscores.  Otherwise,
-    # there is only one trailing underscore.
-    STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE})
-    STRING(REGEX MATCH "_" RESULT ${FUNCTION_NAME})
-    IF("${RESULT}" STREQUAL "")
-      SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}_")
-    ELSE("${RESULT}" STREQUAL "")
-      SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}__")
-    ENDIF("${RESULT}" STREQUAL "")
-  ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "single underscore")
-    STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE})
-    SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}_")
-  ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "mixed case")
-    SET(${OUTPUT_VARIABLE} ${FUNCTION_NAME})
-  ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "no underscore")
-    STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE})
-  ELSEIF("${ompi_cv_f77_external_symbol}" STREQUAL "upper case")
-    STRING(TOUPPER ${FUNCTION_NAME} ${OUTPUT_VARIABLE})
-  ELSE("${ompi_cv_f77_external_symbol}" STREQUAL "double underscore")
-    MESSAGE(FATAL_ERROR "unknown naming convention: ${ompi_cv_f77_external_symbol}")
-  ENDIF("${ompi_cv_f77_external_symbol}" STREQUAL "double underscore")
-
-ENDMACRO(OMPI_F77_MAKE_C_FUNCTION OUTPUT_VARIABLE FUNCTION_NAME)

contrib/platform/win32/CMakeModules/f77_get_alignment.cmake

-# Copyright (c) 2008      High Performance Computing Center Stuttgart, 
-#                         University of Stuttgart.  All rights reserved.
-#
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-# OMPI_F77_GET_ALIGNMENT
-#             in: TYPE         - fortran type to check
-#            out: ALIGNMENT    - alignment to return
-# ----------------------------------------------------
-
-INCLUDE(F77_find_ext_symbol_convention)
-
-MACRO(OMPI_F77_GET_ALIGNMENT TYPE OUTPUT_VARIABLE)
-  MESSAGE(STATUS "Check alignment of Fortran ${TYPE}...")
-
-  OMPI_F77_MAKE_C_FUNCTION(ompi_ac_align_fn align)
-
-  FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f
-    "\t program falign\n"
-    "\t external align\n"
-    "\t $1  w,x,y,z\n"
-    "\t CHARACTER a,b,c\n"
-    "\t common /foo/a,w,b,x,y,c,z\n"
-    "\t call align(w,x,y,z)\n"
-    "\t end \n")
-  
-  IF(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h")
-    SET(ompi_conftest_h "#include \"conftest.h\"")
-  ELSE(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h")
-    SET(ompi_conftest_h "")
-  ENDIF(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h")
-
-  FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c"
-    "\t #include <stdio.h> \n"
-    "\t #include <stdlib.h> \n"
-    "\t $conftest \n"
-    "\t  \n"
-    "\t #ifdef __cplusplus \n"
-    "\t extern \"C\" { \n"
-    "\t #endif \n"
-    "\t void ${ompi_ac_align_fn}(char *w, char *x, char *y, char *z) \n"
-    "\t {   unsigned long aw, ax, ay, az; \n"
-    "\t     FILE *f=fopen(\"conftestval\", \"w\"); \n"
-    "\t     if (!f) exit(1); \n"
-    "\t     aw = (unsigned long) w; \n"
-    "\t     ax = (unsigned long) x; \n"
-    "\t     ay = (unsigned long) y; \n"
-    "\t     az = (unsigned long) z; \n"
-    "\t     if (! ((aw%16)||(ax%16)||(ay%16)||(az%16))) fprintf(f, \"%d\n\", 16); \n"
-    "\t     else if (! ((aw%12)||(ax%12)||(ay%12)||(az%12))) fprintf(f, \"%d\n\", 12); \n"
-    "\t     else if (! ((aw%8)||(ax%8)||(ay%8)||(az%8))) fprintf(f, \"%d\n\", 8); \n"
-    "\t     else if (! ((aw%4)||(ax%4)||(ay%4)||(az%4))) fprintf(f, \"%d\n\", 4); \n"
-    "\t     else if (! ((aw%2)||(ax%2)||(ay%2)||(az%2))) fprintf(f, \"%d\n\", 2); \n"
-    "\t     else fprintf(f, \"%d\n\", 1);  \n"
-    "\t     fclose(f); \n"
-    "\t } \n"
-    "\t #ifdef __cplusplus \n"
-    "\t } \n"
-    "\t #endif \n"
-    )
-
-  EXECUTE_PROCESS(COMMAND ${CL_EXE} /c conftest.c /I${VC_INCLUDE_PATH}
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-    OUTPUT_VARIABLE OUTPUT
-    RESULT_VARIABLE RESULT
-    ERROR_VARIABLE ERROR)
-  
-  EXECUTE_PROCESS(COMMAND ${F77} conftest.f conftest.obj -o conftest
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-    OUTPUT_VARIABLE OUTPUT
-    RESULT_VARIABLE RESULT
-    ERROR_VARIABLE ERROR)
-
-  EXECUTE_PROCESS(COMMAND conftest.exe
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-    OUTPUT_VARIABLE OUTPUT
-    RESULT_VARIABLE RESULT
-    ERROR_VARIABLE ERROR)
-
-  #MESSAGE("RESULT:${RESULT}")
-
-  IF(RESULT)
-    MESSAGE(FATAL_ERROR "Could not determine alignment of ${TYPE}.")
-  ELSE(RESULT)
-    IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
-      # read out type size value from the file, and write back to the output variable
-      FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE})
-      MESSAGE(STATUS "Check alignment of Fortran ${TYPE}...${${OUTPUT_VARIABLE}}")
-    ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
-      MESSAGE(FATAL_ERROR "Could not determine alignment of ${TYPE}.")
-    ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
-  ENDIF(RESULT)
-
-ENDMACRO(OMPI_F77_GET_ALIGNMENT TYPE OUTPUT_VARIABLE)

contrib/platform/win32/CMakeModules/f77_get_fortran_handle_max.cmake

-# Copyright (c) 2010      High Performance Computing Center Stuttgart, 
-#                         University of Stuttgart.  All rights reserved.
-#
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-
-# OMPI_F77_GET_FORTRAN_HANDLE_MAX()
-# -------------------------------------------------------
-# Find the maximum value of fortran integers, then calculate
-# min(INT_MAX, max fortran INTEGER).  This represents the maximum
-# number of fortran MPI handle index.
-MACRO(OMPI_F77_GET_FORTRAN_HANDLE_MAX)
-
-    #store previous value for later use.
-    IF(DEFINED OMPI_FINT_MAX)
-        SET(OMPI_FINT_MAX_OLD ${OMPI_FINT_MAX})
-    ENDIF(DEFINED OMPI_FINT_MAX)
-
-    IF(NOT OMPI_WANT_F77_BINDINGS)
-        SET(OMPI_FINT_MAX 0 CACHE INTERNAL "fortran int max")
-    ELSE(NOT OMPI_WANT_F77_BINDINGS)
-        # Calculate the number of f's that we need to append to the hex
-        # value.  Do one less than we really need becaue we assume the
-        # top nybble is 0x7 to avoid sign issues.
-        MATH(EXPR OMPI_NUMF ${OMPI_SIZEOF_FORTRAN_INTEGER}*2-1)
-        SET(OMPI_FINT_MAX 0x7)
-
-        WHILE(${OMPI_NUMF} GREATER 0)
-            SET(OMPI_FINT_MAX ${OMPI_FINT_MAX}f CACHE INTERNAL "fortran int max")
-            MATH(EXPR OMPI_NUMF ${OMPI_NUMF}-1)
-        ENDWHILE(${OMPI_NUMF} GREATER 0)
-    ENDIF(NOT OMPI_WANT_F77_BINDINGS)
-
-    #OMPI_CINT_MAX doesn't change, check only once and cache the result.
-    IF(NOT DEFINED CINT_MAX_CHECK_DONE)
-
-        FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max.c
-            "#include <stdio.h>\n"
-            "#include <limits.h>\n"
-            "\n"
-            "#ifdef __cplusplus\n"
-            "extern \"C\" {\n"
-            "#endif\n"
-            "\n"
-            "void main()\n"
-            "{\n"
-            "    FILE *fp = fopen(\"fortran_handle_max\", \"w\");\n"
-            "    long cint = INT_MAX;\n"
-            "    fprintf(fp, \"%ld\", cint);\n"
-            "    fclose(fp);\n"
-            "}\n"
-            )
-
-        EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} fortran_handle_max.c ${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE}
-            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-            OUTPUT_VARIABLE OUTPUT
-            RESULT_VARIABLE RESULT
-            ERROR_VARIABLE ERROR)
-
-        EXECUTE_PROCESS(COMMAND fortran_handle_max.exe
-            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-            OUTPUT_VARIABLE OUTPUT
-            RESULT_VARIABLE RESULT
-            ERROR_VARIABLE ERROR)
-
-        IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max)
-            FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max OUTPUT_VALUE)
-            SET(OMPI_CINT_MAX ${OUTPUT_VALUE} CACHE INTERNAL "c int max")
-        ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max)
-            SET(OMPI_CINT_MAX 0)
-        ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_handle_max)
-
-    ENDIF(NOT DEFINED CINT_MAX_CHECK_DONE)
-
-    #whenever OMPI_FINT_MAX changes, recalculate OMPI_FORTRAN_HANDLE_MAX
-    IF(NOT DEFINED OMPI_FINT_MAX OR NOT "${OMPI_FINT_MAX}" STREQUAL "${OMPI_FINT_MAX_OLD}")
-
-        MESSAGE(STATUS "Check Max handle value for Fortran MPI handles...")
-
-        IF(${OMPI_CINT_MAX} EQUAL 0)
-            # wow - something went really wrong.  Be conservative
-            SET(OMPI_FORTRAN_HANDLE_MAX 32767 CACHE INTERNAL "Fortran handle max")
-        ELSEIF(${OMPI_FINT_MAX} EQUAL 0)
-             # we aren't compiling Fortran - just set it to C INT_MAX
-            SET(OMPI_FORTRAN_HANDLE_MAX ${OMPI_CINT_MAX} CACHE INTERNAL "Fortran handle max")
-        ELSE(${OMPI_FINT_MAX} EQUAL 0)
-             # take the lesser of C INT_MAX and Fortran INTEGER
-             # max.  The resulting value will then be storable in
-             # either type.  There's no easy way to do this in
-             # the shell, so make the preprocessor do it.
-            SET(OMPI_FORTRAN_HANDLE_MAX "( ${OMPI_FINT_MAX} < ${OMPI_CINT_MAX} ? ${OMPI_FINT_MAX} : ${OMPI_CINT_MAX} )" CACHE INTERNAL "Fortran handle max")
-        ENDIF(${OMPI_CINT_MAX} EQUAL 0)
-
-        MESSAGE(STATUS "Check Max handle value for Fortran MPI handles...${OMPI_FORTRAN_HANDLE_MAX}")
-        SET(FORTRAN_MAX_HANDLE_CHECK_DONE TRUE CACHE INTERNAL "Fortran handle max check done")
-
-    ENDIF(NOT DEFINED OMPI_FINT_MAX OR NOT "${OMPI_FINT_MAX}" STREQUAL "${OMPI_FINT_MAX_OLD}")
-
-    OMPI_DEF_VAR(OMPI_FORTRAN_HANDLE_MAX "Max handle value for fortran MPI handles, effectively min(INT_MAX, max fortran INTEGER value)." 0 1)
-
-ENDMACRO(OMPI_F77_GET_FORTRAN_HANDLE_MAX)

contrib/platform/win32/CMakeModules/f77_get_sizeof.cmake

-# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, 
-#                         University of Stuttgart.  All rights reserved.
-#
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-
-# OMPI_F77_GET_SIZEOF(type, variable to set)
-# ------------------------------------------
-
-INCLUDE(F77_find_ext_symbol_convention)
-
-MACRO(OMPI_F77_GET_SIZEOF TYPE OUTPUT_VARIABLE)
-  MESSAGE(STATUS "Check size of Fortran 77 ${TYPE}...")
-  
-  OMPI_F77_MAKE_C_FUNCTION(ompi_ac_size_fn size)
-  
-  FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f
-    "\t program fsize \n"
-    "\t external size \n "
-    "\t ${TYPE} x(2) \n"
-    "\t call size(x(1),x(2)) \n"
-    "\t end \n")
-
-  IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h)
-    SET(ompi_conftest_h "#include \"conftest.h\"")
-  ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h)
-    SET(ompi_conftest_h "")    
-  ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.h)
-
-  FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.c
-       "#include <stdio.h> \n"
-       "#include <stdlib.h> \n"
-       "${ompi_conftest_h} \n"
-       "#ifdef __cplusplus \n"
-       "extern \"C\" { \n"
-       "#endif \n"
-       ""
-       "void ${ompi_ac_size_fn}(char *a, char *b) \n"
-       "{ \n"
-       "    int diff = (int) (b - a); \n"
-       "    FILE *f=fopen(\"conftestval\", \"w\"); \n"
-       "    if (!f) exit(1); \n"
-       "    fprintf(f, \"%d\\n\", diff); \n"
-       "    fclose(f); \n"
-       "} \n"
-       "#ifdef __cplusplus \n"
-       "} \n"
-       "#endif \n")
-
-  # generate the C object file
-  EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest.c ${OMPI_C_OUTPUT_OBJ}conftest_c.obj
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-    OUTPUT_VARIABLE OUTPUT
-    RESULT_VARIABLE RESULT
-    ERROR_VARIABLE ERROR)
-
-  # generate the Fortran object file
-  # some Fortran compilers don't allow to compile and link in one step. :-(
-  EXECUTE_PROCESS(COMMAND ${F77} ${F77_OPTION_COMPILE} conftest.f ${F77_OUTPUT_OBJ}conftest.obj
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-    OUTPUT_VARIABLE OUTPUT
-    RESULT_VARIABLE RESULT
-    ERROR_VARIABLE ERROR)
-
-  # link the C and Fortran object files.
-  EXECUTE_PROCESS(COMMAND ${F77} conftest.obj conftest_c.obj ${F77_OUTPUT_EXE}conftest.exe
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-    OUTPUT_VARIABLE OUTPUT
-    RESULT_VARIABLE RESULT
-    ERROR_VARIABLE ERROR)
-
-  EXECUTE_PROCESS(COMMAND conftest.exe
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-    OUTPUT_VARIABLE OUTPUT
-    RESULT_VARIABLE RESULT
-    ERROR_VARIABLE ERROR)
-
-#  MESSAGE("RESULT:${RESULT}")
-
-  IF(RESULT)
-    MESSAGE(FATAL_ERROR "Could not determine size of ${TYPE}.")
-  ELSE(RESULT)
-    IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
-      # read out type size value from the file, and write back to the output variable
-      FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE})
-      STRING(REPLACE "\n" "" ${OUTPUT_VARIABLE} ${${OUTPUT_VARIABLE}})
-      MESSAGE(STATUS "Check size of Fortran 77 ${TYPE}...${${OUTPUT_VARIABLE}}")
-    ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
-      MESSAGE(FATAL_ERROR "Could not determine size of ${TYPE}.")
-    ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
-  ENDIF(RESULT)
-
-ENDMACRO(OMPI_F77_GET_SIZEOF TYPE OUTPUT_VARIABLE)

contrib/platform/win32/CMakeModules/f77_get_value_true.cmake

-# Copyright (c) 2010      High Performance Computing Center Stuttgart, 
-#                         University of Stuttgart.  All rights reserved.
-#
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-
-# OMPI_F77_GET_VALUE_TRUE()
-# -------------------------------------------------------
-# Determine the value of .TRUE. of this Fortran compiler.
-MACRO(OMPI_F77_GET_VALUE_TRUE)
-
-    IF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED FORTRAN_VALUE_CHECK_DONE)
-
-        MESSAGE(STATUS "Check Fortran value for .TRUE. logical type...")
-
-        OMPI_F77_MAKE_C_FUNCTION(ompi_print_logical_fn print)
-
-        FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c 
-            "#include <stdio.h>\n"
-            "#include <stdlib.h>\n"
-            "\n"
-            "#ifdef __cplusplus\n"
-            "extern \"C\" {\n"
-            "#endif\n"
-            "\n"
-            "void ${ompi_print_logical_fn}(${ompi_fortran_logical_t} * logical);\n"
-            "\n"
-            "void ${ompi_print_logical_fn}(${ompi_fortran_logical_t} * logical)\n"
-            "{\n"
-            "    FILE *f=fopen(\"fortran_true_value\", \"w\");\n"
-            "    if (!f) exit(1);\n"
-            "\n"
-            "    if( ${SIZEOF_INT} >= sizeof(${ompi_fortran_logical_t}) ) {\n"
-            "        fprintf(f, \"%d\\n\", (int)*logical);\n"
-            "    } else if (${SIZEOF_LONG} >= sizeof(${ompi_fortran_logical_t}) ) {\n"
-            "	fprintf(f, \"%ld\\n\", (long) *logical);\n"
-            "#ifdef HAVE_LONG_LONG\n"
-            "    } else if (${SIZEOF_LONG_LONG} >= sizeof(${ompi_fortran_logical_t}) ) {\n"
-            "        fprintf(f, \"%lld\\n\", (long long) *logical);\n"
-            "#endif\n"
-            "    } else {\n"
-            "        exit(1);\n"
-            "    }\n"
-            "}\n"
-            "\n"
-            "#ifdef __cplusplus\n"
-            "}\n"
-            "#endif\n")
-
-        FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_f.f
-            "\tprogram main\n"
-            "\tlogical value\n"
-            "\tvalue=.TRUE.\n"
-            "\tCALL print(value)\n"
-            "\tend\n")
-
-        IF(NOT "${C_COMPILER_INCLUDE}" STREQUAL "")
-          SET(EXECUTE_OPT "${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE}")
-        ENDIF(NOT "${C_COMPILER_INCLUDE}" STREQUAL "")
-
-        EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest_c.c ${EXECUTE_OPT} ${OMPI_C_OUTPUT_OBJ}conftest_c.obj
-            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-            OUTPUT_VARIABLE OUTPUT
-            RESULT_VARIABLE RESULT
-            ERROR_VARIABLE ERROR)
-
-        IF(RESULT)
-            MESSAGE(STATUS "${OUTPUT}\n${ERROR}")
-            MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE..  Aborting.")
-        ENDIF(RESULT)
-
-        EXECUTE_PROCESS(COMMAND ${F77} ${F77_OPTION_COMPILE} conftest_f.f ${F77_OUTPUT_OBJ}conftest_f.obj
-            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-            OUTPUT_VARIABLE OUTPUT
-            RESULT_VARIABLE RESULT
-            ERROR_VARIABLE ERROR)
-
-        IF(RESULT)
-            MESSAGE(STATUS "${OUTPUT}\n${ERROR}")
-            MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE..  Aborting.")
-        ENDIF(RESULT)
-
-        EXECUTE_PROCESS(COMMAND ${F77} conftest_f.obj conftest_c.obj ${F77_OUTPUT_EXE}conftest.exe
-            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-            OUTPUT_VARIABLE OUTPUT
-            RESULT_VARIABLE RESULT
-            ERROR_VARIABLE ERROR)
-
-        IF(RESULT)
-            MESSAGE(STATUS "${OUTPUT}\n${ERROR}")
-            MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE..  Aborting.")
-        ENDIF(RESULT)
-
-        EXECUTE_PROCESS(COMMAND conftest.exe
-            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
-            OUTPUT_VARIABLE OUTPUT
-            RESULT_VARIABLE RESULT
-            ERROR_VARIABLE ERROR)
-
-        IF(RESULT)
-            UNSET(FORTRAN_VALUE_CHECK_DONE CACHE)
-            MESSAGE(STATUS "${OUTPUT}\n${ERROR}")
-            MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE..  Aborting.")
-        ELSE(RESULT)
-            IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value)
-              FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value OUTPUT_VALUE)
-              MESSAGE(STATUS "Check Fortran value for .TRUE. logical type...${OUTPUT_VALUE}")
-              SET(OMPI_FORTRAN_VALUE_TRUE ${OUTPUT_VALUE} CACHE INTERNAL "Fortran value true")
-              SET(FORTRAN_VALUE_CHECK_DONE TRUE CACHE INTERNAL "Fortran value true check done")
-            ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value)
-              UNSET(FORTRAN_VALUE_CHECK_DONE CACHE)
-              MESSAGE(FATAL_ERROR "Could not determine value of Fortran .TRUE..  Aborting.")
-            ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_true_value)
-        ENDIF(RESULT)
-
-    ELSEIF(NOT OMPI_WANT_F77_BINDINGS)
-        SET(OMPI_FORTRAN_VALUE_TRUE 0)
-        UNSET(FORTRAN_VALUE_CHECK_DONE CACHE)
-    ENDIF(OMPI_WANT_F77_BINDINGS AND NOT DEFINED FORTRAN_VALUE_CHECK_DONE)
-
-    OMPI_DEF_VAR(OMPI_FORTRAN_VALUE_TRUE "Fortran value for .TRUE. logical type" 0 1)
-
-ENDMACRO(OMPI_F77_GET_VALUE_TRUE)

contrib/platform/win32/CMakeModules/fortran_check.cmake

+# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, 
+#                         University of Stuttgart.  All rights reserved.
+#
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+
+# OMPI_FORTRAN_CHECK(Fortran type, c type required, 
+#                types to search, expected size)
+#----------------------------------------------------------
+# Check Fortran type, including:
+# - whether compiler supports or not
+# - size of type
+# - equal to expected size
+# - alignment
+# - associated C type
+#
+# types to search is a list of values
+
+MACRO(OMPI_FORTRAN_CHECK FORTRAN_TYPE C_TYPE TYPE_LIST EXPECTED_SIZE)
+
+  STRING(REPLACE "*" "" TYPE_NAME ${FORTRAN_TYPE})
+  STRING(REPLACE " " "_" TYPE_NAME ${TYPE_NAME})
+  STRING(TOLOWER ${TYPE_NAME} TYPE_NAME_L)
+
+  INCLUDE(FORTRAN_check_type)
+  INCLUDE(FORTRAN_get_alignment)
+  INCLUDE(FORTRAN_get_sizeof)
+  INCLUDE(ompi_find_type)
+
+  SET(ofc_expected_size ${EXPECTED_SIZE})
+  SET(ofc_have_type 0)
+  SET(ofc_type_size ${SIZEOF_INT})
+  SET(ofc_type_alignment ${SIZEOF_INT})
+  SET(ofc_c_type ${ompi_fortran_bogus_type_t})
+
+  IF(OMPI_WANT_FORTRAN_BINDINGS)
+    IF(NOT DEFINED FORTRAN_SETUP_${TYPE_NAME}_DONE)
+
+    OMPI_FORTRAN_CHECK_TYPE(${FORTRAN_TYPE} ofc_have_type)
+
+    IF(ofc_have_type)
+      # What is the size of this type?
+
+      # NOTE: Some Fortran compilers actually will return that a
+      # type exists even if it doesn't support it -- the compiler
+      # will automatically convert the unsupported type to a type
+      # that it *does* support.  For example, if you try to use
+      # INTEGER*16 and the compiler doesn't support it, it may well
+      # automatically convert it to INTEGER*8 for you (!).  So we
+      # have to check the actual size of the type once we determine
+      # that the compiler doesn't error if we try to use it
+      # (i.e,. the compiler *might* support that type).  If the size
+      # doesn't match the expected size, then the compiler doesn't
+      # really support it.
+      OMPI_FORTRAN_GET_SIZEOF(${FORTRAN_TYPE} ofc_type_size)
+
+      IF(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}")
+        MESSAGE(STATUS "*** Fortran 77 ${FORTRAN_TYPE} does not have expected size!")
+        MESSAGE(STATUS "*** Expected ${ofc_expected_size}, got ${ofc_type_size}")
+        MESSAGE(STATUS "*** Disabling MPI support for Fortran 77 ${FORTRAN_TYPE}")
+        SET(ofc_have_type 0)
+      ELSE(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}")
+        # Look for a corresponding C type (will abort by itself if the
+        # type isn't found and we need it)
+        IF(NOT "${TYPE_LIST}" STREQUAL "")
+          OMPI_FIND_TYPE(${FORTRAN_TYPE} "${TYPE_LIST}" ${C_TYPE} ${ofc_type_size} ofc_c_type)
+        ENDIF(NOT "${TYPE_LIST}" STREQUAL "")
+
+        OMPI_FORTRAN_GET_ALIGNMENT(${FORTRAN_TYPE} ofc_type_alignment)
+
+      ENDIF(NOT ${ofc_expected_size} STREQUAL "-1" AND NOT ${ofc_type_size} EQUAL "${ofc_expected_size}")
+      SET(FORTRAN_SETUP_${TYPE_NAME}_DONE TRUE CACHE INTERNAL "FORTRAN ${TYPE_NAME} check done or not.")
+     ENDIF(ofc_have_type)
+
+    SET(OMPI_HAVE_FORTRAN_${TYPE_NAME}_C ${ofc_have_type} CACHE INTERNAL "OMPI_HAVE_FORTRAN_${TYPE_NAME}")
+    SET(OMPI_SIZEOF_FORTRAN_${TYPE_NAME}_C ${ofc_type_size} CACHE INTERNAL "OMPI_SIZEOF_FORTRAN_${TYPE_NAME}")
+    SET(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}_C ${ofc_type_alignment} CACHE INTERNAL "OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}")
+
+    ENDIF(NOT DEFINED FORTRAN_SETUP_${TYPE_NAME}_DONE)
+
+    SET(OMPI_HAVE_FORTRAN_${TYPE_NAME} ${OMPI_HAVE_FORTRAN_${TYPE_NAME}_C}
+        CACHE INTERNAL "OMPI_HAVE_FORTRAN_${TYPE_NAME}")
+    SET(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} ${OMPI_SIZEOF_FORTRAN_${TYPE_NAME}_C}
+        CACHE INTERNAL "OMPI_SIZEOF_FORTRAN_${TYPE_NAME}")
+    SET(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} ${OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}_C}
+        CACHE INTERNAL "OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}")
+
+  ELSEIF(NOT OMPI_WANT_FORTRAN_BINDINGS)
+    UNSET(FORTRAN_SETUP_${TYPE_NAME}_DONE)
+    SET(OMPI_HAVE_FORTRAN_${TYPE_NAME} ${ofc_have_type} CACHE INTERNAL "OMPI_HAVE_FORTRAN_${TYPE_NAME}")
+    SET(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} ${ofc_type_size} CACHE INTERNAL "OMPI_SIZEOF_FORTRAN_${TYPE_NAME}")
+    SET(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} ${ofc_type_alignment} CACHE INTERNAL "OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}")
+  ENDIF(OMPI_WANT_FORTRAN_BINDINGS)
+
+  IF(NOT "${TYPE_LIST}" STREQUAL "")
+    SET(ompi_fortran_${TYPE_NAME_L}_t ${ofc_c_type} CACHE INTERNAL "ompi_fortran_${TYPE_NAME_L}_t")
+  ENDIF(NOT "${TYPE_LIST}" STREQUAL "")
+
+  #MESSAGE("OMPI_HAVE_FORTRAN_${TYPE_NAME}:${OMPI_HAVE_FORTRAN_${TYPE_NAME}}")
+  #MESSAGE("OMPI_SIZEOF_FORTRAN_${TYPE_NAME}:${OMPI_SIZEOF_FORTRAN_${TYPE_NAME}}")
+  #MESSAGE("OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}:${OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME}}")
+  #MESSAGE("ompi_fortran_${TYPE_NAME_L}_t:${ompi_fortran_${TYPE_NAME_L}_t}")
+
+  OMPI_DEF_VAR(OMPI_HAVE_FORTRAN_${TYPE_NAME} "Whether we have Fortran 77 `${FORTRAN_TYPE}' or not." 0 1)
+  OMPI_DEF_VAR(OMPI_SIZEOF_FORTRAN_${TYPE_NAME} "Size of Fortran 77 `${FORTRAN_TYPE}'." 0 1)
+  OMPI_DEF_VAR(OMPI_ALIGNMENT_FORTRAN_${TYPE_NAME} "Alignment of Fortran 77 `${FORTRAN_TYPE}'." 0 1)
+  OMPI_DEF_VAR(ompi_fortran_${TYPE_NAME_L}_t "C type corresponding to Fortran 77 `${FORTRAN_TYPE}'." 0 0)
+
+ENDMACRO(OMPI_FORTRAN_CHECK FORTRAN_TYPE C_TYPE TYPE_LIST EXPECTED_SIZE)

contrib/platform/win32/CMakeModules/fortran_check_real16_c_equiv.cmake

+# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, 
+#                         University of Stuttgart.  All rights reserved.
+#
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+
+# OMPI_FORTRAN_CHECK_REAL16_C_EQUIV
+# ----------------------------------------------------
+MACRO(OMPI_FORTRAN_CHECK_REAL16_C_EQUIV)
+  SET(OMPI_REAL16_MATCHES_C 0)
+
+  IF(OMPI_WANT_FORTRAN_BINDINGS AND OMPI_HAVE_FORTRAN_REAL16 AND NOT DEFINED REAL16_MATCHES_CHECK_DONE)
+    IF(NOT ${ompi_fortran_real16_t} STREQUAL "")
+      STRING(TOUPPER ${ompi_fortran_real16_t} REAL16_C_TYPE)
+
+      IF(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE})
+        OMPI_FORTRAN_MAKE_C_FUNCTION(ompi_ac_c_fn c)
+        FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c
+          "#include <stdio.h>\n"
+          "#include <stdlib.h>\n"
+          "\n"
+          "#ifdef __cplusplus\n"
+          "extern \"C\" {\n"
+          "#endif\n"
+          "void ${ompi_ac_c_fn}(${ompi_fortran_real16_t} *a) {\n"
+          "    ${ompi_fortran_real16_t} foo = 11; "
+          "    FILE *fp = fopen(\"conftestval\", \"w\");\n"
+          "    if (NULL == fp) exit(1);\n"
+          "    foo = 1 / foo;"
+          "    fprintf(fp, \"%s\n\", (foo == *a) ? \"yes\" : \"no\");\n"
+          "    fclose(fp);\n"
+          "}\n"
+          "#ifdef __cplusplus\n"
+          "}\n"
+          "#endif\n")
+
+        FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_f.f 
+          "\tprogram bogus\n"
+          "\tREAL*16 :: foo = 11\n"
+          "\tfoo = 1 / foo\n"
+          "\tcall c(foo)\n"
+          "\tend program bogus\n")
+
+        EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} ${OMPI_C_OPTION_COMPILE} conftest_c.c ${OMPI_C_INCLUDE_DIR}${C_COMPILER_INCLUDE}
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+          OUTPUT_VARIABLE OUTPUT
+          RESULT_VARIABLE RESULT
+          ERROR_VARIABLE ERROR)
+      
+        EXECUTE_PROCESS(COMMAND ${FORTRAN} conftest_f.f conftest_c.obj ${FORTRAN_OUTPUT_OBJ}conftest
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+          OUTPUT_VARIABLE OUTPUT
+          RESULT_VARIABLE RESULT
+          ERROR_VARIABLE ERROR)
+
+        EXECUTE_PROCESS(COMMAND conftest.exe
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+          OUTPUT_VARIABLE OUTPUT
+          RESULT_VARIABLE RESULT
+          ERROR_VARIABLE ERROR)
+
+        IF(RESULT)
+          UNSET(REAL16_MATCHES_CHECK_DONE CACHE)
+          MESSAGE(FATAL_ERROR "Can not determine if REAL*16 bit-matches C.")
+        ELSE(RESULT)
+          IF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
+            # read out type size value from the file, and write back to the output variable
+            FILE(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval ${OUTPUT_VARIABLE})
+            MESSAGE(STATUS "Check if REAL*16 bit-matches C...${OUTPUT_VARIABLE}")
+            SET(OMPI_REAL16_MATCHES_C 1)
+            SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.")
+          ELSE(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
+            UNSET(REAL16_MATCHES_CHECK_DONE CACHE)
+            MESSAGE(STATUS "Check if REAL*16 bit-matches C...failed")
+          ENDIF(EXISTS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftestval)
+        ENDIF(RESULT)
+
+      ELSE(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE})
+        SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.")
+        MESSAGE(STATUS "Check if REAL*16 bit-matches C...skipped. (no corresponding C type)")
+      ENDIF(${OMPI_SIZEOF_FORTRAN_REAL16} EQUAL SIZEOF_${REAL16_C_TYPE})
+
+    ELSE(NOT ${ompi_fortran_real16_t} STREQUAL "")
+      SET(REAL16_MATCHES_CHECK_DONE TRUE CACHE INTERNAL "Real16 matches c type check done.")
+      MESSAGE(STATUS "Check if REAL*16 bit-matches C...skipped. (no REAL*16)")
+    ENDIF(NOT ${ompi_fortran_real16_t} STREQUAL "")
+
+  ELSEIF(NOT OMPI_WANT_FORTRAN_BINDINGS)
+    UNSET(REAL16_MATCHES_CHECK_DONE CACHE)
+  ENDIF(OMPI_WANT_FORTRAN_BINDINGS AND OMPI_HAVE_FORTRAN_REAL16  AND NOT DEFINED REAL16_MATCHES_CHECK_DONE)
+
+  OMPI_DEF_VAR(OMPI_REAL16_MATCHES_C "if REAL*16 bit-matches C." 0 1)
+
+ENDMACRO(OMPI_FORTRAN_CHECK_REAL16_C_EQUIV)

contrib/platform/win32/CMakeModules/fortran_check_type.cmake

+# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, 
+#                         University of Stuttgart.  All rights reserved.
+#
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+# OMPI_FORTRAN_CHECK_TYPE
+#         in: TYPE         - fortran type to check.
+#        out: HAVE_TYPE    - 0/1 whether we have that type.
+# -----------------------------------------------------------------
+
+MACRO(OMPI_FORTRAN_CHECK_TYPE TYPE HAVE_TYPE)
+
+  IF(NOT DEFINED ${TYPE_NAME}_CHECK_DONE)
+
+    MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...")
+
+    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_fortran_type.f
+      "\t program main \n"
+      "\t ${TYPE} bogus_variable \n"
+      "\t END \n")
+
+    EXECUTE_PROCESS(COMMAND ${FORTRAN} check_fortran_type.f
+      WORKING_DIRECTORY  ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+      OUTPUT_VARIABLE    OUTPUT
+      RESULT_VARIABLE    RESULT
+      ERROR_VARIABLE     ERROR)
+
+    IF(RESULT)
+      SET(${HAVE_TYPE} 0 CACHE INTERNAL "have Fortran ${TYPE}")
+      MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...no")
+    ELSE(RESULT)
+      SET(${HAVE_TYPE} 1 CACHE INTERNAL "have Fortran ${TYPE}")
+      MESSAGE(STATUS "Check if Fortran 77 compiler supports ${TYPE}...yes")
+    ENDIF(RESULT)
+
+    SET(${TYPE_NAME}_CHECK_DONE TRUE CACHE INTERNAL "${TYPE_NAME} check done")
+
+  ENDIF(NOT DEFINED ${TYPE_NAME}_CHECK_DONE)
+
+ENDMACRO(OMPI_FORTRAN_CHECK_TYPE TYPE HAVE_TYPE)

contrib/platform/win32/CMakeModules/fortran_find_ext_symbol_convention.cmake

+# Copyright (c) 2008-2010 High Performance Computing Center Stuttgart, 
+#                         University of Stuttgart.  All rights reserved.
+#
+# $COPYRIGHT$
+# 
+# Additional copyrights may follow
+# 
+# $HEADER$
+#
+
+
+MACRO(OMPI_FORTRAN_FIND_EXT_SYMBOL_CONVENTION)
+  IF(NOT SYMBOL_CONVENTION_CHECK_DONE)
+    SET(OMPI_FORTRAN_DOUBLE_UNDERSCORE 0
+      CACHE INTERNAL "external symbol convention - double underscore")
+    SET(OMPI_FORTRAN_SINGLE_UNDERSCORE 0
+      CACHE INTERNAL "external symbol convention - single underscore")
+    SET(OMPI_FORTRAN_CAPS 0
+      CACHE INTERNAL "external symbol convention - captital")
+    SET(OMPI_FORTRAN_PLAIN 0
+      CACHE INTERNAL "external symbol convention - plain")
+
+    # make sure we know our linking convention...
+    MESSAGE(STATUS "Check ${FORTRAN} external symbol convention...")
+    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest.f
+      "\t subroutine FOO_bar(a) \n"
+      "\t integer a \n"
+      "\t a = 1 \n"
+      "\t return \n"
+      "\t end \n")
+
+    EXECUTE_PROCESS(COMMAND ${FORTRAN} ${FORTRAN_OPTION_COMPILE} conftest.f ${FORTRAN_OUTPUT_OBJ}conftest.lib
+      WORKING_DIRECTORY  ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+      OUTPUT_VARIABLE    OUTPUT
+      RESULT_VARIABLE    RESULT
+      ERROR_VARIABLE     ERROR)
+
+    SET(OUTPUT_OBJ_FILE "conftest.lib")
+
+    # now run dumpbin to generate an output file
+    EXECUTE_PROCESS(COMMAND ${DUMP_UTIL} ${OUTPUT_OBJ_FILE} ${DUMP_UTIL_OPT}
+      WORKING_DIRECTORY  ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+      OUTPUT_VARIABLE    DUMP_OUTPUT
+      RESULT_VARIABLE    RESULT
+      ERROR_VARIABLE     ERROR)
+
+    STRING(REGEX MATCH foo_bar__\n DOUBLE_UNDERSCORE ${DUMP_OUTPUT})
+    STRING(REGEX MATCH foo_bar_\n SINGLE_UNDERSCORE ${DUMP_OUTPUT})
+    STRING(REGEX MATCH FOO_bar\n MIXED_CASE ${DUMP_OUTPUT})
+    STRING(REGEX MATCH foo_bar\n NO_UNDERSCORE ${DUMP_OUTPUT})
+    STRING(REGEX MATCH FOO_BAR\n UPPER_CASE ${DUMP_OUTPUT})
+
+    # set up the corresponding values
+    IF(NOT DOUBLE_UNDERSCORE STREQUAL "")
+      SET(OMPI_FORTRAN_DOUBLE_UNDERSCORE 1
+        CACHE INTERNAL "external symbol convention - double underscore")
+      SET(FUNC_NAME "foo_bar__")
+      SET(ompi_cv_fortran_external_symbol "double underscore"
+        CACHE INTERNAL "FORTRAN external symbol convention")
+    ELSEIF(NOT SINGLE_UNDERSCORE STREQUAL "")
+      SET(OMPI_FORTRAN_SINGLE_UNDERSCORE 1
+        CACHE INTERNAL "external symbol convention - single underscore")
+      SET(FUNC_NAME "foo_bar_")
+      SET(ompi_cv_fortran_external_symbol "single underscore"
+        CACHE INTERNAL "FORTRAN external symbol convention")
+    ELSEIF(NOT MIXED_CASE STREQUAL "")
+      SET(OMPI_FORTRAN_CAPS 1
+        CACHE INTERNAL "external symbol convention - captital")
+      SET(FUNC_NAME "FOO_bar")
+      SET(ompi_cv_fortran_external_symbol "mixed case"
+        CACHE INTERNAL "FORTRAN external symbol convention")
+    ELSEIF(NOT NO_UNDERSCORE STREQUAL "")
+      SET(OMPI_FORTRAN_PLAIN 1
+        CACHE INTERNAL "external symbol convention - plain")
+      SET(FUNC_NAME "foo_bar")
+      SET(ompi_cv_fortran_external_symbol "no underscore"
+        CACHE INTERNAL "FORTRAN external symbol convention")
+    ELSEIF(NOT UPPER_CASE STREQUAL "")
+      SET(OMPI_FORTRAN_CAPS 1
+        CACHE INTERNAL "external symbol convention - captital")
+      SET(FUNC_NAME "FOO_BAR")
+      SET(ompi_cv_fortran_external_symbol "upper case"
+        CACHE INTERNAL "FORTRAN external symbol convention")
+    ELSE(NOT UPPER_CASE STREQUAL "")
+      MESSAGE(FATAL_ERROR "unknow Fortran naming convertion.")
+      SET(ompi_cv_fortran_external_symbol "unknow")
+    ENDIF(NOT DOUBLE_UNDERSCORE STREQUAL "")
+
+    MESSAGE(STATUS "Check ${FORTRAN} external symbol convention...${ompi_cv_fortran_external_symbol}")
+
+    # now test if we can link the library with c program
+    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/conftest_c.c 
+      "int main(){${FUNC_NAME}();return(0);}")
+
+    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CMakeLists.txt
+      "CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)\n"
+      "PROJECT(conftest_c C)\n"
+      "IF(NOT \"${FORTRAN_LIB_PATH}\" STREQUAL \"\")\n"
+      "  LINK_DIRECTORIES(\"${FORTRAN_LIB_PATH}\")\n"
+      "ENDIF(NOT \"${FORTRAN_LIB_PATH}\" STREQUAL \"\")\n"
+      "LINK_DIRECTORIES(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/)\n"
+      "ADD_EXECUTABLE(conftest_c conftest_c.c)\n"
+      "TARGET_LINK_LIBRARIES(conftest_c ${OUTPUT_OBJ_FILE})\n")
+
+    TRY_COMPILE(
+      TEST_OK
+      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+      conftest_c
+      OUTPUT_VARIABLE MY_OUTPUT)
+
+    #MESSAGE("MY_OUTPUT:${MY_OUTPUT}")
+
+    IF(TEST_OK)
+      SET(SYMBOL_CONVENTION_CHECK_DONE TRUE CACHE INTERNAL "Symbol convention check done.")
+    ELSE(TEST_OK)
+      UNSET(SYMBOL_CONVENTION_CHECK_DONE CACHE)
+      MESSAGE(STATUS "${MY_OUTPUT}")
+      MESSAGE(STATUS "*** Probably you have to setup the library path of the Fortran compiler.")
+      MESSAGE(FATAL_ERROR "C and Fortran 77 compilers are not link compatible.  Cannot continue.")
+    ENDIF(TEST_OK)
+
+  ENDIF(NOT SYMBOL_CONVENTION_CHECK_DONE)
+
+ENDMACRO(OMPI_FORTRAN_FIND_EXT_SYMBOL_CONVENTION)
+
+
+# return the corresponding C function name
+# OMPI_FORTRAN_MAKE_C_FUNCTION
+#             in: FUNCTION_NAME     -Fortran function name
+#            out: OUTPUT_VARIABLE   -C function name
+MACRO(OMPI_FORTRAN_MAKE_C_FUNCTION OUTPUT_VARIABLE FUNCTION_NAME)
+  IF("${ompi_cv_fortran_external_symbol}" STREQUAL "double underscore")
+    # so the general rule is that if there is an _ in the function
+    # name, then there are two trailing underscores.  Otherwise,
+    # there is only one trailing underscore.
+    STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE})
+    STRING(REGEX MATCH "_" RESULT ${FUNCTION_NAME})
+    IF("${RESULT}" STREQUAL "")
+      SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}_")
+    ELSE("${RESULT}" STREQUAL "")
+      SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}__")
+    ENDIF("${RESULT}" STREQUAL "")
+  ELSEIF("${ompi_cv_fortran_external_symbol}" STREQUAL "single underscore")
+    STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE})
+    SET(${OUTPUT_VARIABLE} "${${OUTPUT_VARIABLE}}_")
+  ELSEIF("${ompi_cv_fortran_external_symbol}" STREQUAL "mixed case")
+    SET(${OUTPUT_VARIABLE} ${FUNCTION_NAME})
+  ELSEIF("${ompi_cv_fortran_external_symbol}" STREQUAL "no underscore")
+    STRING(TOLOWER ${FUNCTION_NAME} ${OUTPUT_VARIABLE})
+  ELSEIF("${ompi_cv_fortran_external_symbol}" STREQUAL "upper case")
+    STRING(TOUPPER ${FUNCTION_NAME} ${OUTPUT_VARIABLE})
+  ELSE("${ompi_cv_fortran_external_symbol}" STREQUAL "double underscore")