summaryrefslogtreecommitdiffstats
path: root/Modules/FortranCInterface
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-08-05 21:07:36 (GMT)
committerBrad King <brad.king@kitware.com>2009-08-05 21:07:36 (GMT)
commitedcddb522cd9a7108216b92140e5bc1e7bcb5530 (patch)
tree2cb4ba6d1a3c33f31c0d254ed29a21e96fa14497 /Modules/FortranCInterface
parent71287734a9344e130721502e6342ef0afb0554a4 (diff)
downloadCMake-edcddb522cd9a7108216b92140e5bc1e7bcb5530.zip
CMake-edcddb522cd9a7108216b92140e5bc1e7bcb5530.tar.gz
CMake-edcddb522cd9a7108216b92140e5bc1e7bcb5530.tar.bz2
Cleanup FortranCInterface for PGI and GCC 4.2
This documents the purpose of the extra my_module_.c and mymodule.c source files, and sorts the symbols.
Diffstat (limited to 'Modules/FortranCInterface')
-rw-r--r--Modules/FortranCInterface/CMakeLists.txt12
-rw-r--r--Modules/FortranCInterface/my_module_.c3
-rw-r--r--Modules/FortranCInterface/mymodule_.c3
3 files changed, 10 insertions, 8 deletions
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index 778c4f4..3ebfeb0 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -22,17 +22,17 @@ list(REMOVE_DUPLICATES global_symbols)
# List manglings of module symbol names to try.
set(module_symbols
__my_module_MOD_my_sub # GNU 4.3
- __my_module__my_sub # GNU 4.2
- __mymodule__mysub # GNU 4.2
__my_module_NMOD_my_sub # VisualAge
- __mymodule_MOD_mysub # GNU
+ __my_module__my_sub # GNU 4.2
+ __mymodule_MOD_mysub # GNU 4.3
__mymodule_NMOD_mysub # VisualAge
- my_module_my_sub_ # PGI 8
+ __mymodule__mysub # GNU 4.2
my_module$my_sub # HP
my_module_mp_my_sub_ # Intel
- mymodule_mysub_ # PGI 8
+ my_module_my_sub_ # PGI
mymodule$mysub # HP
mymodule_mp_mysub_ # Intel
+ mymodule_mysub_ # PGI
${FortranCInterface_MODULE_SYMBOLS}
)
list(REMOVE_DUPLICATES module_symbols)
@@ -70,7 +70,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 ${symbol_sources} mymodule_.c my_module_.c)
+add_library(symbols STATIC mymodule_.c my_module_.c ${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 bba63cb..0d7091f 100644
--- a/Modules/FortranCInterface/my_module_.c
+++ b/Modules/FortranCInterface/my_module_.c
@@ -1 +1,2 @@
-void my_module_(void){}
+/* PGI Fortran wants my_module_ when calling any my_module symbol. */
+void my_module_(void) {}
diff --git a/Modules/FortranCInterface/mymodule_.c b/Modules/FortranCInterface/mymodule_.c
index 68550b2..a7152af 100644
--- a/Modules/FortranCInterface/mymodule_.c
+++ b/Modules/FortranCInterface/mymodule_.c
@@ -1 +1,2 @@
-void mymodule_(void){}
+/* PGI Fortran wants mymodule_ when calling any mymodule symbol. */
+void mymodule_(void) {}