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

qustion about compilation and linking

davidqusx
Beginner
487 Views

fortran codes.

new System:IA-32-based system with Intel extended Memory64Technology (Intel EM64T)

old system: IA-32-based system

ifort -pc80 -prec-div -mp -shared -w -c -O3

ld -shared -o libdisl.so $(OBJECTS)

On the old system, everything is fine. However, when I make on the new system, the following warnings and errors generated:

ld: warning: i386 architecture of input file `disl_field.o' is incompatible with i386:x86-64 output

....

disl_field.o(.text+0x26): In function `disl_displ_':
: undefined reference to `for_cpystr'
.......

Please help me find the problem with compilation and linking.

Thanks,

David

0 Kudos
3 Replies
TimP
Honored Contributor III
487 Views
If you are running the 64-bit system, the default ld is the 64-bit one. It looks like you chose the 32-bit ifort. If you used the 32-bit ifort also for linking, it would choose a 32-bit ld and link against the 32-bit ifort runtime libraries. When you invoke ld directly, it's your responsibility to choose the ld which matches your .o files and to specify the Fortran libraries.
0 Kudos
davidqusx
Beginner
487 Views
Please how tochoose 32- or 64- ifort/ld?
0 Kudos
Steven_L_Intel1
Employee
487 Views
When you install the compiler, you have to choose a "custom" install to select the 32-bit compiler. I'm not sure how to tell it to use the 32-bit tools, offhand.

The 32 and 64 bit compilers are installed in different directories. The 32 bit is in /fc and the 64 bit in /fce. So you choose which one you want when you give the "source" command.

Message Edited by Steve_Lionel on 03-31-2006 08:46 AM

0 Kudos
Reply