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.
This commit is contained in:
parent
3551869e92
commit
21faaa5d7f
|
@ -56,6 +56,7 @@ list(REMOVE_DUPLICATES module_symbols)
|
||||||
# Note that some compiler manglings cannot be invoked from C:
|
# Note that some compiler manglings cannot be invoked from C:
|
||||||
# MIPSpro uses "MY_SUB.in.MY_MODULE"
|
# MIPSpro uses "MY_SUB.in.MY_MODULE"
|
||||||
# SunPro uses "my_module.my_sub_"
|
# SunPro uses "my_module.my_sub_"
|
||||||
|
# PathScale uses "MY_SUB.in.MY_MODULE"
|
||||||
|
|
||||||
# Add module symbols only with Fortran90.
|
# Add module symbols only with Fortran90.
|
||||||
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||||
|
|
|
@ -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. */
|
/* PGI Fortran wants mymodule_ when calling any mymodule symbol. */
|
||||||
void mymodule_(void) {}
|
void mymodule_(void) {}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue