Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Warning when linking library

blanclar
Beginner
785 Views
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!
0 Kudos
4 Replies
TimP
Honored Contributor III
785 Views
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
0 Kudos
blanclar
Beginner
785 Views
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".
0 Kudos
Steven_L_Intel1
Employee
785 Views
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.
0 Kudos
blanclar
Beginner
785 Views
Thank you very much that has solved the issue.
0 Kudos
Reply