[Cmake-commits] CMake branch, next, updated. v2.8.4-1267-ge2aa38f

Brad King brad.king at kitware.com
Thu Mar 24 16:10:16 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  e2aa38f335e2212cf955d7bb9fd1e0ae0da6ec27 (commit)
       via  d0203fb567cafc97138cff1128f78cb41203ceef (commit)
      from  fccdca95de7e2381701883bdb68db496bc3e46ce (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2aa38f335e2212cf955d7bb9fd1e0ae0da6ec27
commit e2aa38f335e2212cf955d7bb9fd1e0ae0da6ec27
Merge: fccdca9 d0203fb
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Mar 24 16:10:14 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Mar 24 16:10:14 2011 -0400

    Merge topic 'fix-FortranCInterface-for-Cray-7.3.2' into next
    
    d0203fb FortranCInterface: Fix mangling detection with Cray Fortran >= 7.3.2


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0203fb567cafc97138cff1128f78cb41203ceef
commit d0203fb567cafc97138cff1128f78cb41203ceef
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Mar 24 16:06:58 2011 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Mar 24 16:06:58 2011 -0400

    FortranCInterface: Fix mangling detection with Cray Fortran >= 7.3.2
    
    The Cray Fortran compiler started using module init symbols in version 7.3.2.
    Starting in commit 71287734 (Teach FortranC interface for Intel, PGI, and gcc
    4.2, 2009-08-05) we provide C versions of the module init symbols so that the
    detection executable can link when the C versions of the module-mangled symbols
    are picked up.
    
    If no C module-mangled symbol matches then we cannot let the C module init
    symbol appear because it will be duplicated by the Fortran copy that provides
    the module-mangled symbol.  This was first handled for the PathScale compiler
    in commit 21faaa5d (FortranCInterface: Fix PathScale detection, 2010-01-22) and
    commit 46858720 (FortranCInterface: Fix PathScale detection again, 2010-02-16).
    Handle it now for the Cray compiler too.

diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index 4bcaae9..d35a72c 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -70,6 +70,17 @@ else()
 endif()
 
 # Generate C symbol sources.
+set(symbol_sources)
+if(NOT "${CMAKE_Fortran_COMPILER_ID}" MATCHES "^(PathScale|Cray)$")
+  # Provide mymodule_ and my_module_ init symbols because:
+  #  - PGI Fortran uses module init symbols
+  # but not for:
+  #  - PathScale Fortran uses module init symbols but module symbols
+  #    use '.in.' so we cannot provide them anyway.
+  #  - Cray Fortran >= 7.3.2 uses module init symbols but module symbols
+  #    use 'mysub$mymodule_' so we cannot provide them anyway.
+  list(APPEND symbol_sources mymodule_.c my_module_.c)
+endif()
 foreach(symbol IN LISTS global_symbols module_symbols)
   # Skip symbols with '$' if C cannot handle them.
   if(C_SUPPORTS_DOLLAR OR NOT "${symbol}" MATCHES "\\$")
@@ -89,7 +100,7 @@ endforeach()
 add_library(myfort STATIC mysub.f my_sub.f ${myfort_modules})
 
 # Provide symbols through C but fall back to Fortran.
-add_library(symbols STATIC mymodule_.c my_module_.c ${symbol_sources})
+add_library(symbols STATIC ${symbol_sources})
 target_link_libraries(symbols myfort)
 
 # Require symbols through Fortran.
diff --git a/Modules/FortranCInterface/my_module_.c b/Modules/FortranCInterface/my_module_.c
index 364b214..6510ae9 100644
--- a/Modules/FortranCInterface/my_module_.c
+++ b/Modules/FortranCInterface/my_module_.c
@@ -1,8 +1 @@
-#if defined(__PATHSCALE__)
-/* PathScale Fortran wants my_module_ when calling any my_module symbol,
-   but module symbols use '.in.' so we cannot provide them anyway.  */
-void pathscale_my_module_(void) {}
-#else
-/* PGI Fortran wants my_module_ when calling any my_module symbol.  */
 void my_module_(void) {}
-#endif
diff --git a/Modules/FortranCInterface/mymodule_.c b/Modules/FortranCInterface/mymodule_.c
index b5feda6..5270605 100644
--- a/Modules/FortranCInterface/mymodule_.c
+++ b/Modules/FortranCInterface/mymodule_.c
@@ -1,8 +1 @@
-#if defined(__PATHSCALE__)
-/* PathScale Fortran wants mymodule_ when calling any mymodule symbol,
-   but module symbols use '.in.' so we cannot provide them anyway.  */
-void pathscale_mymodule_(void) {}
-#else
-/* PGI Fortran wants mymodule_ when calling any mymodule symbol.  */
 void mymodule_(void) {}
-#endif

-----------------------------------------------------------------------

Summary of changes:
 Modules/FortranCInterface/CMakeLists.txt |   13 ++++++++++++-
 Modules/FortranCInterface/my_module_.c   |    7 -------
 Modules/FortranCInterface/mymodule_.c    |    7 -------
 3 files changed, 12 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list