Warning when linking library

Warning when linking library

Hello,

I am trying to compile a program with ifort on a mac intel (os X) and I want to link a library that I have generated:

ifort -Vaxlib -O3 -W0 -arch x86_64  cosmo.o main.f90  
-L/Users/alain/ablancha/util/F90 -lmylib90 -o toto

I got the following message:

ld64 warning: in /Users/alain/ablancha/util/F90/libmylib90.a, file is not of required architecture

The library has been obtained by:

ifort -c -u -w -O3 -vec-report0 -arch x86_64 example.f90
ar -cr libmylib90.a *.o
ranlib libmylib90.a

the option

-arch x86_64 

was added in a attempt to solve the problem, but this had no effect. A friend of mine has no problem with the same operation on linux.

Thanks in advance for any suggestion!

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

ifort uses (only) environment paths to make the choice between 32- and 64-bit compilation.
The -Vaxlib option went away long before mac was supported.
It does look as if the .a has a 32-bit object. You should be able to find it by
file *.o

Thanks for this comment.
Indeed, it seems to have something to do with the 32-bit versus 64.
I first thought to have download a wrong version of ifort.
But this seems not to be the explanation. When I compile with :

-u -w -O3 -vec-report0 -m32a

and ask for file *.O, I got:

 Mach-O 64-bit object x86_64

which I understand as the compilation was 64-bit, while my mac is an Intel Core 2 Duo, so a 32 bit proc. Could this be the source of the trouble ? I do not know what 32-bit and 64-bit compilation actually mean. Is this related to the architecture of the proc ? Than I would expect to have a "32-bit object".

There's only one download for Mac which provides both the 32-bit and 64-bit compilers and libraries. You select the one you want with the appropriate "source" command - the path with /fc/ for 32-bit and the path with /fce/ for 64-bit.

Steve - Intel Developer Support

Thank you very much that has solved the issue.

Leave a Comment

Please sign in to add a comment. Not a member? Join today