Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29009 Discussions

Use of option -names and its compatibility with MKL library

pfr
Beginner
594 Views

Dear all,

I am trying to compile a fortran 90 code that calls some MKL routines (VML functions vserfinv and vserf). I struggled a little while with the linking stage that kept saying :

fill_matrix.o: In function `fill_matrices_mp_perform_variable_change':
fill_matrix.f90:(.text+0x14ae): undefined reference to `vserf'
fill_matrix.o: In function `fill_matrices_mp_init_p':
fill_matrix.f90:(.text+0x8375): undefined reference to `vserfinv'

(don't mind the fill_matrix routine's name)

I found out that when removing the -names as_is option at the compilation time it worked out (even though I left it on when doing the link). I now ask the question : why is that? I tried to use either lower or upper case in my call to these VML functions but it turned to be rather unsucessful.

I would welcome any ideas / comments on that problem (which is not critical, I agree).

Thanks alot to all of this message's readers.

Pierre-Franois

ps : I don't know if I did right to write this message in this section of the forum. If not, I do apologize for any incovenience.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
594 Views

The MKL library assumes default Fortran external naming conventions. -names is a "big hammer" switch that can cause big problems if you use it in conjunction with an external library. My advice is to never ever use that switch.

If you need to call specific routines that have non-default naming (such as mixed-case), write interface blocks with BIND(C,NAME="MixedCaseName") in the procedure declaration rather than using switches.

0 Kudos
Reply