magma_f77.cpp does not use capitalized names for some functions meant to be exposed to Fortran
#define magmaf_smalloc FORTRAN_NAME( magmaf_smalloc, MAGMAF_smalloc )
For example, above. When linking to external libraries Fortran expects functions names to be ALL CAPS. So this should become
#define magmaf_smalloc FORTRAN_NAME( magmaf_smalloc, MAGMAF_SMALLOC )
A workaround, obviously is to manually fix the code as I had to do.
Comments (6)
-
-
reporter ifort on Windows.
I realize that ifort has a compiler option called “/names:{uppercase|lowercase|as_is}” to control the interpretation, but the safe option is to assume the “all external routines are upper case” option.
So for example , I had in my code
CALL MAGMAF_free
By default, the linker will be looking for MAGMAF_FREELooking at magma_f77.cpp it looks to me that the MAGMA team has not been able to make up it’s mind either ?
// ----------------------------------------------------------------------------- // CPU regular (non-pinned) allocation #define magmaf_malloc_cpu FORTRAN_NAME( magmaf_malloc_cpu, MAGMAF_MALLOC_CPU ) magma_int_t magmaf_malloc_cpu( void** ptr, magma_int_t* bytes ) { return magma_malloc_cpu( ptr, *bytes ); } #define magmaf_smalloc_cpu FORTRAN_NAME( magmaf_smalloc_cpu, MAGMAF_smalloc_cpu ) magma_int_t magmaf_smalloc_cpu( float** ptr, magma_int_t* n ) { return magma_smalloc_cpu( ptr, *n ); }
-
They are meant to be uppercase. The mixed case instances are bugs. They’ve been there since 2018, so it seems no one uses those routines from Fortran on Windows.
-
reporter OK, good to know. I guess people just fix it themselves and don't bother to file a bug report!
-
- changed status to resolved
Fix Fortran uppercase names. Fixes
#71.→ <<cset df1e9939fe21>>
-
Merged in fortran-case (pull request #40)
Fix Fortran uppercase names. Fixes
#71.→ <<cset 19fe4544d232>>
- Log in to comment
What Fortran compiler are you using?