summaryrefslogtreecommitdiff
path: root/Modules/FortranCInterface
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-01-22 14:15:47 -0500
committerBrad King <brad.king@kitware.com>2010-01-22 14:15:47 -0500
commit21faaa5d7f9e0e34df78bbfd54217ac45b6c98ce (patch)
treead2a8373f9e7e04036275b646d43aba39dd8e5b1 /Modules/FortranCInterface
parent3551869e9234d65325c47c18735dbb3a8b3c9a8c (diff)
downloadcmake-21faaa5d7f9e0e34df78bbfd54217ac45b6c98ce.tar.gz
FortranCInterface: Fix PathScale detection
PathScale Fortran mangles module symbols as "MYSUB.in.MYMODULE" and also requires "mymodule_" when the module is imported. We cannot provide the symbol with ".in." mangling so we should not provide "mymodule_" because it would duplicate the one in the Fortran-provided object file.
Diffstat (limited to 'Modules/FortranCInterface')
-rw-r--r--Modules/FortranCInterface/CMakeLists.txt1
-rw-r--r--Modules/FortranCInterface/mymodule_.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index d014d9ac83..18014af5a4 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -56,6 +56,7 @@ list(REMOVE_DUPLICATES module_symbols)
# Note that some compiler manglings cannot be invoked from C:
# MIPSpro uses "MY_SUB.in.MY_MODULE"
# SunPro uses "my_module.my_sub_"
+# PathScale uses "MY_SUB.in.MY_MODULE"
# Add module symbols only with Fortran90.
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
diff --git a/Modules/FortranCInterface/mymodule_.c b/Modules/FortranCInterface/mymodule_.c
index a7152afad5..b5feda6cef 100644
--- a/Modules/FortranCInterface/mymodule_.c
+++ b/Modules/FortranCInterface/mymodule_.c
@@ -1,2 +1,8 @@
+#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