[CMake] FORTRAN name mangling

Thompson, KT kgt at lanl.gov
Mon Jan 11 14:06:48 EST 2016


"bind(c)" is a part of the Fortran 2003 standard.  Any compiler that claims to support this standard should work for you.

I use Intel Fortran on Linux (v13-16) with bind(c) w/o issue.  FWIW - I also use the Portland Group (12+) and IBM Fortran (v14) compilers this way.

-kt

-----Original Message-----
From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Michael Jackson
Sent: Monday, January 11, 2016 11:48 AM
To: Bill Somerville <bill at classdesign.com>
Cc: cmake at cmake.org
Subject: Re: [CMake] FORTRAN name mangling

Actually, 
  If we just use the following:

SingleEBSDPattern(ipar, fpar, ebsdPattern, quats, accum_e, mLPNH, mLPSH);

and the same declaration in a .h file then we can link and execute just fine. My question now would be:

Do other FORTRAN compilers support this “bind(C)” thing, such as Intel Fortran? If so then I can really NOT worry about figuring out the mangling that is needed and just declare the functions in a C style header like normal. No macros needed.
--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.jackson at bluequartz.net

> On Jan 11, 2016, at 1:13 PM, Bill Somerville <bill at classdesign.com> wrote:
> 
> On 11/01/2016 17:58, Michael Jackson wrote:
>> and we call the function from our C code like the following:
>> 
>> 
>> SingleEBSDPattern_(ipar, fpar, ebsdPattern, quats, accum_e, mLPNH, mLPSH);
>> 
> You need to use the macros here too.
> 
> Regards
> Bill Somerville.
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


More information about the CMake mailing list