fortran - Linking C++ with BLAS and LAPACK -


to call fortran routine c++ have been using: extern "c" void routinename_(...) appended underscore making compatible fortran subroutine name "routinename".

when link c++ blas or lapack works without underscore. difference between linking c++ these libraries, written in fortran, makes underscore unnecessary?

i might wrong, given there's little information go on, but...

from here: first f77 compilers appended _ names of functions in abi. behavior unlike c, takes function name , uses name in abi.

some f77 compilers behaved differently, instead upper-casing entire subroutine name, foo() became foo() when seen c. unix fortran compilers mimicked c behavior , copy-pasta'd name foo() foo() in abi too.

if @ blas bindings c reference implementation here, though, you'll see they're handling trailing underscores when dealing f77. i'd wager underscores far more common feature of f77 abi in past not having them.

later on, fortran 2003 introduced interoperability c (see here). made function naming scheme same when fortran constructs used (see here).

i'm going to, thus, make wild guess has abi differences across fortran versions. or across compilers, given different compilers seem have different behaviors in fortran.

so, again, i'm not sure if matched situation, given there's not go on in question, couldn't fit comment here 'answer'.

and if i'm wrong tell me can correct mah' post.

tl;dr: because compiler versions


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -