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

can't mix C/Fortran using optimizations

John_Biddiscombe
Beginner
424 Views
If I compile a library using C code, then linking fails when a fortran application tries to link to it if I have selected -fast or -O2/3

Specifically,
xiar: executing 'ar'

when linking the libs, and once this has happened, nothing works properly afterwards.

ipo: warning #11060: ../../bin/libhdf5_fortran.a is an archive, but has no symbols (this can happen if ar is used where xiar is needed)
ipo: warning #11010: file format not recognized for ../../bin/libhdf5_fortran.a
ipo: warning #11060: ../../bin/libhdf5_test_fortran.a is an archive, but has no symbols (this can happen if ar is used where xiar is needed)
ipo: warning #11010: file format not recognized for ../../bin/libhdf5_test_fortran.a
ipo: warning #11060: ../../bin/libhdf5_fortran.a is an archive, but has no symbols (this can happen if ar is used where xiar is needed)
ipo: warning #11010: file format not recognized for ../../bin/libhdf5_fortran.a

and the link fails with a ton of missing symbols.

Does anyone have any suggestions?

thanks

JB
0 Kudos
3 Replies
Steven_L_Intel1
Employee
424 Views
-fast implies -ipo. Which C compiler did you use and how did you do the compile and link? You haven't shown us the whole process.
0 Kudos
TimP
Honored Contributor III
424 Views
As the messages indicate, ipo objects can't be placed in a .a library by generic linux tools; xiar would be required to make the library, and xilink to use it. It's a little strange to put a .a file in a /bin/ directory. but its probably OK if you can sort out the confusion. -O2 or -O3 won't in themselves require xiar or xilink.
-fast basically is a shortcut to get around benchmark rules which limit the number of options; better results often are obtained by specifying individual options.
0 Kudos
John_Biddiscombe
Beginner
423 Views
I think I've found the problem. A file compiled with GCC was being pulled into the link phase and this broke everything. I'm recomiling everything now and it seems to be ok.

Sorry for the noise.
0 Kudos
Reply